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
|
@@ -48,22 +48,22 @@ interface TrustTokensDeleteButtonData {
|
|
|
48
48
|
|
|
49
49
|
class TrustTokensDeleteButton extends HTMLElement {
|
|
50
50
|
static readonly litTagName = LitHtml.literal`devtools-trust-tokens-delete-button`;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
52
|
+
#issuer: DataGrid.DataGridUtils.CellValue|null = null;
|
|
53
|
+
#deleteClickHandler: (issuerOrigin: string) => void = () => {};
|
|
54
54
|
|
|
55
55
|
connectedCallback(): void {
|
|
56
|
-
this
|
|
56
|
+
this.#shadow.adoptedStyleSheets = [trustTokensViewDeleteButtonStyles];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
set data(data: TrustTokensDeleteButtonData) {
|
|
60
|
-
this
|
|
61
|
-
this
|
|
62
|
-
this
|
|
60
|
+
this.#issuer = data.issuer;
|
|
61
|
+
this.#deleteClickHandler = data.deleteClickHandler;
|
|
62
|
+
this.#render();
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
if (!this
|
|
65
|
+
#render(): void {
|
|
66
|
+
if (!this.#issuer) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
// clang-format off
|
|
@@ -71,14 +71,14 @@ class TrustTokensDeleteButton extends HTMLElement {
|
|
|
71
71
|
<!-- Wrap the button in a container, otherwise we can't center it inside the column. -->
|
|
72
72
|
<span class="button-container">
|
|
73
73
|
<button class="delete-button"
|
|
74
|
-
title=${i18nString(UIStrings.deleteTrustTokens, {PH1: this
|
|
75
|
-
@click=${(): void => this
|
|
74
|
+
title=${i18nString(UIStrings.deleteTrustTokens, {PH1: this.#issuer as string})}
|
|
75
|
+
@click=${(): void => this.#deleteClickHandler(this.#issuer as string)}>
|
|
76
76
|
<${IconButton.Icon.Icon.litTagName} .data=${
|
|
77
77
|
{iconName: 'trash_bin_icon', color: 'var(--color-text-secondary)', width: '9px', height: '14px'} as
|
|
78
78
|
IconButton.Icon.IconWithName}>
|
|
79
79
|
</${IconButton.Icon.Icon.litTagName}>
|
|
80
80
|
</button>
|
|
81
|
-
</span>`, this
|
|
81
|
+
</span>`, this.#shadow, {host: this});
|
|
82
82
|
// clang-format on
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -90,22 +90,22 @@ export interface TrustTokensViewData {
|
|
|
90
90
|
|
|
91
91
|
export class TrustTokensView extends HTMLElement {
|
|
92
92
|
static readonly litTagName = LitHtml.literal`devtools-trust-tokens-storage-view`;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
94
|
+
#tokens: Protocol.Storage.TrustTokens[] = [];
|
|
95
|
+
#deleteClickHandler: (issuerOrigin: string) => void = () => {};
|
|
96
96
|
|
|
97
97
|
connectedCallback(): void {
|
|
98
|
-
this
|
|
99
|
-
this
|
|
98
|
+
this.#shadow.adoptedStyleSheets = [trustTokensViewStyles];
|
|
99
|
+
this.#render();
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
set data(data: TrustTokensViewData) {
|
|
103
|
-
this
|
|
104
|
-
this
|
|
105
|
-
this
|
|
103
|
+
this.#tokens = data.tokens;
|
|
104
|
+
this.#deleteClickHandler = data.deleteClickHandler;
|
|
105
|
+
this.#render();
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
#render(): void {
|
|
109
109
|
// clang-format off
|
|
110
110
|
LitHtml.render(LitHtml.html`
|
|
111
111
|
<div>
|
|
@@ -116,14 +116,14 @@ export class TrustTokensView extends HTMLElement {
|
|
|
116
116
|
{iconName: 'ic_info_black_18dp', color: 'var(--color-link)', width: '14px'} as
|
|
117
117
|
IconButton.Icon.IconWithName}>
|
|
118
118
|
</${IconButton.Icon.Icon.litTagName}>
|
|
119
|
-
${this
|
|
119
|
+
${this.#renderGridOrNoDataMessage()}
|
|
120
120
|
</div>
|
|
121
|
-
`, this
|
|
121
|
+
`, this.#shadow, {host: this});
|
|
122
122
|
// clang-format on
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
if (this
|
|
125
|
+
#renderGridOrNoDataMessage(): LitHtml.TemplateResult {
|
|
126
|
+
if (this.#tokens.length === 0) {
|
|
127
127
|
return LitHtml.html`<div class="no-tt-message">${i18nString(UIStrings.noTrustTokensStored)}</div>`;
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -154,7 +154,7 @@ export class TrustTokensView extends HTMLElement {
|
|
|
154
154
|
sortable: false,
|
|
155
155
|
},
|
|
156
156
|
],
|
|
157
|
-
rows: this
|
|
157
|
+
rows: this.#buildRowsFromTokens(),
|
|
158
158
|
initialSort: {
|
|
159
159
|
columnId: 'issuer',
|
|
160
160
|
direction: DataGrid.DataGridUtils.SortDirection.ASC,
|
|
@@ -168,14 +168,14 @@ export class TrustTokensView extends HTMLElement {
|
|
|
168
168
|
`;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
|
|
172
|
-
const tokens = this
|
|
171
|
+
#buildRowsFromTokens(): DataGrid.DataGridUtils.Row[] {
|
|
172
|
+
const tokens = this.#tokens.filter(token => token.count > 0);
|
|
173
173
|
return tokens.map(token => ({
|
|
174
174
|
cells: [
|
|
175
175
|
{
|
|
176
176
|
columnId: 'delete-button',
|
|
177
177
|
value: removeTrailingSlash(token.issuerOrigin),
|
|
178
|
-
renderer: this
|
|
178
|
+
renderer: this.#deleteButtonRendererForDataGridCell.bind(this),
|
|
179
179
|
},
|
|
180
180
|
{columnId: 'issuer', value: removeTrailingSlash(token.issuerOrigin)},
|
|
181
181
|
{columnId: 'count', value: token.count},
|
|
@@ -183,10 +183,10 @@ export class TrustTokensView extends HTMLElement {
|
|
|
183
183
|
}));
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
#deleteButtonRendererForDataGridCell(issuer: DataGrid.DataGridUtils.CellValue): LitHtml.TemplateResult {
|
|
187
187
|
// clang-format off
|
|
188
188
|
return LitHtml.html`<${TrustTokensDeleteButton.litTagName}
|
|
189
|
-
.data=${{issuer, deleteClickHandler: this
|
|
189
|
+
.data=${{issuer, deleteClickHandler: this.#deleteClickHandler} as TrustTokensDeleteButtonData}
|
|
190
190
|
></${TrustTokensDeleteButton.litTagName}>`;
|
|
191
191
|
// clang-format on
|
|
192
192
|
}
|
|
@@ -1283,7 +1283,7 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
|
|
|
1283
1283
|
this.searchCanceled();
|
|
1284
1284
|
this.searchableViewInternal.updateSearchMatchesCount(0);
|
|
1285
1285
|
|
|
1286
|
-
this.searchRegex = searchConfig.toSearchRegex(true);
|
|
1286
|
+
this.searchRegex = searchConfig.toSearchRegex(true).regex;
|
|
1287
1287
|
|
|
1288
1288
|
this.regexMatchRanges = [];
|
|
1289
1289
|
this.currentMatchRangeIndex = -1;
|
|
@@ -49,7 +49,6 @@ import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
|
|
|
49
49
|
import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
|
|
50
50
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
51
51
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
52
|
-
import * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';
|
|
53
52
|
// eslint-disable-next-line rulesdir/es_modules_import
|
|
54
53
|
import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
|
|
55
54
|
import type {Chrome} from '../../../extension-api/ExtensionAPI.js'; // eslint-disable-line rulesdir/es_modules_import
|
|
@@ -1006,11 +1005,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
1006
1005
|
wrapper.style.setProperty('max-width', '100%');
|
|
1007
1006
|
wrapper.appendChild(lineFragment);
|
|
1008
1007
|
applyCurrentStyle(wrapper);
|
|
1009
|
-
|
|
1010
|
-
if (child.classList.contains('devtools-link') && child instanceof HTMLElement) {
|
|
1011
|
-
this.applyForcedVisibleStyle(child);
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1008
|
+
|
|
1014
1009
|
a.appendChild(wrapper);
|
|
1015
1010
|
if (i < lines.length - 1) {
|
|
1016
1011
|
a.appendChild(document.createElement('br'));
|
|
@@ -1032,25 +1027,6 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
1032
1027
|
return Platform.StringUtilities.format(format, parameters, formatters, formattedResult, append.bind(this));
|
|
1033
1028
|
}
|
|
1034
1029
|
|
|
1035
|
-
private applyForcedVisibleStyle(element: HTMLElement): void {
|
|
1036
|
-
element.style.setProperty('-webkit-text-stroke', '0', 'important');
|
|
1037
|
-
element.style.setProperty('text-decoration', 'underline', 'important');
|
|
1038
|
-
|
|
1039
|
-
const themedColor = ThemeSupport.ThemeSupport.instance().patchColorText(
|
|
1040
|
-
'rgb(33%, 33%, 33%)', ThemeSupport.ThemeSupport.ColorUsage.Foreground);
|
|
1041
|
-
element.style.setProperty('color', themedColor, 'important');
|
|
1042
|
-
|
|
1043
|
-
let backgroundColor = 'hsl(0, 0%, 100%)';
|
|
1044
|
-
if (this.message.level === Protocol.Log.LogEntryLevel.Error) {
|
|
1045
|
-
backgroundColor = 'hsl(0, 100%, 97%)';
|
|
1046
|
-
} else if (this.message.level === Protocol.Log.LogEntryLevel.Warning || this.shouldRenderAsWarning()) {
|
|
1047
|
-
backgroundColor = 'hsl(50, 100%, 95%)';
|
|
1048
|
-
}
|
|
1049
|
-
const themedBackgroundColor = ThemeSupport.ThemeSupport.instance().patchColorText(
|
|
1050
|
-
backgroundColor, ThemeSupport.ThemeSupport.ColorUsage.Background);
|
|
1051
|
-
element.style.setProperty('background-color', themedBackgroundColor, 'important');
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
1030
|
matchesFilterRegex(regexObject: RegExp): boolean {
|
|
1055
1031
|
regexObject.lastIndex = 0;
|
|
1056
1032
|
const contentElement = this.contentElement();
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
--override-focused-message-background-color: hsl(214deg 19% 20%);
|
|
50
50
|
--override-console-warning-background-color: hsl(50deg 100% 10%);
|
|
51
51
|
--override-console-warning-text-color: hsl(39deg 89% 55%);
|
|
52
|
+
--override-console-link-color: var(--color-background-inverted);
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
.console-toolbar-container {
|
|
@@ -460,6 +461,10 @@
|
|
|
460
461
|
height: 0;
|
|
461
462
|
}
|
|
462
463
|
|
|
464
|
+
.-theme-with-dark-background #console-messages .console-message-text .devtools-link {
|
|
465
|
+
color: var(--override-console-link-color);
|
|
466
|
+
}
|
|
467
|
+
|
|
463
468
|
@media (forced-colors: active) {
|
|
464
469
|
.console-message-expand-icon,
|
|
465
470
|
.console-warning-level [is="ui-icon"].icon-mask.expand-group-icon {
|
|
@@ -271,11 +271,11 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
271
271
|
this.#sideBar.addItem(i18nString(UIStrings.mediaQueries), 'media-queries');
|
|
272
272
|
this.#sideBar.select('summary');
|
|
273
273
|
|
|
274
|
-
this.#sideBar.addEventListener(SidebarEvents.ItemSelected, this
|
|
275
|
-
this.#sideBar.addEventListener(SidebarEvents.Reset, this
|
|
276
|
-
this.#controller.addEventListener(CSSOverViewControllerEvents.Reset, this
|
|
277
|
-
this.#controller.addEventListener(CSSOverViewControllerEvents.PopulateNodes, this
|
|
278
|
-
this.#resultsContainer.element.addEventListener('click', this
|
|
274
|
+
this.#sideBar.addEventListener(SidebarEvents.ItemSelected, this.#sideBarItemSelected, this);
|
|
275
|
+
this.#sideBar.addEventListener(SidebarEvents.Reset, this.#sideBarReset, this);
|
|
276
|
+
this.#controller.addEventListener(CSSOverViewControllerEvents.Reset, this.#reset, this);
|
|
277
|
+
this.#controller.addEventListener(CSSOverViewControllerEvents.PopulateNodes, this.#createElementsView, this);
|
|
278
|
+
this.#resultsContainer.element.addEventListener('click', this.#onClick.bind(this));
|
|
279
279
|
|
|
280
280
|
this.#data = null;
|
|
281
281
|
}
|
|
@@ -298,7 +298,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
298
298
|
this.#domModel = domModel;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
|
|
301
|
+
#sideBarItemSelected(event: Common.EventTarget.EventTargetEvent<string>): void {
|
|
302
302
|
const {data} = event;
|
|
303
303
|
const section = (this.#fragment as UI.Fragment.Fragment).$(data);
|
|
304
304
|
if (!section) {
|
|
@@ -308,11 +308,11 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
308
308
|
section.scrollIntoView();
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
|
|
311
|
+
#sideBarReset(): void {
|
|
312
312
|
this.#controller.dispatchEventToListeners(CSSOverViewControllerEvents.Reset);
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
|
|
315
|
+
#reset(): void {
|
|
316
316
|
this.#resultsContainer.element.removeChildren();
|
|
317
317
|
this.#mainContainer.setSidebarMinimized(true);
|
|
318
318
|
this.#elementContainer.closeTabs();
|
|
@@ -321,7 +321,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
321
321
|
this.#sideBar.select('summary');
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
|
|
324
|
+
#onClick(evt: Event): void {
|
|
325
325
|
if (!evt.target) {
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
@@ -453,19 +453,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
453
453
|
this.#mainContainer.setSidebarMinimized(false);
|
|
454
454
|
}
|
|
455
455
|
|
|
456
|
-
|
|
457
|
-
// Traverse the event path on the grid to find the nearest element with a backend node ID attached. Use
|
|
458
|
-
// that for the highlighting.
|
|
459
|
-
const node = (evt.composedPath() as HTMLElement[]).find(el => el.dataset && el.dataset.backendNodeId);
|
|
460
|
-
if (!node) {
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
const backendNodeId = Number(node.dataset.backendNodeId);
|
|
465
|
-
this.#controller.dispatchEventToListeners(CSSOverViewControllerEvents.RequestNodeHighlight, backendNodeId);
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
private async render(data: OverviewData): Promise<void> {
|
|
456
|
+
async #render(data: OverviewData): Promise<void> {
|
|
469
457
|
if (!data || !('backgroundColors' in data) || !('textColors' in data)) {
|
|
470
458
|
return;
|
|
471
459
|
}
|
|
@@ -485,10 +473,10 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
485
473
|
} = this.#data;
|
|
486
474
|
|
|
487
475
|
// Convert rgb values from the computed styles to either undefined or HEX(A) strings.
|
|
488
|
-
const sortedBackgroundColors = this
|
|
489
|
-
const sortedTextColors = this
|
|
490
|
-
const sortedFillColors = this
|
|
491
|
-
const sortedBorderColors = this
|
|
476
|
+
const sortedBackgroundColors = this.#sortColorsByLuminance(backgroundColors);
|
|
477
|
+
const sortedTextColors = this.#sortColorsByLuminance(textColors);
|
|
478
|
+
const sortedFillColors = this.#sortColorsByLuminance(fillColors);
|
|
479
|
+
const sortedBorderColors = this.#sortColorsByLuminance(borderColors);
|
|
492
480
|
|
|
493
481
|
this.#fragment = UI.Fragment.Fragment.build`
|
|
494
482
|
<div class="vbox overview-completed-view">
|
|
@@ -549,44 +537,44 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
549
537
|
PH1: sortedBackgroundColors.length,
|
|
550
538
|
})}</h2>
|
|
551
539
|
<ul>
|
|
552
|
-
${sortedBackgroundColors.map(this
|
|
540
|
+
${sortedBackgroundColors.map(this.#colorsToFragment.bind(this, 'background'))}
|
|
553
541
|
</ul>
|
|
554
542
|
|
|
555
543
|
<h2>${i18nString(UIStrings.textColorsS, {
|
|
556
544
|
PH1: sortedTextColors.length,
|
|
557
545
|
})}</h2>
|
|
558
546
|
<ul>
|
|
559
|
-
${sortedTextColors.map(this
|
|
547
|
+
${sortedTextColors.map(this.#colorsToFragment.bind(this, 'text'))}
|
|
560
548
|
</ul>
|
|
561
549
|
|
|
562
|
-
${textColorContrastIssues.size > 0 ? this
|
|
550
|
+
${textColorContrastIssues.size > 0 ? this.#contrastIssuesToFragment(textColorContrastIssues) : ''}
|
|
563
551
|
|
|
564
552
|
<h2>${i18nString(UIStrings.fillColorsS, {
|
|
565
553
|
PH1: sortedFillColors.length,
|
|
566
554
|
})}</h2>
|
|
567
555
|
<ul>
|
|
568
|
-
${sortedFillColors.map(this
|
|
556
|
+
${sortedFillColors.map(this.#colorsToFragment.bind(this, 'fill'))}
|
|
569
557
|
</ul>
|
|
570
558
|
|
|
571
559
|
<h2>${i18nString(UIStrings.borderColorsS, {
|
|
572
560
|
PH1: sortedBorderColors.length,
|
|
573
561
|
})}</h2>
|
|
574
562
|
<ul>
|
|
575
|
-
${sortedBorderColors.map(this
|
|
563
|
+
${sortedBorderColors.map(this.#colorsToFragment.bind(this, 'border'))}
|
|
576
564
|
</ul>
|
|
577
565
|
</div>
|
|
578
566
|
|
|
579
567
|
<div $="font-info" class="results-section font-info">
|
|
580
568
|
<h1>${i18nString(UIStrings.fontInfo)}</h1>
|
|
581
569
|
${
|
|
582
|
-
fontInfo.size > 0 ? this
|
|
570
|
+
fontInfo.size > 0 ? this.#fontInfoToFragment(fontInfo) :
|
|
583
571
|
UI.Fragment.Fragment.build`<div>${i18nString(UIStrings.thereAreNoFonts)}</div>`}
|
|
584
572
|
</div>
|
|
585
573
|
|
|
586
574
|
<div $="unused-declarations" class="results-section unused-declarations">
|
|
587
575
|
<h1>${i18nString(UIStrings.unusedDeclarations)}</h1>
|
|
588
576
|
${
|
|
589
|
-
unusedDeclarations.size > 0 ? this
|
|
577
|
+
unusedDeclarations.size > 0 ? this.#groupToFragment(unusedDeclarations, 'unused-declarations', 'declaration') :
|
|
590
578
|
UI.Fragment.Fragment.build`<div class="horizontally-padded">${
|
|
591
579
|
i18nString(UIStrings.thereAreNoUnusedDeclarations)}</div>`}
|
|
592
580
|
</div>
|
|
@@ -594,7 +582,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
594
582
|
<div $="media-queries" class="results-section media-queries">
|
|
595
583
|
<h1>${i18nString(UIStrings.mediaQueries)}</h1>
|
|
596
584
|
${
|
|
597
|
-
mediaQueries.size > 0 ? this
|
|
585
|
+
mediaQueries.size > 0 ? this.#groupToFragment(mediaQueries, 'media-queries', 'text') :
|
|
598
586
|
UI.Fragment.Fragment.build`<div class="horizontally-padded">${
|
|
599
587
|
i18nString(UIStrings.thereAreNoMediaQueries)}</div>`}
|
|
600
588
|
</div>
|
|
@@ -603,7 +591,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
603
591
|
this.#resultsContainer.element.appendChild(this.#fragment.element());
|
|
604
592
|
}
|
|
605
593
|
|
|
606
|
-
|
|
594
|
+
#createElementsView(evt: Common.EventTarget.EventTargetEvent<{payload: PopulateNodesEvent}>): void {
|
|
607
595
|
const {payload} = evt.data;
|
|
608
596
|
|
|
609
597
|
let id = '';
|
|
@@ -659,17 +647,17 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
659
647
|
this.#elementContainer.appendTab(id, tabTitle, view, true);
|
|
660
648
|
}
|
|
661
649
|
|
|
662
|
-
|
|
650
|
+
#fontInfoToFragment(fontInfo: Map<string, Map<string, Map<string, number[]>>>): UI.Fragment.Fragment {
|
|
663
651
|
const fonts = Array.from(fontInfo.entries());
|
|
664
652
|
return UI.Fragment.Fragment.build`
|
|
665
653
|
${fonts.map(([font, fontMetrics]) => {
|
|
666
654
|
return UI.Fragment.Fragment.build`<section class="font-family"><h2>${font}</h2> ${
|
|
667
|
-
this
|
|
655
|
+
this.#fontMetricsToFragment(font, fontMetrics)}</section>`;
|
|
668
656
|
})}
|
|
669
657
|
`;
|
|
670
658
|
}
|
|
671
659
|
|
|
672
|
-
|
|
660
|
+
#fontMetricsToFragment(font: string, fontMetrics: Map<string, Map<string, number[]>>): UI.Fragment.Fragment {
|
|
673
661
|
const fontMetricInfo = Array.from(fontMetrics.entries());
|
|
674
662
|
|
|
675
663
|
return UI.Fragment.Fragment.build`
|
|
@@ -679,13 +667,13 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
679
667
|
return UI.Fragment.Fragment.build`
|
|
680
668
|
<div>
|
|
681
669
|
<h3>${label}</h3>
|
|
682
|
-
${this
|
|
670
|
+
${this.#groupToFragment(values, 'font-info', 'value', sanitizedPath)}
|
|
683
671
|
</div>`;
|
|
684
672
|
})}
|
|
685
673
|
</div>`;
|
|
686
674
|
}
|
|
687
675
|
|
|
688
|
-
|
|
676
|
+
#groupToFragment(
|
|
689
677
|
items: Map<string, (number | UnusedDeclaration | Protocol.CSS.CSSMedia)[]>, type: string, dataLabel: string,
|
|
690
678
|
path: string = ''): UI.Fragment.Fragment {
|
|
691
679
|
// Sort by number of items descending.
|
|
@@ -715,18 +703,18 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
715
703
|
</ul>`;
|
|
716
704
|
}
|
|
717
705
|
|
|
718
|
-
|
|
706
|
+
#contrastIssuesToFragment(issues: Map<string, ContrastIssue[]>): UI.Fragment.Fragment {
|
|
719
707
|
return UI.Fragment.Fragment.build`
|
|
720
708
|
<h2>${i18nString(UIStrings.contrastIssuesS, {
|
|
721
709
|
PH1: issues.size,
|
|
722
710
|
})}</h2>
|
|
723
711
|
<ul>
|
|
724
|
-
${[...issues.entries()].map(([key, value]) => this
|
|
712
|
+
${[...issues.entries()].map(([key, value]) => this.#contrastIssueToFragment(key, value))}
|
|
725
713
|
</ul>
|
|
726
714
|
`;
|
|
727
715
|
}
|
|
728
716
|
|
|
729
|
-
|
|
717
|
+
#contrastIssueToFragment(key: string, issues: ContrastIssue[]): UI.Fragment.Fragment {
|
|
730
718
|
console.assert(issues.length > 0);
|
|
731
719
|
|
|
732
720
|
let minContrastIssue: ContrastIssue = issues[0];
|
|
@@ -797,7 +785,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
797
785
|
return blockFragment;
|
|
798
786
|
}
|
|
799
787
|
|
|
800
|
-
|
|
788
|
+
#colorsToFragment(section: string, color: string): UI.Fragment.Fragment|undefined {
|
|
801
789
|
const blockFragment = UI.Fragment.Fragment.build`<li>
|
|
802
790
|
<button data-type="color" data-color="${color}" data-section="${section}" class="block" $="color"></button>
|
|
803
791
|
<div class="block-title">${color}</div>
|
|
@@ -815,7 +803,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
815
803
|
return blockFragment;
|
|
816
804
|
}
|
|
817
805
|
|
|
818
|
-
|
|
806
|
+
#sortColorsByLuminance(srcColors: Map<string, Set<number>>): string[] {
|
|
819
807
|
return Array.from(srcColors.keys()).sort((colA, colB) => {
|
|
820
808
|
const colorA = Common.Color.Color.parse(colA);
|
|
821
809
|
const colorB = Common.Color.Color.parse(colB);
|
|
@@ -827,7 +815,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
827
815
|
}
|
|
828
816
|
|
|
829
817
|
setOverviewData(data: OverviewData): void {
|
|
830
|
-
this
|
|
818
|
+
this.#render(data);
|
|
831
819
|
}
|
|
832
820
|
|
|
833
821
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -967,14 +955,15 @@ export class ElementDetailsView extends UI.Widget.Widget {
|
|
|
967
955
|
refreshCallback: undefined,
|
|
968
956
|
});
|
|
969
957
|
this.#elementGrid.element.classList.add('element-grid');
|
|
970
|
-
this.#elementGrid.element.addEventListener('mouseover', this
|
|
958
|
+
this.#elementGrid.element.addEventListener('mouseover', this.#onMouseOver.bind(this));
|
|
971
959
|
this.#elementGrid.setStriped(true);
|
|
972
|
-
this.#elementGrid.addEventListener(
|
|
960
|
+
this.#elementGrid.addEventListener(
|
|
961
|
+
DataGrid.DataGrid.Events.SortingChanged, this.#sortMediaQueryDataGrid.bind(this));
|
|
973
962
|
|
|
974
963
|
this.#elementGrid.asWidget().show(this.element);
|
|
975
964
|
}
|
|
976
965
|
|
|
977
|
-
|
|
966
|
+
#sortMediaQueryDataGrid(): void {
|
|
978
967
|
const sortColumnId = this.#elementGrid.sortColumnId();
|
|
979
968
|
if (!sortColumnId) {
|
|
980
969
|
return;
|
|
@@ -984,7 +973,7 @@ export class ElementDetailsView extends UI.Widget.Widget {
|
|
|
984
973
|
this.#elementGrid.sortNodes(comparator, !this.#elementGrid.isSortOrderAscending());
|
|
985
974
|
}
|
|
986
975
|
|
|
987
|
-
|
|
976
|
+
#onMouseOver(evt: Event): void {
|
|
988
977
|
// Traverse the event path on the grid to find the nearest element with a backend node ID attached. Use
|
|
989
978
|
// that for the highlighting.
|
|
990
979
|
const node = (evt.composedPath() as HTMLElement[]).find(el => el.dataset && el.dataset.backendNodeId);
|
|
@@ -1093,7 +1082,7 @@ export class ElementNode extends DataGrid.SortableDataGrid.SortableDataGridNode<
|
|
|
1093
1082
|
const cell = this.createTD(columnId);
|
|
1094
1083
|
|
|
1095
1084
|
if (this.data.range) {
|
|
1096
|
-
const link = this
|
|
1085
|
+
const link = this.#linkifyRuleLocation(
|
|
1097
1086
|
this.#cssModel, this.#linkifier, this.data.styleSheetId,
|
|
1098
1087
|
TextUtils.TextRange.TextRange.fromObject(this.data.range));
|
|
1099
1088
|
|
|
@@ -1153,7 +1142,7 @@ export class ElementNode extends DataGrid.SortableDataGrid.SortableDataGridNode<
|
|
|
1153
1142
|
return super.createCell(columnId);
|
|
1154
1143
|
}
|
|
1155
1144
|
|
|
1156
|
-
|
|
1145
|
+
#linkifyRuleLocation(
|
|
1157
1146
|
cssModel: SDK.CSSModel.CSSModel, linkifier: Components.Linkifier.Linkifier,
|
|
1158
1147
|
styleSheetId: Protocol.CSS.StyleSheetId, ruleLocation: TextUtils.TextRange.TextRange): Element|undefined {
|
|
1159
1148
|
const styleSheetHeader = cssModel.styleSheetHeaderForId(styleSheetId);
|
|
@@ -16,10 +16,10 @@ export class OverviewController extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
16
16
|
|
|
17
17
|
this.currentUrl = SDK.TargetManager.TargetManager.instance().inspectedURL();
|
|
18
18
|
SDK.TargetManager.TargetManager.instance().addEventListener(
|
|
19
|
-
SDK.TargetManager.Events.InspectedURLChanged, this
|
|
19
|
+
SDK.TargetManager.Events.InspectedURLChanged, this.#checkUrlAndResetIfChanged, this);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
#checkUrlAndResetIfChanged(): void {
|
|
23
23
|
if (this.currentUrl === SDK.TargetManager.TargetManager.instance().inspectedURL()) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -55,13 +55,13 @@ export class CSSOverviewPanel extends UI.Panel.Panel implements SDK.TargetManage
|
|
|
55
55
|
|
|
56
56
|
this.#controller.addEventListener(Events.RequestOverviewStart, _event => {
|
|
57
57
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.CaptureCssOverviewClicked);
|
|
58
|
-
this
|
|
58
|
+
this.#startOverview();
|
|
59
59
|
}, this);
|
|
60
|
-
this.#controller.addEventListener(Events.OverviewCompleted, this
|
|
61
|
-
this.#controller.addEventListener(Events.Reset, this
|
|
62
|
-
this.#controller.addEventListener(Events.RequestNodeHighlight, this
|
|
60
|
+
this.#controller.addEventListener(Events.OverviewCompleted, this.#overviewCompleted, this);
|
|
61
|
+
this.#controller.addEventListener(Events.Reset, this.#reset, this);
|
|
62
|
+
this.#controller.addEventListener(Events.RequestNodeHighlight, this.#requestNodeHighlight, this);
|
|
63
63
|
|
|
64
|
-
this
|
|
64
|
+
this.#reset();
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
static instance(): CSSOverviewPanel {
|
|
@@ -84,14 +84,14 @@ export class CSSOverviewPanel extends UI.Panel.Panel implements SDK.TargetManage
|
|
|
84
84
|
targetRemoved(): void {
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
#getModel(): CSSOverviewModel {
|
|
88
88
|
if (!this.#model) {
|
|
89
89
|
throw new Error('Did not retrieve model information yet.');
|
|
90
90
|
}
|
|
91
91
|
return this.#model;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
#reset(): void {
|
|
95
95
|
this.#backgroundColors = new Map();
|
|
96
96
|
this.#textColors = new Map();
|
|
97
97
|
this.#fillColors = new Map();
|
|
@@ -117,14 +117,14 @@ export class CSSOverviewPanel extends UI.Panel.Panel implements SDK.TargetManage
|
|
|
117
117
|
},
|
|
118
118
|
};
|
|
119
119
|
this.#textColorContrastIssues = new Map();
|
|
120
|
-
this
|
|
120
|
+
this.#renderInitialView();
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
this
|
|
123
|
+
#requestNodeHighlight(evt: Common.EventTarget.EventTargetEvent<number>): void {
|
|
124
|
+
this.#getModel().highlightNode((evt.data as Protocol.DOM.BackendNodeId));
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
#renderInitialView(): void {
|
|
128
128
|
this.#processingView.hideWidget();
|
|
129
129
|
this.#completedView.hideWidget();
|
|
130
130
|
|
|
@@ -132,14 +132,14 @@ export class CSSOverviewPanel extends UI.Panel.Panel implements SDK.TargetManage
|
|
|
132
132
|
this.#startView.show();
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
#renderOverviewStartedView(): void {
|
|
136
136
|
this.#startView.hide();
|
|
137
137
|
this.#completedView.hideWidget();
|
|
138
138
|
|
|
139
139
|
this.#processingView.show(this.contentElement);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
#renderOverviewCompletedView(): void {
|
|
143
143
|
this.#startView.hide();
|
|
144
144
|
this.#processingView.hideWidget();
|
|
145
145
|
|
|
@@ -158,10 +158,10 @@ export class CSSOverviewPanel extends UI.Panel.Panel implements SDK.TargetManage
|
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
this
|
|
161
|
+
async #startOverview(): Promise<void> {
|
|
162
|
+
this.#renderOverviewStartedView();
|
|
163
163
|
|
|
164
|
-
const model = this
|
|
164
|
+
const model = this.#getModel();
|
|
165
165
|
const [globalStyleStats, { elementCount, backgroundColors, textColors, textColorContrastIssues, fillColors, borderColors, fontInfo, unusedDeclarations }, mediaQueries] = await Promise.all([
|
|
166
166
|
model.getGlobalStylesheetStats(),
|
|
167
167
|
model.getNodeStyleStats(),
|
|
@@ -211,17 +211,8 @@ export class CSSOverviewPanel extends UI.Panel.Panel implements SDK.TargetManage
|
|
|
211
211
|
this.#controller.dispatchEventToListeners(Events.OverviewCompleted);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
if (!item.length) {
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return item[0].value;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
private overviewCompleted(): void {
|
|
224
|
-
this.renderOverviewCompletedView();
|
|
214
|
+
#overviewCompleted(): void {
|
|
215
|
+
this.#renderOverviewCompletedView();
|
|
225
216
|
}
|
|
226
217
|
wasShown(): void {
|
|
227
218
|
super.wasShown();
|
|
@@ -25,10 +25,10 @@ export class CSSOverviewProcessingView extends UI.Widget.Widget {
|
|
|
25
25
|
super();
|
|
26
26
|
|
|
27
27
|
this.#controller = controller;
|
|
28
|
-
this
|
|
28
|
+
this.#render();
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
#render(): void {
|
|
32
32
|
const cancelButton = UI.UIUtils.createTextButton(
|
|
33
33
|
i18nString(UIStrings.cancel), () => this.#controller.dispatchEventToListeners(Events.RequestOverviewCancel), '',
|
|
34
34
|
true /* primary */);
|