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.
- package/AUTHORS +1 -0
- package/config/gni/all_devtools_files.gni +0 -1
- package/config/gni/devtools_grd_files.gni +30 -4
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/Images/src/ic_preview_feature.svg +3 -0
- package/front_end/Tests.js +2 -3
- package/front_end/core/common/Settings.ts +26 -45
- package/front_end/core/host/UserMetrics.ts +2 -2
- package/front_end/core/i18n/locales/en-US.json +60 -15
- package/front_end/core/i18n/locales/en-XL.json +60 -15
- package/front_end/core/platform/keyboard-utilities.ts +1 -0
- package/front_end/core/root/Runtime.ts +62 -61
- package/front_end/core/sdk/AccessibilityModel.ts +73 -73
- package/front_end/core/sdk/CPUProfileDataModel.ts +14 -14
- package/front_end/core/sdk/CPUProfilerModel.ts +33 -33
- package/front_end/core/sdk/CPUThrottlingManager.ts +8 -8
- package/front_end/core/sdk/CSSFontFace.ts +10 -10
- package/front_end/core/sdk/CSSMatchedStyles.ts +114 -114
- package/front_end/core/sdk/CSSMedia.ts +22 -22
- package/front_end/core/sdk/CSSMetadata.ts +53 -49
- package/front_end/core/sdk/CSSModel.ts +139 -135
- package/front_end/core/sdk/CSSProperty.ts +18 -18
- package/front_end/core/sdk/CSSRule.ts +15 -15
- package/front_end/core/sdk/CSSStyleDeclaration.ts +49 -47
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +12 -12
- package/front_end/core/sdk/ChildTargetManager.ts +41 -40
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +10 -10
- package/front_end/core/sdk/Connections.ts +81 -81
- package/front_end/core/sdk/ConsoleModel.ts +68 -68
- package/front_end/core/sdk/Cookie.ts +48 -48
- package/front_end/core/sdk/CookieModel.ts +13 -13
- package/front_end/core/sdk/CookieParser.ts +45 -45
- package/front_end/core/sdk/DOMDebuggerModel.ts +131 -131
- package/front_end/core/sdk/DOMModel.ts +264 -252
- package/front_end/core/sdk/DebuggerModel.ts +209 -205
- package/front_end/core/sdk/EmulationModel.ts +76 -76
- package/front_end/core/sdk/FilmStripModel.ts +29 -29
- package/front_end/core/sdk/FrameManager.ts +43 -42
- package/front_end/core/sdk/HeapProfilerModel.ts +36 -36
- package/front_end/core/sdk/IsolateManager.ts +82 -82
- package/front_end/core/sdk/IssuesModel.ts +6 -6
- package/front_end/core/sdk/LayerTreeBase.ts +37 -37
- package/front_end/core/sdk/LogModel.ts +5 -5
- package/front_end/core/sdk/NetworkManager.ts +229 -225
- package/front_end/core/sdk/NetworkRequest.ts +368 -360
- package/front_end/core/sdk/OverlayColorGenerator.ts +9 -9
- package/front_end/core/sdk/OverlayModel.ts +155 -153
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +100 -101
- package/front_end/core/sdk/PageResourceLoader.ts +30 -30
- package/front_end/core/sdk/PaintProfiler.ts +16 -16
- package/front_end/core/sdk/PerformanceMetricsModel.ts +12 -12
- package/front_end/core/sdk/ProfileTreeModel.ts +3 -3
- package/front_end/core/sdk/RemoteObject.ts +108 -104
- package/front_end/core/sdk/Resource.ts +85 -84
- package/front_end/core/sdk/ResourceTreeModel.ts +150 -145
- package/front_end/core/sdk/RuntimeModel.ts +38 -34
- package/front_end/core/sdk/SDKModel.ts +3 -3
- package/front_end/core/sdk/ScreenCaptureModel.ts +19 -19
- package/front_end/core/sdk/Script.ts +29 -29
- package/front_end/core/sdk/SecurityOriginManager.ts +19 -19
- package/front_end/core/sdk/ServerTiming.ts +2 -2
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +43 -43
- package/front_end/core/sdk/ServiceWorkerManager.ts +72 -68
- package/front_end/core/sdk/SourceMap.ts +40 -36
- package/front_end/core/sdk/SourceMapManager.ts +57 -57
- package/front_end/core/sdk/Target.ts +64 -63
- package/front_end/core/sdk/TargetManager.ts +60 -56
- package/front_end/core/sdk/TracingManager.ts +39 -39
- package/front_end/core/sdk/TracingModel.ts +125 -125
- package/front_end/core/sdk/WebAuthnModel.ts +9 -9
- package/front_end/entrypoints/lighthouse_worker/{LighthouseService.js → LighthouseService.ts} +20 -45
- package/front_end/entrypoints/lighthouse_worker/{lighthouse_worker.js → lighthouse_worker.ts} +0 -0
- package/front_end/entrypoints/main/MainImpl.ts +7 -2
- package/front_end/legacy_test_runner/elements_test_runner/ElementsTestRunner.js +4 -4
- package/front_end/legacy_test_runner/sdk_test_runner/sdk_test_runner.js +1 -1
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -6
- package/front_end/models/issues_manager/GenericIssue.ts +86 -0
- package/front_end/models/issues_manager/Issue.ts +24 -0
- package/front_end/models/issues_manager/IssuesManager.ts +18 -6
- package/front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md +3 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +5422 -1
- package/front_end/panels/console/ConsoleSidebar.ts +0 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +53 -61
- package/front_end/panels/elements/ElementsTreeOutline.ts +0 -1
- package/front_end/panels/elements/components/LayoutPane.ts +5 -1
- package/front_end/panels/issues/GenericIssueDetailsView.ts +68 -0
- package/front_end/panels/issues/IssueAggregator.ts +16 -0
- package/front_end/panels/issues/IssueKindView.ts +95 -0
- package/front_end/panels/issues/IssueView.ts +6 -0
- package/front_end/panels/issues/IssuesPane.ts +81 -18
- package/front_end/panels/issues/issuesTree.css +8 -3
- package/front_end/panels/lighthouse/LighthouseController.ts +3 -1
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/network/networkLogView.css +5 -0
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +1 -0
- package/front_end/panels/settings/settingsScreen.css +24 -0
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +8 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
- package/front_end/panels/sources/sources-meta.ts +22 -7
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +4 -4
- package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +137 -0
- package/front_end/ui/components/code_highlighter/codeHighlighter.css +51 -0
- package/front_end/ui/components/code_highlighter/code_highlighter.ts +11 -0
- package/front_end/ui/components/docs/text_editor/basic.html +28 -0
- package/front_end/ui/components/docs/text_editor/basic.ts +14 -0
- package/front_end/ui/components/docs/text_prompt/basic.html +35 -0
- package/front_end/ui/components/docs/text_prompt/basic.ts +19 -0
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -0
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +17 -0
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -0
- package/front_end/ui/components/text_editor/TextEditor.ts +161 -0
- package/front_end/ui/components/text_editor/config.ts +264 -0
- package/front_end/{panels/console/components/components.ts → ui/components/text_editor/text_editor.ts} +2 -5
- package/front_end/ui/components/text_editor/theme.ts +113 -0
- package/front_end/ui/components/text_prompt/TextPrompt.ts +144 -0
- package/front_end/ui/components/text_prompt/textPrompt.css +33 -0
- package/front_end/ui/components/text_prompt/text_prompt.ts +9 -0
- package/front_end/ui/legacy/ARIAUtils.ts +14 -11
- package/front_end/ui/legacy/TabbedPane.ts +32 -3
- package/front_end/ui/legacy/UIUtils.ts +3 -1
- package/front_end/ui/legacy/View.ts +6 -0
- package/front_end/ui/legacy/ViewManager.ts +5 -1
- package/front_end/ui/legacy/ViewRegistration.ts +5 -0
- package/front_end/ui/legacy/XLink.ts +1 -1
- package/front_end/ui/legacy/closeButton.css +6 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +8 -3
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +38 -38
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +10 -4
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +23 -6
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +14 -16
- package/front_end/ui/legacy/filter.css +1 -0
- package/front_end/ui/legacy/tabbedPane.css +24 -0
- package/front_end/ui/legacy/toolbar.css +5 -0
- package/inspector_overlay/main.ts +2 -1
- package/inspector_overlay/tool_screenshot.ts +8 -1
- package/package.json +1 -1
- package/scripts/build/rollup.config.js +9 -0
- package/scripts/migration/class-fields/migrate.js +56 -0
- package/scripts/migration/class-fields/package.json +5 -0
- package/front_end/panels/console/components/SidebarDeprecation.ts +0 -58
- 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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
47
|
-
this
|
|
46
|
+
this.#accessibilityModelInternal = accessibilityModel;
|
|
47
|
+
this.#agent = accessibilityModel.getAgent();
|
|
48
48
|
|
|
49
|
-
this
|
|
50
|
-
accessibilityModel.setAXNodeForAXId(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
|
|
54
|
-
this
|
|
53
|
+
this.#backendDOMNodeIdInternal = payload.backendDOMNodeId;
|
|
54
|
+
this.#deferredDOMNodeInternal = new DeferredDOMNode(accessibilityModel.target(), payload.backendDOMNodeId);
|
|
55
55
|
} else {
|
|
56
|
-
this
|
|
57
|
-
this
|
|
56
|
+
this.#backendDOMNodeIdInternal = null;
|
|
57
|
+
this.#deferredDOMNodeInternal = null;
|
|
58
58
|
}
|
|
59
|
-
this
|
|
60
|
-
if (this
|
|
61
|
-
this
|
|
59
|
+
this.#ignoredInternal = payload.ignored;
|
|
60
|
+
if (this.#ignoredInternal && 'ignoredReasons' in payload) {
|
|
61
|
+
this.#ignoredReasonsInternal = payload.ignoredReasons;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
this
|
|
65
|
-
this
|
|
66
|
-
this
|
|
67
|
-
this
|
|
68
|
-
this
|
|
69
|
-
this
|
|
70
|
-
this
|
|
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
|
|
74
|
+
return this.#idInternal;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
accessibilityModel(): AccessibilityModel {
|
|
78
|
-
return this
|
|
78
|
+
return this.#accessibilityModelInternal;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
ignored(): boolean {
|
|
82
|
-
return this
|
|
82
|
+
return this.#ignoredInternal;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
ignoredReasons(): Protocol.Accessibility.AXProperty[]|null {
|
|
86
|
-
return this
|
|
86
|
+
return this.#ignoredReasonsInternal || null;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
role(): Protocol.Accessibility.AXValue|null {
|
|
90
|
-
return this
|
|
90
|
+
return this.#roleInternal || null;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
coreProperties(): CoreOrProtocolAxProperty[] {
|
|
94
94
|
const properties: CoreOrProtocolAxProperty[] = [];
|
|
95
95
|
|
|
96
|
-
if (this
|
|
97
|
-
properties.push({name: CoreAxPropertyName.Name, value: this
|
|
96
|
+
if (this.#nameInternal) {
|
|
97
|
+
properties.push({name: CoreAxPropertyName.Name, value: this.#nameInternal});
|
|
98
98
|
}
|
|
99
|
-
if (this
|
|
100
|
-
properties.push({name: CoreAxPropertyName.Description, value: this
|
|
99
|
+
if (this.#descriptionInternal) {
|
|
100
|
+
properties.push({name: CoreAxPropertyName.Description, value: this.#descriptionInternal});
|
|
101
101
|
}
|
|
102
|
-
if (this
|
|
103
|
-
properties.push({name: CoreAxPropertyName.Value, value: this
|
|
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
|
|
110
|
+
return this.#nameInternal || null;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
description(): Protocol.Accessibility.AXValue|null {
|
|
114
|
-
return this
|
|
114
|
+
return this.#descriptionInternal || null;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
value(): Protocol.Accessibility.AXValue|null {
|
|
118
|
-
return this
|
|
118
|
+
return this.#valueInternal || null;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
properties(): Protocol.Accessibility.AXProperty[]|null {
|
|
122
|
-
return this
|
|
122
|
+
return this.#propertiesInternal || null;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
parentNode(): AccessibilityNode|null {
|
|
126
|
-
return this
|
|
126
|
+
return this.#parentNodeInternal;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
setParentNode(parentNode: AccessibilityNode|null): void {
|
|
130
|
-
this
|
|
130
|
+
this.#parentNodeInternal = parentNode;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
isDOMNode(): boolean {
|
|
134
|
-
return Boolean(this
|
|
134
|
+
return Boolean(this.#backendDOMNodeIdInternal);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
backendDOMNodeId(): Protocol.DOM.BackendNodeId|null {
|
|
138
|
-
return this
|
|
138
|
+
return this.#backendDOMNodeIdInternal;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
deferredDOMNode(): DeferredDOMNode|null {
|
|
142
|
-
return this
|
|
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
|
|
155
|
+
if (!this.#childIds) {
|
|
156
156
|
return [];
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
const children = [];
|
|
160
|
-
for (const childId of this
|
|
161
|
-
const child = this
|
|
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
|
|
171
|
+
if (!this.#childIds) {
|
|
172
172
|
return 0;
|
|
173
173
|
}
|
|
174
|
-
return this
|
|
174
|
+
return this.#childIds.length;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
hasOnlyUnloadedChildren(): boolean {
|
|
178
|
-
if (!this
|
|
178
|
+
if (!this.#childIds || !this.#childIds.length) {
|
|
179
179
|
return false;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
return this
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
|
207
|
-
this
|
|
208
|
-
this
|
|
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
|
|
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
|
|
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
|
|
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
|
|
318
|
+
return this.#axIdToAXNode.get(axId) || null;
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
setAXNodeForAXId(axId: string, axNode: AccessibilityNode): void {
|
|
322
|
-
this
|
|
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
|
|
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
|
|
337
|
+
return this.#backendDOMNodeIdToDOMNode.get(backendDOMNodeId) ?? null;
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
setAXNodeForBackendDOMNodeId(backendDOMNodeId: Protocol.DOM.BackendNodeId, axNode: AccessibilityNode): void {
|
|
341
|
-
this
|
|
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
|
-
|
|
73
|
+
#idToNode!: Map<number, CPUProfileNode>;
|
|
74
74
|
gcNode!: CPUProfileNode;
|
|
75
75
|
programNode?: ProfileNode;
|
|
76
76
|
idleNode?: ProfileNode;
|
|
77
|
-
|
|
78
|
-
|
|
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
|
|
303
|
-
const idToNode = this
|
|
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
|
|
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
|
|
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
|
|
401
|
-
this
|
|
400
|
+
if (!this.#stackStartTimes) {
|
|
401
|
+
this.#stackStartTimes = new Float64Array(stackDepth);
|
|
402
402
|
}
|
|
403
|
-
const stackStartTimes = this
|
|
404
|
-
if (!this
|
|
405
|
-
this
|
|
403
|
+
const stackStartTimes = this.#stackStartTimes;
|
|
404
|
+
if (!this.#stackChildrenDuration) {
|
|
405
|
+
this.#stackChildrenDuration = new Float64Array(stackDepth);
|
|
406
406
|
}
|
|
407
|
-
const stackChildrenDuration = this
|
|
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
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
|
|
59
|
+
readonly #debuggerModelInternal: DebuggerModel;
|
|
60
60
|
|
|
61
61
|
constructor(target: Target) {
|
|
62
62
|
super(target);
|
|
63
|
-
this
|
|
64
|
-
this
|
|
65
|
-
this
|
|
66
|
-
this
|
|
67
|
-
this
|
|
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
|
|
70
|
-
this
|
|
69
|
+
this.#profilerAgent.invoke_enable();
|
|
70
|
+
this.#debuggerModelInternal = (target.model(DebuggerModel) as DebuggerModel);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
runtimeModel(): RuntimeModel {
|
|
74
|
-
return this
|
|
74
|
+
return this.#debuggerModelInternal.runtimeModel();
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
debuggerModel(): DebuggerModel {
|
|
78
|
-
return this
|
|
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
|
|
84
|
-
this
|
|
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
|
|
93
|
-
this
|
|
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
|
|
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
|
|
117
|
+
return this.#isRecording;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
startRecording(): Promise<unknown> {
|
|
121
|
-
this
|
|
121
|
+
this.#isRecording = true;
|
|
122
122
|
const intervalUs = 100;
|
|
123
|
-
this
|
|
124
|
-
return this
|
|
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
|
|
129
|
-
return this
|
|
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
|
|
138
|
+
this.#preciseCoverageDeltaUpdateCallback = preciseCoverageDeltaUpdateCallback;
|
|
139
139
|
const allowUpdatesTriggeredByBackend = true;
|
|
140
|
-
return this
|
|
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
|
|
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
|
|
156
|
-
return this
|
|
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
|
|
161
|
-
this
|
|
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
|
-
|
|
15
|
+
#cpuThrottlingRateInternal: number;
|
|
16
16
|
|
|
17
17
|
private constructor() {
|
|
18
18
|
super();
|
|
19
|
-
this
|
|
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
|
|
33
|
+
return this.#cpuThrottlingRateInternal;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
setCPUThrottlingRate(rate: number): void {
|
|
37
|
-
this
|
|
37
|
+
this.#cpuThrottlingRateInternal = rate;
|
|
38
38
|
for (const emulationModel of TargetManager.instance().models(EmulationModel)) {
|
|
39
|
-
emulationModel.setCPUThrottlingRate(this
|
|
39
|
+
emulationModel.setCPUThrottlingRate(this.#cpuThrottlingRateInternal);
|
|
40
40
|
}
|
|
41
|
-
this.dispatchEventToListeners(Events.RateChanged, this
|
|
41
|
+
this.dispatchEventToListeners(Events.RateChanged, this.#cpuThrottlingRateInternal);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
modelAdded(emulationModel: EmulationModel): void {
|
|
45
|
-
if (this
|
|
46
|
-
emulationModel.setCPUThrottlingRate(this
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
13
|
-
this
|
|
14
|
-
this
|
|
15
|
-
for (const axis of this
|
|
16
|
-
this
|
|
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
|
|
21
|
+
return this.#fontFamily;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
getVariationAxisByTag(tag: string): Protocol.CSS.FontVariationAxis|undefined {
|
|
25
|
-
return this
|
|
25
|
+
return this.#fontVariationAxesByTag.get(tag);
|
|
26
26
|
}
|
|
27
27
|
}
|