chrome-devtools-frontend 1.0.1646714 → 1.0.1650035

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.
Files changed (48) hide show
  1. package/extension-api/ExtensionAPI.d.ts +26 -0
  2. package/front_end/core/common/Debouncer.ts +9 -1
  3. package/front_end/core/sdk/CSSMatchedStyles.ts +3 -1
  4. package/front_end/core/sdk/CSSMetadata.ts +20 -1
  5. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +65 -0
  6. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +15 -0
  7. package/front_end/generated/Deprecation.ts +8 -0
  8. package/front_end/generated/InspectorBackendCommands.ts +3 -2
  9. package/front_end/generated/SupportedCSSProperties.js +533 -19
  10. package/front_end/generated/protocol.ts +26 -4
  11. package/front_end/models/ai_assistance/agents/AiAgent.ts +8 -1
  12. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +7 -0
  13. package/front_end/models/extensions/ExtensionAPI.ts +47 -21
  14. package/front_end/models/javascript_metadata/NativeFunctions.js +7 -3
  15. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +39 -1
  16. package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
  17. package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +228 -0
  18. package/front_end/panels/ai_assistance/components/ChatMessage.ts +39 -2
  19. package/front_end/panels/application/ApplicationPanelSidebar.ts +4 -0
  20. package/front_end/panels/application/CookieItemsView.ts +55 -6
  21. package/front_end/panels/application/DOMStorageItemsView.ts +43 -8
  22. package/front_end/panels/application/KeyValueStorageItemsView.ts +17 -9
  23. package/front_end/panels/console/ConsolePinPane.ts +1 -0
  24. package/front_end/panels/elements/ElementsTreeElement.ts +97 -57
  25. package/front_end/panels/elements/StylePropertyTreeElement.ts +73 -16
  26. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +9 -1
  27. package/front_end/panels/elements/StylesSidebarPane.ts +22 -8
  28. package/front_end/panels/layer_viewer/PaintProfilerView.ts +309 -182
  29. package/front_end/panels/layer_viewer/paintProfiler.css +27 -23
  30. package/front_end/panels/layers/LayerPaintProfilerView.ts +86 -29
  31. package/front_end/panels/profiler/HeapSnapshotView.ts +6 -0
  32. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +210 -356
  33. package/front_end/panels/sources/watchExpressionsSidebarPane.css +7 -0
  34. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +5 -5
  35. package/front_end/panels/timeline/components/NetworkTrackWidget.ts +122 -0
  36. package/front_end/panels/timeline/components/components.ts +2 -0
  37. package/front_end/panels/timeline/components/networkTrackWidget.css +31 -0
  38. package/front_end/panels/timeline/timeline.ts +2 -0
  39. package/front_end/third_party/chromium/README.chromium +1 -1
  40. package/front_end/ui/components/buttons/FloatingButton.ts +17 -2
  41. package/front_end/ui/components/buttons/floatingButton.css +2 -2
  42. package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +1 -1
  43. package/front_end/ui/legacy/TextPrompt.ts +24 -18
  44. package/front_end/ui/legacy/Treeoutline.ts +31 -4
  45. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +50 -24
  46. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +10 -10
  47. package/front_end/ui/visual_logging/KnownContextValues.ts +5 -0
  48. package/package.json +1 -1
@@ -4,31 +4,35 @@
4
4
  * found in the LICENSE file.
5
5
  */
6
6
 
7
- .paint-profiler-overview {
8
- background-color: var(--sys-color-cdt-base-container);
9
- }
7
+ @scope to (devtools-widget > *) {
8
+ :scope {
9
+ background-color: var(--sys-color-cdt-base-container);
10
+ display: flex;
11
+ flex-direction: row;
12
+ }
10
13
 
11
- .paint-profiler-canvas-container {
12
- flex: auto;
13
- position: relative;
14
- }
14
+ .paint-profiler-canvas-container {
15
+ flex: auto;
16
+ position: relative;
17
+ }
15
18
 
16
- .paint-profiler-pie-chart {
17
- width: 60px !important; /* stylelint-disable-line declaration-no-important */
18
- height: 60px !important; /* stylelint-disable-line declaration-no-important */
19
- padding: 2px;
20
- overflow: hidden;
21
- font-size: 10px;
22
- }
19
+ .paint-profiler-pie-chart {
20
+ width: 60px !important; /* stylelint-disable-line declaration-no-important */
21
+ height: 60px !important; /* stylelint-disable-line declaration-no-important */
22
+ padding: 2px;
23
+ overflow: hidden;
24
+ font-size: 10px;
25
+ }
23
26
 
24
- .paint-profiler-canvas-container canvas {
25
- z-index: 200;
26
- background-color: var(--sys-color-cdt-base-container);
27
- opacity: 95%;
28
- height: 100%;
29
- width: 100%;
30
- }
27
+ .paint-profiler-canvas-container canvas {
28
+ z-index: 200;
29
+ background-color: var(--sys-color-cdt-base-container);
30
+ opacity: 95%;
31
+ height: 100%;
32
+ width: 100%;
33
+ }
31
34
 
32
- .paint-profiler-canvas-container .overview-grid-window-resizer {
33
- z-index: 2000;
35
+ .paint-profiler-canvas-container .overview-grid-window-resizer {
36
+ z-index: 2000;
37
+ }
34
38
  }
@@ -1,54 +1,111 @@
1
1
  // Copyright 2014 The Chromium Authors
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
- /* eslint-disable @devtools/no-imperative-dom-api */
5
4
 
6
5
  import type * as SDK from '../../core/sdk/sdk.js';
7
6
  import * as UI from '../../ui/legacy/legacy.js';
7
+ import * as Lit from '../../ui/lit/lit.js';
8
8
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
9
9
  import * as LayerViewer from '../layer_viewer/layer_viewer.js';
10
10
 
11
- export class LayerPaintProfilerView extends UI.SplitWidget.SplitWidget {
12
- private readonly logTreeView: LayerViewer.PaintProfilerView.PaintProfilerCommandLogView;
13
- private readonly paintProfilerView: LayerViewer.PaintProfilerView.PaintProfilerView;
14
- constructor(showImageCallback: (arg0?: string|undefined) => void) {
15
- super(true, false);
16
- this.element.setAttribute('jslog', `${VisualLogging.pane('layers.paint-profiler').track({resize: true})}`);
11
+ const {html, render} = Lit;
12
+ const {widget} = UI.Widget;
17
13
 
18
- this.logTreeView = new LayerViewer.PaintProfilerView.PaintProfilerCommandLogView();
19
- this.setSidebarWidget(this.logTreeView);
20
- this.paintProfilerView = new LayerViewer.PaintProfilerView.PaintProfilerView(showImageCallback);
21
- this.setMainWidget(this.paintProfilerView);
14
+ export interface ViewInput {
15
+ showImageCallback: (arg0?: string|undefined) => void;
16
+ snapshot: SDK.PaintProfiler.PaintProfilerSnapshot|null;
17
+ log: SDK.PaintProfiler.PaintProfilerLogItem[];
18
+ scale: number;
19
+ selectionWindow: {left: number, right: number}|null;
20
+ onWindowChanged: (window: {left: number, right: number}|null) => void;
21
+ }
22
+
23
+ export type ViewOutput = undefined;
24
+
25
+ export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
22
26
 
23
- this.paintProfilerView.addEventListener(
24
- LayerViewer.PaintProfilerView.Events.WINDOW_CHANGED, this.onWindowChanged, this);
27
+ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTMLElement): void => {
28
+ // clang-format off
29
+ render(html`
30
+ <devtools-split-view direction="column" jslog=${VisualLogging.pane('layers.paint-profiler').track({resize: true})}>
31
+ <devtools-widget slot="sidebar"
32
+ ${widget(LayerViewer.PaintProfilerView.PaintProfilerCommandLogView, {
33
+ commandLog: input.log,
34
+ selectionWindow: input.selectionWindow,
35
+ })}>
36
+ </devtools-widget>
37
+ <devtools-widget slot="main"
38
+ ${widget(LayerViewer.PaintProfilerView.PaintProfilerView, {
39
+ showImageCallback: input.showImageCallback,
40
+ snapshotAndLog: {snapshot: input.snapshot, log: input.log},
41
+ scale: input.scale,
42
+ })}
43
+ @WindowChanged=${(e: CustomEvent<{left: number, right: number}|null>) => input.onWindowChanged(e.detail)}>
44
+ </devtools-widget>
45
+ </devtools-split-view>
46
+ `, target);
47
+ // clang-format on
48
+ };
49
+
50
+ export class LayerPaintProfilerView extends UI.Widget.VBox {
51
+ readonly #showImageCallback: (arg0?: string|undefined) => void;
52
+ #snapshot: SDK.PaintProfiler.PaintProfilerSnapshot|null = null;
53
+ #log: SDK.PaintProfiler.PaintProfilerLogItem[] = [];
54
+ #scale = 1;
55
+ #selectionWindow: {left: number, right: number}|null = null;
56
+ readonly #view: View;
57
+
58
+ constructor(showImageCallback: (arg0?: string|undefined) => void, view: View = DEFAULT_VIEW) {
59
+ super();
60
+ this.#showImageCallback = showImageCallback;
61
+ this.#view = view;
62
+ }
25
63
 
26
- this.logTreeView.focus();
64
+ override wasShown(): void {
65
+ super.wasShown();
66
+ this.requestUpdate();
67
+ }
68
+
69
+ override performUpdate(): void {
70
+ const input: ViewInput = {
71
+ showImageCallback: this.#showImageCallback,
72
+ snapshot: this.#snapshot,
73
+ log: this.#log,
74
+ scale: this.#scale,
75
+ selectionWindow: this.#selectionWindow,
76
+ onWindowChanged: this.onWindowChanged,
77
+ };
78
+ this.#view(input, undefined, this.contentElement);
27
79
  }
28
80
 
29
81
  reset(): void {
30
- void this.paintProfilerView.setSnapshotAndLog(null, [], null);
82
+ if (this.#snapshot) {
83
+ this.#snapshot.release();
84
+ }
85
+ this.#snapshot = null;
86
+ this.#log = [];
87
+ this.#selectionWindow = null;
88
+ this.requestUpdate();
31
89
  }
32
90
 
33
91
  profile(snapshot: SDK.PaintProfiler.PaintProfilerSnapshot): void {
34
- void snapshot.commandLog().then(log => setSnapshotAndLog.call(this, snapshot, log));
35
-
36
- function setSnapshotAndLog(
37
- this: LayerPaintProfilerView, snapshot: SDK.PaintProfiler.PaintProfilerSnapshot|null,
38
- log: SDK.PaintProfiler.PaintProfilerLogItem[]|null): void {
39
- this.logTreeView.setCommandLog(log || []);
40
- void this.paintProfilerView.setSnapshotAndLog(snapshot, log || [], null);
41
- if (snapshot) {
42
- snapshot.release();
92
+ void snapshot.commandLog().then(log => {
93
+ if (this.#snapshot) {
94
+ this.#snapshot.release();
43
95
  }
44
- }
96
+ this.#snapshot = snapshot;
97
+ this.#log = log || [];
98
+ this.requestUpdate();
99
+ });
45
100
  }
46
101
 
47
102
  setScale(scale: number): void {
48
- this.paintProfilerView.setScale(scale);
103
+ this.#scale = scale;
104
+ this.requestUpdate();
49
105
  }
50
106
 
51
- private onWindowChanged(): void {
52
- this.logTreeView.updateWindow(this.paintProfilerView.selectionWindow());
53
- }
107
+ private onWindowChanged = (window: {left: number, right: number}|null): void => {
108
+ this.#selectionWindow = window;
109
+ this.requestUpdate();
110
+ };
54
111
  }
@@ -136,6 +136,11 @@ const UIStrings = {
136
136
  * detached DOM nodes and other objects kept alive by detached DOM nodes
137
137
  */
138
138
  objectsRetainedByDetachedDomNodes: 'Objects retained by detached DOM nodes',
139
+ /**
140
+ * @description An option which will filter the heap snapshot to show only
141
+ * objects kept alive by contexts
142
+ */
143
+ objectsRetainedByContexts: 'Objects retained by contexts',
139
144
  /**
140
145
  * @description An option which will filter the heap snapshot to show only
141
146
  * objects kept alive by the DevTools console
@@ -773,6 +778,7 @@ export class HeapSnapshotView extends UI.View.SimpleView implements DataDisplayD
773
778
  static readonly ALWAYS_AVAILABLE_FILTERS: ReadonlyArray<{uiName: string, filterName: string}> = [
774
779
  {uiName: i18nString(UIStrings.duplicatedStrings), filterName: 'duplicatedStrings'},
775
780
  {uiName: i18nString(UIStrings.objectsRetainedByDetachedDomNodes), filterName: 'objectsRetainedByDetachedDomNodes'},
781
+ {uiName: i18nString(UIStrings.objectsRetainedByContexts), filterName: 'objectsRetainedByContexts'},
776
782
  {uiName: i18nString(UIStrings.objectsRetainedByConsole), filterName: 'objectsRetainedByConsole'},
777
783
  {uiName: i18nString(UIStrings.objectsRetainedByEventHandlers), filterName: 'objectsRetainedByEventHandlers'},
778
784
  ];