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
|
@@ -8,56 +8,55 @@ import * as Common from '../common/common.js';
|
|
|
8
8
|
import {OverlayColorGenerator} from './OverlayColorGenerator.js';
|
|
9
9
|
|
|
10
10
|
export class OverlayPersistentHighlighter {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
private flexEnabled: boolean;
|
|
11
|
+
readonly #model: OverlayModel;
|
|
12
|
+
readonly #gridHighlights: Map<Protocol.DOM.NodeId, Protocol.Overlay.GridHighlightConfig>;
|
|
13
|
+
readonly #scrollSnapHighlights: Map<Protocol.DOM.NodeId, Protocol.Overlay.ScrollSnapContainerHighlightConfig>;
|
|
14
|
+
readonly #flexHighlights: Map<Protocol.DOM.NodeId, Protocol.Overlay.FlexContainerHighlightConfig>;
|
|
15
|
+
readonly #containerQueryHighlights: Map<Protocol.DOM.NodeId, Protocol.Overlay.ContainerQueryContainerHighlightConfig>;
|
|
16
|
+
readonly #isolatedElementHighlights: Map<Protocol.DOM.NodeId, Protocol.Overlay.IsolationModeHighlightConfig>;
|
|
17
|
+
readonly #colors: Map<Protocol.DOM.NodeId, Common.Color.Color>;
|
|
18
|
+
#gridColorGenerator: OverlayColorGenerator;
|
|
19
|
+
#flexColorGenerator: OverlayColorGenerator;
|
|
20
|
+
#flexEnabled: boolean;
|
|
22
21
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
23
22
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
-
|
|
23
|
+
readonly #showGridLineLabelsSetting: Common.Settings.Setting<any>;
|
|
25
24
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
26
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
-
|
|
26
|
+
readonly #extendGridLinesSetting: Common.Settings.Setting<any>;
|
|
28
27
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
29
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
-
|
|
29
|
+
readonly #showGridAreasSetting: Common.Settings.Setting<any>;
|
|
31
30
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
32
31
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
-
|
|
32
|
+
readonly #showGridTrackSizesSetting: Common.Settings.Setting<any>;
|
|
34
33
|
constructor(model: OverlayModel, flexEnabled: boolean = true) {
|
|
35
|
-
this
|
|
34
|
+
this.#model = model;
|
|
36
35
|
|
|
37
|
-
this
|
|
36
|
+
this.#gridHighlights = new Map();
|
|
38
37
|
|
|
39
|
-
this
|
|
38
|
+
this.#scrollSnapHighlights = new Map();
|
|
40
39
|
|
|
41
|
-
this
|
|
40
|
+
this.#flexHighlights = new Map();
|
|
42
41
|
|
|
43
|
-
this
|
|
42
|
+
this.#containerQueryHighlights = new Map();
|
|
44
43
|
|
|
45
|
-
this
|
|
44
|
+
this.#isolatedElementHighlights = new Map();
|
|
46
45
|
|
|
47
|
-
this
|
|
46
|
+
this.#colors = new Map();
|
|
48
47
|
|
|
49
|
-
this
|
|
50
|
-
this
|
|
51
|
-
this
|
|
48
|
+
this.#gridColorGenerator = new OverlayColorGenerator();
|
|
49
|
+
this.#flexColorGenerator = new OverlayColorGenerator();
|
|
50
|
+
this.#flexEnabled = flexEnabled;
|
|
52
51
|
|
|
53
|
-
this
|
|
54
|
-
this
|
|
55
|
-
this
|
|
56
|
-
this
|
|
57
|
-
this
|
|
58
|
-
this
|
|
59
|
-
this
|
|
60
|
-
this
|
|
52
|
+
this.#showGridLineLabelsSetting = Common.Settings.Settings.instance().moduleSetting('showGridLineLabels');
|
|
53
|
+
this.#showGridLineLabelsSetting.addChangeListener(this.onSettingChange, this);
|
|
54
|
+
this.#extendGridLinesSetting = Common.Settings.Settings.instance().moduleSetting('extendGridLines');
|
|
55
|
+
this.#extendGridLinesSetting.addChangeListener(this.onSettingChange, this);
|
|
56
|
+
this.#showGridAreasSetting = Common.Settings.Settings.instance().moduleSetting('showGridAreas');
|
|
57
|
+
this.#showGridAreasSetting.addChangeListener(this.onSettingChange, this);
|
|
58
|
+
this.#showGridTrackSizesSetting = Common.Settings.Settings.instance().moduleSetting('showGridTrackSizes');
|
|
59
|
+
this.#showGridTrackSizesSetting.addChangeListener(this.onSettingChange, this);
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
private onSettingChange(): void {
|
|
@@ -70,10 +69,10 @@ export class OverlayPersistentHighlighter {
|
|
|
70
69
|
const gapBackground = mainColor.setAlpha(0.3);
|
|
71
70
|
const gapHatch = mainColor.setAlpha(0.8);
|
|
72
71
|
|
|
73
|
-
const showGridExtensionLines = (this
|
|
74
|
-
const showPositiveLineNumbers = this
|
|
72
|
+
const showGridExtensionLines = (this.#extendGridLinesSetting.get() as boolean);
|
|
73
|
+
const showPositiveLineNumbers = this.#showGridLineLabelsSetting.get() === 'lineNumbers';
|
|
75
74
|
const showNegativeLineNumbers = showPositiveLineNumbers;
|
|
76
|
-
const showLineNames = this
|
|
75
|
+
const showLineNames = this.#showGridLineLabelsSetting.get() === 'lineNames';
|
|
77
76
|
return {
|
|
78
77
|
rowGapColor: gapBackground.toProtocolRGBA(),
|
|
79
78
|
rowHatchColor: gapHatch.toProtocolRGBA(),
|
|
@@ -89,8 +88,8 @@ export class OverlayPersistentHighlighter {
|
|
|
89
88
|
showPositiveLineNumbers,
|
|
90
89
|
showNegativeLineNumbers,
|
|
91
90
|
showLineNames,
|
|
92
|
-
showAreaNames: (this
|
|
93
|
-
showTrackSizes: (this
|
|
91
|
+
showAreaNames: (this.#showGridAreasSetting.get() as boolean),
|
|
92
|
+
showTrackSizes: (this.#showGridTrackSizesSetting.get() as boolean),
|
|
94
93
|
areaBorderColor: mainColor.toProtocolRGBA(),
|
|
95
94
|
gridBackgroundColor: background.toProtocolRGBA(),
|
|
96
95
|
};
|
|
@@ -122,95 +121,95 @@ export class OverlayPersistentHighlighter {
|
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
highlightGridInOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
125
|
-
this
|
|
124
|
+
this.#gridHighlights.set(nodeId, this.buildGridHighlightConfig(nodeId));
|
|
126
125
|
this.updateHighlightsInOverlay();
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
isGridHighlighted(nodeId: Protocol.DOM.NodeId): boolean {
|
|
130
|
-
return this
|
|
129
|
+
return this.#gridHighlights.has(nodeId);
|
|
131
130
|
}
|
|
132
131
|
|
|
133
132
|
colorOfGrid(nodeId: Protocol.DOM.NodeId): Common.Color.Color {
|
|
134
|
-
let color = this
|
|
133
|
+
let color = this.#colors.get(nodeId);
|
|
135
134
|
if (!color) {
|
|
136
|
-
color = this
|
|
137
|
-
this
|
|
135
|
+
color = this.#gridColorGenerator.next();
|
|
136
|
+
this.#colors.set(nodeId, color);
|
|
138
137
|
}
|
|
139
138
|
|
|
140
139
|
return color;
|
|
141
140
|
}
|
|
142
141
|
|
|
143
142
|
setColorOfGrid(nodeId: Protocol.DOM.NodeId, color: Common.Color.Color): void {
|
|
144
|
-
this
|
|
143
|
+
this.#colors.set(nodeId, color);
|
|
145
144
|
}
|
|
146
145
|
|
|
147
146
|
hideGridInOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
148
|
-
if (this
|
|
149
|
-
this
|
|
147
|
+
if (this.#gridHighlights.has(nodeId)) {
|
|
148
|
+
this.#gridHighlights.delete(nodeId);
|
|
150
149
|
this.updateHighlightsInOverlay();
|
|
151
150
|
}
|
|
152
151
|
}
|
|
153
152
|
|
|
154
153
|
highlightScrollSnapInOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
155
|
-
this
|
|
154
|
+
this.#scrollSnapHighlights.set(nodeId, this.buildScrollSnapContainerHighlightConfig(nodeId));
|
|
156
155
|
this.updateHighlightsInOverlay();
|
|
157
156
|
}
|
|
158
157
|
|
|
159
158
|
isScrollSnapHighlighted(nodeId: Protocol.DOM.NodeId): boolean {
|
|
160
|
-
return this
|
|
159
|
+
return this.#scrollSnapHighlights.has(nodeId);
|
|
161
160
|
}
|
|
162
161
|
|
|
163
162
|
hideScrollSnapInOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
164
|
-
if (this
|
|
165
|
-
this
|
|
163
|
+
if (this.#scrollSnapHighlights.has(nodeId)) {
|
|
164
|
+
this.#scrollSnapHighlights.delete(nodeId);
|
|
166
165
|
this.updateHighlightsInOverlay();
|
|
167
166
|
}
|
|
168
167
|
}
|
|
169
168
|
|
|
170
169
|
highlightFlexInOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
171
|
-
this
|
|
170
|
+
this.#flexHighlights.set(nodeId, this.buildFlexContainerHighlightConfig(nodeId));
|
|
172
171
|
this.updateHighlightsInOverlay();
|
|
173
172
|
}
|
|
174
173
|
|
|
175
174
|
isFlexHighlighted(nodeId: Protocol.DOM.NodeId): boolean {
|
|
176
|
-
return this
|
|
175
|
+
return this.#flexHighlights.has(nodeId);
|
|
177
176
|
}
|
|
178
177
|
|
|
179
178
|
colorOfFlex(nodeId: Protocol.DOM.NodeId): Common.Color.Color {
|
|
180
|
-
let color = this
|
|
179
|
+
let color = this.#colors.get(nodeId);
|
|
181
180
|
if (!color) {
|
|
182
|
-
color = this
|
|
183
|
-
this
|
|
181
|
+
color = this.#flexColorGenerator.next();
|
|
182
|
+
this.#colors.set(nodeId, color);
|
|
184
183
|
}
|
|
185
184
|
|
|
186
185
|
return color;
|
|
187
186
|
}
|
|
188
187
|
|
|
189
188
|
setColorOfFlex(nodeId: Protocol.DOM.NodeId, color: Common.Color.Color): void {
|
|
190
|
-
this
|
|
189
|
+
this.#colors.set(nodeId, color);
|
|
191
190
|
}
|
|
192
191
|
|
|
193
192
|
hideFlexInOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
194
|
-
if (this
|
|
195
|
-
this
|
|
193
|
+
if (this.#flexHighlights.has(nodeId)) {
|
|
194
|
+
this.#flexHighlights.delete(nodeId);
|
|
196
195
|
this.updateHighlightsInOverlay();
|
|
197
196
|
}
|
|
198
197
|
}
|
|
199
198
|
|
|
200
199
|
highlightContainerQueryInOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
201
|
-
this
|
|
200
|
+
this.#containerQueryHighlights.set(nodeId, this.buildContainerQueryContainerHighlightConfig());
|
|
202
201
|
this.updateHighlightsInOverlay();
|
|
203
202
|
}
|
|
204
203
|
|
|
205
204
|
hideContainerQueryInOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
206
|
-
if (this
|
|
207
|
-
this
|
|
205
|
+
if (this.#containerQueryHighlights.has(nodeId)) {
|
|
206
|
+
this.#containerQueryHighlights.delete(nodeId);
|
|
208
207
|
this.updateHighlightsInOverlay();
|
|
209
208
|
}
|
|
210
209
|
}
|
|
211
210
|
|
|
212
211
|
isContainerQueryHighlighted(nodeId: Protocol.DOM.NodeId): boolean {
|
|
213
|
-
return this
|
|
212
|
+
return this.#containerQueryHighlights.has(nodeId);
|
|
214
213
|
}
|
|
215
214
|
|
|
216
215
|
private buildContainerQueryContainerHighlightConfig(): Protocol.Overlay.ContainerQueryContainerHighlightConfig {
|
|
@@ -227,19 +226,19 @@ export class OverlayPersistentHighlighter {
|
|
|
227
226
|
}
|
|
228
227
|
|
|
229
228
|
highlightIsolatedElementInOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
230
|
-
this
|
|
229
|
+
this.#isolatedElementHighlights.set(nodeId, this.buildIsolationModeHighlightConfig());
|
|
231
230
|
this.updateHighlightsInOverlay();
|
|
232
231
|
}
|
|
233
232
|
|
|
234
233
|
hideIsolatedElementInOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
235
|
-
if (this
|
|
236
|
-
this
|
|
234
|
+
if (this.#isolatedElementHighlights.has(nodeId)) {
|
|
235
|
+
this.#isolatedElementHighlights.delete(nodeId);
|
|
237
236
|
this.updateHighlightsInOverlay();
|
|
238
237
|
}
|
|
239
238
|
}
|
|
240
239
|
|
|
241
240
|
isIsolatedElementHighlighted(nodeId: Protocol.DOM.NodeId): boolean {
|
|
242
|
-
return this
|
|
241
|
+
return this.#isolatedElementHighlights.has(nodeId);
|
|
243
242
|
}
|
|
244
243
|
|
|
245
244
|
private buildIsolationModeHighlightConfig(): Protocol.Overlay.IsolationModeHighlightConfig {
|
|
@@ -251,20 +250,20 @@ export class OverlayPersistentHighlighter {
|
|
|
251
250
|
}
|
|
252
251
|
|
|
253
252
|
hideAllInOverlay(): void {
|
|
254
|
-
this
|
|
255
|
-
this
|
|
256
|
-
this
|
|
257
|
-
this
|
|
258
|
-
this
|
|
253
|
+
this.#flexHighlights.clear();
|
|
254
|
+
this.#gridHighlights.clear();
|
|
255
|
+
this.#scrollSnapHighlights.clear();
|
|
256
|
+
this.#containerQueryHighlights.clear();
|
|
257
|
+
this.#isolatedElementHighlights.clear();
|
|
259
258
|
this.updateHighlightsInOverlay();
|
|
260
259
|
}
|
|
261
260
|
|
|
262
261
|
refreshHighlights(): void {
|
|
263
|
-
const gridsNeedUpdate = this.updateHighlightsForDeletedNodes(this
|
|
264
|
-
const flexboxesNeedUpdate = this.updateHighlightsForDeletedNodes(this
|
|
265
|
-
const scrollSnapsNeedUpdate = this.updateHighlightsForDeletedNodes(this
|
|
266
|
-
const containerQueriesNeedUpdate = this.updateHighlightsForDeletedNodes(this
|
|
267
|
-
const isolatedElementsNeedUpdate = this.updateHighlightsForDeletedNodes(this
|
|
262
|
+
const gridsNeedUpdate = this.updateHighlightsForDeletedNodes(this.#gridHighlights);
|
|
263
|
+
const flexboxesNeedUpdate = this.updateHighlightsForDeletedNodes(this.#flexHighlights);
|
|
264
|
+
const scrollSnapsNeedUpdate = this.updateHighlightsForDeletedNodes(this.#scrollSnapHighlights);
|
|
265
|
+
const containerQueriesNeedUpdate = this.updateHighlightsForDeletedNodes(this.#containerQueryHighlights);
|
|
266
|
+
const isolatedElementsNeedUpdate = this.updateHighlightsForDeletedNodes(this.#isolatedElementHighlights);
|
|
268
267
|
if (flexboxesNeedUpdate || gridsNeedUpdate || scrollSnapsNeedUpdate || containerQueriesNeedUpdate ||
|
|
269
268
|
isolatedElementsNeedUpdate) {
|
|
270
269
|
this.updateHighlightsInOverlay();
|
|
@@ -274,7 +273,7 @@ export class OverlayPersistentHighlighter {
|
|
|
274
273
|
private updateHighlightsForDeletedNodes(highlights: Map<Protocol.DOM.NodeId, unknown>): boolean {
|
|
275
274
|
let needsUpdate = false;
|
|
276
275
|
for (const nodeId of highlights.keys()) {
|
|
277
|
-
if (this
|
|
276
|
+
if (this.#model.getDOMModel().nodeForId(nodeId) === null) {
|
|
278
277
|
highlights.delete(nodeId);
|
|
279
278
|
needsUpdate = true;
|
|
280
279
|
}
|
|
@@ -283,28 +282,28 @@ export class OverlayPersistentHighlighter {
|
|
|
283
282
|
}
|
|
284
283
|
|
|
285
284
|
resetOverlay(): void {
|
|
286
|
-
for (const nodeId of this
|
|
287
|
-
this
|
|
285
|
+
for (const nodeId of this.#gridHighlights.keys()) {
|
|
286
|
+
this.#gridHighlights.set(nodeId, this.buildGridHighlightConfig(nodeId));
|
|
288
287
|
}
|
|
289
|
-
for (const nodeId of this
|
|
290
|
-
this
|
|
288
|
+
for (const nodeId of this.#flexHighlights.keys()) {
|
|
289
|
+
this.#flexHighlights.set(nodeId, this.buildFlexContainerHighlightConfig(nodeId));
|
|
291
290
|
}
|
|
292
|
-
for (const nodeId of this
|
|
293
|
-
this
|
|
291
|
+
for (const nodeId of this.#scrollSnapHighlights.keys()) {
|
|
292
|
+
this.#scrollSnapHighlights.set(nodeId, this.buildScrollSnapContainerHighlightConfig(nodeId));
|
|
294
293
|
}
|
|
295
|
-
for (const nodeId of this
|
|
296
|
-
this
|
|
294
|
+
for (const nodeId of this.#containerQueryHighlights.keys()) {
|
|
295
|
+
this.#containerQueryHighlights.set(nodeId, this.buildContainerQueryContainerHighlightConfig());
|
|
297
296
|
}
|
|
298
|
-
for (const nodeId of this
|
|
299
|
-
this
|
|
297
|
+
for (const nodeId of this.#isolatedElementHighlights.keys()) {
|
|
298
|
+
this.#isolatedElementHighlights.set(nodeId, this.buildIsolationModeHighlightConfig());
|
|
300
299
|
}
|
|
301
300
|
this.updateHighlightsInOverlay();
|
|
302
301
|
}
|
|
303
302
|
|
|
304
303
|
private updateHighlightsInOverlay(): void {
|
|
305
|
-
const hasNodesToHighlight = this
|
|
306
|
-
this
|
|
307
|
-
this
|
|
304
|
+
const hasNodesToHighlight = this.#gridHighlights.size > 0 || this.#flexHighlights.size > 0 ||
|
|
305
|
+
this.#containerQueryHighlights.size > 0 || this.#isolatedElementHighlights.size > 0;
|
|
306
|
+
this.#model.setShowViewportSizeOnResize(!hasNodesToHighlight);
|
|
308
307
|
this.updateGridHighlightsInOverlay();
|
|
309
308
|
this.updateFlexHighlightsInOverlay();
|
|
310
309
|
this.updateScrollSnapHighlightsInOverlay();
|
|
@@ -313,48 +312,48 @@ export class OverlayPersistentHighlighter {
|
|
|
313
312
|
}
|
|
314
313
|
|
|
315
314
|
private updateGridHighlightsInOverlay(): void {
|
|
316
|
-
const overlayModel = this
|
|
315
|
+
const overlayModel = this.#model;
|
|
317
316
|
const gridNodeHighlightConfigs = [];
|
|
318
|
-
for (const [nodeId, gridHighlightConfig] of this
|
|
317
|
+
for (const [nodeId, gridHighlightConfig] of this.#gridHighlights.entries()) {
|
|
319
318
|
gridNodeHighlightConfigs.push({nodeId, gridHighlightConfig});
|
|
320
319
|
}
|
|
321
320
|
overlayModel.target().overlayAgent().invoke_setShowGridOverlays({gridNodeHighlightConfigs});
|
|
322
321
|
}
|
|
323
322
|
|
|
324
323
|
private updateFlexHighlightsInOverlay(): void {
|
|
325
|
-
if (!this
|
|
324
|
+
if (!this.#flexEnabled) {
|
|
326
325
|
return;
|
|
327
326
|
}
|
|
328
|
-
const overlayModel = this
|
|
327
|
+
const overlayModel = this.#model;
|
|
329
328
|
const flexNodeHighlightConfigs = [];
|
|
330
|
-
for (const [nodeId, flexContainerHighlightConfig] of this
|
|
329
|
+
for (const [nodeId, flexContainerHighlightConfig] of this.#flexHighlights.entries()) {
|
|
331
330
|
flexNodeHighlightConfigs.push({nodeId, flexContainerHighlightConfig});
|
|
332
331
|
}
|
|
333
332
|
overlayModel.target().overlayAgent().invoke_setShowFlexOverlays({flexNodeHighlightConfigs});
|
|
334
333
|
}
|
|
335
334
|
|
|
336
335
|
private updateScrollSnapHighlightsInOverlay(): void {
|
|
337
|
-
const overlayModel = this
|
|
336
|
+
const overlayModel = this.#model;
|
|
338
337
|
const scrollSnapHighlightConfigs = [];
|
|
339
|
-
for (const [nodeId, scrollSnapContainerHighlightConfig] of this
|
|
338
|
+
for (const [nodeId, scrollSnapContainerHighlightConfig] of this.#scrollSnapHighlights.entries()) {
|
|
340
339
|
scrollSnapHighlightConfigs.push({nodeId, scrollSnapContainerHighlightConfig});
|
|
341
340
|
}
|
|
342
341
|
overlayModel.target().overlayAgent().invoke_setShowScrollSnapOverlays({scrollSnapHighlightConfigs});
|
|
343
342
|
}
|
|
344
343
|
|
|
345
344
|
updateContainerQueryHighlightsInOverlay(): void {
|
|
346
|
-
const overlayModel = this
|
|
345
|
+
const overlayModel = this.#model;
|
|
347
346
|
const containerQueryHighlightConfigs = [];
|
|
348
|
-
for (const [nodeId, containerQueryContainerHighlightConfig] of this
|
|
347
|
+
for (const [nodeId, containerQueryContainerHighlightConfig] of this.#containerQueryHighlights.entries()) {
|
|
349
348
|
containerQueryHighlightConfigs.push({nodeId, containerQueryContainerHighlightConfig});
|
|
350
349
|
}
|
|
351
350
|
overlayModel.target().overlayAgent().invoke_setShowContainerQueryOverlays({containerQueryHighlightConfigs});
|
|
352
351
|
}
|
|
353
352
|
|
|
354
353
|
updateIsolatedElementHighlightsInOverlay(): void {
|
|
355
|
-
const overlayModel = this
|
|
354
|
+
const overlayModel = this.#model;
|
|
356
355
|
const isolatedElementHighlightConfigs = [];
|
|
357
|
-
for (const [nodeId, isolationModeHighlightConfig] of this
|
|
356
|
+
for (const [nodeId, isolationModeHighlightConfig] of this.#isolatedElementHighlights.entries()) {
|
|
358
357
|
isolatedElementHighlightConfigs.push({nodeId, isolationModeHighlightConfig});
|
|
359
358
|
}
|
|
360
359
|
overlayModel.target().overlayAgent().invoke_setShowIsolatedElements({isolatedElementHighlightConfigs});
|
|
@@ -60,16 +60,16 @@ interface LoadQueueEntry {
|
|
|
60
60
|
* resources were loaded, and whether there was a load error.
|
|
61
61
|
*/
|
|
62
62
|
export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
#currentlyLoading: number;
|
|
64
|
+
readonly #maxConcurrentLoads: number;
|
|
65
|
+
readonly #pageResources: Map<string, PageResource>;
|
|
66
|
+
#queuedLoads: LoadQueueEntry[];
|
|
67
|
+
readonly #loadOverride: ((arg0: string) => Promise<{
|
|
68
|
+
success: boolean,
|
|
69
|
+
content: string,
|
|
70
|
+
errorDescription: Host.ResourceLoader.LoadErrorDescription,
|
|
71
|
+
}>)|null;
|
|
72
|
+
readonly #loadTimeout: number;
|
|
73
73
|
constructor(
|
|
74
74
|
loadOverride: ((arg0: string) => Promise<{
|
|
75
75
|
success: boolean,
|
|
@@ -78,14 +78,14 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
78
78
|
}>)|null,
|
|
79
79
|
maxConcurrentLoads: number, loadTimeout: number) {
|
|
80
80
|
super();
|
|
81
|
-
this
|
|
82
|
-
this
|
|
83
|
-
this
|
|
84
|
-
this
|
|
81
|
+
this.#currentlyLoading = 0;
|
|
82
|
+
this.#maxConcurrentLoads = maxConcurrentLoads;
|
|
83
|
+
this.#pageResources = new Map();
|
|
84
|
+
this.#queuedLoads = [];
|
|
85
85
|
TargetManager.instance().addModelListener(
|
|
86
86
|
ResourceTreeModel, ResourceTreeModelEvents.MainFrameNavigated, this.onMainFrameNavigated, this);
|
|
87
|
-
this
|
|
88
|
-
this
|
|
87
|
+
this.#loadOverride = loadOverride;
|
|
88
|
+
this.#loadTimeout = loadTimeout;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
static instance({forceNew, loadOverride, maxConcurrentLoads, loadTimeout}: {
|
|
@@ -115,16 +115,16 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
115
115
|
if (!mainFrame.isTopFrame()) {
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
for (const {reject} of this
|
|
118
|
+
for (const {reject} of this.#queuedLoads) {
|
|
119
119
|
reject(new Error(i18nString(UIStrings.loadCanceledDueToReloadOf)));
|
|
120
120
|
}
|
|
121
|
-
this
|
|
122
|
-
this
|
|
121
|
+
this.#queuedLoads = [];
|
|
122
|
+
this.#pageResources.clear();
|
|
123
123
|
this.dispatchEventToListeners(Events.Update);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
getResourcesLoaded(): Map<string, PageResource> {
|
|
127
|
-
return this
|
|
127
|
+
return this.#pageResources;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/**
|
|
@@ -137,25 +137,25 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
137
137
|
queued: number,
|
|
138
138
|
resources: number,
|
|
139
139
|
} {
|
|
140
|
-
return {loading: this
|
|
140
|
+
return {loading: this.#currentlyLoading, queued: this.#queuedLoads.length, resources: this.#pageResources.size};
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
private async acquireLoadSlot(): Promise<void> {
|
|
144
|
-
this
|
|
145
|
-
if (this
|
|
144
|
+
this.#currentlyLoading++;
|
|
145
|
+
if (this.#currentlyLoading > this.#maxConcurrentLoads) {
|
|
146
146
|
const entry: LoadQueueEntry = {resolve: (): void => {}, reject: (): void => {}};
|
|
147
147
|
const waitForCapacity = new Promise<void>((resolve, reject) => {
|
|
148
148
|
entry.resolve = resolve;
|
|
149
149
|
entry.reject = reject;
|
|
150
150
|
});
|
|
151
|
-
this
|
|
151
|
+
this.#queuedLoads.push(entry);
|
|
152
152
|
await waitForCapacity;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
private releaseLoadSlot(): void {
|
|
157
|
-
this
|
|
158
|
-
const entry = this
|
|
157
|
+
this.#currentlyLoading--;
|
|
158
|
+
const entry = this.#queuedLoads.shift();
|
|
159
159
|
if (entry) {
|
|
160
160
|
entry.resolve();
|
|
161
161
|
}
|
|
@@ -182,12 +182,12 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
182
182
|
}> {
|
|
183
183
|
const key = PageResourceLoader.makeKey(url, initiator);
|
|
184
184
|
const pageResource: PageResource = {success: null, size: null, errorMessage: undefined, url, initiator};
|
|
185
|
-
this
|
|
185
|
+
this.#pageResources.set(key, pageResource);
|
|
186
186
|
this.dispatchEventToListeners(Events.Update);
|
|
187
187
|
try {
|
|
188
188
|
await this.acquireLoadSlot();
|
|
189
189
|
const resultPromise = this.dispatchLoad(url, initiator);
|
|
190
|
-
const result = await PageResourceLoader.withTimeout(resultPromise, this
|
|
190
|
+
const result = await PageResourceLoader.withTimeout(resultPromise, this.#loadTimeout);
|
|
191
191
|
pageResource.errorMessage = result.errorDescription.message;
|
|
192
192
|
pageResource.success = result.success;
|
|
193
193
|
if (result.success) {
|
|
@@ -215,8 +215,8 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
215
215
|
errorDescription: Host.ResourceLoader.LoadErrorDescription,
|
|
216
216
|
}> {
|
|
217
217
|
let failureReason: string|null = null;
|
|
218
|
-
if (this
|
|
219
|
-
return this
|
|
218
|
+
if (this.#loadOverride) {
|
|
219
|
+
return this.#loadOverride(url);
|
|
220
220
|
}
|
|
221
221
|
const parsedURL = new Common.ParsedURL.ParsedURL(url);
|
|
222
222
|
const eligibleForLoadFromTarget = getLoadThroughTargetSetting().get() && parsedURL && parsedURL.isHttpOrHttps();
|
|
@@ -60,43 +60,43 @@ export class PaintProfilerModel extends SDKModel<void> {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
export class PaintProfilerSnapshot {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
readonly #paintProfilerModel: PaintProfilerModel;
|
|
64
|
+
readonly #id: Protocol.LayerTree.SnapshotId;
|
|
65
|
+
#refCount: number;
|
|
66
66
|
|
|
67
67
|
constructor(paintProfilerModel: PaintProfilerModel, snapshotId: Protocol.LayerTree.SnapshotId) {
|
|
68
|
-
this
|
|
69
|
-
this
|
|
70
|
-
this
|
|
68
|
+
this.#paintProfilerModel = paintProfilerModel;
|
|
69
|
+
this.#id = snapshotId;
|
|
70
|
+
this.#refCount = 1;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
release(): void {
|
|
74
|
-
console.assert(this
|
|
75
|
-
if (!--this
|
|
76
|
-
this
|
|
74
|
+
console.assert(this.#refCount > 0, 'release is already called on the object');
|
|
75
|
+
if (!--this.#refCount) {
|
|
76
|
+
this.#paintProfilerModel.layerTreeAgent.invoke_releaseSnapshot({snapshotId: this.#id});
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
addReference(): void {
|
|
81
|
-
++this
|
|
82
|
-
console.assert(this
|
|
81
|
+
++this.#refCount;
|
|
82
|
+
console.assert(this.#refCount > 0, 'Referencing a dead object');
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
async replay(scale?: number, fromStep?: number, toStep?: number): Promise<string|null> {
|
|
86
|
-
const response = await this
|
|
87
|
-
{snapshotId: this
|
|
86
|
+
const response = await this.#paintProfilerModel.layerTreeAgent.invoke_replaySnapshot(
|
|
87
|
+
{snapshotId: this.#id, fromStep, toStep, scale: scale || 1.0});
|
|
88
88
|
return response.dataURL;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
async profile(clipRect: Protocol.DOM.Rect|null): Promise<Protocol.LayerTree.PaintProfile[]> {
|
|
92
|
-
const response = await this
|
|
93
|
-
{snapshotId: this
|
|
92
|
+
const response = await this.#paintProfilerModel.layerTreeAgent.invoke_profileSnapshot(
|
|
93
|
+
{snapshotId: this.#id, minRepeatCount: 5, minDuration: 1, clipRect: clipRect || undefined});
|
|
94
94
|
|
|
95
95
|
return response.timings;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
async commandLog(): Promise<PaintProfilerLogItem[]|null> {
|
|
99
|
-
const response = await this
|
|
99
|
+
const response = await this.#paintProfilerModel.layerTreeAgent.invoke_snapshotCommandLog({snapshotId: this.#id});
|
|
100
100
|
|
|
101
101
|
return response.commandLog ? response.commandLog.map((entry, index) => new PaintProfilerLogItem(entry, index)) :
|
|
102
102
|
null;
|
|
@@ -10,18 +10,18 @@ import {Capability} from './Target.js';
|
|
|
10
10
|
import {SDKModel} from './SDKModel.js';
|
|
11
11
|
|
|
12
12
|
export class PerformanceMetricsModel extends SDKModel<void> {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
readonly #agent: ProtocolProxyApi.PerformanceApi;
|
|
14
|
+
readonly #metricModes: Map<string, MetricMode>;
|
|
15
|
+
readonly #metricData: Map<string, {
|
|
16
16
|
lastValue: (number | undefined),
|
|
17
17
|
lastTimestamp: (number|undefined),
|
|
18
18
|
}>;
|
|
19
19
|
|
|
20
20
|
constructor(target: Target) {
|
|
21
21
|
super(target);
|
|
22
|
-
this
|
|
22
|
+
this.#agent = target.performanceAgent();
|
|
23
23
|
|
|
24
|
-
this
|
|
24
|
+
this.#metricModes = new Map([
|
|
25
25
|
['TaskDuration', MetricMode.CumulativeTime],
|
|
26
26
|
['ScriptDuration', MetricMode.CumulativeTime],
|
|
27
27
|
['LayoutDuration', MetricMode.CumulativeTime],
|
|
@@ -30,32 +30,32 @@ export class PerformanceMetricsModel extends SDKModel<void> {
|
|
|
30
30
|
['RecalcStyleCount', MetricMode.CumulativeCount],
|
|
31
31
|
]);
|
|
32
32
|
|
|
33
|
-
this
|
|
33
|
+
this.#metricData = new Map();
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
enable(): Promise<Object> {
|
|
37
|
-
return this
|
|
37
|
+
return this.#agent.invoke_enable({});
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
disable(): Promise<Object> {
|
|
41
|
-
return this
|
|
41
|
+
return this.#agent.invoke_disable();
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
async requestMetrics(): Promise<{
|
|
45
45
|
metrics: Map<string, number>,
|
|
46
46
|
timestamp: number,
|
|
47
47
|
}> {
|
|
48
|
-
const rawMetrics = await this
|
|
48
|
+
const rawMetrics = await this.#agent.invoke_getMetrics() || [];
|
|
49
49
|
const metrics = new Map<string, number>();
|
|
50
50
|
const timestamp = performance.now();
|
|
51
51
|
for (const metric of rawMetrics.metrics) {
|
|
52
|
-
let data = this
|
|
52
|
+
let data = this.#metricData.get(metric.name);
|
|
53
53
|
if (!data) {
|
|
54
54
|
data = {lastValue: undefined, lastTimestamp: undefined};
|
|
55
|
-
this
|
|
55
|
+
this.#metricData.set(metric.name, data);
|
|
56
56
|
}
|
|
57
57
|
let value;
|
|
58
|
-
switch (this
|
|
58
|
+
switch (this.#metricModes.get(metric.name)) {
|
|
59
59
|
case MetricMode.CumulativeTime:
|
|
60
60
|
value = (data.lastTimestamp && data.lastValue) ?
|
|
61
61
|
Platform.NumberUtilities.clamp(
|