chrome-devtools-frontend 1.0.951864 → 1.0.952784
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/front_end/.eslintrc.js +6 -0
- 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/PageResourceLoader.ts +2 -1
- 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 +202 -200
- 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/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/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/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/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/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/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/timeline/TimelineFlameChartView.ts +1 -1
- 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/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_prompt/TextPrompt.ts +18 -18
- package/front_end/ui/components/tree_outline/TreeOutline.ts +69 -70
- package/front_end/ui/legacy/SearchableView.ts +13 -4
- 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
|
@@ -104,7 +104,7 @@ export class RenderCoordinator extends EventTarget {
|
|
|
104
104
|
|
|
105
105
|
done(): Promise<void> {
|
|
106
106
|
if (this.#pendingWorkFrames.length === 0) {
|
|
107
|
-
this
|
|
107
|
+
this.#logIfEnabled('[Queue empty]');
|
|
108
108
|
return Promise.resolve();
|
|
109
109
|
}
|
|
110
110
|
return new Promise(resolve => this.addEventListener('renderqueueempty', () => resolve(), {once: true}));
|
|
@@ -118,10 +118,10 @@ export class RenderCoordinator extends EventTarget {
|
|
|
118
118
|
if (!callback) {
|
|
119
119
|
throw new Error('Read called with label but no callback');
|
|
120
120
|
}
|
|
121
|
-
return this
|
|
121
|
+
return this.#enqueueHandler<T>(callback, ACTION.READ, labelOrCallback);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
return this
|
|
124
|
+
return this.#enqueueHandler<T>(labelOrCallback, ACTION.READ, UNNAMED_READ);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
async write<T extends unknown>(callback: CoordinatorCallback): Promise<T>;
|
|
@@ -132,10 +132,10 @@ export class RenderCoordinator extends EventTarget {
|
|
|
132
132
|
if (!callback) {
|
|
133
133
|
throw new Error('Write called with label but no callback');
|
|
134
134
|
}
|
|
135
|
-
return this
|
|
135
|
+
return this.#enqueueHandler<T>(callback, ACTION.WRITE, labelOrCallback);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
return this
|
|
138
|
+
return this.#enqueueHandler<T>(labelOrCallback, ACTION.WRITE, UNNAMED_WRITE);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
takeRecords(): CoordinatorLogEntry[] {
|
|
@@ -158,13 +158,13 @@ export class RenderCoordinator extends EventTarget {
|
|
|
158
158
|
if (!callback) {
|
|
159
159
|
throw new Error('Scroll called with label but no callback');
|
|
160
160
|
}
|
|
161
|
-
return this
|
|
161
|
+
return this.#enqueueHandler<T>(callback, ACTION.READ, labelOrCallback);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
return this
|
|
164
|
+
return this.#enqueueHandler<T>(labelOrCallback, ACTION.READ, UNNAMED_SCROLL);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
#enqueueHandler<T = unknown>(callback: CoordinatorCallback, action: ACTION, label = ''): Promise<T> {
|
|
168
168
|
this.#labels.set(callback, `${action === ACTION.READ ? '[Read]' : '[Write]'}: ${label}`);
|
|
169
169
|
|
|
170
170
|
if (this.#pendingWorkFrames.length === 0) {
|
|
@@ -197,11 +197,11 @@ export class RenderCoordinator extends EventTarget {
|
|
|
197
197
|
this.#rejectors.set(callback, reject);
|
|
198
198
|
});
|
|
199
199
|
|
|
200
|
-
this
|
|
200
|
+
this.#scheduleWork();
|
|
201
201
|
return resolverPromise as Promise<T>;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
|
|
204
|
+
async #handleWork(handler: CoordinatorCallback): Promise<void> {
|
|
205
205
|
const data = await handler.call(undefined);
|
|
206
206
|
const resolver = this.#resolvers.get(handler);
|
|
207
207
|
if (!resolver) {
|
|
@@ -213,7 +213,7 @@ export class RenderCoordinator extends EventTarget {
|
|
|
213
213
|
this.#rejectors.delete(handler);
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
|
|
216
|
+
#scheduleWork(): void {
|
|
217
217
|
const hasScheduledWork = this.#scheduledWorkId !== 0;
|
|
218
218
|
if (hasScheduledWork) {
|
|
219
219
|
return;
|
|
@@ -230,13 +230,13 @@ export class RenderCoordinator extends EventTarget {
|
|
|
230
230
|
this.dispatchEvent(new RenderCoordinatorQueueEmptyEvent());
|
|
231
231
|
window.dispatchEvent(new RenderCoordinatorQueueEmptyEvent());
|
|
232
232
|
|
|
233
|
-
this
|
|
233
|
+
this.#logIfEnabled('[Queue empty]');
|
|
234
234
|
this.#scheduledWorkId = 0;
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
this.dispatchEvent(new RenderCoordinatorNewFrameEvent());
|
|
239
|
-
this
|
|
239
|
+
this.#logIfEnabled('[New frame]');
|
|
240
240
|
|
|
241
241
|
const frame = this.#pendingWorkFrames.shift();
|
|
242
242
|
if (!frame) {
|
|
@@ -247,8 +247,8 @@ export class RenderCoordinator extends EventTarget {
|
|
|
247
247
|
// to proceed together.
|
|
248
248
|
const readers: Promise<unknown>[] = [];
|
|
249
249
|
for (const reader of frame.readers) {
|
|
250
|
-
this
|
|
251
|
-
readers.push(this
|
|
250
|
+
this.#logIfEnabled(this.#labels.get(reader));
|
|
251
|
+
readers.push(this.#handleWork(reader));
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
// Wait for them all to be done.
|
|
@@ -262,14 +262,14 @@ export class RenderCoordinator extends EventTarget {
|
|
|
262
262
|
}),
|
|
263
263
|
]);
|
|
264
264
|
} catch (err) {
|
|
265
|
-
this
|
|
265
|
+
this.#rejectAll(frame.readers, err);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
// Next do all the writers as a block.
|
|
269
269
|
const writers: Promise<unknown>[] = [];
|
|
270
270
|
for (const writer of frame.writers) {
|
|
271
|
-
this
|
|
272
|
-
writers.push(this
|
|
271
|
+
this.#logIfEnabled(this.#labels.get(writer));
|
|
272
|
+
writers.push(this.#handleWork(writer));
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
// And wait for them to be done, too.
|
|
@@ -283,18 +283,18 @@ export class RenderCoordinator extends EventTarget {
|
|
|
283
283
|
}),
|
|
284
284
|
]);
|
|
285
285
|
} catch (err) {
|
|
286
|
-
this
|
|
286
|
+
this.#rejectAll(frame.writers, err);
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
// Since there may have been more work requested in
|
|
290
290
|
// the callback of a reader / writer, we attempt to schedule
|
|
291
291
|
// it at this point.
|
|
292
292
|
this.#scheduledWorkId = 0;
|
|
293
|
-
this
|
|
293
|
+
this.#scheduleWork();
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
|
|
297
|
+
#rejectAll(handlers: CoordinatorCallback[], error: Error): void {
|
|
298
298
|
for (const handler of handlers) {
|
|
299
299
|
const rejector = this.#rejectors.get(handler);
|
|
300
300
|
if (!rejector) {
|
|
@@ -308,7 +308,7 @@ export class RenderCoordinator extends EventTarget {
|
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
|
|
311
|
+
#logIfEnabled(value: string|undefined): void {
|
|
312
312
|
if (!this.observe || !value) {
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
@@ -42,15 +42,15 @@ export class Report extends HTMLElement {
|
|
|
42
42
|
|
|
43
43
|
set data({reportTitle}: ReportData) {
|
|
44
44
|
this.#reportTitle = reportTitle;
|
|
45
|
-
this
|
|
45
|
+
this.#render();
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
connectedCallback(): void {
|
|
49
49
|
this.#shadow.adoptedStyleSheets = [reportStyles];
|
|
50
|
-
this
|
|
50
|
+
this.#render();
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
#render(): void {
|
|
54
54
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
55
55
|
// clang-format off
|
|
56
56
|
LitHtml.render(LitHtml.html`
|
|
@@ -69,19 +69,19 @@ export interface ReportSectionData {
|
|
|
69
69
|
|
|
70
70
|
export class ReportSection extends HTMLElement {
|
|
71
71
|
static readonly litTagName = LitHtml.literal`devtools-report-section`;
|
|
72
|
-
|
|
72
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
73
73
|
connectedCallback(): void {
|
|
74
|
-
this
|
|
75
|
-
this
|
|
74
|
+
this.#shadow.adoptedStyleSheets = [reportSectionStyles];
|
|
75
|
+
this.#render();
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
#render(): void {
|
|
78
78
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
79
79
|
// clang-format off
|
|
80
80
|
LitHtml.render(LitHtml.html`
|
|
81
81
|
<div class="section">
|
|
82
82
|
<slot></slot>
|
|
83
83
|
</div>
|
|
84
|
-
`, this
|
|
84
|
+
`, this.#shadow, {host: this});
|
|
85
85
|
// clang-format on
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -92,10 +92,10 @@ export class ReportSectionHeader extends HTMLElement {
|
|
|
92
92
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
93
93
|
connectedCallback(): void {
|
|
94
94
|
this.#shadow.adoptedStyleSheets = [reportSectionHeaderStyles];
|
|
95
|
-
this
|
|
95
|
+
this.#render();
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
#render(): void {
|
|
99
99
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
100
100
|
// clang-format off
|
|
101
101
|
LitHtml.render(LitHtml.html`
|
|
@@ -113,10 +113,10 @@ export class ReportSectionDivider extends HTMLElement {
|
|
|
113
113
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
114
114
|
connectedCallback(): void {
|
|
115
115
|
this.#shadow.adoptedStyleSheets = [reportSectionDividerStyles];
|
|
116
|
-
this
|
|
116
|
+
this.#render();
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
#render(): void {
|
|
120
120
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
121
121
|
// clang-format off
|
|
122
122
|
LitHtml.render(LitHtml.html`
|
|
@@ -133,10 +133,10 @@ export class ReportKey extends HTMLElement {
|
|
|
133
133
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
134
134
|
connectedCallback(): void {
|
|
135
135
|
this.#shadow.adoptedStyleSheets = [reportKeyStyles];
|
|
136
|
-
this
|
|
136
|
+
this.#render();
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
#render(): void {
|
|
140
140
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
141
141
|
// clang-format off
|
|
142
142
|
LitHtml.render(LitHtml.html`
|
|
@@ -152,10 +152,10 @@ export class ReportValue extends HTMLElement {
|
|
|
152
152
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
153
153
|
connectedCallback(): void {
|
|
154
154
|
this.#shadow.adoptedStyleSheets = [reportValueStyles];
|
|
155
|
-
this
|
|
155
|
+
this.#render();
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
#render(): void {
|
|
159
159
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
160
160
|
// clang-format off
|
|
161
161
|
LitHtml.render(LitHtml.html`
|
|
@@ -84,16 +84,16 @@ export class RequestLinkIcon extends HTMLElement {
|
|
|
84
84
|
this.#reveal = data.revealOverride;
|
|
85
85
|
}
|
|
86
86
|
if (!this.#request && data.affectedRequest) {
|
|
87
|
-
this.#requestResolvedPromise = this
|
|
87
|
+
this.#requestResolvedPromise = this.#resolveRequest(data.affectedRequest.requestId);
|
|
88
88
|
}
|
|
89
|
-
this
|
|
89
|
+
this.#render();
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
connectedCallback(): void {
|
|
93
93
|
this.#shadow.adoptedStyleSheets = [requestLinkIconStyles];
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
#resolveRequest(requestId: Protocol.Network.RequestId): Promise<void> {
|
|
97
97
|
if (!this.#requestResolver) {
|
|
98
98
|
throw new Error('A `RequestResolver` must be provided if an `affectedRequest` is provided.');
|
|
99
99
|
}
|
|
@@ -120,7 +120,7 @@ export class RequestLinkIcon extends HTMLElement {
|
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
#iconColor(): string {
|
|
124
124
|
if (!this.#request) {
|
|
125
125
|
return '--issue-color-yellow';
|
|
126
126
|
}
|
|
@@ -130,7 +130,7 @@ export class RequestLinkIcon extends HTMLElement {
|
|
|
130
130
|
iconData(): IconButton.Icon.IconData {
|
|
131
131
|
return {
|
|
132
132
|
iconName: 'network_panel_icon',
|
|
133
|
-
color: `var(${this
|
|
133
|
+
color: `var(${this.#iconColor()})`,
|
|
134
134
|
width: '16px',
|
|
135
135
|
height: '16px',
|
|
136
136
|
};
|
|
@@ -156,25 +156,25 @@ export class RequestLinkIcon extends HTMLElement {
|
|
|
156
156
|
this.#additionalOnClickAction?.();
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
#getTooltip(): Platform.UIString.LocalizedString {
|
|
160
160
|
if (this.#request) {
|
|
161
161
|
return i18nString(UIStrings.clickToShowRequestInTheNetwork, {url: this.#request.url()});
|
|
162
162
|
}
|
|
163
163
|
return i18nString(UIStrings.requestUnavailableInTheNetwork);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
#getUrlForDisplaying(): string|undefined {
|
|
167
167
|
if (!this.#request) {
|
|
168
168
|
return this.#affectedRequest?.url;
|
|
169
169
|
}
|
|
170
170
|
return this.#request.url();
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
#maybeRenderURL(): LitHtml.TemplateResult|{} {
|
|
174
174
|
if (!this.#displayURL) {
|
|
175
175
|
return LitHtml.nothing;
|
|
176
176
|
}
|
|
177
|
-
const url = this
|
|
177
|
+
const url = this.#getUrlForDisplaying();
|
|
178
178
|
if (!url) {
|
|
179
179
|
return LitHtml.nothing;
|
|
180
180
|
}
|
|
@@ -182,26 +182,26 @@ export class RequestLinkIcon extends HTMLElement {
|
|
|
182
182
|
return LitHtml.html`<span aria-label=${i18nString(UIStrings.shortenedURL)} title=${url}>${filename}</span>`;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
#render(): Promise<void> {
|
|
186
186
|
return coordinator.write(() => {
|
|
187
187
|
// clang-format off
|
|
188
188
|
LitHtml.render(LitHtml.html`
|
|
189
|
-
${LitHtml.Directives.until(this.#requestResolvedPromise.then(() => this
|
|
189
|
+
${LitHtml.Directives.until(this.#requestResolvedPromise.then(() => this.#renderComponent()), this.#renderComponent())}
|
|
190
190
|
`,
|
|
191
191
|
this.#shadow, {host: this});
|
|
192
192
|
// clang-format on
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
#renderComponent(): LitHtml.TemplateResult {
|
|
197
197
|
// clang-format off
|
|
198
198
|
return LitHtml.html`
|
|
199
199
|
<span class=${LitHtml.Directives.classMap({'link': Boolean(this.#request)})}
|
|
200
200
|
tabindex="0"
|
|
201
201
|
@click=${this.handleClick}>
|
|
202
202
|
<${IconButton.Icon.Icon.litTagName} .data=${this.iconData() as IconButton.Icon.IconData}
|
|
203
|
-
title=${this
|
|
204
|
-
${this
|
|
203
|
+
title=${this.#getTooltip()}></${IconButton.Icon.Icon.litTagName}>
|
|
204
|
+
${this.#maybeRenderURL()}
|
|
205
205
|
</span>`;
|
|
206
206
|
// clang-format on
|
|
207
207
|
}
|
|
@@ -41,12 +41,12 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
41
41
|
this.#disabled = Boolean(data.disabled);
|
|
42
42
|
|
|
43
43
|
this.#changeListenerDescriptor = this.#setting.addChangeListener(() => {
|
|
44
|
-
this
|
|
44
|
+
this.#render();
|
|
45
45
|
});
|
|
46
|
-
this
|
|
46
|
+
this.#render();
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
#render(): void {
|
|
50
50
|
if (!this.#setting) {
|
|
51
51
|
throw new Error('No "Setting" object provided for rendering');
|
|
52
52
|
}
|
|
@@ -56,13 +56,13 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
56
56
|
<p>
|
|
57
57
|
<label>
|
|
58
58
|
<input type="checkbox" ?checked=${this.#setting.get()} ?disabled=${this.#disabled} @change=${
|
|
59
|
-
this
|
|
59
|
+
this.#checkboxChanged} aria-label=${this.#setting.title()} /> ${this.#setting.title()}
|
|
60
60
|
</label>
|
|
61
61
|
</p>`,
|
|
62
62
|
this.#shadow, {host: this});
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
#checkboxChanged(e: Event): void {
|
|
66
66
|
this.#setting?.set((e.target as HTMLInputElement).checked);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -69,10 +69,10 @@ export class SurveyLink extends HTMLElement {
|
|
|
69
69
|
this.#canShowSurvey = data.canShowSurvey;
|
|
70
70
|
this.#showSurvey = data.showSurvey;
|
|
71
71
|
|
|
72
|
-
this
|
|
72
|
+
this.#checkSurvey();
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
#checkSurvey(): void {
|
|
76
76
|
this.#state = State.Checking;
|
|
77
77
|
this.#canShowSurvey(this.#trigger, ({canShowSurvey}) => {
|
|
78
78
|
if (!canShowSurvey) {
|
|
@@ -80,24 +80,24 @@ export class SurveyLink extends HTMLElement {
|
|
|
80
80
|
} else {
|
|
81
81
|
this.#state = State.ShowLink;
|
|
82
82
|
}
|
|
83
|
-
this
|
|
83
|
+
this.#render();
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
#sendSurvey(): void {
|
|
88
88
|
this.#state = State.Sending;
|
|
89
|
-
this
|
|
89
|
+
this.#render();
|
|
90
90
|
this.#showSurvey(this.#trigger, ({surveyShown}) => {
|
|
91
91
|
if (!surveyShown) {
|
|
92
92
|
this.#state = State.Failed;
|
|
93
93
|
} else {
|
|
94
94
|
this.#state = State.SurveyShown;
|
|
95
95
|
}
|
|
96
|
-
this
|
|
96
|
+
this.#render();
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
#render(): void {
|
|
101
101
|
if (this.#state === State.Checking || this.#state === State.DontShowLink) {
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
@@ -123,7 +123,7 @@ export class SurveyLink extends HTMLElement {
|
|
|
123
123
|
// clang-format off
|
|
124
124
|
// eslint-disable-next-line rulesdir/ban_style_tags_in_lit_html
|
|
125
125
|
const output = LitHtml.html`
|
|
126
|
-
<button class="link ${linkState}" tabindex=${ariaDisabled ? '-1' : '0'} .disabled=${ariaDisabled} aria-disabled=${ariaDisabled} @click=${this
|
|
126
|
+
<button class="link ${linkState}" tabindex=${ariaDisabled ? '-1' : '0'} .disabled=${ariaDisabled} aria-disabled=${ariaDisabled} @click=${this.#sendSurvey}>
|
|
127
127
|
<${IconButton.Icon.Icon.litTagName} class="link-icon" .data=${{iconName: 'feedback_button_icon', color: 'var(--color-link)', width: 'var(--issue-link-icon-size, 16px)', height: 'var(--issue-link-icon-size, 16px)'} as IconButton.Icon.IconData}></${IconButton.Icon.Icon.litTagName}><!--
|
|
128
128
|
-->${linkText}
|
|
129
129
|
</button>
|
|
@@ -46,7 +46,7 @@ export class TextEditor extends HTMLElement {
|
|
|
46
46
|
this.#shadow.adoptedStyleSheets = [CodeHighlighter.Style.default];
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
#createEditor(): CodeMirror.EditorView {
|
|
50
50
|
this.#activeEditor = new CodeMirror.EditorView({
|
|
51
51
|
state: this.state,
|
|
52
52
|
parent: this.#shadow,
|
|
@@ -54,7 +54,7 @@ export class TextEditor extends HTMLElement {
|
|
|
54
54
|
dispatch: (tr: CodeMirror.Transaction): void => {
|
|
55
55
|
this.editor.update([tr]);
|
|
56
56
|
if (tr.reconfigured) {
|
|
57
|
-
this
|
|
57
|
+
this.#ensureSettingListeners();
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
});
|
|
@@ -64,13 +64,13 @@ export class TextEditor extends HTMLElement {
|
|
|
64
64
|
this.#lastScrollPos.left = (event.target as HTMLElement).scrollLeft;
|
|
65
65
|
this.#lastScrollPos.top = (event.target as HTMLElement).scrollTop;
|
|
66
66
|
});
|
|
67
|
-
this
|
|
68
|
-
this
|
|
67
|
+
this.#ensureSettingListeners();
|
|
68
|
+
this.#startObservingResize();
|
|
69
69
|
return this.#activeEditor;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
get editor(): CodeMirror.EditorView {
|
|
73
|
-
return this.#activeEditor || this
|
|
73
|
+
return this.#activeEditor || this.#createEditor();
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
dispatch(spec: CodeMirror.TransactionSpec): void {
|
|
@@ -97,7 +97,7 @@ export class TextEditor extends HTMLElement {
|
|
|
97
97
|
|
|
98
98
|
connectedCallback(): void {
|
|
99
99
|
if (!this.#activeEditor) {
|
|
100
|
-
this
|
|
100
|
+
this.#createEditor();
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -108,7 +108,7 @@ export class TextEditor extends HTMLElement {
|
|
|
108
108
|
window.removeEventListener('resize', this.#resizeListener);
|
|
109
109
|
this.#activeEditor.destroy();
|
|
110
110
|
this.#activeEditor = undefined;
|
|
111
|
-
this
|
|
111
|
+
this.#ensureSettingListeners();
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -118,7 +118,7 @@ export class TextEditor extends HTMLElement {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
#ensureSettingListeners(): void {
|
|
122
122
|
const dynamicSettings = this.#activeEditor ? this.#activeEditor.state.facet(dynamicSetting) : DynamicSetting.none;
|
|
123
123
|
if (dynamicSettings === this.#dynamicSettings) {
|
|
124
124
|
return;
|
|
@@ -144,7 +144,7 @@ export class TextEditor extends HTMLElement {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
#startObservingResize(): void {
|
|
148
148
|
const devtoolsElement =
|
|
149
149
|
WindowBoundsService.WindowBoundsService.WindowBoundsServiceImpl.instance().getDevToolsBoundingElement();
|
|
150
150
|
if (devtoolsElement) {
|
|
@@ -39,7 +39,7 @@ export class TextPrompt extends HTMLElement {
|
|
|
39
39
|
this.#ariaLabelText = data.ariaLabel;
|
|
40
40
|
this.#prefixText = data.prefix;
|
|
41
41
|
this.#suggestionText = data.suggestion;
|
|
42
|
-
this
|
|
42
|
+
this.#render();
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
get data(): TextPromptData {
|
|
@@ -51,10 +51,10 @@ export class TextPrompt extends HTMLElement {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
focus(): void {
|
|
54
|
-
this
|
|
54
|
+
this.#input().focus();
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
#input(): HTMLInputElement {
|
|
58
58
|
const inputElement = this.#shadow.querySelector<HTMLInputElement>('input');
|
|
59
59
|
if (!inputElement) {
|
|
60
60
|
throw new Error('Expected an input element!');
|
|
@@ -63,12 +63,12 @@ export class TextPrompt extends HTMLElement {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
moveCaretToEndOfInput(): void {
|
|
66
|
-
this.setSelectedRange(this
|
|
66
|
+
this.setSelectedRange(this.#text().length, this.#text().length);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
onInput(): void {
|
|
70
|
-
this
|
|
71
|
-
this.dispatchEvent(new PromptInputEvent(this
|
|
70
|
+
this.#suggestion().textContent = this.#text();
|
|
71
|
+
this.dispatchEvent(new PromptInputEvent(this.#text().trim()));
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
onKeyDown(event: KeyboardEvent): void {
|
|
@@ -81,37 +81,37 @@ export class TextPrompt extends HTMLElement {
|
|
|
81
81
|
if (startIndex < 0) {
|
|
82
82
|
throw new RangeError('Selected range start must be a nonnegative integer');
|
|
83
83
|
}
|
|
84
|
-
const textContentLength = this
|
|
84
|
+
const textContentLength = this.#text().length;
|
|
85
85
|
if (endIndex > textContentLength) {
|
|
86
86
|
endIndex = textContentLength;
|
|
87
87
|
}
|
|
88
88
|
if (endIndex < startIndex) {
|
|
89
89
|
endIndex = startIndex;
|
|
90
90
|
}
|
|
91
|
-
this
|
|
91
|
+
this.#input().setSelectionRange(startIndex, endIndex);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
setPrefix(prefix: string): void {
|
|
95
95
|
this.#prefixText = prefix;
|
|
96
|
-
this
|
|
96
|
+
this.#render();
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
setSuggestion(suggestion: string): void {
|
|
100
100
|
this.#suggestionText = suggestion;
|
|
101
|
-
this
|
|
101
|
+
this.#render();
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
setText(text: string): void {
|
|
105
|
-
this
|
|
106
|
-
this
|
|
105
|
+
this.#input().value = text;
|
|
106
|
+
this.#suggestion().textContent = this.#text();
|
|
107
107
|
|
|
108
|
-
if (this
|
|
108
|
+
if (this.#input().hasFocus()) {
|
|
109
109
|
this.moveCaretToEndOfInput();
|
|
110
|
-
this
|
|
110
|
+
this.#input().scrollIntoView();
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
#suggestion(): HTMLSpanElement {
|
|
115
115
|
const suggestionElement = this.#shadow.querySelector<HTMLSpanElement>('.suggestion');
|
|
116
116
|
if (!suggestionElement) {
|
|
117
117
|
throw new Error('Expected an suggestion element!');
|
|
@@ -119,11 +119,11 @@ export class TextPrompt extends HTMLElement {
|
|
|
119
119
|
return suggestionElement;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
return this
|
|
122
|
+
#text(): string {
|
|
123
|
+
return this.#input().value || '';
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
#render(): void {
|
|
127
127
|
const output = LitHtml.html`
|
|
128
128
|
<span class="prefix">${this.#prefixText} </span>
|
|
129
129
|
<span class="text-prompt-input"><input aria-label=${this.#ariaLabelText} spellcheck="false" @input=${
|