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
|
@@ -33,11 +33,11 @@ export class CSSOverviewSidebarPanel extends Common.ObjectWrapper.eventMixin<Eve
|
|
|
33
33
|
super(true);
|
|
34
34
|
|
|
35
35
|
this.contentElement.classList.add('overview-sidebar-panel');
|
|
36
|
-
this.contentElement.addEventListener('click', this
|
|
36
|
+
this.contentElement.addEventListener('click', this.#onItemClick.bind(this));
|
|
37
37
|
|
|
38
38
|
// Clear overview.
|
|
39
39
|
const clearResultsButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.clearOverview), 'largeicon-clear');
|
|
40
|
-
clearResultsButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, this
|
|
40
|
+
clearResultsButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, this.#reset, this);
|
|
41
41
|
|
|
42
42
|
// Toolbar.
|
|
43
43
|
const toolbarElement = this.contentElement.createChild('div', 'overview-toolbar');
|
|
@@ -51,18 +51,18 @@ export class CSSOverviewSidebarPanel extends Common.ObjectWrapper.eventMixin<Eve
|
|
|
51
51
|
item.dataset.id = id;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
#reset(): void {
|
|
55
55
|
this.dispatchEventToListeners(SidebarEvents.Reset);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
#deselectAllItems(): void {
|
|
59
59
|
const items = this.contentElement.querySelectorAll(`.${CSSOverviewSidebarPanel.ITEM_CLASS_NAME}`);
|
|
60
60
|
items.forEach(item => {
|
|
61
61
|
item.classList.remove(CSSOverviewSidebarPanel.SELECTED);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
#onItemClick(event: Event): void {
|
|
66
66
|
const target = (event.composedPath()[0] as HTMLElement);
|
|
67
67
|
if (!target.classList.contains(CSSOverviewSidebarPanel.ITEM_CLASS_NAME)) {
|
|
68
68
|
return;
|
|
@@ -86,7 +86,7 @@ export class CSSOverviewSidebarPanel extends Common.ObjectWrapper.eventMixin<Eve
|
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
this
|
|
89
|
+
this.#deselectAllItems();
|
|
90
90
|
target.classList.add(CSSOverviewSidebarPanel.SELECTED);
|
|
91
91
|
}
|
|
92
92
|
wasShown(): void {
|
|
@@ -58,7 +58,7 @@ export class CSSOverviewStartView extends HTMLElement {
|
|
|
58
58
|
|
|
59
59
|
connectedCallback(): void {
|
|
60
60
|
this.#shadow.adoptedStyleSheets = [cssOverviewStartViewStyles];
|
|
61
|
-
this
|
|
61
|
+
this.#render();
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
show(): void {
|
|
@@ -69,11 +69,11 @@ export class CSSOverviewStartView extends HTMLElement {
|
|
|
69
69
|
this.classList.add('hidden');
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
#onStartCaptureClick(): void {
|
|
73
73
|
this.dispatchEvent(new OverviewStartRequestedEvent());
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
#render(): void {
|
|
77
77
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
78
78
|
// clang-format off
|
|
79
79
|
render(html`
|
|
@@ -88,7 +88,7 @@ export class CSSOverviewStartView extends HTMLElement {
|
|
|
88
88
|
<${Buttons.Button.Button.litTagName}
|
|
89
89
|
class="start-capture"
|
|
90
90
|
.variant=${Buttons.Button.Variant.PRIMARY}
|
|
91
|
-
@click=${this
|
|
91
|
+
@click=${this.#onStartCaptureClick}>
|
|
92
92
|
${i18nString(UIStrings.captureOverview)}
|
|
93
93
|
</${Buttons.Button.Button.litTagName}>
|
|
94
94
|
</div>
|
|
@@ -1811,9 +1811,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1811
1811
|
this.nodeInternal.removeNode();
|
|
1812
1812
|
}
|
|
1813
1813
|
|
|
1814
|
-
|
|
1815
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1816
|
-
toggleEditAsHTML(callback?: ((arg0: boolean) => any), startEditing?: boolean): void {
|
|
1814
|
+
toggleEditAsHTML(callback?: ((arg0: boolean) => void), startEditing?: boolean): void {
|
|
1817
1815
|
if (this.editing && this.htmlEditElement) {
|
|
1818
1816
|
this.editing.commit();
|
|
1819
1817
|
return;
|
|
@@ -2220,7 +2218,5 @@ export interface EditorHandles {
|
|
|
2220
2218
|
commit: () => void;
|
|
2221
2219
|
cancel: () => void;
|
|
2222
2220
|
editor?: TextEditor.TextEditor.TextEditor;
|
|
2223
|
-
|
|
2224
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2225
|
-
resize: () => any;
|
|
2221
|
+
resize: () => void;
|
|
2226
2222
|
}
|
|
@@ -53,29 +53,29 @@ export interface AccessibilityTreeNodeData {
|
|
|
53
53
|
|
|
54
54
|
export class AccessibilityTreeNode extends HTMLElement {
|
|
55
55
|
static readonly litTagName = LitHtml.literal`devtools-accessibility-tree-node`;
|
|
56
|
-
|
|
56
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
#ignored = true;
|
|
59
|
+
#name = '';
|
|
60
|
+
#role = '';
|
|
61
|
+
#properties: Protocol.Accessibility.AXProperty[] = [];
|
|
62
62
|
|
|
63
63
|
set data(data: AccessibilityTreeNodeData) {
|
|
64
|
-
this
|
|
65
|
-
this
|
|
66
|
-
this
|
|
67
|
-
this
|
|
68
|
-
this
|
|
64
|
+
this.#ignored = data.ignored;
|
|
65
|
+
this.#name = data.name;
|
|
66
|
+
this.#role = data.role;
|
|
67
|
+
this.#properties = data.properties;
|
|
68
|
+
this.#render();
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
connectedCallback(): void {
|
|
72
|
-
this
|
|
72
|
+
this.#shadow.adoptedStyleSheets = [accessibilityTreeNodeStyles];
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
const role = LitHtml.html`<span class='role-value'>${truncateTextIfNeeded(this
|
|
77
|
-
const name = LitHtml.html`"<span class='attribute-value'>${this
|
|
78
|
-
const properties = this
|
|
75
|
+
async #render(): Promise<void> {
|
|
76
|
+
const role = LitHtml.html`<span class='role-value'>${truncateTextIfNeeded(this.#role)}</span>`;
|
|
77
|
+
const name = LitHtml.html`"<span class='attribute-value'>${this.#name}</span>"`;
|
|
78
|
+
const properties = this.#properties.map(
|
|
79
79
|
({name, value}) => isPrintable(value.type) ?
|
|
80
80
|
LitHtml.html` <span class='attribute-name'>${name}</span>: <span class='attribute-value'>${
|
|
81
81
|
value.value}</span>` :
|
|
@@ -84,10 +84,10 @@ export class AccessibilityTreeNode extends HTMLElement {
|
|
|
84
84
|
await Coordinator.RenderCoordinator.RenderCoordinator.instance().write('Accessibility node render', () => {
|
|
85
85
|
// clang-format off
|
|
86
86
|
LitHtml.render(
|
|
87
|
-
this
|
|
87
|
+
this.#ignored ?
|
|
88
88
|
LitHtml.html`<span>${i18nString(UIStrings.ignored)}</span>` :
|
|
89
89
|
LitHtml.html`${role} ${name}${properties}`,
|
|
90
|
-
this
|
|
90
|
+
this.#shadow,
|
|
91
91
|
{host: this});
|
|
92
92
|
// clang-format on
|
|
93
93
|
});
|
|
@@ -92,58 +92,58 @@ interface SettingStore<Setting> {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export class AdornerManager {
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
#adornerSettings: AdornerSettingsMap = new Map();
|
|
96
|
+
#settingStore: SettingStore<AdornerSetting[]>;
|
|
97
97
|
|
|
98
98
|
constructor(settingStore: SettingStore<AdornerSetting[]>) {
|
|
99
|
-
this
|
|
100
|
-
this
|
|
99
|
+
this.#settingStore = settingStore;
|
|
100
|
+
this.#syncSettings();
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
updateSettings(settings: AdornerSettingsMap): void {
|
|
104
|
-
this
|
|
105
|
-
this
|
|
104
|
+
this.#adornerSettings = settings;
|
|
105
|
+
this.#persistCurrentSettings();
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
getSettings(): Readonly<AdornerSettingsMap> {
|
|
109
|
-
return this
|
|
109
|
+
return this.#adornerSettings;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
isAdornerEnabled(adornerText: string): boolean {
|
|
113
|
-
return this
|
|
113
|
+
return this.#adornerSettings.get(adornerText) || false;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
#persistCurrentSettings(): void {
|
|
117
117
|
const settingList = [];
|
|
118
|
-
for (const [adorner, isEnabled] of this
|
|
118
|
+
for (const [adorner, isEnabled] of this.#adornerSettings) {
|
|
119
119
|
settingList.push({adorner, isEnabled});
|
|
120
120
|
}
|
|
121
|
-
this
|
|
121
|
+
this.#settingStore.set(settingList);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
const settingList = this
|
|
124
|
+
#loadSettings(): void {
|
|
125
|
+
const settingList = this.#settingStore.get();
|
|
126
126
|
for (const setting of settingList) {
|
|
127
|
-
this
|
|
127
|
+
this.#adornerSettings.set(setting.adorner, setting.isEnabled);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
this
|
|
131
|
+
#syncSettings(): void {
|
|
132
|
+
this.#loadSettings();
|
|
133
133
|
|
|
134
134
|
// Prune outdated adorners and add new ones to the persistence.
|
|
135
|
-
const outdatedAdorners = new Set(this
|
|
135
|
+
const outdatedAdorners = new Set(this.#adornerSettings.keys());
|
|
136
136
|
for (const {adorner, isEnabled} of DefaultAdornerSettings) {
|
|
137
137
|
outdatedAdorners.delete(adorner);
|
|
138
|
-
if (!this
|
|
139
|
-
this
|
|
138
|
+
if (!this.#adornerSettings.has(adorner)) {
|
|
139
|
+
this.#adornerSettings.set(adorner, isEnabled);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
for (const outdatedAdorner of outdatedAdorners) {
|
|
143
|
-
this
|
|
143
|
+
this.#adornerSettings.delete(outdatedAdorner);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
this
|
|
146
|
+
this.#persistCurrentSettings();
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -44,21 +44,21 @@ export interface AdornerSettingsPaneData {
|
|
|
44
44
|
|
|
45
45
|
export class AdornerSettingsPane extends HTMLElement {
|
|
46
46
|
static readonly litTagName = LitHtml.literal`devtools-adorner-settings-pane`;
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
48
|
+
#settings: AdornerSettingsMap = new Map();
|
|
49
49
|
|
|
50
50
|
connectedCallback(): void {
|
|
51
|
-
this
|
|
51
|
+
this.#shadow.adoptedStyleSheets = [adornerSettingsPaneStyles];
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
set data(data: AdornerSettingsPaneData) {
|
|
55
|
-
this
|
|
56
|
-
this
|
|
55
|
+
this.#settings = new Map(data.settings.entries());
|
|
56
|
+
this.#render();
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
show(): void {
|
|
60
60
|
this.classList.remove('hidden');
|
|
61
|
-
const settingsPane = this
|
|
61
|
+
const settingsPane = this.#shadow.querySelector<HTMLElement>('.adorner-settings-pane');
|
|
62
62
|
if (settingsPane) {
|
|
63
63
|
settingsPane.focus();
|
|
64
64
|
}
|
|
@@ -68,21 +68,21 @@ export class AdornerSettingsPane extends HTMLElement {
|
|
|
68
68
|
this.classList.add('hidden');
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
#onChange(ev: Event): void {
|
|
72
72
|
const inputEl = ev.target as HTMLInputElement;
|
|
73
73
|
const adorner = inputEl.dataset.adorner;
|
|
74
74
|
if (adorner === undefined) {
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
const isEnabledNow = inputEl.checked;
|
|
78
|
-
this
|
|
79
|
-
this.dispatchEvent(new AdornerSettingUpdatedEvent(adorner, isEnabledNow, this
|
|
80
|
-
this
|
|
78
|
+
this.#settings.set(adorner, isEnabledNow);
|
|
79
|
+
this.dispatchEvent(new AdornerSettingUpdatedEvent(adorner, isEnabledNow, this.#settings));
|
|
80
|
+
this.#render();
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
#render(): void {
|
|
84
84
|
const settingTemplates = [];
|
|
85
|
-
for (const [adorner, isEnabled] of this
|
|
85
|
+
for (const [adorner, isEnabled] of this.#settings) {
|
|
86
86
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
87
87
|
// clang-format off
|
|
88
88
|
settingTemplates.push(html`
|
|
@@ -103,12 +103,12 @@ export class AdornerSettingsPane extends HTMLElement {
|
|
|
103
103
|
render(html`
|
|
104
104
|
<div class="adorner-settings-pane" tabindex="-1">
|
|
105
105
|
<div class="settings-title">${i18nString(UIStrings.settingsTitle)}</div>
|
|
106
|
-
<div class="setting-list" @change=${this
|
|
106
|
+
<div class="setting-list" @change=${this.#onChange}>
|
|
107
107
|
${settingTemplates}
|
|
108
108
|
</div>
|
|
109
109
|
<button class="close" @click=${this.hide} aria-label=${i18nString(UIStrings.closeButton)}></button>
|
|
110
110
|
</div>
|
|
111
|
-
`, this
|
|
111
|
+
`, this.#shadow, {
|
|
112
112
|
host: this,
|
|
113
113
|
});
|
|
114
114
|
// clang-format on
|
|
@@ -21,44 +21,44 @@ export interface CSSQueryData {
|
|
|
21
21
|
export class CSSQuery extends HTMLElement {
|
|
22
22
|
static readonly litTagName = LitHtml.literal`devtools-css-query`;
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
25
|
+
#queryPrefix: string = '';
|
|
26
|
+
#queryName?: string;
|
|
27
|
+
#queryText: string = '';
|
|
28
|
+
#onQueryTextClick?: (event: Event) => void;
|
|
29
29
|
|
|
30
30
|
set data(data: CSSQueryData) {
|
|
31
|
-
this
|
|
32
|
-
this
|
|
33
|
-
this
|
|
34
|
-
this
|
|
35
|
-
this
|
|
31
|
+
this.#queryPrefix = data.queryPrefix;
|
|
32
|
+
this.#queryName = data.queryName;
|
|
33
|
+
this.#queryText = data.queryText;
|
|
34
|
+
this.#onQueryTextClick = data.onQueryTextClick;
|
|
35
|
+
this.#render();
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
connectedCallback(): void {
|
|
39
|
-
this
|
|
39
|
+
this.#shadow.adoptedStyleSheets = [
|
|
40
40
|
cssQueryStyles,
|
|
41
41
|
inspectorCommonStyles,
|
|
42
42
|
];
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
#render(): void {
|
|
46
46
|
const queryClasses = LitHtml.Directives.classMap({
|
|
47
47
|
query: true,
|
|
48
|
-
editable: Boolean(this
|
|
48
|
+
editable: Boolean(this.#onQueryTextClick),
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
52
52
|
// clang-format off
|
|
53
53
|
const queryText = html`
|
|
54
|
-
<span class="query-text" @click=${this
|
|
54
|
+
<span class="query-text" @click=${this.#onQueryTextClick}>${this.#queryText}</span>
|
|
55
55
|
`;
|
|
56
56
|
|
|
57
57
|
render(html`
|
|
58
58
|
<div class=${queryClasses}>
|
|
59
|
-
${this
|
|
59
|
+
${this.#queryPrefix ? html`<span>${this.#queryPrefix + ' '}</span>` : LitHtml.nothing}${this.#queryName ? html`<span>${this.#queryName + ' '}</span>` : LitHtml.nothing}${queryText}
|
|
60
60
|
</div>
|
|
61
|
-
`, this
|
|
61
|
+
`, this.#shadow, {
|
|
62
62
|
host: this,
|
|
63
63
|
});
|
|
64
64
|
// clang-format on
|
|
@@ -16,37 +16,37 @@ export interface ComputedStylePropertyData {
|
|
|
16
16
|
|
|
17
17
|
export class ComputedStyleProperty extends HTMLElement {
|
|
18
18
|
static readonly litTagName = LitHtml.literal`devtools-computed-style-property`;
|
|
19
|
-
|
|
19
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
#inherited = false;
|
|
22
|
+
#traceable = false;
|
|
23
|
+
#onNavigateToSource: ((event?: Event) => void) = () => {};
|
|
24
24
|
|
|
25
25
|
connectedCallback(): void {
|
|
26
|
-
this
|
|
26
|
+
this.#shadow.adoptedStyleSheets = [computedStylePropertyStyles];
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
set data(data: ComputedStylePropertyData) {
|
|
30
|
-
this
|
|
31
|
-
this
|
|
32
|
-
this
|
|
33
|
-
this
|
|
30
|
+
this.#inherited = data.inherited;
|
|
31
|
+
this.#traceable = data.traceable;
|
|
32
|
+
this.#onNavigateToSource = data.onNavigateToSource;
|
|
33
|
+
this.#render();
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
#render(): void {
|
|
37
37
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
38
38
|
// clang-format off
|
|
39
39
|
render(html`
|
|
40
|
-
<div class="computed-style-property ${this
|
|
40
|
+
<div class="computed-style-property ${this.#inherited ? 'inherited' : ''}">
|
|
41
41
|
<slot name="property-name"></slot>
|
|
42
42
|
<span class="hidden" aria-hidden="false">: </span>
|
|
43
|
-
${this
|
|
44
|
-
html`<span class="goto" @click=${this
|
|
43
|
+
${this.#traceable ?
|
|
44
|
+
html`<span class="goto" @click=${this.#onNavigateToSource}></span>` :
|
|
45
45
|
null}
|
|
46
46
|
<slot name="property-value"></slot>
|
|
47
47
|
<span class="hidden" aria-hidden="false">;</span>
|
|
48
48
|
</div>
|
|
49
|
-
`, this
|
|
49
|
+
`, this.#shadow, {
|
|
50
50
|
host: this,
|
|
51
51
|
});
|
|
52
52
|
// clang-format on
|
|
@@ -16,34 +16,34 @@ export interface ComputedStyleTraceData {
|
|
|
16
16
|
|
|
17
17
|
export class ComputedStyleTrace extends HTMLElement {
|
|
18
18
|
static readonly litTagName = LitHtml.literal`devtools-computed-style-trace`;
|
|
19
|
-
|
|
19
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
#selector = '';
|
|
22
|
+
#active = false;
|
|
23
|
+
#onNavigateToSource: ((event?: Event) => void) = () => {};
|
|
24
24
|
|
|
25
25
|
connectedCallback(): void {
|
|
26
|
-
this
|
|
26
|
+
this.#shadow.adoptedStyleSheets = [computedStyleTraceStyles];
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
set data(data: ComputedStyleTraceData) {
|
|
30
|
-
this
|
|
31
|
-
this
|
|
32
|
-
this
|
|
33
|
-
this
|
|
30
|
+
this.#selector = data.selector;
|
|
31
|
+
this.#active = data.active;
|
|
32
|
+
this.#onNavigateToSource = data.onNavigateToSource;
|
|
33
|
+
this.#render();
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
#render(): void {
|
|
37
37
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
38
38
|
// clang-format off
|
|
39
39
|
render(html`
|
|
40
|
-
<div class="computed-style-trace ${this
|
|
41
|
-
<span class="goto" @click=${this
|
|
42
|
-
<slot name="trace-value" @click=${this
|
|
43
|
-
<span class="trace-selector">${this
|
|
40
|
+
<div class="computed-style-trace ${this.#active ? 'active' : 'inactive'}">
|
|
41
|
+
<span class="goto" @click=${this.#onNavigateToSource}></span>
|
|
42
|
+
<slot name="trace-value" @click=${this.#onNavigateToSource}></slot>
|
|
43
|
+
<span class="trace-selector">${this.#selector}</span>
|
|
44
44
|
<slot name="trace-link"></slot>
|
|
45
45
|
</div>
|
|
46
|
-
`, this
|
|
46
|
+
`, this.#shadow, {
|
|
47
47
|
host: this,
|
|
48
48
|
});
|
|
49
49
|
// clang-format on
|