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
|
@@ -52,96 +52,97 @@ export interface Hinge {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyApi.OverlayDispatcher {
|
|
55
|
-
|
|
55
|
+
readonly #domModel: DOMModel;
|
|
56
56
|
overlayAgent: ProtocolProxyApi.OverlayApi;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
readonly #debuggerModel: DebuggerModel|null;
|
|
58
|
+
#inspectModeEnabledInternal: boolean;
|
|
59
|
+
#hideHighlightTimeout: number|null;
|
|
60
|
+
#defaultHighlighter: Highlighter;
|
|
61
|
+
#highlighter: Highlighter;
|
|
62
62
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
63
63
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
-
|
|
64
|
+
#showPaintRectsSetting: Common.Settings.Setting<any>;
|
|
65
65
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
66
66
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
|
-
|
|
67
|
+
#showLayoutShiftRegionsSetting: Common.Settings.Setting<any>;
|
|
68
68
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
69
69
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
70
|
-
|
|
70
|
+
#showAdHighlightsSetting: Common.Settings.Setting<any>;
|
|
71
71
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
72
72
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
73
|
-
|
|
73
|
+
#showDebugBordersSetting: Common.Settings.Setting<any>;
|
|
74
74
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
75
75
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
-
|
|
76
|
+
#showFPSCounterSetting: Common.Settings.Setting<any>;
|
|
77
77
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
78
78
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
79
|
-
|
|
79
|
+
#showScrollBottleneckRectsSetting: Common.Settings.Setting<any>;
|
|
80
80
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
81
81
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
82
|
-
|
|
82
|
+
#showHitTestBordersSetting: Common.Settings.Setting<any>;
|
|
83
83
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
84
84
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
#showWebVitalsSetting: Common.Settings.Setting<any>;
|
|
86
|
+
#registeredListeners: Common.EventTarget.EventDescriptor[];
|
|
87
|
+
#showViewportSizeOnResize: boolean;
|
|
88
|
+
#persistentHighlighter: OverlayPersistentHighlighter|null;
|
|
89
|
+
readonly #sourceOrderHighlighter: SourceOrderHighlighter;
|
|
90
|
+
#sourceOrderModeActiveInternal: boolean;
|
|
91
91
|
|
|
92
92
|
constructor(target: Target) {
|
|
93
93
|
super(target);
|
|
94
|
-
this
|
|
94
|
+
this.#domModel = (target.model(DOMModel) as DOMModel);
|
|
95
95
|
|
|
96
96
|
target.registerOverlayDispatcher(this);
|
|
97
97
|
this.overlayAgent = target.overlayAgent();
|
|
98
98
|
|
|
99
|
-
this
|
|
100
|
-
if (this
|
|
99
|
+
this.#debuggerModel = target.model(DebuggerModel);
|
|
100
|
+
if (this.#debuggerModel) {
|
|
101
101
|
Common.Settings.Settings.instance()
|
|
102
102
|
.moduleSetting('disablePausedStateOverlay')
|
|
103
103
|
.addChangeListener(this.updatePausedInDebuggerMessage, this);
|
|
104
|
-
this
|
|
105
|
-
|
|
104
|
+
this.#debuggerModel.addEventListener(
|
|
105
|
+
DebuggerModelEvents.DebuggerPaused, this.updatePausedInDebuggerMessage, this);
|
|
106
|
+
this.#debuggerModel.addEventListener(
|
|
106
107
|
DebuggerModelEvents.DebuggerResumed, this.updatePausedInDebuggerMessage, this);
|
|
107
108
|
// TODO(dgozman): we should get DebuggerResumed on navigations instead of listening to GlobalObjectCleared.
|
|
108
|
-
this
|
|
109
|
+
this.#debuggerModel.addEventListener(
|
|
109
110
|
DebuggerModelEvents.GlobalObjectCleared, this.updatePausedInDebuggerMessage, this);
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
this
|
|
113
|
+
this.#inspectModeEnabledInternal = false;
|
|
113
114
|
|
|
114
|
-
this
|
|
115
|
-
this
|
|
116
|
-
this
|
|
115
|
+
this.#hideHighlightTimeout = null;
|
|
116
|
+
this.#defaultHighlighter = new DefaultHighlighter(this);
|
|
117
|
+
this.#highlighter = this.#defaultHighlighter;
|
|
117
118
|
|
|
118
|
-
this
|
|
119
|
-
this
|
|
120
|
-
this
|
|
121
|
-
this
|
|
122
|
-
this
|
|
123
|
-
this
|
|
119
|
+
this.#showPaintRectsSetting = Common.Settings.Settings.instance().moduleSetting('showPaintRects');
|
|
120
|
+
this.#showLayoutShiftRegionsSetting = Common.Settings.Settings.instance().moduleSetting('showLayoutShiftRegions');
|
|
121
|
+
this.#showAdHighlightsSetting = Common.Settings.Settings.instance().moduleSetting('showAdHighlights');
|
|
122
|
+
this.#showDebugBordersSetting = Common.Settings.Settings.instance().moduleSetting('showDebugBorders');
|
|
123
|
+
this.#showFPSCounterSetting = Common.Settings.Settings.instance().moduleSetting('showFPSCounter');
|
|
124
|
+
this.#showScrollBottleneckRectsSetting =
|
|
124
125
|
Common.Settings.Settings.instance().moduleSetting('showScrollBottleneckRects');
|
|
125
|
-
this
|
|
126
|
-
this
|
|
126
|
+
this.#showHitTestBordersSetting = Common.Settings.Settings.instance().moduleSetting('showHitTestBorders');
|
|
127
|
+
this.#showWebVitalsSetting = Common.Settings.Settings.instance().moduleSetting('showWebVitals');
|
|
127
128
|
|
|
128
|
-
this
|
|
129
|
-
this
|
|
129
|
+
this.#registeredListeners = [];
|
|
130
|
+
this.#showViewportSizeOnResize = true;
|
|
130
131
|
if (!target.suspended()) {
|
|
131
132
|
this.overlayAgent.invoke_enable();
|
|
132
133
|
this.wireAgentToSettings();
|
|
133
134
|
}
|
|
134
135
|
|
|
135
|
-
this
|
|
136
|
-
this
|
|
137
|
-
this
|
|
136
|
+
this.#persistentHighlighter = new OverlayPersistentHighlighter(this);
|
|
137
|
+
this.#domModel.addEventListener(DOMModelEvents.NodeRemoved, () => {
|
|
138
|
+
this.#persistentHighlighter && this.#persistentHighlighter.refreshHighlights();
|
|
138
139
|
});
|
|
139
|
-
this
|
|
140
|
-
this
|
|
140
|
+
this.#domModel.addEventListener(DOMModelEvents.DocumentUpdated, () => {
|
|
141
|
+
this.#persistentHighlighter && this.#persistentHighlighter.hideAllInOverlay();
|
|
141
142
|
});
|
|
142
143
|
|
|
143
|
-
this
|
|
144
|
-
this
|
|
144
|
+
this.#sourceOrderHighlighter = new SourceOrderHighlighter(this);
|
|
145
|
+
this.#sourceOrderModeActiveInternal = false;
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
static highlightObjectAsDOMNode(object: RemoteObject): void {
|
|
@@ -178,7 +179,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
getDOMModel(): DOMModel {
|
|
181
|
-
return this
|
|
182
|
+
return this.#domModel;
|
|
182
183
|
}
|
|
183
184
|
|
|
184
185
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
@@ -197,58 +198,59 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
197
198
|
}
|
|
198
199
|
|
|
199
200
|
private async wireAgentToSettings(): Promise<void> {
|
|
200
|
-
this
|
|
201
|
-
this
|
|
202
|
-
() => this.overlayAgent.invoke_setShowPaintRects({result: this
|
|
203
|
-
this
|
|
204
|
-
() =>
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
201
|
+
this.#registeredListeners = [
|
|
202
|
+
this.#showPaintRectsSetting.addChangeListener(
|
|
203
|
+
() => this.overlayAgent.invoke_setShowPaintRects({result: this.#showPaintRectsSetting.get()})),
|
|
204
|
+
this.#showLayoutShiftRegionsSetting.addChangeListener(
|
|
205
|
+
() =>
|
|
206
|
+
this.overlayAgent.invoke_setShowLayoutShiftRegions({result: this.#showLayoutShiftRegionsSetting.get()})),
|
|
207
|
+
this.#showAdHighlightsSetting.addChangeListener(
|
|
208
|
+
() => this.overlayAgent.invoke_setShowAdHighlights({show: this.#showAdHighlightsSetting.get()})),
|
|
209
|
+
this.#showDebugBordersSetting.addChangeListener(
|
|
210
|
+
() => this.overlayAgent.invoke_setShowDebugBorders({show: this.#showDebugBordersSetting.get()})),
|
|
211
|
+
this.#showFPSCounterSetting.addChangeListener(
|
|
212
|
+
() => this.overlayAgent.invoke_setShowFPSCounter({show: this.#showFPSCounterSetting.get()})),
|
|
213
|
+
this.#showScrollBottleneckRectsSetting.addChangeListener(
|
|
212
214
|
() => this.overlayAgent.invoke_setShowScrollBottleneckRects(
|
|
213
|
-
{show: this
|
|
214
|
-
this
|
|
215
|
-
() => this.overlayAgent.invoke_setShowHitTestBorders({show: this
|
|
216
|
-
this
|
|
217
|
-
() => this.overlayAgent.invoke_setShowWebVitals({show: this
|
|
215
|
+
{show: this.#showScrollBottleneckRectsSetting.get()})),
|
|
216
|
+
this.#showHitTestBordersSetting.addChangeListener(
|
|
217
|
+
() => this.overlayAgent.invoke_setShowHitTestBorders({show: this.#showHitTestBordersSetting.get()})),
|
|
218
|
+
this.#showWebVitalsSetting.addChangeListener(
|
|
219
|
+
() => this.overlayAgent.invoke_setShowWebVitals({show: this.#showWebVitalsSetting.get()})),
|
|
218
220
|
];
|
|
219
221
|
|
|
220
|
-
if (this
|
|
222
|
+
if (this.#showPaintRectsSetting.get()) {
|
|
221
223
|
this.overlayAgent.invoke_setShowPaintRects({result: true});
|
|
222
224
|
}
|
|
223
|
-
if (this
|
|
225
|
+
if (this.#showLayoutShiftRegionsSetting.get()) {
|
|
224
226
|
this.overlayAgent.invoke_setShowLayoutShiftRegions({result: true});
|
|
225
227
|
}
|
|
226
|
-
if (this
|
|
228
|
+
if (this.#showAdHighlightsSetting.get()) {
|
|
227
229
|
this.overlayAgent.invoke_setShowAdHighlights({show: true});
|
|
228
230
|
}
|
|
229
|
-
if (this
|
|
231
|
+
if (this.#showDebugBordersSetting.get()) {
|
|
230
232
|
this.overlayAgent.invoke_setShowDebugBorders({show: true});
|
|
231
233
|
}
|
|
232
|
-
if (this
|
|
234
|
+
if (this.#showFPSCounterSetting.get()) {
|
|
233
235
|
this.overlayAgent.invoke_setShowFPSCounter({show: true});
|
|
234
236
|
}
|
|
235
|
-
if (this
|
|
237
|
+
if (this.#showScrollBottleneckRectsSetting.get()) {
|
|
236
238
|
this.overlayAgent.invoke_setShowScrollBottleneckRects({show: true});
|
|
237
239
|
}
|
|
238
|
-
if (this
|
|
240
|
+
if (this.#showHitTestBordersSetting.get()) {
|
|
239
241
|
this.overlayAgent.invoke_setShowHitTestBorders({show: true});
|
|
240
242
|
}
|
|
241
|
-
if (this
|
|
243
|
+
if (this.#showWebVitalsSetting.get()) {
|
|
242
244
|
this.overlayAgent.invoke_setShowWebVitals({show: true});
|
|
243
245
|
}
|
|
244
|
-
if (this
|
|
246
|
+
if (this.#debuggerModel && this.#debuggerModel.isPaused()) {
|
|
245
247
|
this.updatePausedInDebuggerMessage();
|
|
246
248
|
}
|
|
247
|
-
await this.overlayAgent.invoke_setShowViewportSizeOnResize({show: this
|
|
249
|
+
await this.overlayAgent.invoke_setShowViewportSizeOnResize({show: this.#showViewportSizeOnResize});
|
|
248
250
|
}
|
|
249
251
|
|
|
250
252
|
async suspendModel(): Promise<void> {
|
|
251
|
-
Common.EventTarget.removeEventListeners(this
|
|
253
|
+
Common.EventTarget.removeEventListeners(this.#registeredListeners);
|
|
252
254
|
await this.overlayAgent.invoke_disable();
|
|
253
255
|
}
|
|
254
256
|
|
|
@@ -257,11 +259,11 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
257
259
|
}
|
|
258
260
|
|
|
259
261
|
setShowViewportSizeOnResize(show: boolean): void {
|
|
260
|
-
if (this
|
|
262
|
+
if (this.#showViewportSizeOnResize === show) {
|
|
261
263
|
return;
|
|
262
264
|
}
|
|
263
265
|
|
|
264
|
-
this
|
|
266
|
+
this.#showViewportSizeOnResize = show;
|
|
265
267
|
if (this.target().suspended()) {
|
|
266
268
|
return;
|
|
267
269
|
}
|
|
@@ -272,7 +274,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
272
274
|
if (this.target().suspended()) {
|
|
273
275
|
return;
|
|
274
276
|
}
|
|
275
|
-
const message = this
|
|
277
|
+
const message = this.#debuggerModel && this.#debuggerModel.isPaused() &&
|
|
276
278
|
!Common.Settings.Settings.instance().moduleSetting('disablePausedStateOverlay').get() ?
|
|
277
279
|
i18nString(UIStrings.pausedInDebugger) :
|
|
278
280
|
undefined;
|
|
@@ -280,36 +282,36 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
280
282
|
}
|
|
281
283
|
|
|
282
284
|
setHighlighter(highlighter: Highlighter|null): void {
|
|
283
|
-
this
|
|
285
|
+
this.#highlighter = highlighter || this.#defaultHighlighter;
|
|
284
286
|
}
|
|
285
287
|
|
|
286
288
|
async setInspectMode(mode: Protocol.Overlay.InspectMode, showDetailedTooltip: boolean|undefined = true):
|
|
287
289
|
Promise<void> {
|
|
288
|
-
await this
|
|
289
|
-
this
|
|
290
|
+
await this.#domModel.requestDocument();
|
|
291
|
+
this.#inspectModeEnabledInternal = mode !== Protocol.Overlay.InspectMode.None;
|
|
290
292
|
this.dispatchEventToListeners(Events.InspectModeWillBeToggled, this);
|
|
291
|
-
this
|
|
293
|
+
this.#highlighter.setInspectMode(mode, this.buildHighlightConfig('all', showDetailedTooltip));
|
|
292
294
|
}
|
|
293
295
|
|
|
294
296
|
inspectModeEnabled(): boolean {
|
|
295
|
-
return this
|
|
297
|
+
return this.#inspectModeEnabledInternal;
|
|
296
298
|
}
|
|
297
299
|
|
|
298
300
|
highlightInOverlay(data: HighlightData, mode?: string, showInfo?: boolean): void {
|
|
299
|
-
if (this
|
|
301
|
+
if (this.#sourceOrderModeActiveInternal) {
|
|
300
302
|
// Return early if the source order is currently being shown the in the
|
|
301
303
|
// overlay, so that it is not cleared by the highlight
|
|
302
304
|
return;
|
|
303
305
|
}
|
|
304
|
-
if (this
|
|
305
|
-
clearTimeout(this
|
|
306
|
-
this
|
|
306
|
+
if (this.#hideHighlightTimeout) {
|
|
307
|
+
clearTimeout(this.#hideHighlightTimeout);
|
|
308
|
+
this.#hideHighlightTimeout = null;
|
|
307
309
|
}
|
|
308
310
|
const highlightConfig = this.buildHighlightConfig(mode);
|
|
309
311
|
if (typeof showInfo !== 'undefined') {
|
|
310
312
|
highlightConfig.showInfo = showInfo;
|
|
311
313
|
}
|
|
312
|
-
this
|
|
314
|
+
this.#highlighter.highlightInOverlay(data, highlightConfig);
|
|
313
315
|
}
|
|
314
316
|
|
|
315
317
|
highlightInOverlayForTwoSeconds(data: HighlightData): void {
|
|
@@ -318,94 +320,94 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
318
320
|
}
|
|
319
321
|
|
|
320
322
|
highlightGridInPersistentOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
321
|
-
if (!this
|
|
323
|
+
if (!this.#persistentHighlighter) {
|
|
322
324
|
return;
|
|
323
325
|
}
|
|
324
|
-
this
|
|
326
|
+
this.#persistentHighlighter.highlightGridInOverlay(nodeId);
|
|
325
327
|
this.dispatchEventToListeners(Events.PersistentGridOverlayStateChanged, {nodeId, enabled: true});
|
|
326
328
|
}
|
|
327
329
|
|
|
328
330
|
isHighlightedGridInPersistentOverlay(nodeId: Protocol.DOM.NodeId): boolean {
|
|
329
|
-
if (!this
|
|
331
|
+
if (!this.#persistentHighlighter) {
|
|
330
332
|
return false;
|
|
331
333
|
}
|
|
332
|
-
return this
|
|
334
|
+
return this.#persistentHighlighter.isGridHighlighted(nodeId);
|
|
333
335
|
}
|
|
334
336
|
|
|
335
337
|
hideGridInPersistentOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
336
|
-
if (!this
|
|
338
|
+
if (!this.#persistentHighlighter) {
|
|
337
339
|
return;
|
|
338
340
|
}
|
|
339
|
-
this
|
|
341
|
+
this.#persistentHighlighter.hideGridInOverlay(nodeId);
|
|
340
342
|
this.dispatchEventToListeners(Events.PersistentGridOverlayStateChanged, {nodeId, enabled: false});
|
|
341
343
|
}
|
|
342
344
|
|
|
343
345
|
highlightScrollSnapInPersistentOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
344
|
-
if (!this
|
|
346
|
+
if (!this.#persistentHighlighter) {
|
|
345
347
|
return;
|
|
346
348
|
}
|
|
347
|
-
this
|
|
349
|
+
this.#persistentHighlighter.highlightScrollSnapInOverlay(nodeId);
|
|
348
350
|
this.dispatchEventToListeners(Events.PersistentScrollSnapOverlayStateChanged, {nodeId, enabled: true});
|
|
349
351
|
}
|
|
350
352
|
|
|
351
353
|
isHighlightedScrollSnapInPersistentOverlay(nodeId: Protocol.DOM.NodeId): boolean {
|
|
352
|
-
if (!this
|
|
354
|
+
if (!this.#persistentHighlighter) {
|
|
353
355
|
return false;
|
|
354
356
|
}
|
|
355
|
-
return this
|
|
357
|
+
return this.#persistentHighlighter.isScrollSnapHighlighted(nodeId);
|
|
356
358
|
}
|
|
357
359
|
|
|
358
360
|
hideScrollSnapInPersistentOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
359
|
-
if (!this
|
|
361
|
+
if (!this.#persistentHighlighter) {
|
|
360
362
|
return;
|
|
361
363
|
}
|
|
362
|
-
this
|
|
364
|
+
this.#persistentHighlighter.hideScrollSnapInOverlay(nodeId);
|
|
363
365
|
this.dispatchEventToListeners(Events.PersistentScrollSnapOverlayStateChanged, {nodeId, enabled: false});
|
|
364
366
|
}
|
|
365
367
|
|
|
366
368
|
highlightFlexContainerInPersistentOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
367
|
-
if (!this
|
|
369
|
+
if (!this.#persistentHighlighter) {
|
|
368
370
|
return;
|
|
369
371
|
}
|
|
370
|
-
this
|
|
372
|
+
this.#persistentHighlighter.highlightFlexInOverlay(nodeId);
|
|
371
373
|
this.dispatchEventToListeners(Events.PersistentFlexContainerOverlayStateChanged, {nodeId, enabled: true});
|
|
372
374
|
}
|
|
373
375
|
|
|
374
376
|
isHighlightedFlexContainerInPersistentOverlay(nodeId: Protocol.DOM.NodeId): boolean {
|
|
375
|
-
if (!this
|
|
377
|
+
if (!this.#persistentHighlighter) {
|
|
376
378
|
return false;
|
|
377
379
|
}
|
|
378
|
-
return this
|
|
380
|
+
return this.#persistentHighlighter.isFlexHighlighted(nodeId);
|
|
379
381
|
}
|
|
380
382
|
|
|
381
383
|
hideFlexContainerInPersistentOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
382
|
-
if (!this
|
|
384
|
+
if (!this.#persistentHighlighter) {
|
|
383
385
|
return;
|
|
384
386
|
}
|
|
385
|
-
this
|
|
387
|
+
this.#persistentHighlighter.hideFlexInOverlay(nodeId);
|
|
386
388
|
this.dispatchEventToListeners(Events.PersistentFlexContainerOverlayStateChanged, {nodeId, enabled: false});
|
|
387
389
|
}
|
|
388
390
|
|
|
389
391
|
highlightContainerQueryInPersistentOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
390
|
-
if (!this
|
|
392
|
+
if (!this.#persistentHighlighter) {
|
|
391
393
|
return;
|
|
392
394
|
}
|
|
393
|
-
this
|
|
395
|
+
this.#persistentHighlighter.highlightContainerQueryInOverlay(nodeId);
|
|
394
396
|
this.dispatchEventToListeners(Events.PersistentContainerQueryOverlayStateChanged, {nodeId, enabled: true});
|
|
395
397
|
}
|
|
396
398
|
|
|
397
399
|
isHighlightedContainerQueryInPersistentOverlay(nodeId: Protocol.DOM.NodeId): boolean {
|
|
398
|
-
if (!this
|
|
400
|
+
if (!this.#persistentHighlighter) {
|
|
399
401
|
return false;
|
|
400
402
|
}
|
|
401
|
-
return this
|
|
403
|
+
return this.#persistentHighlighter.isContainerQueryHighlighted(nodeId);
|
|
402
404
|
}
|
|
403
405
|
|
|
404
406
|
hideContainerQueryInPersistentOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
405
|
-
if (!this
|
|
407
|
+
if (!this.#persistentHighlighter) {
|
|
406
408
|
return;
|
|
407
409
|
}
|
|
408
|
-
this
|
|
410
|
+
this.#persistentHighlighter.hideContainerQueryInOverlay(nodeId);
|
|
409
411
|
this.dispatchEventToListeners(Events.PersistentContainerQueryOverlayStateChanged, {nodeId, enabled: false});
|
|
410
412
|
}
|
|
411
413
|
|
|
@@ -414,92 +416,92 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
414
416
|
parentOutlineColor: Common.Color.SourceOrderHighlight.ParentOutline.toProtocolRGBA(),
|
|
415
417
|
childOutlineColor: Common.Color.SourceOrderHighlight.ChildOutline.toProtocolRGBA(),
|
|
416
418
|
};
|
|
417
|
-
this
|
|
419
|
+
this.#sourceOrderHighlighter.highlightSourceOrderInOverlay(node, sourceOrderConfig);
|
|
418
420
|
}
|
|
419
421
|
|
|
420
422
|
colorOfGridInPersistentOverlay(nodeId: Protocol.DOM.NodeId): string|null {
|
|
421
|
-
if (!this
|
|
423
|
+
if (!this.#persistentHighlighter) {
|
|
422
424
|
return null;
|
|
423
425
|
}
|
|
424
|
-
return this
|
|
426
|
+
return this.#persistentHighlighter.colorOfGrid(nodeId).asString(Common.Color.Format.HEX);
|
|
425
427
|
}
|
|
426
428
|
|
|
427
429
|
setColorOfGridInPersistentOverlay(nodeId: Protocol.DOM.NodeId, colorStr: string): void {
|
|
428
|
-
if (!this
|
|
430
|
+
if (!this.#persistentHighlighter) {
|
|
429
431
|
return;
|
|
430
432
|
}
|
|
431
433
|
const color = Common.Color.Color.parse(colorStr);
|
|
432
434
|
if (!color) {
|
|
433
435
|
return;
|
|
434
436
|
}
|
|
435
|
-
this
|
|
436
|
-
this
|
|
437
|
+
this.#persistentHighlighter.setColorOfGrid(nodeId, color);
|
|
438
|
+
this.#persistentHighlighter.resetOverlay();
|
|
437
439
|
}
|
|
438
440
|
|
|
439
441
|
colorOfFlexInPersistentOverlay(nodeId: Protocol.DOM.NodeId): string|null {
|
|
440
|
-
if (!this
|
|
442
|
+
if (!this.#persistentHighlighter) {
|
|
441
443
|
return null;
|
|
442
444
|
}
|
|
443
|
-
return this
|
|
445
|
+
return this.#persistentHighlighter.colorOfFlex(nodeId).asString(Common.Color.Format.HEX);
|
|
444
446
|
}
|
|
445
447
|
|
|
446
448
|
setColorOfFlexInPersistentOverlay(nodeId: Protocol.DOM.NodeId, colorStr: string): void {
|
|
447
|
-
if (!this
|
|
449
|
+
if (!this.#persistentHighlighter) {
|
|
448
450
|
return;
|
|
449
451
|
}
|
|
450
452
|
const color = Common.Color.Color.parse(colorStr);
|
|
451
453
|
if (!color) {
|
|
452
454
|
return;
|
|
453
455
|
}
|
|
454
|
-
this
|
|
455
|
-
this
|
|
456
|
+
this.#persistentHighlighter.setColorOfFlex(nodeId, color);
|
|
457
|
+
this.#persistentHighlighter.resetOverlay();
|
|
456
458
|
}
|
|
457
459
|
|
|
458
460
|
hideSourceOrderInOverlay(): void {
|
|
459
|
-
this
|
|
461
|
+
this.#sourceOrderHighlighter.hideSourceOrderHighlight();
|
|
460
462
|
}
|
|
461
463
|
|
|
462
464
|
setSourceOrderActive(isActive: boolean): void {
|
|
463
|
-
this
|
|
465
|
+
this.#sourceOrderModeActiveInternal = isActive;
|
|
464
466
|
}
|
|
465
467
|
|
|
466
468
|
sourceOrderModeActive(): boolean {
|
|
467
|
-
return this
|
|
469
|
+
return this.#sourceOrderModeActiveInternal;
|
|
468
470
|
}
|
|
469
471
|
|
|
470
472
|
highlightIsolatedElementInPersistentOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
471
|
-
if (!this
|
|
473
|
+
if (!this.#persistentHighlighter) {
|
|
472
474
|
return;
|
|
473
475
|
}
|
|
474
|
-
this
|
|
476
|
+
this.#persistentHighlighter.highlightIsolatedElementInOverlay(nodeId);
|
|
475
477
|
}
|
|
476
478
|
|
|
477
479
|
hideIsolatedElementInPersistentOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
478
|
-
if (!this
|
|
480
|
+
if (!this.#persistentHighlighter) {
|
|
479
481
|
return;
|
|
480
482
|
}
|
|
481
|
-
this
|
|
483
|
+
this.#persistentHighlighter.hideIsolatedElementInOverlay(nodeId);
|
|
482
484
|
}
|
|
483
485
|
|
|
484
486
|
isHighlightedIsolatedElementInPersistentOverlay(nodeId: Protocol.DOM.NodeId): boolean {
|
|
485
|
-
if (!this
|
|
487
|
+
if (!this.#persistentHighlighter) {
|
|
486
488
|
return false;
|
|
487
489
|
}
|
|
488
|
-
return this
|
|
490
|
+
return this.#persistentHighlighter.isIsolatedElementHighlighted(nodeId);
|
|
489
491
|
}
|
|
490
492
|
|
|
491
493
|
private delayedHideHighlight(delay: number): void {
|
|
492
|
-
if (this
|
|
493
|
-
this
|
|
494
|
+
if (this.#hideHighlightTimeout === null) {
|
|
495
|
+
this.#hideHighlightTimeout = window.setTimeout(() => this.highlightInOverlay({clear: true}), delay);
|
|
494
496
|
}
|
|
495
497
|
}
|
|
496
498
|
|
|
497
499
|
highlightFrame(frameId: Protocol.Page.FrameId): void {
|
|
498
|
-
if (this
|
|
499
|
-
clearTimeout(this
|
|
500
|
-
this
|
|
500
|
+
if (this.#hideHighlightTimeout) {
|
|
501
|
+
clearTimeout(this.#hideHighlightTimeout);
|
|
502
|
+
this.#hideHighlightTimeout = null;
|
|
501
503
|
}
|
|
502
|
-
this
|
|
504
|
+
this.#highlighter.highlightFrame(frameId);
|
|
503
505
|
}
|
|
504
506
|
|
|
505
507
|
showHingeForDualScreen(hinge: Hinge|null): void {
|
|
@@ -749,7 +751,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
749
751
|
}
|
|
750
752
|
|
|
751
753
|
nodeHighlightRequested({nodeId}: Protocol.Overlay.NodeHighlightRequestedEvent): void {
|
|
752
|
-
const node = this
|
|
754
|
+
const node = this.#domModel.nodeForId(nodeId);
|
|
753
755
|
if (node) {
|
|
754
756
|
this.dispatchEventToListeners(Events.HighlightNodeRequested, node);
|
|
755
757
|
}
|
|
@@ -827,9 +829,9 @@ export interface Highlighter {
|
|
|
827
829
|
}
|
|
828
830
|
|
|
829
831
|
class DefaultHighlighter implements Highlighter {
|
|
830
|
-
|
|
832
|
+
readonly #model: OverlayModel;
|
|
831
833
|
constructor(model: OverlayModel) {
|
|
832
|
-
this
|
|
834
|
+
this.#model = model;
|
|
833
835
|
}
|
|
834
836
|
|
|
835
837
|
highlightInOverlay(data: HighlightData, highlightConfig: Protocol.Overlay.HighlightConfig): void {
|
|
@@ -839,20 +841,20 @@ class DefaultHighlighter implements Highlighter {
|
|
|
839
841
|
const backendNodeId = deferredNode ? deferredNode.backendNodeId() : undefined;
|
|
840
842
|
const objectId = object ? object.objectId : undefined;
|
|
841
843
|
if (nodeId || backendNodeId || objectId) {
|
|
842
|
-
this
|
|
844
|
+
this.#model.target().overlayAgent().invoke_highlightNode(
|
|
843
845
|
{highlightConfig, nodeId, backendNodeId, objectId, selector: selectorList});
|
|
844
846
|
} else {
|
|
845
|
-
this
|
|
847
|
+
this.#model.target().overlayAgent().invoke_hideHighlight();
|
|
846
848
|
}
|
|
847
849
|
}
|
|
848
850
|
|
|
849
851
|
async setInspectMode(mode: Protocol.Overlay.InspectMode, highlightConfig: Protocol.Overlay.HighlightConfig):
|
|
850
852
|
Promise<void> {
|
|
851
|
-
await this
|
|
853
|
+
await this.#model.target().overlayAgent().invoke_setInspectMode({mode, highlightConfig});
|
|
852
854
|
}
|
|
853
855
|
|
|
854
856
|
highlightFrame(frameId: Protocol.Page.FrameId): void {
|
|
855
|
-
this
|
|
857
|
+
this.#model.target().overlayAgent().invoke_highlightFrame({
|
|
856
858
|
frameId,
|
|
857
859
|
contentColor: Common.Color.PageHighlight.Content.toProtocolRGBA(),
|
|
858
860
|
contentOutlineColor: Common.Color.PageHighlight.ContentOutline.toProtocolRGBA(),
|
|
@@ -861,21 +863,21 @@ class DefaultHighlighter implements Highlighter {
|
|
|
861
863
|
}
|
|
862
864
|
|
|
863
865
|
export class SourceOrderHighlighter {
|
|
864
|
-
|
|
866
|
+
readonly #model: OverlayModel;
|
|
865
867
|
constructor(model: OverlayModel) {
|
|
866
|
-
this
|
|
868
|
+
this.#model = model;
|
|
867
869
|
}
|
|
868
870
|
|
|
869
871
|
highlightSourceOrderInOverlay(node: DOMNode, sourceOrderConfig: Protocol.Overlay.SourceOrderConfig): void {
|
|
870
|
-
this
|
|
871
|
-
this
|
|
872
|
-
this
|
|
872
|
+
this.#model.setSourceOrderActive(true);
|
|
873
|
+
this.#model.setShowViewportSizeOnResize(false);
|
|
874
|
+
this.#model.getOverlayAgent().invoke_highlightSourceOrder({sourceOrderConfig, nodeId: node.id});
|
|
873
875
|
}
|
|
874
876
|
|
|
875
877
|
hideSourceOrderHighlight(): void {
|
|
876
|
-
this
|
|
877
|
-
this
|
|
878
|
-
this
|
|
878
|
+
this.#model.setSourceOrderActive(false);
|
|
879
|
+
this.#model.setShowViewportSizeOnResize(true);
|
|
880
|
+
this.#model.clearHighlight();
|
|
879
881
|
}
|
|
880
882
|
}
|
|
881
883
|
|