chrome-devtools-frontend 1.0.943182 → 1.0.943709

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/front_end/core/i18n/locales/af.json +455 -44
  2. package/front_end/core/i18n/locales/am.json +455 -44
  3. package/front_end/core/i18n/locales/ar.json +455 -44
  4. package/front_end/core/i18n/locales/as.json +455 -44
  5. package/front_end/core/i18n/locales/az.json +455 -44
  6. package/front_end/core/i18n/locales/be.json +456 -45
  7. package/front_end/core/i18n/locales/bg.json +455 -44
  8. package/front_end/core/i18n/locales/bn.json +455 -44
  9. package/front_end/core/i18n/locales/bs.json +455 -44
  10. package/front_end/core/i18n/locales/ca.json +457 -46
  11. package/front_end/core/i18n/locales/cs.json +458 -47
  12. package/front_end/core/i18n/locales/cy.json +455 -44
  13. package/front_end/core/i18n/locales/da.json +455 -44
  14. package/front_end/core/i18n/locales/de.json +455 -44
  15. package/front_end/core/i18n/locales/el.json +455 -44
  16. package/front_end/core/i18n/locales/en-GB.json +449 -38
  17. package/front_end/core/i18n/locales/en-US.json +7 -7
  18. package/front_end/core/i18n/locales/en-XL.json +7 -7
  19. package/front_end/core/i18n/locales/es-419.json +455 -44
  20. package/front_end/core/i18n/locales/es.json +455 -44
  21. package/front_end/core/i18n/locales/et.json +455 -44
  22. package/front_end/core/i18n/locales/eu.json +462 -51
  23. package/front_end/core/i18n/locales/fa.json +455 -44
  24. package/front_end/core/i18n/locales/fi.json +455 -44
  25. package/front_end/core/i18n/locales/fil.json +454 -43
  26. package/front_end/core/i18n/locales/fr-CA.json +455 -44
  27. package/front_end/core/i18n/locales/fr.json +456 -45
  28. package/front_end/core/i18n/locales/gl.json +455 -44
  29. package/front_end/core/i18n/locales/gu.json +456 -45
  30. package/front_end/core/i18n/locales/he.json +455 -44
  31. package/front_end/core/i18n/locales/hi.json +455 -44
  32. package/front_end/core/i18n/locales/hr.json +455 -44
  33. package/front_end/core/i18n/locales/hu.json +455 -44
  34. package/front_end/core/i18n/locales/hy.json +455 -44
  35. package/front_end/core/i18n/locales/id.json +455 -44
  36. package/front_end/core/i18n/locales/is.json +455 -44
  37. package/front_end/core/i18n/locales/it.json +502 -91
  38. package/front_end/core/i18n/locales/ja.json +456 -45
  39. package/front_end/core/i18n/locales/ka.json +455 -44
  40. package/front_end/core/i18n/locales/kk.json +456 -45
  41. package/front_end/core/i18n/locales/km.json +455 -44
  42. package/front_end/core/i18n/locales/kn.json +455 -44
  43. package/front_end/core/i18n/locales/ko.json +455 -44
  44. package/front_end/core/i18n/locales/ky.json +456 -45
  45. package/front_end/core/i18n/locales/lo.json +454 -43
  46. package/front_end/core/i18n/locales/lt.json +455 -44
  47. package/front_end/core/i18n/locales/lv.json +458 -47
  48. package/front_end/core/i18n/locales/mk.json +455 -44
  49. package/front_end/core/i18n/locales/ml.json +461 -50
  50. package/front_end/core/i18n/locales/mn.json +455 -44
  51. package/front_end/core/i18n/locales/mr.json +455 -44
  52. package/front_end/core/i18n/locales/ms.json +455 -44
  53. package/front_end/core/i18n/locales/my.json +456 -45
  54. package/front_end/core/i18n/locales/ne.json +456 -45
  55. package/front_end/core/i18n/locales/nl.json +532 -121
  56. package/front_end/core/i18n/locales/no.json +455 -44
  57. package/front_end/core/i18n/locales/or.json +455 -44
  58. package/front_end/core/i18n/locales/pa.json +455 -44
  59. package/front_end/core/i18n/locales/pl.json +455 -44
  60. package/front_end/core/i18n/locales/pt-PT.json +504 -93
  61. package/front_end/core/i18n/locales/pt.json +454 -43
  62. package/front_end/core/i18n/locales/ro.json +455 -44
  63. package/front_end/core/i18n/locales/ru.json +455 -44
  64. package/front_end/core/i18n/locales/si.json +455 -44
  65. package/front_end/core/i18n/locales/sk.json +456 -45
  66. package/front_end/core/i18n/locales/sl.json +455 -44
  67. package/front_end/core/i18n/locales/sq.json +455 -44
  68. package/front_end/core/i18n/locales/sr-Latn.json +455 -44
  69. package/front_end/core/i18n/locales/sr.json +455 -44
  70. package/front_end/core/i18n/locales/sv.json +456 -45
  71. package/front_end/core/i18n/locales/sw.json +455 -44
  72. package/front_end/core/i18n/locales/ta.json +456 -45
  73. package/front_end/core/i18n/locales/te.json +454 -43
  74. package/front_end/core/i18n/locales/th.json +455 -44
  75. package/front_end/core/i18n/locales/tr.json +455 -44
  76. package/front_end/core/i18n/locales/uk.json +455 -44
  77. package/front_end/core/i18n/locales/ur.json +455 -44
  78. package/front_end/core/i18n/locales/uz.json +455 -44
  79. package/front_end/core/i18n/locales/vi.json +455 -44
  80. package/front_end/core/i18n/locales/zh-HK.json +459 -48
  81. package/front_end/core/i18n/locales/zh-TW.json +457 -46
  82. package/front_end/core/i18n/locales/zh.json +460 -49
  83. package/front_end/core/i18n/locales/zu.json +455 -44
  84. package/front_end/core/protocol_client/InspectorBackend.ts +4 -0
  85. package/front_end/core/sdk/AccessibilityModel.ts +99 -78
  86. package/front_end/core/sdk/NetworkManager.ts +3 -0
  87. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +13 -12
  88. package/front_end/entrypoints/main/MainImpl.ts +2 -2
  89. package/front_end/generated/InspectorBackendCommands.js +3 -1
  90. package/front_end/generated/protocol-mapping.d.ts +1 -0
  91. package/front_end/generated/protocol-proxy-api.d.ts +2 -0
  92. package/front_end/generated/protocol.d.ts +40 -0
  93. package/front_end/panels/application/ApplicationPanelCacheSection.ts +1 -1
  94. package/front_end/panels/application/BackForwardCacheView.ts +26 -26
  95. package/front_end/panels/elements/AccessibilityTreeUtils.ts +1 -1
  96. package/front_end/panels/elements/AccessibilityTreeView.ts +4 -3
  97. package/front_end/panels/sources/Plugin.ts +0 -3
  98. package/front_end/panels/sources/UISourceCodeFrame.ts +23 -49
  99. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  100. package/front_end/third_party/codemirror.next/package.json +1 -1
  101. package/front_end/ui/components/tree_outline/TreeOutline.ts +8 -0
  102. package/front_end/ui/legacy/Dialog.ts +8 -3
  103. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +5 -4
  104. package/inspector_overlay/css_grid_label_helpers.ts +1 -1
  105. package/inspector_overlay/highlight_common.ts +1 -1
  106. package/inspector_overlay/tool_highlight.ts +1 -1
  107. package/package.json +1 -1
  108. package/scripts/eslint_rules/lib/es_modules_import.js +0 -16
  109. package/scripts/eslint_rules/tests/es_modules_import_test.js +0 -16
@@ -764,6 +764,10 @@ export class TargetBase {
764
764
  manager.removeDomainDispatcher(dispatcher);
765
765
  }
766
766
 
767
+ registerAccessibilityDispatcher(dispatcher: ProtocolProxyApi.AccessibilityDispatcher): void {
768
+ this.registerDispatcher('Accessibility', dispatcher);
769
+ }
770
+
767
771
  registerAnimationDispatcher(dispatcher: ProtocolProxyApi.AnimationDispatcher): void {
768
772
  this.registerDispatcher('Animation', dispatcher);
769
773
  }
@@ -6,7 +6,6 @@ import type * as Protocol from '../../generated/protocol.js';
6
6
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
7
7
 
8
8
  import type {DOMNode} from './DOMModel.js';
9
- import {DOMModel} from './DOMModel.js';
10
9
  import {DeferredDOMNode} from './DOMModel.js';
11
10
  import type {Target} from './Target.js';
12
11
  import {Capability} from './Target.js';
@@ -39,8 +38,9 @@ export class AccessibilityNode {
39
38
  readonly #descriptionInternal: Protocol.Accessibility.AXValue|null;
40
39
  readonly #valueInternal: Protocol.Accessibility.AXValue|null;
41
40
  readonly #propertiesInternal: Protocol.Accessibility.AXProperty[]|null;
42
- #childIds: string[]|null;
43
- #parentNodeInternal: AccessibilityNode|null;
41
+ readonly #parentId: Protocol.Accessibility.AXNodeId|null;
42
+ readonly #frameId: Protocol.Page.FrameId|null;
43
+ readonly #childIds: Protocol.Accessibility.AXNodeId[]|null;
44
44
 
45
45
  constructor(accessibilityModel: AccessibilityModel, payload: Protocol.Accessibility.AXNode) {
46
46
  this.#accessibilityModelInternal = accessibilityModel;
@@ -67,7 +67,13 @@ export class AccessibilityNode {
67
67
  this.#valueInternal = payload.value || null;
68
68
  this.#propertiesInternal = payload.properties || null;
69
69
  this.#childIds = payload.childIds || null;
70
- this.#parentNodeInternal = null;
70
+ this.#parentId = payload.parentId || null;
71
+ if (payload.frameId && !payload.parentId) {
72
+ this.#frameId = payload.frameId;
73
+ accessibilityModel.setRootAXNodeForFrameId(payload.frameId, this);
74
+ } else {
75
+ this.#frameId = null;
76
+ }
71
77
  }
72
78
 
73
79
  id(): Protocol.Accessibility.AXNodeId {
@@ -123,11 +129,10 @@ export class AccessibilityNode {
123
129
  }
124
130
 
125
131
  parentNode(): AccessibilityNode|null {
126
- return this.#parentNodeInternal;
127
- }
128
-
129
- setParentNode(parentNode: AccessibilityNode|null): void {
130
- this.#parentNodeInternal = parentNode;
132
+ if (this.#parentId) {
133
+ return this.#accessibilityModelInternal.axNodeForId(this.#parentId);
134
+ }
135
+ return null;
131
136
  }
132
137
 
133
138
  isDOMNode(): boolean {
@@ -178,38 +183,57 @@ export class AccessibilityNode {
178
183
  if (!this.#childIds || !this.#childIds.length) {
179
184
  return false;
180
185
  }
181
-
182
186
  return this.#childIds.every(id => this.#accessibilityModelInternal.axNodeForId(id) === null);
183
187
  }
184
188
 
189
+ hasUnloadedChildren(): boolean {
190
+ if (!this.#childIds || !this.#childIds.length) {
191
+ return false;
192
+ }
193
+ return this.#childIds.some(id => this.#accessibilityModelInternal.axNodeForId(id) === null);
194
+ }
185
195
  // Only the root node gets a frameId, so nodes have to walk up the tree to find their frameId.
186
196
  getFrameId(): Protocol.Page.FrameId|null {
187
- const domNode = this.accessibilityModel().domNodeforAXNode(this);
188
- if (!domNode) {
189
- return null;
190
- }
191
- return domNode.frameId();
197
+ return this.#frameId || this.parentNode()?.getFrameId() || null;
192
198
  }
193
199
  }
194
200
 
195
- export class AccessibilityModel extends SDKModel<void> {
201
+ // TODO(crbug.com/1167717): Make this a const enum again
202
+ // eslint-disable-next-line rulesdir/const_enum
203
+ export enum Events {
204
+ TreeUpdated = 'TreeUpdated',
205
+ }
206
+
207
+ export type EventTypes = {
208
+ [Events.TreeUpdated]: {root?: AccessibilityNode},
209
+ };
210
+
211
+ export class AccessibilityModel extends SDKModel<EventTypes> implements ProtocolProxyApi.AccessibilityDispatcher {
196
212
  agent: ProtocolProxyApi.AccessibilityApi;
197
213
  #axIdToAXNode: Map<string, AccessibilityNode>;
198
- readonly #backendDOMNodeIdToAXNode: Map<Protocol.DOM.BackendNodeId, AccessibilityNode>;
199
- readonly #backendDOMNodeIdToDOMNode: Map<Protocol.DOM.BackendNodeId, DOMNode|null>;
214
+ #backendDOMNodeIdToAXNode: Map<Protocol.DOM.BackendNodeId, AccessibilityNode>;
215
+ #frameIdToAXNode: Map<Protocol.Page.FrameId, AccessibilityNode>;
216
+ #pendingChildRequests: Map<string, Promise<Protocol.Accessibility.GetChildAXNodesResponse>>;
217
+ #root: AccessibilityNode|null;
200
218
 
201
219
  constructor(target: Target) {
202
220
  super(target);
221
+ target.registerAccessibilityDispatcher(this);
203
222
  this.agent = target.accessibilityAgent();
204
223
  this.resumeModel();
205
224
 
206
225
  this.#axIdToAXNode = new Map();
207
226
  this.#backendDOMNodeIdToAXNode = new Map();
208
- this.#backendDOMNodeIdToDOMNode = new Map();
227
+ this.#frameIdToAXNode = new Map();
228
+ this.#pendingChildRequests = new Map();
229
+ this.#root = null;
209
230
  }
210
231
 
211
232
  clear(): void {
233
+ this.#root = null;
212
234
  this.#axIdToAXNode.clear();
235
+ this.#backendDOMNodeIdToAXNode.clear();
236
+ this.#frameIdToAXNode.clear();
213
237
  }
214
238
 
215
239
  async resumeModel(): Promise<void> {
@@ -225,60 +249,64 @@ export class AccessibilityModel extends SDKModel<void> {
225
249
  if (!nodes) {
226
250
  return;
227
251
  }
228
-
252
+ const axNodes = [];
229
253
  for (const payload of nodes) {
230
- new AccessibilityNode(this, payload);
254
+ axNodes.push(new AccessibilityNode(this, payload));
231
255
  }
256
+ }
232
257
 
233
- for (const axNode of this.#axIdToAXNode.values()) {
234
- for (const axChild of axNode.children()) {
235
- axChild.setParentNode(axNode);
236
- }
237
- }
258
+ loadComplete({root}: Protocol.Accessibility.LoadCompleteEvent): void {
259
+ this.clear();
260
+ this.#root = new AccessibilityNode(this, root);
261
+ this.dispatchEventToListeners(Events.TreeUpdated, {root: this.#root});
238
262
  }
239
263
 
240
- private async pushNodesToFrontend(backendIds: Set<Protocol.DOM.BackendNodeId>): Promise<void> {
241
- const domModel = this.target().model(DOMModel);
242
- if (!domModel) {
243
- return;
244
- }
245
- const newNodesToTrack = await domModel.pushNodesByBackendIdsToFrontend(backendIds);
246
- newNodesToTrack?.forEach((value, key) => this.#backendDOMNodeIdToDOMNode.set(key, value));
264
+ nodesUpdated({nodes}: Protocol.Accessibility.NodesUpdatedEvent): void {
265
+ this.createNodesFromPayload(nodes);
266
+ this.dispatchEventToListeners(Events.TreeUpdated, {});
267
+ return;
247
268
  }
248
269
 
249
270
  private createNodesFromPayload(payloadNodes: Protocol.Accessibility.AXNode[]): AccessibilityNode[] {
250
- const backendIds: Set<Protocol.DOM.BackendNodeId> = new Set();
251
271
  const accessibilityNodes = payloadNodes.map(node => {
252
272
  const sdkNode = new AccessibilityNode(this, node);
253
- const backendId = sdkNode.backendDOMNodeId();
254
- if (backendId) {
255
- backendIds.add(backendId);
256
- }
257
273
  return sdkNode;
258
274
  });
259
- this.pushNodesToFrontend(backendIds);
260
275
 
261
- for (const sdkNode of accessibilityNodes) {
262
- for (const sdkChild of sdkNode.children()) {
263
- sdkChild.setParentNode(sdkNode);
264
- }
265
- }
266
276
  return accessibilityNodes;
267
277
  }
268
278
 
269
- async requestRootNode(depth: number = 2, frameId?: Protocol.Page.FrameId): Promise<AccessibilityNode|undefined> {
270
- const {nodes} = await this.agent.invoke_getFullAXTree({depth, frameId});
271
- if (!nodes) {
279
+ async requestRootNode(frameId?: Protocol.Page.FrameId): Promise<AccessibilityNode|undefined> {
280
+ if (frameId && this.#frameIdToAXNode.has(frameId)) {
281
+ return this.#frameIdToAXNode.get(frameId);
282
+ }
283
+ if (!frameId && this.#root) {
284
+ return this.#root;
285
+ }
286
+ const {node} = await this.agent.invoke_getRootAXNode({frameId});
287
+ if (!node) {
272
288
  return;
273
289
  }
274
- const axNodes = this.createNodesFromPayload(nodes);
275
- const root = axNodes[0];
276
- return root;
290
+ return this.createNodesFromPayload([node])[0];
277
291
  }
278
292
 
279
293
  async requestAXChildren(nodeId: Protocol.Accessibility.AXNodeId, frameId?: Protocol.Page.FrameId):
280
294
  Promise<AccessibilityNode[]> {
281
- const {nodes} = await this.agent.invoke_getChildAXNodes({id: nodeId, frameId});
295
+ const parent = this.#axIdToAXNode.get(nodeId);
296
+ if (parent && !parent.hasUnloadedChildren()) {
297
+ return parent.children();
298
+ }
299
+
300
+ let nodes;
301
+ const request = this.#pendingChildRequests.get(nodeId);
302
+ if (request) {
303
+ nodes = (await request).nodes;
304
+ } else {
305
+ const req = this.agent.invoke_getChildAXNodes({id: nodeId, frameId});
306
+ this.#pendingChildRequests.set(nodeId, req);
307
+ nodes = (await req).nodes;
308
+ this.#pendingChildRequests.delete(nodeId);
309
+ }
282
310
  if (!nodes) {
283
311
  return [];
284
312
  }
@@ -286,36 +314,37 @@ export class AccessibilityModel extends SDKModel<void> {
286
314
  return axNodes;
287
315
  }
288
316
 
289
- async requestAndLoadSubTreeToNode(node: DOMNode): Promise<AccessibilityNode|null> {
317
+ async requestAndLoadSubTreeToNode(node: DOMNode): Promise<AccessibilityNode[]|null> {
290
318
  // Node may have already been loaded, so don't bother requesting it again.
291
- const loadedAXNode = this.axNodeForDOMNode(node);
292
- if (loadedAXNode) {
293
- return loadedAXNode;
319
+ const result = [];
320
+ let ancestor = this.axNodeForDOMNode(node);
321
+ while (ancestor) {
322
+ result.push(ancestor);
323
+ const parent = ancestor.parentNode();
324
+ if (!parent) {
325
+ return result;
326
+ }
327
+ ancestor = parent;
294
328
  }
295
-
296
- const {nodes} = await this.agent.invoke_getPartialAXTree({nodeId: node.id, fetchRelatives: true});
329
+ const {nodes} = await this.agent.invoke_getAXNodeAndAncestors({backendNodeId: node.backendNodeId()});
297
330
  if (!nodes) {
298
331
  return null;
299
332
  }
300
333
  const ancestors = this.createNodesFromPayload(nodes);
301
- // Request top level children nodes.
302
- for (const node of ancestors) {
303
- await this.requestAXChildren(node.id());
304
- }
305
334
 
306
- return this.axNodeForDOMNode(node);
335
+ return ancestors;
307
336
  }
308
337
 
309
- async updateSubtreeAndAncestors(backendNodeId: Protocol.DOM.BackendNodeId): Promise<void> {
310
- const {nodes} = await this.agent.invoke_getPartialAXTree({backendNodeId, fetchRelatives: true});
311
- if (!nodes) {
312
- return;
313
- }
314
- this.createNodesFromPayload(nodes);
338
+ axNodeForId(axId: Protocol.Accessibility.AXNodeId): AccessibilityNode|null {
339
+ return this.#axIdToAXNode.get(axId) || null;
315
340
  }
316
341
 
317
- axNodeForId(axId: string): AccessibilityNode|null {
318
- return this.#axIdToAXNode.get(axId) || null;
342
+ setRootAXNodeForFrameId(frameId: Protocol.Page.FrameId, axNode: AccessibilityNode): void {
343
+ this.#frameIdToAXNode.set(frameId, axNode);
344
+ }
345
+
346
+ axNodeForFrameId(frameId: Protocol.Page.FrameId): AccessibilityNode|null {
347
+ return this.#frameIdToAXNode.get(frameId) ?? null;
319
348
  }
320
349
 
321
350
  setAXNodeForAXId(axId: string, axNode: AccessibilityNode): void {
@@ -329,14 +358,6 @@ export class AccessibilityModel extends SDKModel<void> {
329
358
  return this.#backendDOMNodeIdToAXNode.get(domNode.backendNodeId()) ?? null;
330
359
  }
331
360
 
332
- domNodeforAXNode(axNode: AccessibilityNode): DOMNode|null {
333
- const backendDOMNodeId = axNode.backendDOMNodeId();
334
- if (!backendDOMNodeId) {
335
- return null;
336
- }
337
- return this.#backendDOMNodeIdToDOMNode.get(backendDOMNodeId) ?? null;
338
- }
339
-
340
361
  setAXNodeForBackendDOMNodeId(backendDOMNodeId: Protocol.DOM.BackendNodeId, axNode: AccessibilityNode): void {
341
362
  this.#backendDOMNodeIdToAXNode.set(backendDOMNodeId, axNode);
342
363
  }
@@ -1044,6 +1044,9 @@ export class NetworkDispatcher implements ProtocolProxyApi.NetworkDispatcher {
1044
1044
  this.#manager.dispatchEventToListeners(Events.ReportingApiReportUpdated, data.report);
1045
1045
  }
1046
1046
 
1047
+ reportingApiEndpointsChangedForOrigin(_data: Protocol.Network.ReportingApiEndpointsChangedForOriginEvent): void {
1048
+ }
1049
+
1047
1050
  /**
1048
1051
  * @deprecated
1049
1052
  * This method is only kept for usage in a web test.
@@ -25,13 +25,17 @@ const str_ = i18n.i18n.registerUIStrings('core/sdk/ServiceWorkerCacheModel.ts',
25
25
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
26
26
 
27
27
  export class ServiceWorkerCacheModel extends SDKModel<EventTypes> implements ProtocolProxyApi.StorageDispatcher {
28
- readonly #cachesInternal: Map<string, Cache>;
29
28
  readonly cacheAgent: ProtocolProxyApi.CacheStorageApi;
30
29
  readonly #storageAgent: ProtocolProxyApi.StorageApi;
31
30
  readonly #securityOriginManager: SecurityOriginManager;
32
- readonly #originsUpdated: Set<string>;
33
- readonly #throttler: Common.Throttler.Throttler;
34
- #enabled: boolean;
31
+
32
+ readonly #cachesInternal = new Map<string, Cache>();
33
+ readonly #originsUpdated = new Set<string>();
34
+ readonly #throttler = new Common.Throttler.Throttler(2000);
35
+ #enabled = false;
36
+
37
+ // Used by tests to remove the Throttler timeout.
38
+ #scheduleAsSoonAsPossible = false;
35
39
 
36
40
  /**
37
41
  * Invariant: This #model can only be constructed on a ServiceWorker target.
@@ -40,16 +44,9 @@ export class ServiceWorkerCacheModel extends SDKModel<EventTypes> implements Pro
40
44
  super(target);
41
45
  target.registerStorageDispatcher(this);
42
46
 
43
- this.#cachesInternal = new Map();
44
-
45
47
  this.cacheAgent = target.cacheStorageAgent();
46
48
  this.#storageAgent = target.storageAgent();
47
49
  this.#securityOriginManager = (target.model(SecurityOriginManager) as SecurityOriginManager);
48
-
49
- this.#originsUpdated = new Set();
50
- this.#throttler = new Common.Throttler.Throttler(2000);
51
-
52
- this.#enabled = false;
53
50
  }
54
51
 
55
52
  enable(): void {
@@ -240,7 +237,7 @@ export class ServiceWorkerCacheModel extends SDKModel<EventTypes> implements Pro
240
237
  const promises = Array.from(this.#originsUpdated, origin => this.loadCacheNames(origin));
241
238
  this.#originsUpdated.clear();
242
239
  return Promise.all(promises);
243
- });
240
+ }, this.#scheduleAsSoonAsPossible);
244
241
  }
245
242
 
246
243
  cacheStorageContentUpdated({origin, cacheName}: Protocol.Storage.CacheStorageContentUpdatedEvent): void {
@@ -252,6 +249,10 @@ export class ServiceWorkerCacheModel extends SDKModel<EventTypes> implements Pro
252
249
 
253
250
  indexedDBContentUpdated(_event: Protocol.Storage.IndexedDBContentUpdatedEvent): void {
254
251
  }
252
+
253
+ setThrottlerSchedulesAsSoonAsPossibleForTest(): void {
254
+ this.#scheduleAsSoonAsPossible = true;
255
+ }
255
256
  }
256
257
 
257
258
  // TODO(crbug.com/1167717): Make this a const enum again
@@ -299,8 +299,8 @@ export class MainImpl {
299
299
  'keyboardShortcutEditor', 'Enable keyboard shortcut editor', true,
300
300
  'https://developer.chrome.com/blog/new-in-devtools-88/#keyboard-shortcuts');
301
301
 
302
- // Back-Forward Cache
303
- Root.Runtime.experiments.register('bfcacheDebugging', 'Enable Back-Forward Cache debugging support');
302
+ // Back/forward cache
303
+ Root.Runtime.experiments.register('bfcacheDebugging', 'Enable back/forward cache debugging support');
304
304
 
305
305
  // Timeline
306
306
  Root.Runtime.experiments.register('timelineEventInitiators', 'Timeline: event initiators');
@@ -1700,6 +1700,7 @@ export function registerCommands(inspectorBackend) {
1700
1700
  ['innerRequestId', 'innerRequestURL', 'errorMessage', 'bundleRequestId']);
1701
1701
  inspectorBackend.registerEvent('Network.reportingApiReportAdded', ['report']);
1702
1702
  inspectorBackend.registerEvent('Network.reportingApiReportUpdated', ['report']);
1703
+ inspectorBackend.registerEvent('Network.reportingApiEndpointsChangedForOrigin', ['origin', 'endpoints']);
1703
1704
  inspectorBackend.registerCommand(
1704
1705
  'Network.setAcceptedEncodings', [{'name': 'encodings', 'type': 'object', 'optional': false}], []);
1705
1706
  inspectorBackend.registerCommand('Network.clearAcceptedEncodingsOverride', [], []);
@@ -1791,7 +1792,8 @@ export function registerCommands(inspectorBackend) {
1791
1792
  {'name': 'priority', 'type': 'string', 'optional': true},
1792
1793
  {'name': 'sameParty', 'type': 'boolean', 'optional': true},
1793
1794
  {'name': 'sourceScheme', 'type': 'string', 'optional': true},
1794
- {'name': 'sourcePort', 'type': 'number', 'optional': true}
1795
+ {'name': 'sourcePort', 'type': 'number', 'optional': true},
1796
+ {'name': 'partitionKey', 'type': 'string', 'optional': true}
1795
1797
  ],
1796
1798
  ['success']);
1797
1799
  inspectorBackend.registerCommand(
@@ -305,6 +305,7 @@ export namespace ProtocolMapping {
305
305
  */
306
306
  'Network.reportingApiReportAdded': [Protocol.Network.ReportingApiReportAddedEvent];
307
307
  'Network.reportingApiReportUpdated': [Protocol.Network.ReportingApiReportUpdatedEvent];
308
+ 'Network.reportingApiEndpointsChangedForOrigin': [Protocol.Network.ReportingApiEndpointsChangedForOriginEvent];
308
309
  /**
309
310
  * Fired when the node should be inspected. This happens after call to `setInspectMode` or when
310
311
  * user manually inspects an element.
@@ -2182,6 +2182,8 @@ declare namespace ProtocolProxyApi {
2182
2182
  reportingApiReportAdded(params: Protocol.Network.ReportingApiReportAddedEvent): void;
2183
2183
 
2184
2184
  reportingApiReportUpdated(params: Protocol.Network.ReportingApiReportUpdatedEvent): void;
2185
+
2186
+ reportingApiEndpointsChangedForOrigin(params: Protocol.Network.ReportingApiEndpointsChangedForOriginEvent): void;
2185
2187
  }
2186
2188
 
2187
2189
  export interface OverlayApi {
@@ -7513,6 +7513,15 @@ declare namespace Protocol {
7513
7513
  * This is a temporary ability and it will be removed in the future.
7514
7514
  */
7515
7515
  sourcePort: integer;
7516
+ /**
7517
+ * Cookie partition key. The site of the top-level URL the browser was visiting at the start
7518
+ * of the request to the endpoint that set the cookie.
7519
+ */
7520
+ partitionKey?: string;
7521
+ /**
7522
+ * True if cookie partition key is opaque.
7523
+ */
7524
+ partitionKeyOpaque?: boolean;
7516
7525
  }
7517
7526
 
7518
7527
  /**
@@ -7653,6 +7662,12 @@ declare namespace Protocol {
7653
7662
  * This is a temporary ability and it will be removed in the future.
7654
7663
  */
7655
7664
  sourcePort?: integer;
7665
+ /**
7666
+ * Cookie partition key. The site of the top-level URL the browser was visiting at the start
7667
+ * of the request to the endpoint that set the cookie.
7668
+ * If not set, the cookie will be set as not partitioned.
7669
+ */
7670
+ partitionKey?: string;
7656
7671
  }
7657
7672
 
7658
7673
  export const enum AuthChallengeSource {
@@ -7976,6 +7991,17 @@ declare namespace Protocol {
7976
7991
  status: ReportStatus;
7977
7992
  }
7978
7993
 
7994
+ export interface ReportingApiEndpoint {
7995
+ /**
7996
+ * The URL of the endpoint to which reports may be delivered.
7997
+ */
7998
+ url: string;
7999
+ /**
8000
+ * Name of the endpoint group.
8001
+ */
8002
+ groupName: string;
8003
+ }
8004
+
7979
8005
  /**
7980
8006
  * An object providing the result of a network resource load.
7981
8007
  */
@@ -8332,6 +8358,12 @@ declare namespace Protocol {
8332
8358
  * This is a temporary ability and it will be removed in the future.
8333
8359
  */
8334
8360
  sourcePort?: integer;
8361
+ /**
8362
+ * Cookie partition key. The site of the top-level URL the browser was visiting at the start
8363
+ * of the request to the endpoint that set the cookie.
8364
+ * If not set, the cookie will be set as not partitioned.
8365
+ */
8366
+ partitionKey?: string;
8335
8367
  }
8336
8368
 
8337
8369
  export interface SetCookieResponse extends ProtocolResponseWithError {
@@ -9098,6 +9130,14 @@ declare namespace Protocol {
9098
9130
  export interface ReportingApiReportUpdatedEvent {
9099
9131
  report: ReportingApiReport;
9100
9132
  }
9133
+
9134
+ export interface ReportingApiEndpointsChangedForOriginEvent {
9135
+ /**
9136
+ * Origin of the document(s) which configured the endpoints.
9137
+ */
9138
+ origin: string;
9139
+ endpoints: ReportingApiEndpoint[];
9140
+ }
9101
9141
  }
9102
9142
 
9103
9143
  /**
@@ -20,7 +20,7 @@ const UIStrings = {
20
20
  /**
21
21
  *@description Text in Application Panel Sidebar of the Application panel
22
22
  */
23
- backForwardCache: 'Back-Forward Cache',
23
+ backForwardCache: 'Back/forward cache',
24
24
  /**
25
25
  *@description A context menu item in the Application Panel Sidebar of the Application panel
26
26
  */
@@ -17,67 +17,67 @@ import backForwardCacheViewStyles from './backForwardCacheView.css.js';
17
17
 
18
18
  const UIStrings = {
19
19
  /**
20
- * @description Title text in Back-Forward Cache view of the Application panel
20
+ * @description Title text in back/forward cache view of the Application panel
21
21
  */
22
22
  mainFrame: 'Main Frame',
23
23
  /**
24
- * @description Title text in Back-Forward Cache view of the Application panel
24
+ * @description Title text in back/forward cache view of the Application panel
25
25
  */
26
- backForwardCacheTitle: 'Back-Forward Cache',
26
+ backForwardCacheTitle: 'Back/forward cache',
27
27
  /**
28
28
  * @description Status text for the status of the main frame
29
29
  */
30
30
  unavailable: 'unavailable',
31
31
  /**
32
- * @description Entry name text in the Back-Forward Cache view of the Application panel
32
+ * @description Entry name text in the back/forward cache view of the Application panel
33
33
  */
34
34
  url: 'URL',
35
35
  /**
36
- * @description Entry name text in the Back-Forward Cache view of the Application panel
36
+ * @description Entry name text in the back/forward cache view of the Application panel
37
37
  */
38
- bfcacheStatus: 'Back-Forward Cache Status',
38
+ bfcacheStatus: 'Back/forward cache Status',
39
39
  /**
40
- * @description Status text for the status of the Back-Forward Cache status
40
+ * @description Status text for the status of the back/forward cache status
41
41
  */
42
42
  unknown: 'unknown',
43
43
  /**
44
- * @description Status text for the status of the Back-Forward Cache status indicating that
45
- * the Back-Forward Cache was not used and a normal navigation occured instead.
44
+ * @description Status text for the status of the back/forward cache status indicating that
45
+ * the back/forward cache was not used and a normal navigation occured instead.
46
46
  */
47
- normalNavigation: 'Normal navigation (Not restored from Back-Forward Cache)',
47
+ normalNavigation: 'Normal navigation (Not restored from back/forward cache)',
48
48
  /**
49
- * @description Status text for the status of the Back-Forward Cache status indicating that
50
- * the Back-Forward Cache was used to restore the page instead of reloading it.
49
+ * @description Status text for the status of the back/forward cache status indicating that
50
+ * the back/forward cache was used to restore the page instead of reloading it.
51
51
  */
52
- restoredFromBFCache: 'Restored from Back-Forward Cache',
52
+ restoredFromBFCache: 'Restored from back/forward cache',
53
53
  /**
54
54
  * @description Label for a list of reasons which prevent the page from being eligible for
55
- * Back-Forward Cache. These reasons are actionable i.e. they can be cleaned up to make the
56
- * page eligible for Back-Forward Cache.
55
+ * back/forward cache. These reasons are actionable i.e. they can be cleaned up to make the
56
+ * page eligible for back/forward cache.
57
57
  */
58
58
  pageSupportNeeded: 'Actionable',
59
59
  /**
60
60
  * @description Explanation for actionable items which prevent the page from being eligible
61
- * for Back-Forward Cache.
61
+ * for back/forward cache.
62
62
  */
63
63
  pageSupportNeededExplanation:
64
- 'These reasons are actionable i.e. they can be cleaned up to make the page eligible for Back-Forward Cache.',
64
+ 'These reasons are actionable i.e. they can be cleaned up to make the page eligible for back/forward cache.',
65
65
  /**
66
66
  * @description Label for a list of reasons which prevent the page from being eligible for
67
- * Back-Forward Cache. These reasons are circumstantial / not actionable i.e. they cannot be
68
- * cleaned up by developers to make the page eligible for Back-Forward Cache.
67
+ * back/forward cache. These reasons are circumstantial / not actionable i.e. they cannot be
68
+ * cleaned up by developers to make the page eligible for back/forward cache.
69
69
  */
70
70
  circumstantial: 'Not Actionable',
71
71
  /**
72
72
  * @description Explanation for circumstantial/non-actionable items which prevent the page from being eligible
73
- * for Back-Forward Cache.
73
+ * for back/forward cache.
74
74
  */
75
75
  circumstantialExplanation:
76
76
  'These reasons are not actionable i.e. caching was prevented by something outside of the direct control of the page.',
77
77
  /**
78
78
  * @description Label for a list of reasons which prevent the page from being eligible for
79
- * Back-Forward Cache. These reasons are pending support by chrome i.e. in a future version
80
- * of chrome they will not prevent Back-Forward Cache usage anymore.
79
+ * back/forward cache. These reasons are pending support by chrome i.e. in a future version
80
+ * of chrome they will not prevent back/forward cache usage anymore.
81
81
  */
82
82
  supportPending: 'Pending Support',
83
83
  /**
@@ -86,10 +86,10 @@ const UIStrings = {
86
86
  runTest: 'Run Test',
87
87
  /**
88
88
  * @description Explanation for 'pending support' items which prevent the page from being eligible
89
- * for Back-Forward Cache.
89
+ * for back/forward cache.
90
90
  */
91
91
  supportPendingExplanation:
92
- 'Chrome support for these reasons is pending i.e. they will not prevent the page from being eligible for Back-Forward Cache in a future version of Chrome.',
92
+ 'Chrome support for these reasons is pending i.e. they will not prevent the page from being eligible for back/forward cache in a future version of Chrome.',
93
93
  };
94
94
  const str_ = i18n.i18n.registerUIStrings('panels/application/BackForwardCacheView.ts', UIStrings);
95
95
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -168,9 +168,9 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
168
168
 
169
169
  // We can know whether the current page can use BFCache
170
170
  // as the browser navigates to another unrelated page and goes back to the current page.
171
- // We chose "chrome://version" because it must be cross-site.
171
+ // We chose "chrome://terms" because it must be cross-site.
172
172
  // Ideally, We want to have our own testing page like "chrome: //bfcache-test".
173
- resourceTreeModel.navigate('chrome://version/');
173
+ resourceTreeModel.navigate('chrome://terms');
174
174
  }
175
175
  }
176
176
 
@@ -44,7 +44,7 @@ export function sdkNodeToAXTreeNode(sdkNode: SDK.AccessibilityModel.Accessibilit
44
44
  let localRoot = axmodel.axNodeForDOMNode(document);
45
45
  if (!localRoot && frameId) {
46
46
  // Request the root node of the iframe document:
47
- localRoot = await axmodel.requestRootNode(1, frameId) || null;
47
+ localRoot = await axmodel.requestRootNode(frameId) || null;
48
48
  }
49
49
  if (!localRoot) {
50
50
  throw new Error('Could not find root node');
@@ -104,7 +104,7 @@ export class AccessibilityTreeView extends UI.Widget.VBox {
104
104
 
105
105
  async update(node: SDK.DOMModel.DOMNode): Promise<void> {
106
106
  const axModel = node.domModel().target().model(SDK.AccessibilityModel.AccessibilityModel);
107
- await axModel?.updateSubtreeAndAncestors(node.backendNodeId());
107
+ await axModel?.requestAndLoadSubTreeToNode(node);
108
108
  this.renderTree();
109
109
  }
110
110
 
@@ -140,7 +140,7 @@ export class AccessibilityTreeView extends UI.Widget.VBox {
140
140
 
141
141
  async refreshAccessibilityTree(accessibilityModel: SDK.AccessibilityModel.AccessibilityModel): Promise<void> {
142
142
  // We always expand the root node so we might as well fetch one level of children immediately.
143
- const root = await accessibilityModel.requestRootNode(1);
143
+ const root = await accessibilityModel.requestRootNode();
144
144
  if (!root) {
145
145
  return;
146
146
  }
@@ -169,7 +169,8 @@ export class AccessibilityTreeView extends UI.Widget.VBox {
169
169
  // E
170
170
  // Where only A is already loaded into the model, calling requestAndLoadSubTreeToNode(C) will
171
171
  // load [A, B, D, C] into the model, and return C.
172
- const inspectedAXNode = await this.accessibilityModel.requestAndLoadSubTreeToNode(selectedNode);
172
+ await this.accessibilityModel.requestAndLoadSubTreeToNode(selectedNode);
173
+ const inspectedAXNode = this.accessibilityModel.axNodeForDOMNode(selectedNode);
173
174
  if (!inspectedAXNode) {
174
175
  return;
175
176
  }