chrome-devtools-frontend 1.0.921086 → 1.0.922671
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/all_devtools_files.gni +1 -1
- package/config/gni/devtools_grd_files.gni +2 -0
- package/front_end/core/common/ColorUtils.ts +2 -1
- package/front_end/core/common/Object.ts +36 -1
- package/front_end/core/common/Settings.ts +8 -1
- package/front_end/core/common/common.ts +2 -1
- package/front_end/core/i18n/locales/af.json +53 -32
- package/front_end/core/i18n/locales/am.json +56 -35
- package/front_end/core/i18n/locales/ar.json +53 -32
- package/front_end/core/i18n/locales/as.json +63 -42
- package/front_end/core/i18n/locales/az.json +53 -32
- package/front_end/core/i18n/locales/be.json +52 -31
- package/front_end/core/i18n/locales/bg.json +51 -30
- package/front_end/core/i18n/locales/bn.json +63 -42
- package/front_end/core/i18n/locales/bs.json +57 -36
- package/front_end/core/i18n/locales/ca.json +55 -34
- package/front_end/core/i18n/locales/cs.json +51 -30
- package/front_end/core/i18n/locales/cy.json +63 -42
- package/front_end/core/i18n/locales/da.json +55 -34
- package/front_end/core/i18n/locales/de.json +52 -31
- package/front_end/core/i18n/locales/el.json +58 -37
- package/front_end/core/i18n/locales/en-GB.json +51 -30
- 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/i18n/locales/es-419.json +53 -32
- package/front_end/core/i18n/locales/es.json +52 -31
- package/front_end/core/i18n/locales/et.json +54 -33
- package/front_end/core/i18n/locales/eu.json +71 -50
- package/front_end/core/i18n/locales/fa.json +54 -33
- package/front_end/core/i18n/locales/fi.json +55 -34
- package/front_end/core/i18n/locales/fil.json +59 -38
- package/front_end/core/i18n/locales/fr-CA.json +52 -31
- package/front_end/core/i18n/locales/fr.json +54 -33
- package/front_end/core/i18n/locales/gl.json +57 -36
- package/front_end/core/i18n/locales/gu.json +65 -44
- package/front_end/core/i18n/locales/he.json +56 -35
- package/front_end/core/i18n/locales/hi.json +61 -40
- package/front_end/core/i18n/locales/hr.json +55 -34
- package/front_end/core/i18n/locales/hu.json +53 -32
- package/front_end/core/i18n/locales/hy.json +54 -33
- package/front_end/core/i18n/locales/id.json +59 -38
- package/front_end/core/i18n/locales/is.json +51 -30
- package/front_end/core/i18n/locales/it.json +51 -30
- package/front_end/core/i18n/locales/ja.json +52 -31
- package/front_end/core/i18n/locales/ka.json +51 -30
- package/front_end/core/i18n/locales/kk.json +56 -35
- package/front_end/core/i18n/locales/km.json +59 -38
- package/front_end/core/i18n/locales/kn.json +63 -42
- package/front_end/core/i18n/locales/ko.json +59 -38
- package/front_end/core/i18n/locales/ky.json +54 -33
- package/front_end/core/i18n/locales/lo.json +59 -38
- package/front_end/core/i18n/locales/lt.json +52 -31
- package/front_end/core/i18n/locales/lv.json +60 -39
- package/front_end/core/i18n/locales/mk.json +51 -30
- package/front_end/core/i18n/locales/ml.json +65 -44
- package/front_end/core/i18n/locales/mn.json +59 -38
- package/front_end/core/i18n/locales/mr.json +61 -40
- package/front_end/core/i18n/locales/ms.json +59 -38
- package/front_end/core/i18n/locales/my.json +59 -38
- package/front_end/core/i18n/locales/ne.json +63 -42
- package/front_end/core/i18n/locales/nl.json +55 -34
- package/front_end/core/i18n/locales/no.json +54 -33
- package/front_end/core/i18n/locales/or.json +63 -42
- package/front_end/core/i18n/locales/pa.json +61 -40
- package/front_end/core/i18n/locales/pl.json +51 -30
- package/front_end/core/i18n/locales/pt-PT.json +52 -31
- package/front_end/core/i18n/locales/pt.json +59 -38
- package/front_end/core/i18n/locales/ro.json +52 -31
- package/front_end/core/i18n/locales/ru.json +52 -31
- package/front_end/core/i18n/locales/si.json +59 -38
- package/front_end/core/i18n/locales/sk.json +52 -31
- package/front_end/core/i18n/locales/sl.json +52 -31
- package/front_end/core/i18n/locales/sq.json +51 -30
- package/front_end/core/i18n/locales/sr-Latn.json +52 -31
- package/front_end/core/i18n/locales/sr.json +52 -31
- package/front_end/core/i18n/locales/sv.json +52 -31
- package/front_end/core/i18n/locales/sw.json +60 -39
- package/front_end/core/i18n/locales/ta.json +67 -46
- package/front_end/core/i18n/locales/te.json +62 -41
- package/front_end/core/i18n/locales/th.json +52 -31
- package/front_end/core/i18n/locales/tr.json +55 -34
- package/front_end/core/i18n/locales/uk.json +55 -34
- package/front_end/core/i18n/locales/ur.json +60 -39
- package/front_end/core/i18n/locales/uz.json +52 -31
- package/front_end/core/i18n/locales/vi.json +54 -33
- package/front_end/core/i18n/locales/zh-HK.json +52 -31
- package/front_end/core/i18n/locales/zh-TW.json +57 -36
- package/front_end/core/i18n/locales/zh.json +56 -35
- package/front_end/core/i18n/locales/zu.json +59 -38
- package/front_end/core/sdk/FrameManager.ts +2 -2
- package/front_end/core/sdk/RemoteObject.ts +43 -20
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -1
- package/front_end/entrypoints/js_app/JsMain.ts +1 -1
- package/front_end/entrypoints/node_main/NodeMain.ts +1 -1
- package/front_end/entrypoints/worker_app/WorkerMain.ts +1 -1
- package/front_end/legacy/legacy-defs.d.ts +9 -0
- package/front_end/models/emulation/DeviceModeModel.ts +1 -1
- package/front_end/models/extensions/ExtensionAPI.ts +1 -1
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +4 -1
- package/front_end/models/issues_manager/descriptions/arAttributionEventSourceTriggerDataTooLarge.md +4 -0
- package/front_end/models/timeline_model/TimelineModel.ts +5 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +8 -7
- package/front_end/panels/application/DatabaseQueryView.ts +7 -1
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
- package/front_end/panels/changes/ChangesSidebar.ts +6 -1
- package/front_end/panels/console/ConsolePrompt.ts +6 -1
- package/front_end/panels/console/ConsoleSidebar.ts +5 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +2 -2
- package/front_end/panels/coverage/CoverageView.ts +5 -4
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +59 -48
- package/front_end/panels/css_overview/CSSOverviewController.ts +48 -8
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +1 -1
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +8 -1
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +14 -12
- package/front_end/panels/elements/ElementsPanel.ts +10 -8
- package/front_end/panels/elements/ElementsTreeOutline.ts +8 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +12 -2
- package/front_end/panels/elements/layoutPane.css +1 -0
- package/front_end/panels/emulation/AdvancedApp.ts +2 -12
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +14 -1
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +10 -0
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +7 -1
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +4 -4
- package/front_end/panels/layer_viewer/Layers3DView.ts +7 -1
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +7 -1
- package/front_end/panels/layers/LayersPanel.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +1 -2
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +4 -0
- package/front_end/panels/network/NetworkDataGridNode.ts +46 -104
- package/front_end/panels/network/NetworkItemView.ts +2 -6
- package/front_end/panels/network/NetworkLogView.ts +4 -4
- package/front_end/panels/network/NetworkPanel.ts +12 -18
- package/front_end/panels/network/RequestTimingView.ts +3 -1
- package/front_end/panels/network/module.json +0 -3
- package/front_end/panels/profiler/CPUProfileFlameChart.ts +26 -11
- package/front_end/panels/profiler/HeapProfileView.ts +5 -6
- package/front_end/panels/profiler/HeapSnapshotView.ts +6 -6
- package/front_end/panels/profiler/HeapTimelineOverview.ts +17 -3
- package/front_end/panels/profiler/ProfileLauncherView.ts +6 -1
- package/front_end/panels/profiler/ProfileView.ts +1 -1
- package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
- package/front_end/panels/settings/SettingsScreen.ts +2 -2
- package/front_end/panels/sources/CSSPlugin.ts +6 -6
- package/front_end/panels/sources/DebuggerPlugin.ts +4 -5
- package/front_end/panels/sources/EditingLocationHistoryManager.ts +7 -5
- package/front_end/panels/sources/InplaceFormatterEditorAction.ts +5 -5
- package/front_end/panels/sources/OutlineQuickOpen.ts +7 -2
- package/front_end/panels/sources/ScriptFormatterEditorAction.ts +5 -6
- package/front_end/panels/sources/SourcesPanel.ts +2 -2
- package/front_end/panels/sources/SourcesView.ts +16 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +8 -13
- package/front_end/panels/sources/UISourceCodeFrame.ts +7 -1
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +2 -7
- package/front_end/panels/timeline/TimelineDetailsView.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -4
- package/front_end/panels/timeline/TimelineLayersView.ts +7 -7
- package/front_end/panels/timeline/TimelinePanel.ts +2 -1
- package/front_end/panels/timeline/TimelineTreeView.ts +6 -1
- package/front_end/ui/components/docs/toggle_fonts.ts +28 -1
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +4 -5
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +14 -5
- package/front_end/ui/legacy/Dialog.ts +12 -2
- package/front_end/ui/legacy/FilterBar.ts +12 -8
- package/front_end/ui/legacy/InspectorView.ts +3 -3
- package/front_end/ui/legacy/SplitWidget.ts +6 -1
- package/front_end/ui/legacy/TabbedPane.ts +9 -1
- package/front_end/ui/legacy/TextEditor.ts +12 -1
- package/front_end/ui/legacy/Treeoutline.ts +19 -11
- package/front_end/ui/legacy/ViewManager.ts +8 -7
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +6 -1
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +6 -1
- package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +7 -1
- package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +12 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +19 -71
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +8 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +9 -1
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +13 -3
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +14 -3
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -4
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +13 -3
- package/front_end/ui/legacy/components/quick_open/QuickInput.ts +4 -5
- package/front_end/ui/legacy/components/quick_open/QuickPick.ts +4 -5
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +29 -19
- package/front_end/ui/legacy/components/source_frame/SourcesTextEditor.ts +18 -2
- package/front_end/ui/legacy/components/text_editor/CodeMirrorTextEditor.ts +3 -1
- package/front_end/ui/legacy/splitWidget.css +2 -2
- package/inspector_overlay/common.ts +3 -3
- package/inspector_overlay/tool_viewport_size.ts +1 -1
- package/package.json +1 -1
- package/scripts/build/generate_css_js_files.js +1 -0
|
@@ -51,7 +51,7 @@ const UIStrings = {
|
|
|
51
51
|
const str_ = i18n.i18n.registerUIStrings('panels/console/ConsoleSidebar.ts', UIStrings);
|
|
52
52
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
53
53
|
|
|
54
|
-
export class ConsoleSidebar extends UI.Widget.VBox {
|
|
54
|
+
export class ConsoleSidebar extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(UI.Widget.VBox) {
|
|
55
55
|
private readonly tree: UI.TreeOutline.TreeOutlineInShadow;
|
|
56
56
|
private selectedTreeElement: UI.TreeOutline.TreeElement|null;
|
|
57
57
|
private readonly treeElements: FilterTreeElement[];
|
|
@@ -146,6 +146,10 @@ export const enum Events {
|
|
|
146
146
|
FilterSelected = 'FilterSelected',
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
export type EventTypes = {
|
|
150
|
+
[Events.FilterSelected]: void,
|
|
151
|
+
};
|
|
152
|
+
|
|
149
153
|
class ConsoleSidebarTreeElement extends UI.TreeOutline.TreeElement {
|
|
150
154
|
protected filterInternal: ConsoleFilter;
|
|
151
155
|
|
|
@@ -200,7 +200,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
200
200
|
element: HTMLElement,
|
|
201
201
|
forceSelect: () => void,
|
|
202
202
|
}[];
|
|
203
|
-
private readonly messageResized: (arg0: Common.EventTarget.EventTargetEvent) => void;
|
|
203
|
+
private readonly messageResized: (arg0: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>) => void;
|
|
204
204
|
protected elementInternal: HTMLElement|null;
|
|
205
205
|
private readonly previewFormatter: ObjectUI.RemoteObjectPreviewFormatter.RemoteObjectPreviewFormatter;
|
|
206
206
|
private searchRegexInternal: RegExp|null;
|
|
@@ -227,7 +227,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
227
227
|
constructor(
|
|
228
228
|
consoleMessage: SDK.ConsoleModel.ConsoleMessage, linkifier: Components.Linkifier.Linkifier,
|
|
229
229
|
requestResolver: Logs.RequestResolver.RequestResolver, issueResolver: IssuesManager.IssueResolver.IssueResolver,
|
|
230
|
-
nestingLevel: number, onResize: (arg0: Common.EventTarget.EventTargetEvent) => void) {
|
|
230
|
+
nestingLevel: number, onResize: (arg0: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>) => void) {
|
|
231
231
|
this.message = consoleMessage;
|
|
232
232
|
this.linkifier = linkifier;
|
|
233
233
|
this.requestResolver = requestResolver;
|
|
@@ -614,10 +614,11 @@ export class LineDecorator implements SourceFrame.SourceFrame.LineDecorator {
|
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
|
|
617
|
-
makeGutterClickHandler(url: string):
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
617
|
+
makeGutterClickHandler(url: string):
|
|
618
|
+
(arg0: Common.EventTarget.EventTargetEvent<SourceFrame.SourcesTextEditor.GutterClickEventData>) => void {
|
|
619
|
+
function handleGutterClick(
|
|
620
|
+
event: Common.EventTarget.EventTargetEvent<SourceFrame.SourcesTextEditor.GutterClickEventData>): void {
|
|
621
|
+
if (event.data.gutterType !== LineDecorator.GUTTER_TYPE) {
|
|
621
622
|
return;
|
|
622
623
|
}
|
|
623
624
|
const coverageViewId = 'coverage';
|
|
@@ -17,8 +17,8 @@ import cssOverviewCompletedViewStyles from './cssOverviewCompletedView.css.js';
|
|
|
17
17
|
import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
18
18
|
import type * as Protocol from '../../generated/protocol.js';
|
|
19
19
|
|
|
20
|
-
import type {OverviewController} from './CSSOverviewController.js';
|
|
21
|
-
import {Events} from './CSSOverviewController.js';
|
|
20
|
+
import type {OverviewController, PopulateNodesEvent, PopulateNodesEventNodes, PopulateNodesEventNodeTypes} from './CSSOverviewController.js';
|
|
21
|
+
import {Events as CSSOverViewControllerEvents} from './CSSOverviewController.js';
|
|
22
22
|
import {CSSOverviewSidebarPanel, SidebarEvents} from './CSSOverviewSidebarPanel.js';
|
|
23
23
|
import type {UnusedDeclaration} from './CSSOverviewUnusedDeclarations.js';
|
|
24
24
|
|
|
@@ -246,7 +246,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
246
246
|
this.elementContainer = new DetailsView();
|
|
247
247
|
|
|
248
248
|
// If closing the last tab, collapse the sidebar.
|
|
249
|
-
this.elementContainer.addEventListener(
|
|
249
|
+
this.elementContainer.addEventListener(Events.TabClosed, evt => {
|
|
250
250
|
if (evt.data === 0) {
|
|
251
251
|
this.mainContainer.setSidebarMinimized(true);
|
|
252
252
|
}
|
|
@@ -285,8 +285,8 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
285
285
|
|
|
286
286
|
this.sideBar.addEventListener(SidebarEvents.ItemSelected, this.sideBarItemSelected, this);
|
|
287
287
|
this.sideBar.addEventListener(SidebarEvents.Reset, this.sideBarReset, this);
|
|
288
|
-
this.controller.addEventListener(
|
|
289
|
-
this.controller.addEventListener(
|
|
288
|
+
this.controller.addEventListener(CSSOverViewControllerEvents.Reset, this.reset, this);
|
|
289
|
+
this.controller.addEventListener(CSSOverViewControllerEvents.PopulateNodes, this.createElementsView, this);
|
|
290
290
|
this.resultsContainer.element.addEventListener('click', this.onClick.bind(this));
|
|
291
291
|
|
|
292
292
|
this.data = null;
|
|
@@ -300,8 +300,8 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
300
300
|
// TODO(paullewis): update the links in the panels in case source has been .
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
private sideBarItemSelected(event: Common.EventTarget.EventTargetEvent): void {
|
|
304
|
-
const data =
|
|
303
|
+
private sideBarItemSelected(event: Common.EventTarget.EventTargetEvent<string>): void {
|
|
304
|
+
const {data} = event;
|
|
305
305
|
const section = (this.fragment as UI.Fragment.Fragment).$(data);
|
|
306
306
|
if (!section) {
|
|
307
307
|
return;
|
|
@@ -311,7 +311,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
private sideBarReset(): void {
|
|
314
|
-
this.controller.dispatchEventToListeners(
|
|
314
|
+
this.controller.dispatchEventToListeners(CSSOverViewControllerEvents.Reset);
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
private reset(): void {
|
|
@@ -335,7 +335,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
335
335
|
return;
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
-
let payload;
|
|
338
|
+
let payload: PopulateNodesEvent;
|
|
339
339
|
switch (type) {
|
|
340
340
|
case 'contrast': {
|
|
341
341
|
const section = dataset.section;
|
|
@@ -451,7 +451,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
evt.consume();
|
|
454
|
-
this.controller.dispatchEventToListeners(
|
|
454
|
+
this.controller.dispatchEventToListeners(CSSOverViewControllerEvents.PopulateNodes, {payload});
|
|
455
455
|
this.mainContainer.setSidebarMinimized(false);
|
|
456
456
|
}
|
|
457
457
|
|
|
@@ -464,7 +464,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
464
464
|
}
|
|
465
465
|
|
|
466
466
|
const backendNodeId = Number(node.dataset.backendNodeId);
|
|
467
|
-
this.controller.dispatchEventToListeners(
|
|
467
|
+
this.controller.dispatchEventToListeners(CSSOverViewControllerEvents.RequestNodeHighlight, backendNodeId);
|
|
468
468
|
}
|
|
469
469
|
|
|
470
470
|
private async render(data: OverviewData): Promise<void> {
|
|
@@ -605,43 +605,43 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
605
605
|
this.resultsContainer.element.appendChild(this.fragment.element());
|
|
606
606
|
}
|
|
607
607
|
|
|
608
|
-
private createElementsView(evt: Common.EventTarget.EventTargetEvent): void {
|
|
609
|
-
const {
|
|
608
|
+
private createElementsView(evt: Common.EventTarget.EventTargetEvent<{payload: PopulateNodesEvent}>): void {
|
|
609
|
+
const {payload} = evt.data;
|
|
610
610
|
|
|
611
611
|
let id = '';
|
|
612
612
|
let tabTitle = '';
|
|
613
613
|
|
|
614
|
-
switch (type) {
|
|
614
|
+
switch (payload.type) {
|
|
615
615
|
case 'contrast': {
|
|
616
|
-
const {section, key} =
|
|
616
|
+
const {section, key} = payload;
|
|
617
617
|
id = `${section}-${key}`;
|
|
618
618
|
tabTitle = i18nString(UIStrings.contrastIssues);
|
|
619
619
|
break;
|
|
620
620
|
}
|
|
621
621
|
|
|
622
622
|
case 'color': {
|
|
623
|
-
const {section, color} =
|
|
623
|
+
const {section, color} = payload;
|
|
624
624
|
id = `${section}-${color}`;
|
|
625
625
|
tabTitle = `${color.toUpperCase()} (${section})`;
|
|
626
626
|
break;
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
case 'unused-declarations': {
|
|
630
|
-
const {declaration} =
|
|
630
|
+
const {declaration} = payload;
|
|
631
631
|
id = `${declaration}`;
|
|
632
632
|
tabTitle = `${declaration}`;
|
|
633
633
|
break;
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
case 'media-queries': {
|
|
637
|
-
const {text} =
|
|
637
|
+
const {text} = payload;
|
|
638
638
|
id = `${text}`;
|
|
639
639
|
tabTitle = `${text}`;
|
|
640
640
|
break;
|
|
641
641
|
}
|
|
642
642
|
|
|
643
643
|
case 'font-info': {
|
|
644
|
-
const {name} =
|
|
644
|
+
const {name} = payload;
|
|
645
645
|
id = `${name}`;
|
|
646
646
|
tabTitle = `${name}`;
|
|
647
647
|
break;
|
|
@@ -651,7 +651,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
651
651
|
let view = this.viewMap.get(id);
|
|
652
652
|
if (!view) {
|
|
653
653
|
view = new ElementDetailsView(this.controller, this.domModel, this.cssModel, this.linkifier);
|
|
654
|
-
view.populateNodes(nodes);
|
|
654
|
+
view.populateNodes(payload.nodes);
|
|
655
655
|
this.viewMap.set(id, view);
|
|
656
656
|
}
|
|
657
657
|
|
|
@@ -832,7 +832,7 @@ export class CSSOverviewCompletedView extends UI.Panel.PanelWithSidebar {
|
|
|
832
832
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
833
833
|
static readonly pushedNodes = new Set<Protocol.DOM.BackendNodeId>();
|
|
834
834
|
}
|
|
835
|
-
export class DetailsView extends UI.Widget.VBox {
|
|
835
|
+
export class DetailsView extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(UI.Widget.VBox) {
|
|
836
836
|
private tabbedPane: UI.TabbedPane.TabbedPane;
|
|
837
837
|
constructor() {
|
|
838
838
|
super();
|
|
@@ -840,7 +840,7 @@ export class DetailsView extends UI.Widget.VBox {
|
|
|
840
840
|
this.tabbedPane = new UI.TabbedPane.TabbedPane();
|
|
841
841
|
this.tabbedPane.show(this.element);
|
|
842
842
|
this.tabbedPane.addEventListener(UI.TabbedPane.Events.TabClosed, () => {
|
|
843
|
-
this.dispatchEventToListeners(
|
|
843
|
+
this.dispatchEventToListeners(Events.TabClosed, this.tabbedPane.tabIds().length);
|
|
844
844
|
});
|
|
845
845
|
}
|
|
846
846
|
|
|
@@ -857,6 +857,14 @@ export class DetailsView extends UI.Widget.VBox {
|
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
859
|
|
|
860
|
+
export const enum Events {
|
|
861
|
+
TabClosed = 'TabClosed',
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
export type EventTypes = {
|
|
865
|
+
[Events.TabClosed]: number,
|
|
866
|
+
};
|
|
867
|
+
|
|
860
868
|
export class ElementDetailsView extends UI.Widget.Widget {
|
|
861
869
|
private readonly controller: OverviewController;
|
|
862
870
|
private domModel: SDK.DOMModel.DOMModel;
|
|
@@ -984,11 +992,10 @@ export class ElementDetailsView extends UI.Widget.Widget {
|
|
|
984
992
|
}
|
|
985
993
|
|
|
986
994
|
const backendNodeId = Number(node.dataset.backendNodeId);
|
|
987
|
-
this.controller.dispatchEventToListeners(
|
|
995
|
+
this.controller.dispatchEventToListeners(CSSOverViewControllerEvents.RequestNodeHighlight, backendNodeId);
|
|
988
996
|
}
|
|
989
997
|
|
|
990
|
-
async populateNodes(data:
|
|
991
|
-
Promise<void> {
|
|
998
|
+
async populateNodes(data: PopulateNodesEventNodes): Promise<void> {
|
|
992
999
|
this.elementGrid.rootNode().removeChildren();
|
|
993
1000
|
|
|
994
1001
|
if (!data.length) {
|
|
@@ -997,39 +1004,39 @@ export class ElementDetailsView extends UI.Widget.Widget {
|
|
|
997
1004
|
|
|
998
1005
|
const [firstItem] = data;
|
|
999
1006
|
const visibility = new Set<string>();
|
|
1000
|
-
firstItem.nodeId && visibility.add('nodeId');
|
|
1001
|
-
firstItem.declaration && visibility.add('declaration');
|
|
1002
|
-
firstItem.sourceURL && visibility.add('sourceURL');
|
|
1003
|
-
firstItem.contrastRatio && visibility.add('contrastRatio');
|
|
1007
|
+
'nodeId' in firstItem && firstItem.nodeId && visibility.add('nodeId');
|
|
1008
|
+
'declaration' in firstItem && firstItem.declaration && visibility.add('declaration');
|
|
1009
|
+
'sourceURL' in firstItem && firstItem.sourceURL && visibility.add('sourceURL');
|
|
1010
|
+
'contrastRatio' in firstItem && firstItem.contrastRatio && visibility.add('contrastRatio');
|
|
1004
1011
|
|
|
1005
|
-
let relatedNodesMap;
|
|
1006
|
-
if (visibility.has('nodeId')) {
|
|
1012
|
+
let relatedNodesMap: Map<Protocol.DOM.BackendNodeId, SDK.DOMModel.DOMNode|null>|null|undefined;
|
|
1013
|
+
if ('nodeId' in firstItem && visibility.has('nodeId')) {
|
|
1007
1014
|
// Grab the nodes from the frontend, but only those that have not been
|
|
1008
1015
|
// retrieved already.
|
|
1009
|
-
const nodeIds = (data.reduce((prev, curr) => {
|
|
1010
|
-
|
|
1016
|
+
const nodeIds = (data as {nodeId: number}[]).reduce((prev, curr) => {
|
|
1017
|
+
const nodeId = curr.nodeId as Protocol.DOM.BackendNodeId;
|
|
1018
|
+
if (CSSOverviewCompletedView.pushedNodes.has(nodeId)) {
|
|
1011
1019
|
return prev;
|
|
1012
1020
|
}
|
|
1013
|
-
CSSOverviewCompletedView.pushedNodes.add(
|
|
1014
|
-
return prev.add(
|
|
1015
|
-
}, new Set<Protocol.DOM.BackendNodeId>())
|
|
1021
|
+
CSSOverviewCompletedView.pushedNodes.add(nodeId);
|
|
1022
|
+
return prev.add(nodeId);
|
|
1023
|
+
}, new Set<Protocol.DOM.BackendNodeId>());
|
|
1016
1024
|
relatedNodesMap = await this.domModel.pushNodesByBackendIdsToFrontend(nodeIds);
|
|
1017
1025
|
}
|
|
1018
1026
|
|
|
1019
1027
|
for (const item of data) {
|
|
1020
|
-
|
|
1028
|
+
let frontendNode;
|
|
1029
|
+
if ('nodeId' in item && visibility.has('nodeId')) {
|
|
1021
1030
|
if (!relatedNodesMap) {
|
|
1022
1031
|
continue;
|
|
1023
1032
|
}
|
|
1024
|
-
|
|
1033
|
+
frontendNode = relatedNodesMap.get(item.nodeId as Protocol.DOM.BackendNodeId);
|
|
1025
1034
|
if (!frontendNode) {
|
|
1026
1035
|
continue;
|
|
1027
1036
|
}
|
|
1028
|
-
|
|
1029
|
-
item.node = frontendNode;
|
|
1030
1037
|
}
|
|
1031
1038
|
|
|
1032
|
-
const node = new ElementNode(item, this.linkifier, this.cssModel);
|
|
1039
|
+
const node = new ElementNode(item, frontendNode, this.linkifier, this.cssModel);
|
|
1033
1040
|
node.selectable = false;
|
|
1034
1041
|
this.elementGrid.insertChild(node);
|
|
1035
1042
|
}
|
|
@@ -1043,28 +1050,32 @@ export class ElementDetailsView extends UI.Widget.Widget {
|
|
|
1043
1050
|
export class ElementNode extends DataGrid.SortableDataGrid.SortableDataGridNode<ElementNode> {
|
|
1044
1051
|
private readonly linkifier: Components.Linkifier.Linkifier;
|
|
1045
1052
|
private readonly cssModel: SDK.CSSModel.CSSModel;
|
|
1053
|
+
private readonly frontendNode: SDK.DOMModel.DOMNode|null|undefined;
|
|
1046
1054
|
|
|
1047
1055
|
constructor(
|
|
1048
|
-
data:
|
|
1049
|
-
hasChildren: boolean,
|
|
1050
|
-
[x: string]: unknown,
|
|
1051
|
-
},
|
|
1056
|
+
data: PopulateNodesEventNodeTypes, frontendNode: SDK.DOMModel.DOMNode|null|undefined,
|
|
1052
1057
|
linkifier: Components.Linkifier.Linkifier, cssModel: SDK.CSSModel.CSSModel) {
|
|
1053
|
-
super(data
|
|
1058
|
+
super(data);
|
|
1054
1059
|
|
|
1060
|
+
this.frontendNode = frontendNode;
|
|
1055
1061
|
this.linkifier = linkifier;
|
|
1056
1062
|
this.cssModel = cssModel;
|
|
1057
1063
|
}
|
|
1058
1064
|
|
|
1059
1065
|
createCell(columnId: string): HTMLElement {
|
|
1060
1066
|
// Nodes.
|
|
1067
|
+
const {frontendNode} = this;
|
|
1061
1068
|
if (columnId === 'nodeId') {
|
|
1062
1069
|
const cell = this.createTD(columnId);
|
|
1063
1070
|
cell.textContent = '...';
|
|
1064
1071
|
|
|
1065
|
-
|
|
1072
|
+
if (!frontendNode) {
|
|
1073
|
+
throw new Error('Node entry is missing a related frontend node.');
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
Common.Linkifier.Linkifier.linkify(frontendNode).then(link => {
|
|
1066
1077
|
cell.textContent = '';
|
|
1067
|
-
(link as HTMLElement).dataset.backendNodeId =
|
|
1078
|
+
(link as HTMLElement).dataset.backendNodeId = frontendNode.backendNodeId().toString();
|
|
1068
1079
|
cell.appendChild(link);
|
|
1069
1080
|
const button = document.createElement('button');
|
|
1070
1081
|
button.classList.add('show-element');
|
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
7
|
+
import type * as Protocol from '../../generated/protocol.js';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
import type {ContrastIssue} from './CSSOverviewCompletedView.js';
|
|
10
|
+
import type {UnusedDeclaration} from './CSSOverviewUnusedDeclarations.js';
|
|
11
|
+
|
|
12
|
+
export class OverviewController extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
9
13
|
currentUrl: string;
|
|
10
14
|
constructor() {
|
|
11
15
|
super();
|
|
@@ -25,11 +29,47 @@ export class OverviewController extends Common.ObjectWrapper.ObjectWrapper {
|
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
export type PopulateNodesEvent = {
|
|
33
|
+
type: 'contrast',
|
|
34
|
+
key: string,
|
|
35
|
+
section: string|undefined,
|
|
36
|
+
nodes: ContrastIssue[],
|
|
37
|
+
}|{
|
|
38
|
+
type: 'color',
|
|
39
|
+
color: string,
|
|
40
|
+
section: string | undefined,
|
|
41
|
+
nodes: {nodeId: number}[],
|
|
42
|
+
}|{
|
|
43
|
+
type: 'unused-declarations',
|
|
44
|
+
declaration: string,
|
|
45
|
+
nodes: UnusedDeclaration[],
|
|
46
|
+
}|{
|
|
47
|
+
type: 'media-queries',
|
|
48
|
+
text: string,
|
|
49
|
+
nodes: Protocol.CSS.CSSMedia[],
|
|
50
|
+
}|{
|
|
51
|
+
type: 'font-info',
|
|
52
|
+
name: string,
|
|
53
|
+
nodes: {nodeId: number}[],
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type PopulateNodesEventNodes = PopulateNodesEvent['nodes'];
|
|
57
|
+
export type PopulateNodesEventNodeTypes = PopulateNodesEventNodes[0];
|
|
58
|
+
|
|
59
|
+
export const enum Events {
|
|
60
|
+
RequestOverviewStart = 'RequestOverviewStart',
|
|
61
|
+
RequestNodeHighlight = 'RequestNodeHighlight',
|
|
62
|
+
PopulateNodes = 'PopulateNodes',
|
|
63
|
+
RequestOverviewCancel = 'RequestOverviewCancel',
|
|
64
|
+
OverviewCompleted = 'OverviewCompleted',
|
|
65
|
+
Reset = 'Reset',
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type EventTypes = {
|
|
69
|
+
[Events.RequestOverviewStart]: void,
|
|
70
|
+
[Events.RequestNodeHighlight]: number,
|
|
71
|
+
[Events.PopulateNodes]: {payload: PopulateNodesEvent},
|
|
72
|
+
[Events.RequestOverviewCancel]: void,
|
|
73
|
+
[Events.OverviewCompleted]: void,
|
|
74
|
+
[Events.Reset]: void,
|
|
35
75
|
};
|
|
@@ -100,7 +100,7 @@ export class CSSOverviewPanel extends UI.Panel.Panel {
|
|
|
100
100
|
this.renderInitialView();
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
private requestNodeHighlight(evt: Common.EventTarget.EventTargetEvent): void {
|
|
103
|
+
private requestNodeHighlight(evt: Common.EventTarget.EventTargetEvent<number>): void {
|
|
104
104
|
this.model.highlightNode((evt.data as Protocol.DOM.BackendNodeId));
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import * as Common from '../../core/common/common.js';
|
|
5
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
7
8
|
|
|
@@ -16,7 +17,8 @@ const UIStrings = {
|
|
|
16
17
|
const str_ = i18n.i18n.registerUIStrings('panels/css_overview/CSSOverviewSidebarPanel.ts', UIStrings);
|
|
17
18
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
18
19
|
|
|
19
|
-
export class CSSOverviewSidebarPanel extends UI.Widget.VBox
|
|
20
|
+
export class CSSOverviewSidebarPanel extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(
|
|
21
|
+
UI.Widget.VBox) {
|
|
20
22
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
21
23
|
static get ITEM_CLASS_NAME(): string {
|
|
22
24
|
return 'overview-sidebar-panel-item';
|
|
@@ -97,3 +99,8 @@ export const enum SidebarEvents {
|
|
|
97
99
|
ItemSelected = 'ItemSelected',
|
|
98
100
|
Reset = 'Reset',
|
|
99
101
|
}
|
|
102
|
+
|
|
103
|
+
export type EventTypes = {
|
|
104
|
+
[SidebarEvents.ItemSelected]: string,
|
|
105
|
+
[SidebarEvents.Reset]: void,
|
|
106
|
+
};
|
|
@@ -33,7 +33,7 @@ export class BezierPopoverIcon {
|
|
|
33
33
|
private treeElement: StylePropertyTreeElement;
|
|
34
34
|
private readonly swatchPopoverHelper: InlineEditor.SwatchPopoverHelper.SwatchPopoverHelper;
|
|
35
35
|
private swatch: InlineEditor.Swatches.BezierSwatch;
|
|
36
|
-
private readonly boundBezierChanged: (event: Common.EventTarget.EventTargetEvent) => void;
|
|
36
|
+
private readonly boundBezierChanged: (event: Common.EventTarget.EventTargetEvent<string>) => void;
|
|
37
37
|
private readonly boundOnScroll: (event: Event) => void;
|
|
38
38
|
private bezierEditor?: InlineEditor.BezierEditor.BezierEditor;
|
|
39
39
|
private scrollerElement?: Element;
|
|
@@ -84,8 +84,8 @@ export class BezierPopoverIcon {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
private bezierChanged(event: Common.EventTarget.EventTargetEvent): void {
|
|
88
|
-
this.swatch.setBezierText(
|
|
87
|
+
private bezierChanged(event: Common.EventTarget.EventTargetEvent<string>): void {
|
|
88
|
+
this.swatch.setBezierText(event.data);
|
|
89
89
|
this.treeElement.applyStyleText(this.treeElement.renderedPropertyText(), false);
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -115,7 +115,7 @@ export class ColorSwatchPopoverIcon {
|
|
|
115
115
|
private readonly swatchPopoverHelper: InlineEditor.SwatchPopoverHelper.SwatchPopoverHelper;
|
|
116
116
|
private swatch: InlineEditor.ColorSwatch.ColorSwatch;
|
|
117
117
|
private contrastInfo: ColorPicker.ContrastInfo.ContrastInfo|null;
|
|
118
|
-
private readonly boundSpectrumChanged: (event: Common.EventTarget.EventTargetEvent) => void;
|
|
118
|
+
private readonly boundSpectrumChanged: (event: Common.EventTarget.EventTargetEvent<string>) => void;
|
|
119
119
|
private readonly boundOnScroll: (event: Event) => void;
|
|
120
120
|
private spectrum?: ColorPicker.Spectrum.Spectrum;
|
|
121
121
|
private scrollerElement?: Element;
|
|
@@ -206,12 +206,12 @@ export class ColorSwatchPopoverIcon {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
private spectrumResized(_event: Common.EventTarget.EventTargetEvent): void {
|
|
209
|
+
private spectrumResized(_event: Common.EventTarget.EventTargetEvent<void>): void {
|
|
210
210
|
this.swatchPopoverHelper.reposition();
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
private spectrumChanged(event: Common.EventTarget.EventTargetEvent): void {
|
|
214
|
-
const color = Common.Color.Color.parse(
|
|
213
|
+
private spectrumChanged(event: Common.EventTarget.EventTargetEvent<string>): void {
|
|
214
|
+
const color = Common.Color.Color.parse(event.data);
|
|
215
215
|
if (!color) {
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
@@ -255,7 +255,8 @@ export class ShadowSwatchPopoverHelper {
|
|
|
255
255
|
private readonly swatchPopoverHelper: InlineEditor.SwatchPopoverHelper.SwatchPopoverHelper;
|
|
256
256
|
private readonly shadowSwatch: InlineEditor.Swatches.CSSShadowSwatch;
|
|
257
257
|
private iconElement: HTMLSpanElement;
|
|
258
|
-
private readonly boundShadowChanged:
|
|
258
|
+
private readonly boundShadowChanged:
|
|
259
|
+
(event: Common.EventTarget.EventTargetEvent<InlineEditor.CSSShadowModel.CSSShadowModel>) => void;
|
|
259
260
|
private readonly boundOnScroll: (event: Event) => void;
|
|
260
261
|
private cssShadowEditor?: InlineEditor.CSSShadowEditor.CSSShadowEditor;
|
|
261
262
|
private scrollerElement?: Element;
|
|
@@ -308,8 +309,8 @@ export class ShadowSwatchPopoverHelper {
|
|
|
308
309
|
}
|
|
309
310
|
}
|
|
310
311
|
|
|
311
|
-
private shadowChanged(event: Common.EventTarget.EventTargetEvent): void {
|
|
312
|
-
this.shadowSwatch.setCSSShadow(
|
|
312
|
+
private shadowChanged(event: Common.EventTarget.EventTargetEvent<InlineEditor.CSSShadowModel.CSSShadowModel>): void {
|
|
313
|
+
this.shadowSwatch.setCSSShadow(event.data);
|
|
313
314
|
this.treeElement.applyStyleText(this.treeElement.renderedPropertyText(), false);
|
|
314
315
|
}
|
|
315
316
|
|
|
@@ -342,7 +343,8 @@ export class FontEditorSectionManager {
|
|
|
342
343
|
private parentPane: StylesSidebarPane|null;
|
|
343
344
|
private fontEditor: InlineEditor.FontEditor.FontEditor|null;
|
|
344
345
|
private scrollerElement: Element|null;
|
|
345
|
-
private readonly boundFontChanged:
|
|
346
|
+
private readonly boundFontChanged:
|
|
347
|
+
(event: Common.EventTarget.EventTargetEvent<InlineEditor.FontEditor.FontChangedEvent>) => void;
|
|
346
348
|
private readonly boundOnScroll: () => void;
|
|
347
349
|
private readonly boundResized: () => void;
|
|
348
350
|
constructor(
|
|
@@ -364,7 +366,7 @@ export class FontEditorSectionManager {
|
|
|
364
366
|
this.boundResized = this.fontEditorResized.bind(this);
|
|
365
367
|
}
|
|
366
368
|
|
|
367
|
-
private fontChanged(event: Common.EventTarget.EventTargetEvent): void {
|
|
369
|
+
private fontChanged(event: Common.EventTarget.EventTargetEvent<InlineEditor.FontEditor.FontChangedEvent>): void {
|
|
368
370
|
const {propertyName, value} = event.data;
|
|
369
371
|
const treeElement = this.treeElementMap.get(propertyName);
|
|
370
372
|
this.updateFontProperty(propertyName, value, treeElement);
|
|
@@ -56,6 +56,7 @@ import {ElementsTreeOutline} from './ElementsTreeOutline.js';
|
|
|
56
56
|
import type {MarkerDecorator} from './MarkerDecorator.js';
|
|
57
57
|
import {MetricsSidebarPane} from './MetricsSidebarPane.js';
|
|
58
58
|
import {Events as StylesSidebarPaneEvents, StylesSidebarPane} from './StylesSidebarPane.js';
|
|
59
|
+
import type {StylesUpdateCompletedEvent} from './StylesSidebarPane.js';
|
|
59
60
|
|
|
60
61
|
const UIStrings = {
|
|
61
62
|
/**
|
|
@@ -479,14 +480,15 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
479
480
|
this.updateTreeOutlineVisibleWidth();
|
|
480
481
|
}
|
|
481
482
|
|
|
482
|
-
private selectedNodeChanged(
|
|
483
|
-
|
|
483
|
+
private selectedNodeChanged(
|
|
484
|
+
event: Common.EventTarget.EventTargetEvent<{node: SDK.DOMModel.DOMNode | null, focus: boolean}>): void {
|
|
485
|
+
let selectedNode = event.data.node;
|
|
484
486
|
|
|
485
487
|
// If the selectedNode is a pseudoNode, we want to ensure that it has a valid parentNode
|
|
486
488
|
if (selectedNode && (selectedNode.pseudoType() && !selectedNode.parentNode)) {
|
|
487
489
|
selectedNode = null;
|
|
488
490
|
}
|
|
489
|
-
const focus =
|
|
491
|
+
const {focus} = event.data;
|
|
490
492
|
for (const treeOutline of this.treeOutlines) {
|
|
491
493
|
if (!selectedNode || ElementsTreeOutline.forDOMModel(selectedNode.domModel()) !== treeOutline) {
|
|
492
494
|
treeOutline.selectDOMNode(null);
|
|
@@ -775,8 +777,8 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
775
777
|
}
|
|
776
778
|
}
|
|
777
779
|
|
|
778
|
-
private updateBreadcrumbIfNeeded(event: Common.EventTarget.EventTargetEvent): void {
|
|
779
|
-
const nodes =
|
|
780
|
+
private updateBreadcrumbIfNeeded(event: Common.EventTarget.EventTargetEvent<SDK.DOMModel.DOMNode[]>): void {
|
|
781
|
+
const nodes = event.data;
|
|
780
782
|
/* If we don't have a selected node then we can tell the breadcrumbs that & bail. */
|
|
781
783
|
const selectedNode = this.selectedDOMNode();
|
|
782
784
|
if (!selectedNode) {
|
|
@@ -972,12 +974,12 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
972
974
|
|
|
973
975
|
let skippedInitialTabSelectedEvent = false;
|
|
974
976
|
|
|
975
|
-
const toggleMetricsWidget = (event: Common.EventTarget.EventTargetEvent): void => {
|
|
977
|
+
const toggleMetricsWidget = (event: Common.EventTarget.EventTargetEvent<StylesUpdateCompletedEvent>): void => {
|
|
976
978
|
this.metricsWidget.toggleVisibility(event.data.hasMatchedStyles);
|
|
977
979
|
};
|
|
978
980
|
|
|
979
|
-
const tabSelected = (event: Common.EventTarget.EventTargetEvent): void => {
|
|
980
|
-
const tabId =
|
|
981
|
+
const tabSelected = (event: Common.EventTarget.EventTargetEvent<UI.TabbedPane.EventData>): void => {
|
|
982
|
+
const {tabId} = event.data;
|
|
981
983
|
if (tabId === i18nString(UIStrings.computed)) {
|
|
982
984
|
computedStylePanesWrapper.show(computedView.element);
|
|
983
985
|
showMetricsWidgetInComputedPane();
|
|
@@ -74,7 +74,9 @@ const elementsTreeOutlineByDOMModel = new WeakMap<SDK.DOMModel.DOMModel, Element
|
|
|
74
74
|
|
|
75
75
|
const populatedTreeElements = new Set<ElementsTreeElement>();
|
|
76
76
|
|
|
77
|
-
export class ElementsTreeOutline extends
|
|
77
|
+
export class ElementsTreeOutline extends
|
|
78
|
+
Common.ObjectWrapper.eventMixin<ElementsTreeOutline.EventTypes, typeof UI.TreeOutline.TreeOutline>(
|
|
79
|
+
UI.TreeOutline.TreeOutline) {
|
|
78
80
|
treeElementByNode: WeakMap<SDK.DOMModel.DOMNode, ElementsTreeElement>;
|
|
79
81
|
private readonly shadowRoot: ShadowRoot;
|
|
80
82
|
readonly elementInternal: HTMLElement;
|
|
@@ -1426,6 +1428,11 @@ export namespace ElementsTreeOutline {
|
|
|
1426
1428
|
SelectedNodeChanged = 'SelectedNodeChanged',
|
|
1427
1429
|
ElementsTreeUpdated = 'ElementsTreeUpdated',
|
|
1428
1430
|
}
|
|
1431
|
+
|
|
1432
|
+
export type EventTypes = {
|
|
1433
|
+
[Events.SelectedNodeChanged]: {node: SDK.DOMModel.DOMNode|null, focus: boolean},
|
|
1434
|
+
[Events.ElementsTreeUpdated]: SDK.DOMModel.DOMNode[],
|
|
1435
|
+
};
|
|
1429
1436
|
}
|
|
1430
1437
|
|
|
1431
1438
|
// clang-format off
|
|
@@ -192,7 +192,8 @@ let _stylesSidebarPaneInstance: StylesSidebarPane;
|
|
|
192
192
|
const STYLE_TAG = '<' +
|
|
193
193
|
'style>';
|
|
194
194
|
|
|
195
|
-
export class StylesSidebarPane extends ElementsSidebarPane
|
|
195
|
+
export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventTypes, typeof ElementsSidebarPane>(
|
|
196
|
+
ElementsSidebarPane) {
|
|
196
197
|
private currentToolbarPane: UI.Widget.Widget|null;
|
|
197
198
|
private animatedToolbarPane: UI.Widget.Widget|null;
|
|
198
199
|
private pendingWidget: UI.Widget.Widget|null;
|
|
@@ -800,7 +801,7 @@ export class StylesSidebarPane extends ElementsSidebarPane {
|
|
|
800
801
|
// Record the elements tool load time after the sidepane has loaded.
|
|
801
802
|
Host.userMetrics.panelLoaded('elements', 'DevTools.Launch.Elements');
|
|
802
803
|
|
|
803
|
-
this.dispatchEventToListeners(Events.StylesUpdateCompleted, {
|
|
804
|
+
this.dispatchEventToListeners(Events.StylesUpdateCompleted, {hasMatchedStyles: false});
|
|
804
805
|
}
|
|
805
806
|
|
|
806
807
|
private nodeStylesUpdatedForTest(_node: SDK.DOMModel.DOMNode, _rebuild: boolean): void {
|
|
@@ -1060,6 +1061,15 @@ export const enum Events {
|
|
|
1060
1061
|
StylesUpdateCompleted = 'StylesUpdateCompleted',
|
|
1061
1062
|
}
|
|
1062
1063
|
|
|
1064
|
+
export interface StylesUpdateCompletedEvent {
|
|
1065
|
+
hasMatchedStyles: boolean;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
export type EventTypes = {
|
|
1069
|
+
[Events.InitialUpdateCompleted]: void,
|
|
1070
|
+
[Events.StylesUpdateCompleted]: StylesUpdateCompletedEvent,
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1063
1073
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
1064
1074
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1065
1075
|
export const _maxLinkLength = 23;
|