chrome-devtools-frontend 1.0.942529 → 1.0.943986

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 (212) hide show
  1. package/WATCHLISTS +1 -1
  2. package/config/gni/all_devtools_files.gni +0 -14
  3. package/config/gni/devtools_grd_files.gni +6 -5
  4. package/front_end/Tests.js +0 -32
  5. package/front_end/core/i18n/locales/af.json +455 -44
  6. package/front_end/core/i18n/locales/am.json +455 -44
  7. package/front_end/core/i18n/locales/ar.json +455 -44
  8. package/front_end/core/i18n/locales/as.json +455 -44
  9. package/front_end/core/i18n/locales/az.json +455 -44
  10. package/front_end/core/i18n/locales/be.json +456 -45
  11. package/front_end/core/i18n/locales/bg.json +455 -44
  12. package/front_end/core/i18n/locales/bn.json +455 -44
  13. package/front_end/core/i18n/locales/bs.json +455 -44
  14. package/front_end/core/i18n/locales/ca.json +457 -46
  15. package/front_end/core/i18n/locales/cs.json +458 -47
  16. package/front_end/core/i18n/locales/cy.json +455 -44
  17. package/front_end/core/i18n/locales/da.json +455 -44
  18. package/front_end/core/i18n/locales/de.json +455 -44
  19. package/front_end/core/i18n/locales/el.json +455 -44
  20. package/front_end/core/i18n/locales/en-GB.json +449 -38
  21. package/front_end/core/i18n/locales/en-US.json +8 -8
  22. package/front_end/core/i18n/locales/en-XL.json +8 -8
  23. package/front_end/core/i18n/locales/es-419.json +455 -44
  24. package/front_end/core/i18n/locales/es.json +455 -44
  25. package/front_end/core/i18n/locales/et.json +455 -44
  26. package/front_end/core/i18n/locales/eu.json +462 -51
  27. package/front_end/core/i18n/locales/fa.json +455 -44
  28. package/front_end/core/i18n/locales/fi.json +455 -44
  29. package/front_end/core/i18n/locales/fil.json +454 -43
  30. package/front_end/core/i18n/locales/fr-CA.json +455 -44
  31. package/front_end/core/i18n/locales/fr.json +456 -45
  32. package/front_end/core/i18n/locales/gl.json +455 -44
  33. package/front_end/core/i18n/locales/gu.json +456 -45
  34. package/front_end/core/i18n/locales/he.json +455 -44
  35. package/front_end/core/i18n/locales/hi.json +455 -44
  36. package/front_end/core/i18n/locales/hr.json +455 -44
  37. package/front_end/core/i18n/locales/hu.json +455 -44
  38. package/front_end/core/i18n/locales/hy.json +455 -44
  39. package/front_end/core/i18n/locales/id.json +455 -44
  40. package/front_end/core/i18n/locales/is.json +455 -44
  41. package/front_end/core/i18n/locales/it.json +502 -91
  42. package/front_end/core/i18n/locales/ja.json +456 -45
  43. package/front_end/core/i18n/locales/ka.json +455 -44
  44. package/front_end/core/i18n/locales/kk.json +456 -45
  45. package/front_end/core/i18n/locales/km.json +455 -44
  46. package/front_end/core/i18n/locales/kn.json +455 -44
  47. package/front_end/core/i18n/locales/ko.json +455 -44
  48. package/front_end/core/i18n/locales/ky.json +456 -45
  49. package/front_end/core/i18n/locales/lo.json +454 -43
  50. package/front_end/core/i18n/locales/lt.json +455 -44
  51. package/front_end/core/i18n/locales/lv.json +458 -47
  52. package/front_end/core/i18n/locales/mk.json +455 -44
  53. package/front_end/core/i18n/locales/ml.json +461 -50
  54. package/front_end/core/i18n/locales/mn.json +455 -44
  55. package/front_end/core/i18n/locales/mr.json +455 -44
  56. package/front_end/core/i18n/locales/ms.json +455 -44
  57. package/front_end/core/i18n/locales/my.json +456 -45
  58. package/front_end/core/i18n/locales/ne.json +456 -45
  59. package/front_end/core/i18n/locales/nl.json +532 -121
  60. package/front_end/core/i18n/locales/no.json +455 -44
  61. package/front_end/core/i18n/locales/or.json +455 -44
  62. package/front_end/core/i18n/locales/pa.json +455 -44
  63. package/front_end/core/i18n/locales/pl.json +455 -44
  64. package/front_end/core/i18n/locales/pt-PT.json +504 -93
  65. package/front_end/core/i18n/locales/pt.json +454 -43
  66. package/front_end/core/i18n/locales/ro.json +455 -44
  67. package/front_end/core/i18n/locales/ru.json +455 -44
  68. package/front_end/core/i18n/locales/si.json +455 -44
  69. package/front_end/core/i18n/locales/sk.json +456 -45
  70. package/front_end/core/i18n/locales/sl.json +455 -44
  71. package/front_end/core/i18n/locales/sq.json +455 -44
  72. package/front_end/core/i18n/locales/sr-Latn.json +455 -44
  73. package/front_end/core/i18n/locales/sr.json +455 -44
  74. package/front_end/core/i18n/locales/sv.json +456 -45
  75. package/front_end/core/i18n/locales/sw.json +455 -44
  76. package/front_end/core/i18n/locales/ta.json +456 -45
  77. package/front_end/core/i18n/locales/te.json +454 -43
  78. package/front_end/core/i18n/locales/th.json +455 -44
  79. package/front_end/core/i18n/locales/tr.json +455 -44
  80. package/front_end/core/i18n/locales/uk.json +455 -44
  81. package/front_end/core/i18n/locales/ur.json +455 -44
  82. package/front_end/core/i18n/locales/uz.json +455 -44
  83. package/front_end/core/i18n/locales/vi.json +455 -44
  84. package/front_end/core/i18n/locales/zh-HK.json +459 -48
  85. package/front_end/core/i18n/locales/zh-TW.json +457 -46
  86. package/front_end/core/i18n/locales/zh.json +460 -49
  87. package/front_end/core/i18n/locales/zu.json +455 -44
  88. package/front_end/core/protocol_client/InspectorBackend.ts +4 -0
  89. package/front_end/core/sdk/AccessibilityModel.ts +99 -78
  90. package/front_end/core/sdk/CPUProfilerModel.ts +7 -9
  91. package/front_end/core/sdk/ConsoleModel.ts +27 -33
  92. package/front_end/core/sdk/NetworkManager.ts +3 -0
  93. package/front_end/core/sdk/Script.ts +0 -4
  94. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +13 -12
  95. package/front_end/entrypoints/device_mode_emulation_frame/device_mode_emulation_frame.ts +1 -1
  96. package/front_end/entrypoints/devtools_app/devtools_app.js +1 -1
  97. package/front_end/entrypoints/devtools_app/devtools_app.json +1 -4
  98. package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -1
  99. package/front_end/entrypoints/heap_snapshot_worker/heap_snapshot_worker-entrypoint.ts +1 -1
  100. package/front_end/entrypoints/inspector/inspector.js +1 -1
  101. package/front_end/entrypoints/inspector/inspector.json +1 -3
  102. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +2 -3
  103. package/front_end/entrypoints/js_app/js_app.js +1 -1
  104. package/front_end/entrypoints/js_app/js_app.json +1 -3
  105. package/front_end/entrypoints/main/MainImpl.ts +2 -2
  106. package/front_end/entrypoints/main/main-meta.ts +1 -2
  107. package/front_end/entrypoints/ndb_app/ndb_app.js +1 -1
  108. package/front_end/entrypoints/node_app/node_app-meta.ts +0 -2
  109. package/front_end/entrypoints/node_app/node_app.js +1 -1
  110. package/front_end/entrypoints/node_app/node_app.json +1 -3
  111. package/front_end/entrypoints/node_main/node_main-meta.ts +0 -1
  112. package/front_end/entrypoints/shell/shell.json +1 -4
  113. package/front_end/entrypoints/wasmparser_worker/wasmparser_worker-entrypoint.ts +1 -1
  114. package/front_end/entrypoints/worker_app/worker_app.js +1 -1
  115. package/front_end/entrypoints/worker_app/worker_app.json +1 -3
  116. package/front_end/generated/InspectorBackendCommands.js +21 -1
  117. package/front_end/generated/protocol-mapping.d.ts +32 -1
  118. package/front_end/generated/protocol-proxy-api.d.ts +36 -2
  119. package/front_end/generated/protocol.d.ts +120 -7
  120. package/front_end/legacy_test_runner/console_test_runner/console_test_runner.js +5 -1
  121. package/front_end/models/bindings/DefaultScriptMapping.ts +1 -9
  122. package/front_end/models/bindings/ResourceScriptMapping.ts +3 -11
  123. package/front_end/models/formatter/SourceFormatter.ts +0 -15
  124. package/front_end/models/persistence/persistence-meta.ts +0 -1
  125. package/front_end/panels/accessibility/accessibility-meta.ts +0 -1
  126. package/front_end/panels/animation/animation-meta.ts +0 -1
  127. package/front_end/panels/application/ApplicationPanelCacheSection.ts +1 -1
  128. package/front_end/panels/application/BackForwardCacheStrings.ts +3 -1
  129. package/front_end/panels/application/BackForwardCacheView.ts +26 -26
  130. package/front_end/panels/application/application-meta.ts +0 -1
  131. package/front_end/panels/application/components/stackTraceRow.css +8 -0
  132. package/front_end/panels/browser_debugger/browser_debugger-meta.ts +1 -2
  133. package/front_end/panels/changes/changes-meta.ts +0 -1
  134. package/front_end/panels/console/ConsolePinPane.ts +2 -6
  135. package/front_end/panels/console/ConsoleViewMessage.ts +8 -1
  136. package/front_end/panels/console/console-meta.ts +0 -1
  137. package/front_end/panels/console_counters/console_counters-meta.ts +0 -1
  138. package/front_end/panels/coverage/coverage-meta.ts +0 -1
  139. package/front_end/panels/css_overview/css_overview-meta.ts +0 -1
  140. package/front_end/panels/developer_resources/developer_resources-meta.ts +0 -1
  141. package/front_end/panels/elements/AccessibilityTreeUtils.ts +96 -66
  142. package/front_end/panels/elements/AccessibilityTreeView.ts +76 -125
  143. package/front_end/panels/elements/ElementsPanel.ts +6 -7
  144. package/front_end/panels/elements/elements-meta.ts +0 -1
  145. package/front_end/panels/emulation/emulation-meta.ts +0 -1
  146. package/front_end/panels/help/help-meta.ts +0 -1
  147. package/front_end/panels/input/input-meta.ts +0 -1
  148. package/front_end/panels/issues/issues-meta.ts +0 -1
  149. package/front_end/panels/js_profiler/js_profiler-meta.ts +0 -4
  150. package/front_end/panels/layers/layers-meta.ts +0 -4
  151. package/front_end/panels/lighthouse/lighthouse-meta.ts +0 -1
  152. package/front_end/panels/lighthouse/module.json +0 -3
  153. package/front_end/panels/media/media-meta.ts +0 -1
  154. package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +0 -1
  155. package/front_end/panels/network/network-meta.ts +1 -2
  156. package/front_end/panels/performance_monitor/performance_monitor-meta.ts +0 -1
  157. package/front_end/panels/profiler/CPUProfileView.ts +10 -3
  158. package/front_end/panels/profiler/profiler-meta.ts +0 -3
  159. package/front_end/panels/protocol_monitor/protocol_monitor-meta.ts +0 -1
  160. package/front_end/panels/screencast/screencast-meta.ts +0 -4
  161. package/front_end/panels/security/security-meta.ts +0 -1
  162. package/front_end/panels/sensors/sensors-meta.ts +0 -1
  163. package/front_end/panels/settings/emulation/emulation-meta.ts +0 -1
  164. package/front_end/panels/settings/settings-meta.ts +0 -1
  165. package/front_end/panels/sources/Plugin.ts +0 -3
  166. package/front_end/panels/sources/UISourceCodeFrame.ts +23 -49
  167. package/front_end/panels/sources/sources-meta.ts +2 -6
  168. package/front_end/panels/timeline/timeline-meta.ts +2 -9
  169. package/front_end/panels/web_audio/web_audio-meta.ts +0 -1
  170. package/front_end/panels/webauthn/webauthn-meta.ts +0 -1
  171. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  172. package/front_end/third_party/codemirror.next/package.json +1 -1
  173. package/front_end/ui/components/docs/component_docs.ts +14 -0
  174. package/front_end/ui/components/docs/create_breadcrumbs.ts +1 -1
  175. package/front_end/ui/components/docs/toggle_dark_mode.ts +1 -0
  176. package/front_end/ui/components/docs/toggle_fonts.ts +2 -0
  177. package/front_end/ui/components/helpers/get-stylesheet.ts +0 -1
  178. package/front_end/ui/components/linear_memory_inspector/linear_memory_inspector-meta.ts +1 -2
  179. package/front_end/ui/components/tree_outline/TreeOutline.ts +71 -8
  180. package/front_end/ui/components/tree_outline/TreeOutlineUtils.ts +8 -6
  181. package/front_end/ui/legacy/Dialog.ts +8 -3
  182. package/front_end/ui/legacy/SoftContextMenu.ts +1 -1
  183. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  184. package/front_end/ui/legacy/UIUtils.ts +1 -1
  185. package/front_end/ui/legacy/components/inline_editor/CSSAngle.ts +1 -2
  186. package/front_end/ui/legacy/components/inline_editor/cssAngle.css +4 -0
  187. package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +2 -2
  188. package/front_end/ui/legacy/components/object_ui/object_ui-meta.ts +0 -4
  189. package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +0 -3
  190. package/front_end/ui/legacy/components/quick_open/quick_open-meta.ts +2 -3
  191. package/front_end/ui/legacy/components/source_frame/FontView.ts +3 -1
  192. package/front_end/ui/legacy/components/source_frame/ImageView.ts +3 -1
  193. package/front_end/ui/legacy/components/source_frame/JSONView.ts +3 -1
  194. package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +2 -1
  195. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +6 -6
  196. package/front_end/ui/legacy/components/source_frame/XMLView.ts +5 -2
  197. package/front_end/ui/legacy/textButton.css +5 -4
  198. package/inspector_overlay/css_grid_label_helpers.ts +1 -1
  199. package/inspector_overlay/highlight_common.ts +1 -1
  200. package/inspector_overlay/tool_highlight.ts +1 -1
  201. package/package.json +1 -1
  202. package/scripts/check_gn.js +0 -35
  203. package/scripts/eslint_rules/lib/es_modules_import.js +15 -24
  204. package/scripts/eslint_rules/tests/es_modules_import_test.js +8 -16
  205. package/front_end/emulated_devices/module.json +0 -4
  206. package/front_end/panels/js_profiler/module.json +0 -5
  207. package/front_end/panels/layers/module.json +0 -4
  208. package/front_end/panels/profiler/module.json +0 -3
  209. package/front_end/panels/screencast/module.json +0 -3
  210. package/front_end/panels/timeline/module.json +0 -5
  211. package/front_end/ui/legacy/components/source_frame/messagesPopover.css +0 -32
  212. package/front_end/ui/legacy/components/source_frame/module.json +0 -11
@@ -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
  }
@@ -29,7 +29,6 @@
29
29
  */
30
30
 
31
31
  import * as i18n from '../i18n/i18n.js';
32
- import * as Root from '../root/root.js';
33
32
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
34
33
  import type * as Protocol from '../../generated/protocol.js';
35
34
 
@@ -57,6 +56,7 @@ export class CPUProfilerModel extends SDKModel<EventTypes> implements ProtocolPr
57
56
  #preciseCoverageDeltaUpdateCallback:
58
57
  ((arg0: number, arg1: string, arg2: Array<Protocol.Profiler.ScriptCoverage>) => void)|null;
59
58
  readonly #debuggerModelInternal: DebuggerModel;
59
+ readonly registeredConsoleProfileMessages: ProfileFinishedData[] = [];
60
60
 
61
61
  constructor(target: Target) {
62
62
  super(target);
@@ -92,14 +92,12 @@ export class CPUProfilerModel extends SDKModel<EventTypes> implements ProtocolPr
92
92
  title = this.#anonymousConsoleProfileIdToTitle.get(id);
93
93
  this.#anonymousConsoleProfileIdToTitle.delete(id);
94
94
  }
95
- // Make sure ProfilesPanel is initialized and CPUProfileType is created.
96
- Root.Runtime.Runtime.instance().loadModulePromise('profiler').then(() => {
97
- const eventData: ProfileFinishedData = {
98
- ...this.createEventDataFrom(id, location, title),
99
- cpuProfile: profile,
100
- };
101
- this.dispatchEventToListeners(Events.ConsoleProfileFinished, eventData);
102
- });
95
+ const eventData: ProfileFinishedData = {
96
+ ...this.createEventDataFrom(id, location, title),
97
+ cpuProfile: profile,
98
+ };
99
+ this.registeredConsoleProfileMessages.push(eventData);
100
+ this.dispatchEventToListeners(Events.ConsoleProfileFinished, eventData);
103
101
  }
104
102
 
105
103
  private createEventDataFrom(id: string, scriptLocation: Protocol.Debugger.Location, title?: string): EventData {
@@ -491,6 +491,30 @@ function areAffectedResourcesEquivalent(a?: AffectedResources, b?: AffectedResou
491
491
  return a?.requestId === b?.requestId;
492
492
  }
493
493
 
494
+ function areStackTracesEquivalent(
495
+ stackTrace1?: Protocol.Runtime.StackTrace, stackTrace2?: Protocol.Runtime.StackTrace): boolean {
496
+ if (!stackTrace1 !== !stackTrace2) {
497
+ return false;
498
+ }
499
+ if (!stackTrace1 || !stackTrace2) {
500
+ return true;
501
+ }
502
+ const callFrames1 = stackTrace1.callFrames;
503
+ const callFrames2 = stackTrace2.callFrames;
504
+ if (callFrames1.length !== callFrames2.length) {
505
+ return false;
506
+ }
507
+ for (let i = 0, n = callFrames1.length; i < n; ++i) {
508
+ if (callFrames1[i].scriptId !== callFrames2[i].scriptId ||
509
+ callFrames1[i].functionName !== callFrames2[i].functionName ||
510
+ callFrames1[i].lineNumber !== callFrames2[i].lineNumber ||
511
+ callFrames1[i].columnNumber !== callFrames2[i].columnNumber) {
512
+ return false;
513
+ }
514
+ }
515
+ return areStackTracesEquivalent(stackTrace1.parent, stackTrace2.parent);
516
+ }
517
+
494
518
  export interface ConsoleMessageDetails {
495
519
  type?: MessageType;
496
520
  url?: string;
@@ -659,10 +683,6 @@ export class ConsoleMessage {
659
683
  return false;
660
684
  }
661
685
 
662
- if (!this.isEqualStackTraces(this.stackTrace, msg.stackTrace)) {
663
- return false;
664
- }
665
-
666
686
  if (this.parameters) {
667
687
  if (!msg.parameters || this.parameters.length !== msg.parameters.length) {
668
688
  return false;
@@ -687,38 +707,12 @@ export class ConsoleMessage {
687
707
  }
688
708
  }
689
709
 
690
- const watchExpressionRegex = /^watch-expression-\d+.devtools$/;
691
- const bothAreWatchExpressions =
692
- watchExpressionRegex.test(this.url || '') && watchExpressionRegex.test(msg.url || '');
693
-
694
710
  return (this.runtimeModel() === msg.runtimeModel()) && (this.source === msg.source) && (this.type === msg.type) &&
695
711
  (this.level === msg.level) && (this.line === msg.line) && (this.url === msg.url) &&
696
- (bothAreWatchExpressions || this.scriptId === msg.scriptId) && (this.messageText === msg.messageText) &&
712
+ (this.scriptId === msg.scriptId) && (this.messageText === msg.messageText) &&
697
713
  (this.#executionContextId === msg.#executionContextId) &&
698
- areAffectedResourcesEquivalent(this.#affectedResources, msg.#affectedResources);
699
- }
700
-
701
- private isEqualStackTraces(
702
- stackTrace1: Protocol.Runtime.StackTrace|undefined, stackTrace2: Protocol.Runtime.StackTrace|undefined): boolean {
703
- if (!stackTrace1 !== !stackTrace2) {
704
- return false;
705
- }
706
- if (!stackTrace1 || !stackTrace2) {
707
- return true;
708
- }
709
- const callFrames1 = stackTrace1.callFrames;
710
- const callFrames2 = stackTrace2.callFrames;
711
- if (callFrames1.length !== callFrames2.length) {
712
- return false;
713
- }
714
- for (let i = 0, n = callFrames1.length; i < n; ++i) {
715
- if (callFrames1[i].url !== callFrames2[i].url || callFrames1[i].functionName !== callFrames2[i].functionName ||
716
- callFrames1[i].lineNumber !== callFrames2[i].lineNumber ||
717
- callFrames1[i].columnNumber !== callFrames2[i].columnNumber) {
718
- return false;
719
- }
720
- }
721
- return this.isEqualStackTraces(stackTrace1.parent, stackTrace2.parent);
714
+ areAffectedResourcesEquivalent(this.#affectedResources, msg.#affectedResources) &&
715
+ areStackTracesEquivalent(this.stackTrace, msg.stackTrace);
722
716
  }
723
717
  }
724
718
 
@@ -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.
@@ -313,10 +313,6 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
313
313
  return !this.sourceURL;
314
314
  }
315
315
 
316
- isInlineScriptWithSourceURL(): boolean {
317
- return Boolean(this.hasSourceURL) && this.isInlineScript();
318
- }
319
-
320
316
  async setBlackboxedRanges(positions: Protocol.Debugger.ScriptPosition[]): Promise<boolean> {
321
317
  const response = await this.debuggerModel.target().debuggerAgent().invoke_setBlackboxedRanges(
322
318
  {scriptId: this.scriptId, positions});
@@ -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
@@ -5,7 +5,7 @@
5
5
  import '../../core/dom_extension/dom_extension.js';
6
6
  import '../../Images/Images.js';
7
7
 
8
- import * as Platform from '../../core/platform/platform.js'; // eslint-disable-line rulesdir/es_modules_import
8
+ import * as Platform from '../../core/platform/platform.js';
9
9
 
10
10
  Platform.runOnWindowLoad(() => {
11
11
  if (!window.opener) {
@@ -3,6 +3,6 @@
3
3
  // found in the LICENSE file.
4
4
  import '../shell/shell.js';
5
5
  import './devtools_app-meta-files.js';
6
- import * as Startup from '../startup/startup.js'; // eslint-disable-line rulesdir/es_modules_import
6
+ import * as Startup from '../startup/startup.js';
7
7
 
8
8
  Startup.RuntimeInstantiator.startApplication('devtools_app');
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "modules" : [
3
- { "name": "panels/lighthouse" },
4
- { "name": "emulated_devices" },
5
- { "name": "panels/layers" },
6
- { "name": "panels/timeline" }
3
+ { "name": "panels/lighthouse" }
7
4
  ],
8
5
  "extends": "shell"
9
6
  }
@@ -8,7 +8,7 @@ import '../../third_party/codemirror/package/mode/xml/xml.js';
8
8
  import '../../third_party/codemirror/package/mode/javascript/javascript.js';
9
9
 
10
10
  import * as Platform from '../../core/platform/platform.js';
11
- import * as FormatterWorker from './formatter_worker.js'; // eslint-disable-line rulesdir/es_modules_import
11
+ import * as FormatterWorker from './formatter_worker.js';
12
12
 
13
13
  import {FormatterActions} from './FormatterActions.js';
14
14
 
@@ -2,7 +2,7 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- import * as HeapSnapshotWorker from './heap_snapshot_worker.js'; // eslint-disable-line rulesdir/es_modules_import
5
+ import * as HeapSnapshotWorker from './heap_snapshot_worker.js';
6
6
 
7
7
  // We need to force the worker context
8
8
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -3,6 +3,6 @@
3
3
  // found in the LICENSE file.
4
4
  import '../devtools_app/devtools_app.js';
5
5
  import '../../panels/screencast/screencast-meta.js';
6
- import * as Startup from '../startup/startup.js'; // eslint-disable-line rulesdir/es_modules_import
6
+ import * as Startup from '../startup/startup.js';
7
7
 
8
8
  Startup.RuntimeInstantiator.startApplication('inspector');
@@ -1,6 +1,4 @@
1
1
  {
2
- "modules" : [
3
- { "name": "panels/screencast", "type": "autostart" }
4
- ],
2
+ "modules" : [],
5
3
  "extends": "devtools_app"
6
4
  }
@@ -6,6 +6,8 @@ import * as Common from '../../core/common/common.js';
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
7
  import * as UI from '../../ui/legacy/legacy.js';
8
8
 
9
+ import type * as InspectorMain from './inspector_main.js';
10
+
9
11
  const UIStrings = {
10
12
  /**
11
13
  * @description Title of the Rendering tool. The rendering tool is a collection of settings that
@@ -101,9 +103,6 @@ const UIStrings = {
101
103
  const str_ = i18n.i18n.registerUIStrings('entrypoints/inspector_main/inspector_main-meta.ts', UIStrings);
102
104
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
103
105
 
104
- // eslint-disable-next-line rulesdir/es_modules_import
105
- import type * as InspectorMain from './inspector_main.js';
106
-
107
106
  let loadedInspectorMainModule: (typeof InspectorMain|undefined);
108
107
 
109
108
  async function loadInspectorMainModule(): Promise<typeof InspectorMain> {
@@ -4,6 +4,6 @@
4
4
  import '../shell/shell.js';
5
5
  import '../../panels/js_profiler/js_profiler-meta.js';
6
6
  import './JsMain.js';
7
- import * as Startup from '../startup/startup.js'; // eslint-disable-line rulesdir/es_modules_import
7
+ import * as Startup from '../startup/startup.js';
8
8
 
9
9
  Startup.RuntimeInstantiator.startApplication('js_app');
@@ -1,6 +1,4 @@
1
1
  {
2
- "modules" : [
3
- { "name": "panels/js_profiler" }
4
- ],
2
+ "modules" : [],
5
3
  "extends": "shell"
6
4
  }
@@ -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');
@@ -8,10 +8,9 @@ import * as SDK from '../../core/sdk/sdk.js';
8
8
  import * as Workspace from '../../models/workspace/workspace.js';
9
9
  import * as Components from '../../ui/legacy/components/utils/utils.js';
10
10
  import * as UI from '../../ui/legacy/legacy.js';
11
+ import type * as InspectorMain from '../inspector_main/inspector_main.js';
11
12
 
12
- // eslint-disable-next-line rulesdir/es_modules_import
13
13
  import type * as Main from './main.js';
14
- import type * as InspectorMain from '../inspector_main/inspector_main.js';
15
14
 
16
15
  import * as i18n from '../../core/i18n/i18n.js';
17
16
  const UIStrings = {
@@ -2,6 +2,6 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
  import '../shell/shell.js';
5
- import * as Startup from '../startup/startup.js'; // eslint-disable-line rulesdir/es_modules_import
5
+ import * as Startup from '../startup/startup.js';
6
6
 
7
7
  Startup.RuntimeInstantiator.startApplication('ndb_app');
@@ -4,8 +4,6 @@
4
4
 
5
5
  import * as i18n from '../../core/i18n/i18n.js';
6
6
  import * as UI from '../../ui/legacy/legacy.js';
7
-
8
- // eslint-disable-next-line rulesdir/es_modules_import
9
7
  import type * as Sources from '../../panels/sources/sources.js';
10
8
 
11
9
  const UIStrings = {