chrome-devtools-frontend 1.0.951410 → 1.0.952713
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/config/gni/devtools_grd_files.gni +3 -0
- package/extension-api/ExtensionAPI.d.ts +1 -1
- package/front_end/.eslintrc.js +6 -0
- package/front_end/Tests.js +10 -0
- package/front_end/core/common/App.ts +0 -3
- package/front_end/core/common/AppProvider.ts +0 -3
- package/front_end/core/common/JavaScriptMetaData.ts +0 -3
- package/front_end/core/common/QueryParamHandler.ts +0 -3
- package/front_end/core/common/Runnable.ts +0 -3
- package/front_end/core/common/SimpleHistoryManager.ts +0 -3
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/locales/en-US.json +3 -0
- package/front_end/core/i18n/locales/en-XL.json +3 -0
- package/front_end/core/root/Runtime.ts +4 -12
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +0 -12
- package/front_end/core/sdk/PageResourceLoader.ts +2 -1
- package/front_end/core/sdk/TracingManager.ts +0 -3
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +39 -39
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +54 -54
- package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +20 -20
- package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +54 -54
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +145 -144
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +40 -40
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +64 -69
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +203 -203
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +109 -108
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +17 -17
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +30 -30
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +25 -25
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +52 -55
- package/front_end/entrypoints/main/MainImpl.ts +49 -49
- package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +43 -43
- package/front_end/entrypoints/node_app/NodeMain.ts +38 -38
- package/front_end/generated/InspectorBackendCommands.js +5 -1
- package/front_end/generated/protocol.d.ts +16 -0
- package/front_end/legacy/legacy-defs.d.ts +0 -21
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +0 -3
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -3
- package/front_end/models/bindings/FileUtils.ts +0 -3
- package/front_end/models/extensions/ExtensionAPI.ts +2 -1
- package/front_end/models/extensions/ExtensionTraceProvider.ts +0 -3
- package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +1 -1
- package/front_end/models/issues_manager/ClientHintIssue.ts +95 -0
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +6 -6
- package/front_end/models/issues_manager/ContrastCheckTrigger.ts +15 -15
- package/front_end/models/issues_manager/CorsIssue.ts +9 -9
- package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -5
- package/front_end/models/issues_manager/DeprecationIssue.ts +7 -7
- package/front_end/models/issues_manager/GenericIssue.ts +5 -5
- package/front_end/models/issues_manager/HeavyAdIssue.ts +5 -5
- package/front_end/models/issues_manager/Issue.ts +10 -10
- package/front_end/models/issues_manager/IssueResolver.ts +11 -10
- package/front_end/models/issues_manager/IssuesManager.ts +61 -56
- package/front_end/models/issues_manager/LowTextContrastIssue.ts +4 -4
- package/front_end/models/issues_manager/MixedContentIssue.ts +7 -7
- package/front_end/models/issues_manager/NavigatorUserAgentIssue.ts +7 -7
- package/front_end/models/issues_manager/QuirksModeIssue.ts +4 -4
- package/front_end/models/issues_manager/SameSiteCookieIssue.ts +16 -16
- package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +5 -5
- package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +32 -31
- package/front_end/models/issues_manager/TrustedWebActivityIssue.ts +5 -5
- package/front_end/models/issues_manager/WasmCrossOriginModuleSharingIssue.ts +5 -5
- package/front_end/models/issues_manager/descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/front_end/models/issues_manager/descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/timeline_model/TimelineModel.ts +1 -1
- package/front_end/panels/application/components/BackForwardCacheView.ts +33 -33
- package/front_end/panels/application/components/EndpointsGrid.ts +12 -12
- package/front_end/panels/application/components/FrameDetailsView.ts +108 -110
- package/front_end/panels/application/components/OriginTrialTreeView.ts +45 -45
- package/front_end/panels/application/components/PermissionsPolicySection.ts +19 -19
- package/front_end/panels/application/components/ReportsGrid.ts +30 -30
- package/front_end/panels/application/components/StackTrace.ts +48 -47
- package/front_end/panels/application/components/TrustTokensView.ts +31 -31
- package/front_end/panels/console/ConsoleView.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -25
- package/front_end/panels/console/consoleView.css +5 -0
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +41 -52
- package/front_end/panels/css_overview/CSSOverviewController.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +18 -27
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +6 -6
- package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +4 -4
- package/front_end/panels/elements/ElementsTreeElement.ts +2 -6
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +17 -17
- package/front_end/panels/elements/components/AdornerManager.ts +21 -21
- package/front_end/panels/elements/components/AdornerSettingsPane.ts +14 -14
- package/front_end/panels/elements/components/CSSQuery.ts +16 -16
- package/front_end/panels/elements/components/ComputedStyleProperty.ts +14 -14
- package/front_end/panels/elements/components/ComputedStyleTrace.ts +15 -15
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +78 -78
- package/front_end/panels/elements/components/ElementsPanelLink.ts +16 -16
- package/front_end/panels/elements/components/LayoutPane.ts +47 -47
- package/front_end/panels/elements/components/NodeText.ts +18 -18
- package/front_end/panels/elements/components/QueryContainer.ts +40 -40
- package/front_end/panels/elements/components/StylePropertyEditor.ts +18 -18
- package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +4 -4
- package/front_end/panels/event_listeners/EventListenersUtils.ts +2 -1
- package/front_end/panels/issues/AffectedBlockedByResponseView.ts +4 -4
- package/front_end/panels/issues/AffectedCookiesView.ts +4 -5
- package/front_end/panels/issues/AffectedDirectivesView.ts +19 -19
- package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +7 -8
- package/front_end/panels/issues/AffectedElementsView.ts +4 -4
- package/front_end/panels/issues/AffectedElementsWithLowContrastView.ts +7 -8
- package/front_end/panels/issues/AffectedHeavyAdView.ts +8 -8
- package/front_end/panels/issues/AffectedResourcesView.ts +25 -26
- package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +8 -8
- package/front_end/panels/issues/AffectedSourcesView.ts +4 -4
- package/front_end/panels/issues/AffectedTrustedWebActivityIssueDetailsView.ts +4 -4
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +17 -17
- package/front_end/panels/issues/CSPViolationsListView.ts +22 -23
- package/front_end/panels/issues/CSPViolationsView.ts +17 -17
- package/front_end/panels/issues/ComboBoxOfCheckBoxes.ts +13 -13
- package/front_end/panels/issues/CorsIssueDetailsView.ts +23 -23
- package/front_end/panels/issues/GenericIssueDetailsView.ts +4 -4
- package/front_end/panels/issues/HiddenIssuesRow.ts +7 -7
- package/front_end/panels/issues/IssueAggregator.ts +95 -95
- package/front_end/panels/issues/IssueKindView.ts +14 -14
- package/front_end/panels/issues/IssueView.ts +98 -98
- package/front_end/panels/issues/IssuesPane.ts +102 -102
- package/front_end/panels/issues/WasmCrossOriginModuleSharingAffectedResourcesView.ts +5 -5
- package/front_end/panels/issues/components/HideIssuesMenu.ts +10 -10
- package/front_end/panels/media/PlayerListView.ts +160 -97
- package/front_end/panels/media/PlayerMessagesView.ts +1 -0
- package/front_end/panels/media/playerListView.css +58 -0
- package/front_end/panels/network/NetworkLogView.ts +2 -6
- package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -4
- package/front_end/panels/network/components/RequestTrustTokensView.ts +40 -40
- package/front_end/panels/network/components/WebBundleInfoView.ts +9 -9
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +92 -37
- package/front_end/panels/performance_monitor/performanceMonitor.css +32 -0
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
- package/front_end/panels/search/SearchConfig.ts +0 -6
- package/front_end/panels/settings/KeybindsSettingsTab.ts +4 -0
- package/front_end/panels/settings/components/SyncSection.ts +14 -14
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +96 -96
- package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
- package/front_end/panels/sources/NavigatorView.ts +3 -9
- package/front_end/panels/sources/SourceMapNamesResolver.ts +3 -3
- package/front_end/panels/sources/SourcesPanel.ts +1 -3
- package/front_end/panels/sources/SourcesView.ts +0 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +0 -3
- package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
- package/front_end/panels/timeline/TimelineLoader.ts +0 -3
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -1
- package/front_end/panels/timeline/components/WebVitalsLane.ts +77 -76
- package/front_end/panels/timeline/components/WebVitalsTimeline.ts +133 -133
- package/front_end/panels/timeline/components/WebVitalsTooltip.ts +9 -9
- package/front_end/panels/webauthn/WebauthnPane.ts +203 -205
- package/front_end/third_party/codemirror.next/bundle.ts +3 -3
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +10 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +2 -1
- package/front_end/third_party/codemirror.next/package.json +3 -3
- package/front_end/third_party/diff/DiffWrapper.ts +7 -0
- package/front_end/ui/components/adorners/Adorner.ts +2 -2
- package/front_end/ui/components/buttons/Button.ts +9 -9
- package/front_end/ui/components/data_grid/DataGrid.ts +64 -64
- package/front_end/ui/components/data_grid/DataGridController.ts +22 -22
- package/front_end/ui/components/data_grid/DataGridUtils.ts +3 -0
- package/front_end/ui/components/diff_view/DiffView.ts +6 -6
- package/front_end/ui/components/expandable_list/ExpandableList.ts +5 -5
- package/front_end/ui/components/icon_button/Icon.ts +4 -4
- package/front_end/ui/components/icon_button/IconButton.ts +4 -4
- package/front_end/ui/components/issue_counter/IssueCounter.ts +3 -3
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +11 -11
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +50 -50
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +6 -6
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +4 -4
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +12 -12
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +11 -11
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +40 -39
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +18 -18
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +4 -4
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +5 -5
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +2 -2
- package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +2 -2
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +2 -2
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +4 -4
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +22 -22
- package/front_end/ui/components/report_view/ReportView.ts +16 -16
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +14 -14
- package/front_end/ui/components/settings/SettingCheckbox.ts +5 -5
- package/front_end/ui/components/survey_link/SurveyLink.ts +8 -8
- package/front_end/ui/components/text_editor/TextEditor.ts +9 -9
- package/front_end/ui/components/text_editor/cursor_tooltip.ts +7 -1
- package/front_end/ui/components/text_prompt/TextPrompt.ts +18 -18
- package/front_end/ui/components/tree_outline/TreeOutline.ts +69 -70
- package/front_end/ui/legacy/ContextFlavorListener.ts +0 -4
- package/front_end/ui/legacy/SearchableView.ts +13 -4
- package/front_end/ui/legacy/SuggestBox.ts +0 -3
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +6 -6
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +0 -3
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +13 -12
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +2 -2
- package/front_end/ui/legacy/themeColors.css +2 -0
- package/front_end/ui/legacy/theme_support/theme_support_impl.ts +34 -7
- package/package.json +1 -1
- package/scripts/eslint_rules/lib/use_private_class_members.js +41 -0
- package/scripts/eslint_rules/tests/use_private_class_members_test.js +62 -0
- package/scripts/migration/class-fields/migrate.js +2 -3
- package/scripts/migration/class-fields/migrate.sh +1 -3
- package/scripts/migration/class-fields/package.json +1 -1
- package/config/gni/all_devtools_files.gni +0 -255
- package/scripts/build/devtools_file_hashes.py +0 -82
- package/scripts/devtools_run/devtools_run_cli +0 -49
- package/scripts/devtools_run/package.json +0 -13
- package/scripts/unzip.py +0 -20
- package/scripts/visualize_deps/jquery_svg.html +0 -57
- package/scripts/visualize_deps/run_visualize.js +0 -119
|
@@ -183,66 +183,66 @@ const DEFAULT_METADATA = {
|
|
|
183
183
|
// eslint-disable-next-line rulesdir/custom_element_definitions_location
|
|
184
184
|
export class UserAgentClientHintsForm extends HTMLElement {
|
|
185
185
|
static readonly litTagName = LitHtml.literal`devtools-user-agent-client-hints-form`;
|
|
186
|
-
|
|
186
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
187
187
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
#isFormOpened: boolean = false;
|
|
189
|
+
#isFormDisabled: boolean = false;
|
|
190
|
+
#metaData: Protocol.Emulation.UserAgentMetadata = DEFAULT_METADATA;
|
|
191
|
+
#showMobileCheckbox: boolean = false;
|
|
192
|
+
#showSubmitButton: boolean = false;
|
|
193
|
+
#brandsModifiedAriaMessage: string = '';
|
|
194
194
|
|
|
195
195
|
connectedCallback(): void {
|
|
196
|
-
this
|
|
196
|
+
this.#shadow.adoptedStyleSheets = [userAgentClientHintsFormStyles];
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
set value(data: UserAgentClientHintsFormData) {
|
|
200
200
|
const {metaData = DEFAULT_METADATA, showMobileCheckbox = false, showSubmitButton = false} = data;
|
|
201
|
-
this
|
|
202
|
-
...this
|
|
201
|
+
this.#metaData = {
|
|
202
|
+
...this.#metaData,
|
|
203
203
|
...metaData,
|
|
204
204
|
};
|
|
205
|
-
this
|
|
206
|
-
this
|
|
207
|
-
this
|
|
205
|
+
this.#showMobileCheckbox = showMobileCheckbox;
|
|
206
|
+
this.#showSubmitButton = showSubmitButton;
|
|
207
|
+
this.#render();
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
get value(): UserAgentClientHintsFormData {
|
|
211
211
|
return {
|
|
212
|
-
metaData: this
|
|
212
|
+
metaData: this.#metaData,
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
set disabled(disableForm: boolean) {
|
|
217
|
-
this
|
|
218
|
-
this
|
|
219
|
-
this
|
|
217
|
+
this.#isFormDisabled = disableForm;
|
|
218
|
+
this.#isFormOpened = false;
|
|
219
|
+
this.#render();
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
get disabled(): boolean {
|
|
223
|
-
return this
|
|
223
|
+
return this.#isFormDisabled;
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
#handleTreeExpand = (event: KeyboardEvent): void => {
|
|
227
227
|
if (event.code === 'Space' || event.code === 'Enter' || event.code === 'ArrowLeft' || event.code === 'ArrowRight') {
|
|
228
228
|
event.stopPropagation();
|
|
229
|
-
this
|
|
229
|
+
this.#handleTreeClick(event.code);
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
232
|
|
|
233
|
-
|
|
234
|
-
if (this
|
|
233
|
+
#handleTreeClick = (key: string): void => {
|
|
234
|
+
if (this.#isFormDisabled) {
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
|
-
if ((key === 'ArrowLeft' && !this
|
|
237
|
+
if ((key === 'ArrowLeft' && !this.#isFormOpened) || (key === 'ArrowRight' && this.#isFormOpened)) {
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
|
-
this
|
|
241
|
-
this
|
|
240
|
+
this.#isFormOpened = !this.#isFormOpened;
|
|
241
|
+
this.#render();
|
|
242
242
|
};
|
|
243
243
|
|
|
244
|
-
|
|
245
|
-
const updatedBrands = this
|
|
244
|
+
#handleBrandInputChange = (value: string, index: number, brandInputType: 'brandName'|'brandVersion'): void => {
|
|
245
|
+
const updatedBrands = this.#metaData.brands?.map((browserBrand, brandIndex) => {
|
|
246
246
|
if (brandIndex === index) {
|
|
247
247
|
const {brand, version} = browserBrand;
|
|
248
248
|
if (brandInputType === 'brandName') {
|
|
@@ -258,24 +258,24 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
258
258
|
}
|
|
259
259
|
return browserBrand;
|
|
260
260
|
});
|
|
261
|
-
this
|
|
262
|
-
...this
|
|
261
|
+
this.#metaData = {
|
|
262
|
+
...this.#metaData,
|
|
263
263
|
brands: updatedBrands,
|
|
264
264
|
};
|
|
265
265
|
this.dispatchEvent(new ClientHintsChangeEvent());
|
|
266
|
-
this
|
|
266
|
+
this.#render();
|
|
267
267
|
};
|
|
268
268
|
|
|
269
|
-
|
|
270
|
-
const {brands = []} = this
|
|
269
|
+
#handleBrandDelete = (index: number): void => {
|
|
270
|
+
const {brands = []} = this.#metaData;
|
|
271
271
|
brands.splice(index, 1);
|
|
272
|
-
this
|
|
273
|
-
...this
|
|
272
|
+
this.#metaData = {
|
|
273
|
+
...this.#metaData,
|
|
274
274
|
brands,
|
|
275
275
|
};
|
|
276
276
|
this.dispatchEvent(new ClientHintsChangeEvent());
|
|
277
|
-
this
|
|
278
|
-
this
|
|
277
|
+
this.#brandsModifiedAriaMessage = i18nString(UIStrings.deletedBrand);
|
|
278
|
+
this.#render();
|
|
279
279
|
|
|
280
280
|
// after deleting a brand row, focus on next Brand input if available,
|
|
281
281
|
// otherwise focus on the "Add Brand" button
|
|
@@ -286,10 +286,10 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
286
286
|
(nextFocusElement as HTMLElement)?.focus();
|
|
287
287
|
};
|
|
288
288
|
|
|
289
|
-
|
|
290
|
-
const {brands} = this
|
|
291
|
-
this
|
|
292
|
-
...this
|
|
289
|
+
#handleAddBrandClick = (): void => {
|
|
290
|
+
const {brands} = this.#metaData;
|
|
291
|
+
this.#metaData = {
|
|
292
|
+
...this.#metaData,
|
|
293
293
|
brands: [
|
|
294
294
|
...(Array.isArray(brands) ? brands : []),
|
|
295
295
|
{
|
|
@@ -299,8 +299,8 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
299
299
|
],
|
|
300
300
|
};
|
|
301
301
|
this.dispatchEvent(new ClientHintsChangeEvent());
|
|
302
|
-
this
|
|
303
|
-
this
|
|
302
|
+
this.#brandsModifiedAriaMessage = i18nString(UIStrings.addedBrand);
|
|
303
|
+
this.#render();
|
|
304
304
|
const brandInputElements = this.shadowRoot?.querySelectorAll('.brand-name-input');
|
|
305
305
|
if (brandInputElements) {
|
|
306
306
|
const lastBrandInputElement = Array.from(brandInputElements).pop();
|
|
@@ -310,45 +310,45 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
312
|
|
|
313
|
-
|
|
313
|
+
#handleAddBrandKeyPress = (event: KeyboardEvent): void => {
|
|
314
314
|
if (event.code === 'Space' || event.code === 'Enter') {
|
|
315
315
|
event.preventDefault();
|
|
316
|
-
this
|
|
316
|
+
this.#handleAddBrandClick();
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
319
|
|
|
320
|
-
|
|
321
|
-
if (stateKey in this
|
|
322
|
-
this
|
|
323
|
-
...this
|
|
320
|
+
#handleInputChange = (stateKey: keyof Protocol.Emulation.UserAgentMetadata, value: string|boolean): void => {
|
|
321
|
+
if (stateKey in this.#metaData) {
|
|
322
|
+
this.#metaData = {
|
|
323
|
+
...this.#metaData,
|
|
324
324
|
[stateKey]: value,
|
|
325
325
|
};
|
|
326
|
-
this
|
|
326
|
+
this.#render();
|
|
327
327
|
}
|
|
328
328
|
this.dispatchEvent(new ClientHintsChangeEvent());
|
|
329
329
|
};
|
|
330
330
|
|
|
331
|
-
|
|
331
|
+
#handleLinkPress = (event: KeyboardEvent): void => {
|
|
332
332
|
if (event.code === 'Space' || event.code === 'Enter') {
|
|
333
333
|
event.preventDefault();
|
|
334
334
|
(event.target as HTMLAnchorElement).click();
|
|
335
335
|
}
|
|
336
336
|
};
|
|
337
337
|
|
|
338
|
-
|
|
338
|
+
#handleSubmit = (event: Event): void => {
|
|
339
339
|
event.preventDefault();
|
|
340
|
-
if (this
|
|
341
|
-
this.dispatchEvent(new ClientHintsSubmitEvent(this
|
|
342
|
-
this
|
|
340
|
+
if (this.#showSubmitButton) {
|
|
341
|
+
this.dispatchEvent(new ClientHintsSubmitEvent(this.#metaData));
|
|
342
|
+
this.#render();
|
|
343
343
|
}
|
|
344
344
|
};
|
|
345
345
|
|
|
346
|
-
|
|
346
|
+
#renderInputWithLabel(
|
|
347
347
|
label: string, placeholder: string, value: string,
|
|
348
348
|
stateKey: keyof Protocol.Emulation.UserAgentMetadata): LitHtml.TemplateResult {
|
|
349
349
|
const handleInputChange = (event: KeyboardEvent): void => {
|
|
350
350
|
const value = (event.target as HTMLInputElement).value;
|
|
351
|
-
this
|
|
351
|
+
this.#handleInputChange(stateKey, value);
|
|
352
352
|
};
|
|
353
353
|
return LitHtml.html`
|
|
354
354
|
<label class="full-row label input-field-label-container">
|
|
@@ -364,15 +364,15 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
364
364
|
`;
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
-
|
|
368
|
-
const {platform, platformVersion} = this
|
|
367
|
+
#renderPlatformSection(): LitHtml.TemplateResult {
|
|
368
|
+
const {platform, platformVersion} = this.#metaData;
|
|
369
369
|
const handlePlatformNameChange = (event: KeyboardEvent): void => {
|
|
370
370
|
const value = (event.target as HTMLInputElement).value;
|
|
371
|
-
this
|
|
371
|
+
this.#handleInputChange('platform', value);
|
|
372
372
|
};
|
|
373
373
|
const handlePlatformVersionChange = (event: KeyboardEvent): void => {
|
|
374
374
|
const value = (event.target as HTMLInputElement).value;
|
|
375
|
-
this
|
|
375
|
+
this.#handleInputChange('platformVersion', value);
|
|
376
376
|
};
|
|
377
377
|
return LitHtml.html`
|
|
378
378
|
<span class="full-row label">${i18nString(UIStrings.platformLabel)}</span>
|
|
@@ -397,28 +397,28 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
397
397
|
`;
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
-
|
|
401
|
-
const {model, mobile} = this
|
|
400
|
+
#renderDeviceModelSection(): LitHtml.TemplateResult {
|
|
401
|
+
const {model, mobile} = this.#metaData;
|
|
402
402
|
const handleDeviceModelChange = (event: KeyboardEvent): void => {
|
|
403
403
|
const value = (event.target as HTMLInputElement).value;
|
|
404
|
-
this
|
|
404
|
+
this.#handleInputChange('model', value);
|
|
405
405
|
};
|
|
406
406
|
const handleMobileChange = (event: KeyboardEvent): void => {
|
|
407
407
|
const value = (event.target as HTMLInputElement).checked;
|
|
408
|
-
this
|
|
408
|
+
this.#handleInputChange('mobile', value);
|
|
409
409
|
};
|
|
410
|
-
const mobileCheckboxInput = this
|
|
410
|
+
const mobileCheckboxInput = this.#showMobileCheckbox ? LitHtml.html`
|
|
411
411
|
<label class="mobile-checkbox-container">
|
|
412
412
|
<input type="checkbox" @input=${handleMobileChange} .checked=${mobile} />
|
|
413
413
|
${i18nString(UIStrings.mobileCheckboxLabel)}
|
|
414
414
|
</label>
|
|
415
415
|
` :
|
|
416
|
-
|
|
416
|
+
LitHtml.html``;
|
|
417
417
|
return LitHtml.html`
|
|
418
418
|
<span class="full-row label">${i18nString(UIStrings.deviceModel)}</span>
|
|
419
419
|
<div class="full-row brand-row" aria-label=${i18nString(UIStrings.deviceProperties)} role="group">
|
|
420
420
|
<input
|
|
421
|
-
class="input-field ${this
|
|
421
|
+
class="input-field ${this.#showMobileCheckbox ? 'device-model-input' : 'full-row'}"
|
|
422
422
|
type="text"
|
|
423
423
|
@input=${handleDeviceModelChange}
|
|
424
424
|
.value=${model}
|
|
@@ -429,7 +429,7 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
429
429
|
`;
|
|
430
430
|
}
|
|
431
431
|
|
|
432
|
-
|
|
432
|
+
#renderBrands(): LitHtml.TemplateResult {
|
|
433
433
|
const {
|
|
434
434
|
brands =
|
|
435
435
|
[
|
|
@@ -438,11 +438,11 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
438
438
|
version: '',
|
|
439
439
|
},
|
|
440
440
|
],
|
|
441
|
-
} = this
|
|
441
|
+
} = this.#metaData;
|
|
442
442
|
const brandElements = brands.map((brandRow, index) => {
|
|
443
443
|
const {brand, version} = brandRow;
|
|
444
444
|
const handleDeleteClick = (): void => {
|
|
445
|
-
this
|
|
445
|
+
this.#handleBrandDelete(index);
|
|
446
446
|
};
|
|
447
447
|
const handleKeyPress = (event: KeyboardEvent): void => {
|
|
448
448
|
if (event.code === 'Space' || event.code === 'Enter') {
|
|
@@ -452,11 +452,11 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
452
452
|
};
|
|
453
453
|
const handleBrandBrowserChange = (event: KeyboardEvent): void => {
|
|
454
454
|
const value = (event.target as HTMLInputElement).value;
|
|
455
|
-
this
|
|
455
|
+
this.#handleBrandInputChange(value, index, 'brandName');
|
|
456
456
|
};
|
|
457
457
|
const handleBrandVersionChange = (event: KeyboardEvent): void => {
|
|
458
458
|
const value = (event.target as HTMLInputElement).value;
|
|
459
|
-
this
|
|
459
|
+
this.#handleBrandInputChange(value, index, 'brandVersion');
|
|
460
460
|
};
|
|
461
461
|
return LitHtml.html`
|
|
462
462
|
<div class="full-row brand-row" aria-label=${i18nString(UIStrings.brandProperties)} role="group">
|
|
@@ -508,8 +508,8 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
508
508
|
tabindex="0"
|
|
509
509
|
id="add-brand-button"
|
|
510
510
|
aria-label=${i18nString(UIStrings.addBrand)}
|
|
511
|
-
@click=${this
|
|
512
|
-
@keypress=${this
|
|
511
|
+
@click=${this.#handleAddBrandClick}
|
|
512
|
+
@keypress=${this.#handleAddBrandKeyPress}
|
|
513
513
|
>
|
|
514
514
|
<${IconButton.Icon.Icon.litTagName}
|
|
515
515
|
aria-hidden="true"
|
|
@@ -522,18 +522,18 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
522
522
|
`;
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
-
|
|
526
|
-
const {fullVersion, architecture} = this
|
|
527
|
-
const brandSection = this
|
|
528
|
-
const fullBrowserInput = this
|
|
525
|
+
#render(): void {
|
|
526
|
+
const {fullVersion, architecture} = this.#metaData;
|
|
527
|
+
const brandSection = this.#renderBrands();
|
|
528
|
+
const fullBrowserInput = this.#renderInputWithLabel(
|
|
529
529
|
i18nString(UIStrings.fullBrowserVersion), i18nString(UIStrings.fullBrowserVersionPlaceholder),
|
|
530
530
|
fullVersion || '', 'fullVersion');
|
|
531
|
-
const platformSection = this
|
|
532
|
-
const architectureInput = this
|
|
531
|
+
const platformSection = this.#renderPlatformSection();
|
|
532
|
+
const architectureInput = this.#renderInputWithLabel(
|
|
533
533
|
i18nString(UIStrings.architecture), i18nString(UIStrings.architecturePlaceholder), architecture,
|
|
534
534
|
'architecture');
|
|
535
|
-
const deviceModelSection = this
|
|
536
|
-
const submitButton = this
|
|
535
|
+
const deviceModelSection = this.#renderDeviceModelSection();
|
|
536
|
+
const submitButton = this.#showSubmitButton ? LitHtml.html`
|
|
537
537
|
<${Buttons.Button.Button.litTagName}
|
|
538
538
|
.variant=${Buttons.Button.Variant.SECONDARY}
|
|
539
539
|
.type=${'submit'}
|
|
@@ -541,23 +541,23 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
541
541
|
${i18nString(UIStrings.update)}
|
|
542
542
|
</${Buttons.Button.Button.litTagName}>
|
|
543
543
|
` :
|
|
544
|
-
|
|
544
|
+
LitHtml.html``;
|
|
545
545
|
const output = LitHtml.html`
|
|
546
546
|
<section class="root">
|
|
547
547
|
<div
|
|
548
548
|
class="tree-title"
|
|
549
549
|
role="button"
|
|
550
|
-
@click=${this
|
|
550
|
+
@click=${this.#handleTreeClick}
|
|
551
551
|
tabindex="0"
|
|
552
|
-
@keydown=${this
|
|
553
|
-
aria-expanded=${this
|
|
552
|
+
@keydown=${this.#handleTreeExpand}
|
|
553
|
+
aria-expanded=${this.#isFormOpened}
|
|
554
554
|
aria-controls="form-container"
|
|
555
|
-
@disabled=${this
|
|
556
|
-
aria-disabled=${this
|
|
555
|
+
@disabled=${this.#isFormDisabled}
|
|
556
|
+
aria-disabled=${this.#isFormDisabled}
|
|
557
557
|
aria-label=${i18nString(UIStrings.title)}
|
|
558
558
|
>
|
|
559
559
|
<${IconButton.Icon.Icon.litTagName}
|
|
560
|
-
class=${this
|
|
560
|
+
class=${this.#isFormOpened ? '' : 'rotate-icon'}
|
|
561
561
|
.data=${
|
|
562
562
|
{color: 'var(--client-hints-form-icon-color)', iconName: 'chromeSelect', width: '20px'} as
|
|
563
563
|
IconButton.Icon.IconData}
|
|
@@ -569,7 +569,7 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
569
569
|
href="https://web.dev/user-agent-client-hints/"
|
|
570
570
|
target="_blank"
|
|
571
571
|
class="info-link"
|
|
572
|
-
@keypress=${this
|
|
572
|
+
@keypress=${this.#handleLinkPress}
|
|
573
573
|
aria-label=${i18nString(UIStrings.userAgentClientHintsInfo)}
|
|
574
574
|
>
|
|
575
575
|
<${IconButton.Icon.Icon.litTagName}
|
|
@@ -582,8 +582,8 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
582
582
|
</div>
|
|
583
583
|
<form
|
|
584
584
|
id="form-container"
|
|
585
|
-
class="form-container ${this
|
|
586
|
-
@submit=${this
|
|
585
|
+
class="form-container ${this.#isFormOpened ? '' : 'hide-container'}"
|
|
586
|
+
@submit=${this.#handleSubmit}
|
|
587
587
|
>
|
|
588
588
|
${brandSection}
|
|
589
589
|
${fullBrowserInput}
|
|
@@ -592,18 +592,18 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
592
592
|
${deviceModelSection}
|
|
593
593
|
${submitButton}
|
|
594
594
|
</form>
|
|
595
|
-
<div aria-live="polite" aria-label=${this
|
|
595
|
+
<div aria-live="polite" aria-label=${this.#brandsModifiedAriaMessage}></div>
|
|
596
596
|
</section>
|
|
597
597
|
`;
|
|
598
598
|
// clang-format off
|
|
599
|
-
LitHtml.render(output, this
|
|
599
|
+
LitHtml.render(output, this.#shadow, {host: this});
|
|
600
600
|
// clang-format on
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
validate = (): UI.ListWidget.ValidatorResult => {
|
|
604
|
-
for (const [metaDataKey, metaDataValue] of Object.entries(this
|
|
604
|
+
for (const [metaDataKey, metaDataValue] of Object.entries(this.#metaData)) {
|
|
605
605
|
if (metaDataKey === 'brands') {
|
|
606
|
-
const isBrandValid = this
|
|
606
|
+
const isBrandValid = this.#metaData.brands?.every(({brand, version}) => {
|
|
607
607
|
const brandNameResult = EmulationUtils.UserAgentMetadata.validateAsStructuredHeadersString(
|
|
608
608
|
brand, i18nString(UIStrings.notRepresentable));
|
|
609
609
|
const brandVersionResult = EmulationUtils.UserAgentMetadata.validateAsStructuredHeadersString(
|
|
@@ -172,12 +172,13 @@ export class BreakpointEditDialog extends UI.Widget.Widget {
|
|
|
172
172
|
|
|
173
173
|
private onTypeChanged(): void {
|
|
174
174
|
const type = this.breakpointType;
|
|
175
|
+
this.isLogpoint = type === BreakpointType.Logpoint;
|
|
175
176
|
if (type === BreakpointType.Breakpoint) {
|
|
176
177
|
this.finishEditing(true, '');
|
|
177
|
-
|
|
178
|
-
this.editor.dispatch({effects: this.placeholderCompartment.reconfigure(this.getPlaceholder())});
|
|
179
|
-
this.updateTooltip();
|
|
178
|
+
return;
|
|
180
179
|
}
|
|
180
|
+
this.editor.dispatch({effects: this.placeholderCompartment.reconfigure(this.getPlaceholder())});
|
|
181
|
+
this.updateTooltip();
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
private get breakpointType(): string|null {
|
|
@@ -982,15 +982,11 @@ const boostOrderForNode = new WeakSet<UI.TreeOutline.TreeElement>();
|
|
|
982
982
|
export class NavigatorFolderTreeElement extends UI.TreeOutline.TreeElement {
|
|
983
983
|
private readonly nodeType: string;
|
|
984
984
|
private readonly navigatorView: NavigatorView;
|
|
985
|
-
|
|
986
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
987
|
-
private hoverCallback: ((arg0: boolean) => any)|undefined;
|
|
985
|
+
private hoverCallback: ((arg0: boolean) => void)|undefined;
|
|
988
986
|
node!: NavigatorTreeNode;
|
|
989
987
|
private hovered?: boolean;
|
|
990
988
|
|
|
991
|
-
|
|
992
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
993
|
-
constructor(navigatorView: NavigatorView, type: string, title: string, hoverCallback?: ((arg0: boolean) => any)) {
|
|
989
|
+
constructor(navigatorView: NavigatorView, type: string, title: string, hoverCallback?: ((arg0: boolean) => void)) {
|
|
994
990
|
super('', true);
|
|
995
991
|
this.listItemElement.classList.add('navigator-' + type + '-tree-item', 'navigator-folder-tree-item');
|
|
996
992
|
UI.ARIAUtils.setAccessibleName(this.listItemElement, `${title}, ${type}`);
|
|
@@ -1392,9 +1388,7 @@ export class NavigatorUISourceCodeTreeNode extends NavigatorTreeNode {
|
|
|
1392
1388
|
}
|
|
1393
1389
|
}
|
|
1394
1390
|
|
|
1395
|
-
|
|
1396
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1397
|
-
rename(callback?: ((arg0: boolean) => any)): void {
|
|
1391
|
+
rename(callback?: ((arg0: boolean) => void)): void {
|
|
1398
1392
|
if (!this.treeElement) {
|
|
1399
1393
|
return;
|
|
1400
1394
|
}
|
|
@@ -390,16 +390,16 @@ export class RemoteObject extends SDK.RemoteObject.RemoteObject {
|
|
|
390
390
|
|
|
391
391
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
|
|
392
392
|
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any
|
|
393
|
-
let _scopeResolvedForTest: (...arg0: any[]) =>
|
|
393
|
+
let _scopeResolvedForTest: (...arg0: any[]) => void = function(): void {};
|
|
394
394
|
|
|
395
395
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
|
|
396
396
|
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any
|
|
397
|
-
export const getScopeResolvedForTest = (): (...arg0: any[]) =>
|
|
397
|
+
export const getScopeResolvedForTest = (): (...arg0: any[]) => void => {
|
|
398
398
|
return _scopeResolvedForTest;
|
|
399
399
|
};
|
|
400
400
|
|
|
401
401
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
|
|
402
402
|
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any
|
|
403
|
-
export const setScopeResolvedForTest = (scope: (...arg0: any[]) =>
|
|
403
|
+
export const setScopeResolvedForTest = (scope: (...arg0: any[]) => void): void => {
|
|
404
404
|
_scopeResolvedForTest = scope;
|
|
405
405
|
};
|
|
@@ -956,9 +956,7 @@ export class SourcesPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
|
|
|
956
956
|
return;
|
|
957
957
|
}
|
|
958
958
|
const openText = i18nString(UIStrings.openInSourcesPanel);
|
|
959
|
-
|
|
960
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
961
|
-
const callback: () => any = this.showUILocation.bind(this, uiSourceCode.uiLocation(0, 0));
|
|
959
|
+
const callback: () => void = this.showUILocation.bind(this, uiSourceCode.uiLocation(0, 0));
|
|
962
960
|
contextMenu.revealSection().appendItem(openText, callback);
|
|
963
961
|
}
|
|
964
962
|
|
|
@@ -596,9 +596,6 @@ export type EventTypes = {
|
|
|
596
596
|
[Events.EditorSelected]: Workspace.UISourceCode.UISourceCode,
|
|
597
597
|
};
|
|
598
598
|
|
|
599
|
-
/**
|
|
600
|
-
* @interface
|
|
601
|
-
*/
|
|
602
599
|
export interface EditorAction {
|
|
603
600
|
getOrCreateButton(sourcesView: SourcesView): UI.Toolbar.ToolbarButton;
|
|
604
601
|
}
|
|
@@ -60,9 +60,6 @@ const UIStrings = {
|
|
|
60
60
|
};
|
|
61
61
|
const str_ = i18n.i18n.registerUIStrings('panels/sources/TabbedEditorContainer.ts', UIStrings);
|
|
62
62
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
63
|
-
/**
|
|
64
|
-
* @interface
|
|
65
|
-
*/
|
|
66
63
|
export interface TabbedEditorContainerDelegate {
|
|
67
64
|
viewForFile(uiSourceCode: Workspace.UISourceCode.UISourceCode): UI.Widget.Widget;
|
|
68
65
|
|
|
@@ -518,7 +518,7 @@ export class TimelineFlameChartView extends UI.Widget.VBox implements PerfUI.Fla
|
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
performSearch(searchConfig: UI.SearchableView.SearchConfig, shouldJump: boolean, jumpBackwards?: boolean): void {
|
|
521
|
-
this.searchRegex = searchConfig.toSearchRegex();
|
|
521
|
+
this.searchRegex = searchConfig.toSearchRegex().regex;
|
|
522
522
|
this.updateSearchResults(shouldJump, jumpBackwards);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
@@ -525,7 +525,7 @@ export class TimelineTreeView extends UI.Widget.VBox implements UI.SearchableVie
|
|
|
525
525
|
return;
|
|
526
526
|
}
|
|
527
527
|
const searchRegex = searchConfig.toSearchRegex();
|
|
528
|
-
this.searchResults = this.root.searchTree(event => TimelineUIUtils.testContentMatching(event, searchRegex));
|
|
528
|
+
this.searchResults = this.root.searchTree(event => TimelineUIUtils.testContentMatching(event, searchRegex.regex));
|
|
529
529
|
this.searchableView.updateSearchMatchesCount(this.searchResults.length);
|
|
530
530
|
}
|
|
531
531
|
|