chrome-devtools-frontend 1.0.927127 → 1.0.928589

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 (144) hide show
  1. package/AUTHORS +1 -0
  2. package/config/gni/all_devtools_files.gni +0 -1
  3. package/config/gni/devtools_grd_files.gni +30 -4
  4. package/config/gni/devtools_image_files.gni +1 -0
  5. package/front_end/Images/src/ic_preview_feature.svg +3 -0
  6. package/front_end/Tests.js +2 -3
  7. package/front_end/core/common/Settings.ts +26 -45
  8. package/front_end/core/host/UserMetrics.ts +2 -2
  9. package/front_end/core/i18n/locales/en-US.json +60 -15
  10. package/front_end/core/i18n/locales/en-XL.json +60 -15
  11. package/front_end/core/platform/keyboard-utilities.ts +1 -0
  12. package/front_end/core/root/Runtime.ts +62 -61
  13. package/front_end/core/sdk/AccessibilityModel.ts +73 -73
  14. package/front_end/core/sdk/CPUProfileDataModel.ts +14 -14
  15. package/front_end/core/sdk/CPUProfilerModel.ts +33 -33
  16. package/front_end/core/sdk/CPUThrottlingManager.ts +8 -8
  17. package/front_end/core/sdk/CSSFontFace.ts +10 -10
  18. package/front_end/core/sdk/CSSMatchedStyles.ts +114 -114
  19. package/front_end/core/sdk/CSSMedia.ts +22 -22
  20. package/front_end/core/sdk/CSSMetadata.ts +53 -49
  21. package/front_end/core/sdk/CSSModel.ts +139 -135
  22. package/front_end/core/sdk/CSSProperty.ts +18 -18
  23. package/front_end/core/sdk/CSSRule.ts +15 -15
  24. package/front_end/core/sdk/CSSStyleDeclaration.ts +49 -47
  25. package/front_end/core/sdk/CSSStyleSheetHeader.ts +12 -12
  26. package/front_end/core/sdk/ChildTargetManager.ts +41 -40
  27. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +10 -10
  28. package/front_end/core/sdk/Connections.ts +81 -81
  29. package/front_end/core/sdk/ConsoleModel.ts +68 -68
  30. package/front_end/core/sdk/Cookie.ts +48 -48
  31. package/front_end/core/sdk/CookieModel.ts +13 -13
  32. package/front_end/core/sdk/CookieParser.ts +45 -45
  33. package/front_end/core/sdk/DOMDebuggerModel.ts +131 -131
  34. package/front_end/core/sdk/DOMModel.ts +264 -252
  35. package/front_end/core/sdk/DebuggerModel.ts +209 -205
  36. package/front_end/core/sdk/EmulationModel.ts +76 -76
  37. package/front_end/core/sdk/FilmStripModel.ts +29 -29
  38. package/front_end/core/sdk/FrameManager.ts +43 -42
  39. package/front_end/core/sdk/HeapProfilerModel.ts +36 -36
  40. package/front_end/core/sdk/IsolateManager.ts +82 -82
  41. package/front_end/core/sdk/IssuesModel.ts +6 -6
  42. package/front_end/core/sdk/LayerTreeBase.ts +37 -37
  43. package/front_end/core/sdk/LogModel.ts +5 -5
  44. package/front_end/core/sdk/NetworkManager.ts +229 -225
  45. package/front_end/core/sdk/NetworkRequest.ts +368 -360
  46. package/front_end/core/sdk/OverlayColorGenerator.ts +9 -9
  47. package/front_end/core/sdk/OverlayModel.ts +155 -153
  48. package/front_end/core/sdk/OverlayPersistentHighlighter.ts +100 -101
  49. package/front_end/core/sdk/PageResourceLoader.ts +30 -30
  50. package/front_end/core/sdk/PaintProfiler.ts +16 -16
  51. package/front_end/core/sdk/PerformanceMetricsModel.ts +12 -12
  52. package/front_end/core/sdk/ProfileTreeModel.ts +3 -3
  53. package/front_end/core/sdk/RemoteObject.ts +108 -104
  54. package/front_end/core/sdk/Resource.ts +85 -84
  55. package/front_end/core/sdk/ResourceTreeModel.ts +150 -145
  56. package/front_end/core/sdk/RuntimeModel.ts +38 -34
  57. package/front_end/core/sdk/SDKModel.ts +3 -3
  58. package/front_end/core/sdk/ScreenCaptureModel.ts +19 -19
  59. package/front_end/core/sdk/Script.ts +29 -29
  60. package/front_end/core/sdk/SecurityOriginManager.ts +19 -19
  61. package/front_end/core/sdk/ServerTiming.ts +2 -2
  62. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +43 -43
  63. package/front_end/core/sdk/ServiceWorkerManager.ts +72 -68
  64. package/front_end/core/sdk/SourceMap.ts +40 -36
  65. package/front_end/core/sdk/SourceMapManager.ts +57 -57
  66. package/front_end/core/sdk/Target.ts +64 -63
  67. package/front_end/core/sdk/TargetManager.ts +60 -56
  68. package/front_end/core/sdk/TracingManager.ts +39 -39
  69. package/front_end/core/sdk/TracingModel.ts +125 -125
  70. package/front_end/core/sdk/WebAuthnModel.ts +9 -9
  71. package/front_end/entrypoints/lighthouse_worker/{LighthouseService.js → LighthouseService.ts} +20 -45
  72. package/front_end/entrypoints/lighthouse_worker/{lighthouse_worker.js → lighthouse_worker.ts} +0 -0
  73. package/front_end/entrypoints/main/MainImpl.ts +7 -2
  74. package/front_end/legacy_test_runner/elements_test_runner/ElementsTestRunner.js +4 -4
  75. package/front_end/legacy_test_runner/sdk_test_runner/sdk_test_runner.js +1 -1
  76. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -6
  77. package/front_end/models/issues_manager/GenericIssue.ts +86 -0
  78. package/front_end/models/issues_manager/Issue.ts +24 -0
  79. package/front_end/models/issues_manager/IssuesManager.ts +18 -6
  80. package/front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md +3 -0
  81. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  82. package/front_end/models/javascript_metadata/NativeFunctions.js +5422 -1
  83. package/front_end/panels/console/ConsoleSidebar.ts +0 -3
  84. package/front_end/panels/elements/ElementsTreeElement.ts +53 -61
  85. package/front_end/panels/elements/ElementsTreeOutline.ts +0 -1
  86. package/front_end/panels/elements/components/LayoutPane.ts +5 -1
  87. package/front_end/panels/issues/GenericIssueDetailsView.ts +68 -0
  88. package/front_end/panels/issues/IssueAggregator.ts +16 -0
  89. package/front_end/panels/issues/IssueKindView.ts +95 -0
  90. package/front_end/panels/issues/IssueView.ts +6 -0
  91. package/front_end/panels/issues/IssuesPane.ts +81 -18
  92. package/front_end/panels/issues/issuesTree.css +8 -3
  93. package/front_end/panels/lighthouse/LighthouseController.ts +3 -1
  94. package/front_end/panels/network/NetworkItemView.ts +1 -1
  95. package/front_end/panels/network/networkLogView.css +5 -0
  96. package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
  97. package/front_end/panels/settings/SettingsScreen.ts +1 -0
  98. package/front_end/panels/settings/settingsScreen.css +24 -0
  99. package/front_end/panels/snippets/SnippetsQuickOpen.ts +8 -3
  100. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
  101. package/front_end/panels/sources/sources-meta.ts +22 -7
  102. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  103. package/front_end/third_party/codemirror.next/package.json +4 -4
  104. package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +137 -0
  105. package/front_end/ui/components/code_highlighter/codeHighlighter.css +51 -0
  106. package/front_end/ui/components/code_highlighter/code_highlighter.ts +11 -0
  107. package/front_end/ui/components/docs/text_editor/basic.html +28 -0
  108. package/front_end/ui/components/docs/text_editor/basic.ts +14 -0
  109. package/front_end/ui/components/docs/text_prompt/basic.html +35 -0
  110. package/front_end/ui/components/docs/text_prompt/basic.ts +19 -0
  111. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -0
  112. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +17 -0
  113. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -0
  114. package/front_end/ui/components/text_editor/TextEditor.ts +161 -0
  115. package/front_end/ui/components/text_editor/config.ts +264 -0
  116. package/front_end/{panels/console/components/components.ts → ui/components/text_editor/text_editor.ts} +2 -5
  117. package/front_end/ui/components/text_editor/theme.ts +113 -0
  118. package/front_end/ui/components/text_prompt/TextPrompt.ts +144 -0
  119. package/front_end/ui/components/text_prompt/textPrompt.css +33 -0
  120. package/front_end/ui/components/text_prompt/text_prompt.ts +9 -0
  121. package/front_end/ui/legacy/ARIAUtils.ts +14 -11
  122. package/front_end/ui/legacy/TabbedPane.ts +32 -3
  123. package/front_end/ui/legacy/UIUtils.ts +3 -1
  124. package/front_end/ui/legacy/View.ts +6 -0
  125. package/front_end/ui/legacy/ViewManager.ts +5 -1
  126. package/front_end/ui/legacy/ViewRegistration.ts +5 -0
  127. package/front_end/ui/legacy/XLink.ts +1 -1
  128. package/front_end/ui/legacy/closeButton.css +6 -0
  129. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +8 -3
  130. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +38 -38
  131. package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +10 -4
  132. package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +23 -6
  133. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +14 -16
  134. package/front_end/ui/legacy/filter.css +1 -0
  135. package/front_end/ui/legacy/tabbedPane.css +24 -0
  136. package/front_end/ui/legacy/toolbar.css +5 -0
  137. package/inspector_overlay/main.ts +2 -1
  138. package/inspector_overlay/tool_screenshot.ts +8 -1
  139. package/package.json +1 -1
  140. package/scripts/build/rollup.config.js +9 -0
  141. package/scripts/migration/class-fields/migrate.js +56 -0
  142. package/scripts/migration/class-fields/package.json +5 -0
  143. package/front_end/panels/console/components/SidebarDeprecation.ts +0 -58
  144. package/front_end/panels/console/components/sidebarDeprecation.css +0 -17
@@ -27,119 +27,119 @@ export interface CoreOrProtocolAxProperty {
27
27
  }
28
28
 
29
29
  export class AccessibilityNode {
30
- private readonly accessibilityModelInternal: AccessibilityModel;
31
- private readonly agent: ProtocolProxyApi.AccessibilityApi;
32
- private readonly idInternal: Protocol.Accessibility.AXNodeId;
33
- private readonly backendDOMNodeIdInternal: Protocol.DOM.BackendNodeId|null;
34
- private readonly deferredDOMNodeInternal: DeferredDOMNode|null;
35
- private readonly ignoredInternal: boolean;
36
- private readonly ignoredReasonsInternal: Protocol.Accessibility.AXProperty[]|undefined;
37
- private readonly roleInternal: Protocol.Accessibility.AXValue|null;
38
- private readonly nameInternal: Protocol.Accessibility.AXValue|null;
39
- private readonly descriptionInternal: Protocol.Accessibility.AXValue|null;
40
- private readonly valueInternal: Protocol.Accessibility.AXValue|null;
41
- private readonly propertiesInternal: Protocol.Accessibility.AXProperty[]|null;
42
- private childIds: string[]|null;
43
- private parentNodeInternal: AccessibilityNode|null;
30
+ readonly #accessibilityModelInternal: AccessibilityModel;
31
+ readonly #agent: ProtocolProxyApi.AccessibilityApi;
32
+ readonly #idInternal: Protocol.Accessibility.AXNodeId;
33
+ readonly #backendDOMNodeIdInternal: Protocol.DOM.BackendNodeId|null;
34
+ readonly #deferredDOMNodeInternal: DeferredDOMNode|null;
35
+ readonly #ignoredInternal: boolean;
36
+ readonly #ignoredReasonsInternal: Protocol.Accessibility.AXProperty[]|undefined;
37
+ readonly #roleInternal: Protocol.Accessibility.AXValue|null;
38
+ readonly #nameInternal: Protocol.Accessibility.AXValue|null;
39
+ readonly #descriptionInternal: Protocol.Accessibility.AXValue|null;
40
+ readonly #valueInternal: Protocol.Accessibility.AXValue|null;
41
+ readonly #propertiesInternal: Protocol.Accessibility.AXProperty[]|null;
42
+ #childIds: string[]|null;
43
+ #parentNodeInternal: AccessibilityNode|null;
44
44
 
45
45
  constructor(accessibilityModel: AccessibilityModel, payload: Protocol.Accessibility.AXNode) {
46
- this.accessibilityModelInternal = accessibilityModel;
47
- this.agent = accessibilityModel.getAgent();
46
+ this.#accessibilityModelInternal = accessibilityModel;
47
+ this.#agent = accessibilityModel.getAgent();
48
48
 
49
- this.idInternal = payload.nodeId;
50
- accessibilityModel.setAXNodeForAXId(this.idInternal, this);
49
+ this.#idInternal = payload.nodeId;
50
+ accessibilityModel.setAXNodeForAXId(this.#idInternal, this);
51
51
  if (payload.backendDOMNodeId) {
52
52
  accessibilityModel.setAXNodeForBackendDOMNodeId(payload.backendDOMNodeId, this);
53
- this.backendDOMNodeIdInternal = payload.backendDOMNodeId;
54
- this.deferredDOMNodeInternal = new DeferredDOMNode(accessibilityModel.target(), payload.backendDOMNodeId);
53
+ this.#backendDOMNodeIdInternal = payload.backendDOMNodeId;
54
+ this.#deferredDOMNodeInternal = new DeferredDOMNode(accessibilityModel.target(), payload.backendDOMNodeId);
55
55
  } else {
56
- this.backendDOMNodeIdInternal = null;
57
- this.deferredDOMNodeInternal = null;
56
+ this.#backendDOMNodeIdInternal = null;
57
+ this.#deferredDOMNodeInternal = null;
58
58
  }
59
- this.ignoredInternal = payload.ignored;
60
- if (this.ignoredInternal && 'ignoredReasons' in payload) {
61
- this.ignoredReasonsInternal = payload.ignoredReasons;
59
+ this.#ignoredInternal = payload.ignored;
60
+ if (this.#ignoredInternal && 'ignoredReasons' in payload) {
61
+ this.#ignoredReasonsInternal = payload.ignoredReasons;
62
62
  }
63
63
 
64
- this.roleInternal = payload.role || null;
65
- this.nameInternal = payload.name || null;
66
- this.descriptionInternal = payload.description || null;
67
- this.valueInternal = payload.value || null;
68
- this.propertiesInternal = payload.properties || null;
69
- this.childIds = payload.childIds || null;
70
- this.parentNodeInternal = null;
64
+ this.#roleInternal = payload.role || null;
65
+ this.#nameInternal = payload.name || null;
66
+ this.#descriptionInternal = payload.description || null;
67
+ this.#valueInternal = payload.value || null;
68
+ this.#propertiesInternal = payload.properties || null;
69
+ this.#childIds = payload.childIds || null;
70
+ this.#parentNodeInternal = null;
71
71
  }
72
72
 
73
73
  id(): Protocol.Accessibility.AXNodeId {
74
- return this.idInternal;
74
+ return this.#idInternal;
75
75
  }
76
76
 
77
77
  accessibilityModel(): AccessibilityModel {
78
- return this.accessibilityModelInternal;
78
+ return this.#accessibilityModelInternal;
79
79
  }
80
80
 
81
81
  ignored(): boolean {
82
- return this.ignoredInternal;
82
+ return this.#ignoredInternal;
83
83
  }
84
84
 
85
85
  ignoredReasons(): Protocol.Accessibility.AXProperty[]|null {
86
- return this.ignoredReasonsInternal || null;
86
+ return this.#ignoredReasonsInternal || null;
87
87
  }
88
88
 
89
89
  role(): Protocol.Accessibility.AXValue|null {
90
- return this.roleInternal || null;
90
+ return this.#roleInternal || null;
91
91
  }
92
92
 
93
93
  coreProperties(): CoreOrProtocolAxProperty[] {
94
94
  const properties: CoreOrProtocolAxProperty[] = [];
95
95
 
96
- if (this.nameInternal) {
97
- properties.push({name: CoreAxPropertyName.Name, value: this.nameInternal});
96
+ if (this.#nameInternal) {
97
+ properties.push({name: CoreAxPropertyName.Name, value: this.#nameInternal});
98
98
  }
99
- if (this.descriptionInternal) {
100
- properties.push({name: CoreAxPropertyName.Description, value: this.descriptionInternal});
99
+ if (this.#descriptionInternal) {
100
+ properties.push({name: CoreAxPropertyName.Description, value: this.#descriptionInternal});
101
101
  }
102
- if (this.valueInternal) {
103
- properties.push({name: CoreAxPropertyName.Value, value: this.valueInternal});
102
+ if (this.#valueInternal) {
103
+ properties.push({name: CoreAxPropertyName.Value, value: this.#valueInternal});
104
104
  }
105
105
 
106
106
  return properties;
107
107
  }
108
108
 
109
109
  name(): Protocol.Accessibility.AXValue|null {
110
- return this.nameInternal || null;
110
+ return this.#nameInternal || null;
111
111
  }
112
112
 
113
113
  description(): Protocol.Accessibility.AXValue|null {
114
- return this.descriptionInternal || null;
114
+ return this.#descriptionInternal || null;
115
115
  }
116
116
 
117
117
  value(): Protocol.Accessibility.AXValue|null {
118
- return this.valueInternal || null;
118
+ return this.#valueInternal || null;
119
119
  }
120
120
 
121
121
  properties(): Protocol.Accessibility.AXProperty[]|null {
122
- return this.propertiesInternal || null;
122
+ return this.#propertiesInternal || null;
123
123
  }
124
124
 
125
125
  parentNode(): AccessibilityNode|null {
126
- return this.parentNodeInternal;
126
+ return this.#parentNodeInternal;
127
127
  }
128
128
 
129
129
  setParentNode(parentNode: AccessibilityNode|null): void {
130
- this.parentNodeInternal = parentNode;
130
+ this.#parentNodeInternal = parentNode;
131
131
  }
132
132
 
133
133
  isDOMNode(): boolean {
134
- return Boolean(this.backendDOMNodeIdInternal);
134
+ return Boolean(this.#backendDOMNodeIdInternal);
135
135
  }
136
136
 
137
137
  backendDOMNodeId(): Protocol.DOM.BackendNodeId|null {
138
- return this.backendDOMNodeIdInternal;
138
+ return this.#backendDOMNodeIdInternal;
139
139
  }
140
140
 
141
141
  deferredDOMNode(): DeferredDOMNode|null {
142
- return this.deferredDOMNodeInternal;
142
+ return this.#deferredDOMNodeInternal;
143
143
  }
144
144
 
145
145
  highlightDOMNode(): void {
@@ -152,13 +152,13 @@ export class AccessibilityNode {
152
152
  }
153
153
 
154
154
  children(): AccessibilityNode[] {
155
- if (!this.childIds) {
155
+ if (!this.#childIds) {
156
156
  return [];
157
157
  }
158
158
 
159
159
  const children = [];
160
- for (const childId of this.childIds) {
161
- const child = this.accessibilityModelInternal.axNodeForId(childId);
160
+ for (const childId of this.#childIds) {
161
+ const child = this.#accessibilityModelInternal.axNodeForId(childId);
162
162
  if (child) {
163
163
  children.push(child);
164
164
  }
@@ -168,18 +168,18 @@ export class AccessibilityNode {
168
168
  }
169
169
 
170
170
  numChildren(): number {
171
- if (!this.childIds) {
171
+ if (!this.#childIds) {
172
172
  return 0;
173
173
  }
174
- return this.childIds.length;
174
+ return this.#childIds.length;
175
175
  }
176
176
 
177
177
  hasOnlyUnloadedChildren(): boolean {
178
- if (!this.childIds || !this.childIds.length) {
178
+ if (!this.#childIds || !this.#childIds.length) {
179
179
  return false;
180
180
  }
181
181
 
182
- return this.childIds.every(id => this.accessibilityModelInternal.axNodeForId(id) === null);
182
+ return this.#childIds.every(id => this.#accessibilityModelInternal.axNodeForId(id) === null);
183
183
  }
184
184
 
185
185
  // Only the root node gets a frameId, so nodes have to walk up the tree to find their frameId.
@@ -194,22 +194,22 @@ export class AccessibilityNode {
194
194
 
195
195
  export class AccessibilityModel extends SDKModel<void> {
196
196
  agent: ProtocolProxyApi.AccessibilityApi;
197
- private axIdToAXNode: Map<string, AccessibilityNode>;
198
- private readonly backendDOMNodeIdToAXNode: Map<Protocol.DOM.BackendNodeId, AccessibilityNode>;
199
- private readonly backendDOMNodeIdToDOMNode: Map<Protocol.DOM.BackendNodeId, DOMNode|null>;
197
+ #axIdToAXNode: Map<string, AccessibilityNode>;
198
+ readonly #backendDOMNodeIdToAXNode: Map<Protocol.DOM.BackendNodeId, AccessibilityNode>;
199
+ readonly #backendDOMNodeIdToDOMNode: Map<Protocol.DOM.BackendNodeId, DOMNode|null>;
200
200
 
201
201
  constructor(target: Target) {
202
202
  super(target);
203
203
  this.agent = target.accessibilityAgent();
204
204
  this.resumeModel();
205
205
 
206
- this.axIdToAXNode = new Map();
207
- this.backendDOMNodeIdToAXNode = new Map();
208
- this.backendDOMNodeIdToDOMNode = new Map();
206
+ this.#axIdToAXNode = new Map();
207
+ this.#backendDOMNodeIdToAXNode = new Map();
208
+ this.#backendDOMNodeIdToDOMNode = new Map();
209
209
  }
210
210
 
211
211
  clear(): void {
212
- this.axIdToAXNode.clear();
212
+ this.#axIdToAXNode.clear();
213
213
  }
214
214
 
215
215
  async resumeModel(): Promise<void> {
@@ -230,7 +230,7 @@ export class AccessibilityModel extends SDKModel<void> {
230
230
  new AccessibilityNode(this, payload);
231
231
  }
232
232
 
233
- for (const axNode of this.axIdToAXNode.values()) {
233
+ for (const axNode of this.#axIdToAXNode.values()) {
234
234
  for (const axChild of axNode.children()) {
235
235
  axChild.setParentNode(axNode);
236
236
  }
@@ -243,7 +243,7 @@ export class AccessibilityModel extends SDKModel<void> {
243
243
  return;
244
244
  }
245
245
  const newNodesToTrack = await domModel.pushNodesByBackendIdsToFrontend(backendIds);
246
- newNodesToTrack?.forEach((value, key) => this.backendDOMNodeIdToDOMNode.set(key, value));
246
+ newNodesToTrack?.forEach((value, key) => this.#backendDOMNodeIdToDOMNode.set(key, value));
247
247
  }
248
248
 
249
249
  private createNodesFromPayload(payloadNodes: Protocol.Accessibility.AXNode[]): AccessibilityNode[] {
@@ -315,18 +315,18 @@ export class AccessibilityModel extends SDKModel<void> {
315
315
  }
316
316
 
317
317
  axNodeForId(axId: string): AccessibilityNode|null {
318
- return this.axIdToAXNode.get(axId) || null;
318
+ return this.#axIdToAXNode.get(axId) || null;
319
319
  }
320
320
 
321
321
  setAXNodeForAXId(axId: string, axNode: AccessibilityNode): void {
322
- this.axIdToAXNode.set(axId, axNode);
322
+ this.#axIdToAXNode.set(axId, axNode);
323
323
  }
324
324
 
325
325
  axNodeForDOMNode(domNode: DOMNode|null): AccessibilityNode|null {
326
326
  if (!domNode) {
327
327
  return null;
328
328
  }
329
- return this.backendDOMNodeIdToAXNode.get(domNode.backendNodeId()) ?? null;
329
+ return this.#backendDOMNodeIdToAXNode.get(domNode.backendNodeId()) ?? null;
330
330
  }
331
331
 
332
332
  domNodeforAXNode(axNode: AccessibilityNode): DOMNode|null {
@@ -334,11 +334,11 @@ export class AccessibilityModel extends SDKModel<void> {
334
334
  if (!backendDOMNodeId) {
335
335
  return null;
336
336
  }
337
- return this.backendDOMNodeIdToDOMNode.get(backendDOMNodeId) ?? null;
337
+ return this.#backendDOMNodeIdToDOMNode.get(backendDOMNodeId) ?? null;
338
338
  }
339
339
 
340
340
  setAXNodeForBackendDOMNodeId(backendDOMNodeId: Protocol.DOM.BackendNodeId, axNode: AccessibilityNode): void {
341
- this.backendDOMNodeIdToAXNode.set(backendDOMNodeId, axNode);
341
+ this.#backendDOMNodeIdToAXNode.set(backendDOMNodeId, axNode);
342
342
  }
343
343
 
344
344
  getAgent(): ProtocolProxyApi.AccessibilityApi {
@@ -70,12 +70,12 @@ export class CPUProfileDataModel extends ProfileTreeModel {
70
70
  lines: any;
71
71
  totalHitCount: number;
72
72
  profileHead: CPUProfileNode;
73
- private idToNode!: Map<number, CPUProfileNode>;
73
+ #idToNode!: Map<number, CPUProfileNode>;
74
74
  gcNode!: CPUProfileNode;
75
75
  programNode?: ProfileNode;
76
76
  idleNode?: ProfileNode;
77
- private stackStartTimes?: Float64Array;
78
- private stackChildrenDuration?: Float64Array;
77
+ #stackStartTimes?: Float64Array;
78
+ #stackChildrenDuration?: Float64Array;
79
79
  constructor(profile: Protocol.Profiler.Profile, target: Target|null) {
80
80
  super(target);
81
81
  // @ts-ignore Legacy types
@@ -299,8 +299,8 @@ export class CPUProfileDataModel extends ProfileTreeModel {
299
299
  }
300
300
 
301
301
  private buildIdToNodeMap(): void {
302
- this.idToNode = new Map();
303
- const idToNode = this.idToNode;
302
+ this.#idToNode = new Map();
303
+ const idToNode = this.#idToNode;
304
304
  const stack = [this.profileHead];
305
305
  while (stack.length) {
306
306
  const node = (stack.pop() as CPUProfileNode);
@@ -339,7 +339,7 @@ export class CPUProfileDataModel extends ProfileTreeModel {
339
339
  if (!this.programNode || samplesCount < 3) {
340
340
  return;
341
341
  }
342
- const idToNode = this.idToNode;
342
+ const idToNode = this.#idToNode;
343
343
  const programNodeId = this.programNode.id;
344
344
  const gcNodeId = this.gcNode ? this.gcNode.id : -1;
345
345
  const idleNodeId = this.idleNode ? this.idleNode.id : -1;
@@ -383,7 +383,7 @@ export class CPUProfileDataModel extends ProfileTreeModel {
383
383
  stopTime = stopTime || Infinity;
384
384
  const samples = this.samples;
385
385
  const timestamps = this.timestamps;
386
- const idToNode = this.idToNode;
386
+ const idToNode = this.#idToNode;
387
387
  const gcNode = this.gcNode;
388
388
  const samplesCount = samples.length;
389
389
  const startIndex =
@@ -397,14 +397,14 @@ export class CPUProfileDataModel extends ProfileTreeModel {
397
397
  // Extra slots for gc being put on top,
398
398
  // and one at the bottom to allow safe stackTop-1 access.
399
399
  const stackDepth = this.maxDepth + 3;
400
- if (!this.stackStartTimes) {
401
- this.stackStartTimes = new Float64Array(stackDepth);
400
+ if (!this.#stackStartTimes) {
401
+ this.#stackStartTimes = new Float64Array(stackDepth);
402
402
  }
403
- const stackStartTimes = this.stackStartTimes;
404
- if (!this.stackChildrenDuration) {
405
- this.stackChildrenDuration = new Float64Array(stackDepth);
403
+ const stackStartTimes = this.#stackStartTimes;
404
+ if (!this.#stackChildrenDuration) {
405
+ this.#stackChildrenDuration = new Float64Array(stackDepth);
406
406
  }
407
- const stackChildrenDuration = this.stackChildrenDuration;
407
+ const stackChildrenDuration = this.#stackChildrenDuration;
408
408
 
409
409
  let node;
410
410
  let sampleIndex;
@@ -495,6 +495,6 @@ export class CPUProfileDataModel extends ProfileTreeModel {
495
495
  }
496
496
 
497
497
  nodeByIndex(index: number): CPUProfileNode|null {
498
- return this.samples && this.idToNode.get(this.samples[index]) || null;
498
+ return this.samples && this.#idToNode.get(this.samples[index]) || null;
499
499
  }
500
500
  }
@@ -50,38 +50,38 @@ const str_ = i18n.i18n.registerUIStrings('core/sdk/CPUProfilerModel.ts', UIStrin
50
50
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
51
51
 
52
52
  export class CPUProfilerModel extends SDKModel<EventTypes> implements ProtocolProxyApi.ProfilerDispatcher {
53
- private isRecording: boolean;
54
- private nextAnonymousConsoleProfileNumber: number;
55
- private anonymousConsoleProfileIdToTitle: Map<string, string>;
56
- private readonly profilerAgent: ProtocolProxyApi.ProfilerApi;
57
- private preciseCoverageDeltaUpdateCallback:
53
+ #isRecording: boolean;
54
+ #nextAnonymousConsoleProfileNumber: number;
55
+ #anonymousConsoleProfileIdToTitle: Map<string, string>;
56
+ readonly #profilerAgent: ProtocolProxyApi.ProfilerApi;
57
+ #preciseCoverageDeltaUpdateCallback:
58
58
  ((arg0: number, arg1: string, arg2: Array<Protocol.Profiler.ScriptCoverage>) => void)|null;
59
- private readonly debuggerModelInternal: DebuggerModel;
59
+ readonly #debuggerModelInternal: DebuggerModel;
60
60
 
61
61
  constructor(target: Target) {
62
62
  super(target);
63
- this.isRecording = false;
64
- this.nextAnonymousConsoleProfileNumber = 1;
65
- this.anonymousConsoleProfileIdToTitle = new Map();
66
- this.profilerAgent = target.profilerAgent();
67
- this.preciseCoverageDeltaUpdateCallback = null;
63
+ this.#isRecording = false;
64
+ this.#nextAnonymousConsoleProfileNumber = 1;
65
+ this.#anonymousConsoleProfileIdToTitle = new Map();
66
+ this.#profilerAgent = target.profilerAgent();
67
+ this.#preciseCoverageDeltaUpdateCallback = null;
68
68
  target.registerProfilerDispatcher(this);
69
- this.profilerAgent.invoke_enable();
70
- this.debuggerModelInternal = (target.model(DebuggerModel) as DebuggerModel);
69
+ this.#profilerAgent.invoke_enable();
70
+ this.#debuggerModelInternal = (target.model(DebuggerModel) as DebuggerModel);
71
71
  }
72
72
 
73
73
  runtimeModel(): RuntimeModel {
74
- return this.debuggerModelInternal.runtimeModel();
74
+ return this.#debuggerModelInternal.runtimeModel();
75
75
  }
76
76
 
77
77
  debuggerModel(): DebuggerModel {
78
- return this.debuggerModelInternal;
78
+ return this.#debuggerModelInternal;
79
79
  }
80
80
 
81
81
  consoleProfileStarted({id, location, title}: Protocol.Profiler.ConsoleProfileStartedEvent): void {
82
82
  if (!title) {
83
- title = i18nString(UIStrings.profileD, {PH1: this.nextAnonymousConsoleProfileNumber++});
84
- this.anonymousConsoleProfileIdToTitle.set(id, title);
83
+ title = i18nString(UIStrings.profileD, {PH1: this.#nextAnonymousConsoleProfileNumber++});
84
+ this.#anonymousConsoleProfileIdToTitle.set(id, title);
85
85
  }
86
86
  const eventData = this.createEventDataFrom(id, location, title);
87
87
  this.dispatchEventToListeners(Events.ConsoleProfileStarted, eventData);
@@ -89,8 +89,8 @@ export class CPUProfilerModel extends SDKModel<EventTypes> implements ProtocolPr
89
89
 
90
90
  consoleProfileFinished({id, location, profile, title}: Protocol.Profiler.ConsoleProfileFinishedEvent): void {
91
91
  if (!title) {
92
- title = this.anonymousConsoleProfileIdToTitle.get(id);
93
- this.anonymousConsoleProfileIdToTitle.delete(id);
92
+ title = this.#anonymousConsoleProfileIdToTitle.get(id);
93
+ this.#anonymousConsoleProfileIdToTitle.delete(id);
94
94
  }
95
95
  // Make sure ProfilesPanel is initialized and CPUProfileType is created.
96
96
  Root.Runtime.Runtime.instance().loadModulePromise('profiler').then(() => {
@@ -103,7 +103,7 @@ export class CPUProfilerModel extends SDKModel<EventTypes> implements ProtocolPr
103
103
  }
104
104
 
105
105
  private createEventDataFrom(id: string, scriptLocation: Protocol.Debugger.Location, title?: string): EventData {
106
- const debuggerLocation = Location.fromPayload(this.debuggerModelInternal, scriptLocation);
106
+ const debuggerLocation = Location.fromPayload(this.#debuggerModelInternal, scriptLocation);
107
107
  const globalId = this.target().id() + '.' + id;
108
108
  return {
109
109
  id: globalId,
@@ -114,19 +114,19 @@ export class CPUProfilerModel extends SDKModel<EventTypes> implements ProtocolPr
114
114
  }
115
115
 
116
116
  isRecordingProfile(): boolean {
117
- return this.isRecording;
117
+ return this.#isRecording;
118
118
  }
119
119
 
120
120
  startRecording(): Promise<unknown> {
121
- this.isRecording = true;
121
+ this.#isRecording = true;
122
122
  const intervalUs = 100;
123
- this.profilerAgent.invoke_setSamplingInterval({interval: intervalUs});
124
- return this.profilerAgent.invoke_start();
123
+ this.#profilerAgent.invoke_setSamplingInterval({interval: intervalUs});
124
+ return this.#profilerAgent.invoke_start();
125
125
  }
126
126
 
127
127
  stopRecording(): Promise<Protocol.Profiler.Profile|null> {
128
- this.isRecording = false;
129
- return this.profilerAgent.invoke_stop().then(response => response.profile || null);
128
+ this.#isRecording = false;
129
+ return this.#profilerAgent.invoke_stop().then(response => response.profile || null);
130
130
  }
131
131
 
132
132
  startPreciseCoverage(
@@ -135,9 +135,9 @@ export class CPUProfilerModel extends SDKModel<EventTypes> implements ProtocolPr
135
135
  ((arg0: number, arg1: string, arg2: Array<Protocol.Profiler.ScriptCoverage>) => void)|
136
136
  null): Promise<unknown> {
137
137
  const callCount = false;
138
- this.preciseCoverageDeltaUpdateCallback = preciseCoverageDeltaUpdateCallback;
138
+ this.#preciseCoverageDeltaUpdateCallback = preciseCoverageDeltaUpdateCallback;
139
139
  const allowUpdatesTriggeredByBackend = true;
140
- return this.profilerAgent.invoke_startPreciseCoverage(
140
+ return this.#profilerAgent.invoke_startPreciseCoverage(
141
141
  {callCount, detailed: jsCoveragePerBlock, allowTriggeredUpdates: allowUpdatesTriggeredByBackend});
142
142
  }
143
143
 
@@ -145,20 +145,20 @@ export class CPUProfilerModel extends SDKModel<EventTypes> implements ProtocolPr
145
145
  timestamp: number,
146
146
  coverage: Array<Protocol.Profiler.ScriptCoverage>,
147
147
  }> {
148
- const r = await this.profilerAgent.invoke_takePreciseCoverage();
148
+ const r = await this.#profilerAgent.invoke_takePreciseCoverage();
149
149
  const timestamp = (r && r.timestamp) || 0;
150
150
  const coverage = (r && r.result) || [];
151
151
  return {timestamp, coverage};
152
152
  }
153
153
 
154
154
  stopPreciseCoverage(): Promise<unknown> {
155
- this.preciseCoverageDeltaUpdateCallback = null;
156
- return this.profilerAgent.invoke_stopPreciseCoverage();
155
+ this.#preciseCoverageDeltaUpdateCallback = null;
156
+ return this.#profilerAgent.invoke_stopPreciseCoverage();
157
157
  }
158
158
 
159
159
  preciseCoverageDeltaUpdate({timestamp, occasion, result}: Protocol.Profiler.PreciseCoverageDeltaUpdateEvent): void {
160
- if (this.preciseCoverageDeltaUpdateCallback) {
161
- this.preciseCoverageDeltaUpdateCallback(timestamp, occasion, result);
160
+ if (this.#preciseCoverageDeltaUpdateCallback) {
161
+ this.#preciseCoverageDeltaUpdateCallback(timestamp, occasion, result);
162
162
  }
163
163
  }
164
164
  }
@@ -12,11 +12,11 @@ let throttlingManagerInstance: CPUThrottlingManager;
12
12
 
13
13
  export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
14
14
  SDKModelObserver<EmulationModel> {
15
- private cpuThrottlingRateInternal: number;
15
+ #cpuThrottlingRateInternal: number;
16
16
 
17
17
  private constructor() {
18
18
  super();
19
- this.cpuThrottlingRateInternal = CPUThrottlingRates.NoThrottling;
19
+ this.#cpuThrottlingRateInternal = CPUThrottlingRates.NoThrottling;
20
20
  TargetManager.instance().observeModels(EmulationModel, this);
21
21
  }
22
22
 
@@ -30,20 +30,20 @@ export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Eve
30
30
  }
31
31
 
32
32
  cpuThrottlingRate(): number {
33
- return this.cpuThrottlingRateInternal;
33
+ return this.#cpuThrottlingRateInternal;
34
34
  }
35
35
 
36
36
  setCPUThrottlingRate(rate: number): void {
37
- this.cpuThrottlingRateInternal = rate;
37
+ this.#cpuThrottlingRateInternal = rate;
38
38
  for (const emulationModel of TargetManager.instance().models(EmulationModel)) {
39
- emulationModel.setCPUThrottlingRate(this.cpuThrottlingRateInternal);
39
+ emulationModel.setCPUThrottlingRate(this.#cpuThrottlingRateInternal);
40
40
  }
41
- this.dispatchEventToListeners(Events.RateChanged, this.cpuThrottlingRateInternal);
41
+ this.dispatchEventToListeners(Events.RateChanged, this.#cpuThrottlingRateInternal);
42
42
  }
43
43
 
44
44
  modelAdded(emulationModel: EmulationModel): void {
45
- if (this.cpuThrottlingRateInternal !== CPUThrottlingRates.NoThrottling) {
46
- emulationModel.setCPUThrottlingRate(this.cpuThrottlingRateInternal);
45
+ if (this.#cpuThrottlingRateInternal !== CPUThrottlingRates.NoThrottling) {
46
+ emulationModel.setCPUThrottlingRate(this.#cpuThrottlingRateInternal);
47
47
  }
48
48
  }
49
49
 
@@ -5,23 +5,23 @@
5
5
  import type * as Protocol from '../../generated/protocol.js';
6
6
 
7
7
  export class CSSFontFace {
8
- private readonly fontFamily: string;
9
- private readonly fontVariationAxes: Protocol.CSS.FontVariationAxis[];
10
- private readonly fontVariationAxesByTag: Map<string, Protocol.CSS.FontVariationAxis>;
8
+ readonly #fontFamily: string;
9
+ readonly #fontVariationAxes: Protocol.CSS.FontVariationAxis[];
10
+ readonly #fontVariationAxesByTag: Map<string, Protocol.CSS.FontVariationAxis>;
11
11
  constructor(payload: Protocol.CSS.FontFace) {
12
- this.fontFamily = payload.fontFamily;
13
- this.fontVariationAxes = payload.fontVariationAxes || [];
14
- this.fontVariationAxesByTag = new Map();
15
- for (const axis of this.fontVariationAxes) {
16
- this.fontVariationAxesByTag.set(axis.tag, axis);
12
+ this.#fontFamily = payload.fontFamily;
13
+ this.#fontVariationAxes = payload.fontVariationAxes || [];
14
+ this.#fontVariationAxesByTag = new Map();
15
+ for (const axis of this.#fontVariationAxes) {
16
+ this.#fontVariationAxesByTag.set(axis.tag, axis);
17
17
  }
18
18
  }
19
19
 
20
20
  getFontFamily(): string {
21
- return this.fontFamily;
21
+ return this.#fontFamily;
22
22
  }
23
23
 
24
24
  getVariationAxisByTag(tag: string): Protocol.CSS.FontVariationAxis|undefined {
25
- return this.fontVariationAxesByTag.get(tag);
25
+ return this.#fontVariationAxesByTag.get(tag);
26
26
  }
27
27
  }