chrome-devtools-frontend 1.0.1736236 → 1.0.1738725

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 (134) hide show
  1. package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +1 -1
  2. package/.agents/skills/version-control/SKILL.md +63 -11
  3. package/docs/devtools-protocol.md +3 -1
  4. package/eslint.config.mjs +0 -6
  5. package/front_end/core/host/AidaClient.ts +14 -36
  6. package/front_end/core/host/AidaGcaTranslation.ts +8 -5
  7. package/front_end/core/root/Runtime.ts +0 -5
  8. package/front_end/design_system_tokens.css +1 -0
  9. package/front_end/entrypoints/main/GlobalAiButton.ts +2 -9
  10. package/front_end/entrypoints/main/MainImpl.ts +0 -4
  11. package/front_end/generated/SupportedCSSProperties.ts +8 -23
  12. package/front_end/models/ai-utils/AiUtils.ts +1 -5
  13. package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -18
  14. package/front_end/models/ai_assistance/contexts/FileContext.ts +1 -2
  15. package/front_end/models/ai_assistance/tools/ListSources.ts +3 -1
  16. package/front_end/models/ai_code_generation/AiCodeGeneration.ts +0 -6
  17. package/front_end/models/javascript_metadata/NativeFunctions.ts +9 -5
  18. package/front_end/models/trace/EventsSerializer.ts +0 -8
  19. package/front_end/models/workspace/UISourceCode.ts +30 -8
  20. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -7
  21. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +15 -34
  22. package/front_end/panels/ai_assistance/components/ChatView.ts +2 -16
  23. package/front_end/panels/ai_assistance/components/chatView.css +0 -32
  24. package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
  25. package/front_end/panels/animation/AnimationTimeline.ts +1 -1
  26. package/front_end/panels/animation/animationTimeline.css +5 -3
  27. package/front_end/panels/application/PrivateVerificationTokensView.ts +114 -26
  28. package/front_end/panels/application/ResourcesPanel.ts +1 -0
  29. package/front_end/panels/application/backgroundServiceView.css +2 -2
  30. package/front_end/panels/application/components/permissionsPolicySection.css +0 -4
  31. package/front_end/panels/application/frameDetailsReportView.css +0 -7
  32. package/front_end/panels/application/indexedDBViews.css +3 -3
  33. package/front_end/panels/application/privateVerificationTokensView.css +6 -0
  34. package/front_end/panels/application/serviceWorkerUpdateCycleView.css +1 -1
  35. package/front_end/panels/application/serviceWorkersView.css +2 -2
  36. package/front_end/panels/comments/CommentsPane.ts +1 -1
  37. package/front_end/panels/comments/commentsPane.css +1 -1
  38. package/front_end/panels/common/common.ts +0 -1
  39. package/front_end/panels/console/ConsoleView.ts +11 -1
  40. package/front_end/panels/console/ConsoleViewMessage.ts +5 -1
  41. package/front_end/panels/console/consolePinPane.css +1 -1
  42. package/front_end/panels/console/consoleView.css +5 -4
  43. package/front_end/panels/elements/DOMTreeWidget.ts +47 -5
  44. package/front_end/panels/elements/layoutPane.css +0 -1
  45. package/front_end/panels/emulation/InspectedPagePlaceholder.ts +1 -0
  46. package/front_end/panels/emulation/deviceModeView.css +0 -1
  47. package/front_end/panels/issues/issuesTree.css +2 -2
  48. package/front_end/panels/layer_viewer/LayerDetailsView.ts +34 -17
  49. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +39 -17
  50. package/front_end/panels/layer_viewer/Layers3DView.ts +34 -13
  51. package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
  52. package/front_end/panels/layer_viewer/layers3DView.css +0 -4
  53. package/front_end/panels/media/playerListView.css +0 -18
  54. package/front_end/panels/media/playerPropertiesView.css +1 -1
  55. package/front_end/panels/network/NetworkWaterfallColumn.ts +22 -10
  56. package/front_end/panels/network/RequestPreviewView.ts +182 -63
  57. package/front_end/panels/network/SignedExchangeInfoView.ts +242 -158
  58. package/front_end/panels/network/networkConfigView.css +1 -1
  59. package/front_end/panels/network/networkLogView.css +2 -1
  60. package/front_end/panels/network/networkPanel.css +0 -5
  61. package/front_end/panels/network/networkTimingTable.css +1 -1
  62. package/front_end/panels/network/signedExchangeInfoView.css +12 -8
  63. package/front_end/panels/performance_monitor/performanceMonitor.css +2 -2
  64. package/front_end/panels/profiler/IsolateSelector.ts +31 -10
  65. package/front_end/panels/profiler/profilesPanel.css +0 -8
  66. package/front_end/panels/protocol_monitor/JSONEditor.css +1 -1
  67. package/front_end/panels/screencast/screencastView.css +2 -2
  68. package/front_end/panels/security/SecurityPanel.ts +474 -418
  69. package/front_end/panels/security/SecurityPanelSidebar.ts +68 -48
  70. package/front_end/panels/security/lockIcon.css +52 -50
  71. package/front_end/panels/security/mainView.css +149 -145
  72. package/front_end/panels/security/originView.css +117 -115
  73. package/front_end/panels/sensors/LocationsSettingsTab.ts +2 -50
  74. package/front_end/panels/sensors/locationsSettingsTab.css +1 -21
  75. package/front_end/panels/settings/AISettingsTab.ts +1 -2
  76. package/front_end/panels/settings/SettingsScreen.ts +1 -1
  77. package/front_end/panels/sources/CallStackSidebarPane.ts +31 -6
  78. package/front_end/panels/sources/NavigatorView.ts +105 -31
  79. package/front_end/panels/sources/breakpointsView.css +2 -1
  80. package/front_end/panels/sources/scopeChainSidebarPane.css +1 -1
  81. package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -0
  82. package/front_end/panels/timeline/TimelineLayersView.ts +108 -46
  83. package/front_end/panels/timeline/TimelinePanel.ts +4 -2
  84. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
  85. package/front_end/panels/timeline/components/networkRequestDetails.css +1 -1
  86. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +0 -7
  87. package/front_end/panels/web_audio/webAudio.css +1 -2
  88. package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
  89. package/front_end/panels/whats_new/ReleaseNoteText.ts +6 -6
  90. package/front_end/panels/whats_new/resources/WNDT.md +6 -6
  91. package/front_end/third_party/chromium/README.chromium +1 -1
  92. package/front_end/ui/comments/CommentAnchorResolver.ts +45 -4
  93. package/front_end/ui/comments/CommentOverlayManager.ts +45 -12
  94. package/front_end/ui/components/buttons/FloatingButton.ts +2 -6
  95. package/front_end/ui/components/buttons/button.css +2 -2
  96. package/front_end/ui/components/buttons/floatingButton.css +0 -44
  97. package/front_end/ui/components/icon_button/iconButton.css +1 -1
  98. package/front_end/ui/components/markdown_view/markdownView.css +1 -1
  99. package/front_end/ui/legacy/ContextMenu.ts +7 -5
  100. package/front_end/ui/legacy/InspectorDrawerView.ts +1 -0
  101. package/front_end/ui/legacy/InspectorView.ts +5 -1
  102. package/front_end/ui/legacy/PopoverHelper.ts +1 -0
  103. package/front_end/ui/legacy/RootView.ts +9 -3
  104. package/front_end/ui/legacy/SplitWidget.ts +1 -0
  105. package/front_end/ui/legacy/Treeoutline.ts +9 -0
  106. package/front_end/ui/legacy/UIUtils.ts +1 -1
  107. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +130 -137
  108. package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
  109. package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +1 -0
  110. package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +1 -1
  111. package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +3 -1
  112. package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +7 -6
  113. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -0
  114. package/front_end/ui/legacy/components/perf_ui/pieChart.css +2 -2
  115. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -10
  116. package/front_end/ui/legacy/filter.css +1 -1
  117. package/front_end/ui/legacy/infobar.css +1 -1
  118. package/front_end/ui/legacy/inspectorCommon.css +2 -2
  119. package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +3 -3
  120. package/front_end/ui/legacy/listWidget.css +2 -7
  121. package/front_end/ui/legacy/softDropDownButton.css +1 -1
  122. package/front_end/ui/legacy/tabbedPane.css +2 -1
  123. package/front_end/ui/legacy/treeoutline.css +3 -2
  124. package/front_end/ui/visual_logging/KnownContextValues.ts +133 -0
  125. package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
  126. package/package.json +1 -1
  127. package/front_end/Images/geminiInDevTools.png +0 -0
  128. package/front_end/Images/geminiInDevTools_2x.png +0 -0
  129. package/front_end/generated/InspectorBackendCommands.ts +0 -1690
  130. package/front_end/generated/protocol-mapping.d.ts +0 -5986
  131. package/front_end/generated/protocol-proxy-api.d.ts +0 -5452
  132. package/front_end/generated/protocol.ts +0 -23364
  133. package/front_end/panels/common/GeminiRebrandPromoDialog.ts +0 -193
  134. package/front_end/panels/common/geminiRebrandPromoDialog.css +0 -47
@@ -92,13 +92,13 @@
92
92
  display: flex;
93
93
  flex: auto;
94
94
  margin-right: var(--sys-size-3);
95
- max-width: 400px;
95
+ max-width: var(--sys-size-32);
96
96
  min-width: var(--sys-size-19);
97
97
  }
98
98
 
99
99
  .report-field-value-filename,
100
100
  .service-worker-client-string {
101
- max-width: 400px;
101
+ max-width: var(--sys-size-32);
102
102
  overflow: hidden;
103
103
  text-overflow: ellipsis;
104
104
  }
@@ -55,7 +55,7 @@ const UIStrings = {
55
55
  /**
56
56
  * @description Button text for sending comments to the agent.
57
57
  */
58
- sendToAgent: 'Send to Agent',
58
+ sendToAgent: 'Send to agent',
59
59
  /**
60
60
  * @description Status text shown next to a spinner when a comment thread is being processed by the agent.
61
61
  */
@@ -118,7 +118,7 @@
118
118
  list-style: none;
119
119
  }
120
120
 
121
- /* Extra space between the Send to Agent footer and the sent comments separator. */
121
+ /* Extra space between the Send to agent footer and the sent comments separator. */
122
122
  .comments-sent-section {
123
123
  margin-top: var(--sys-size-11);
124
124
  /*
@@ -3,7 +3,6 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  export {GdpSignUpDialog} from './GdpSignUpDialog.js';
6
- export {GeminiRebrandPromoDialog} from './GeminiRebrandPromoDialog.js';
7
6
  export * as AiCodeCompletionSummaryToolbar from './AiCodeCompletionSummaryToolbar.js';
8
7
  export * from './BadgeNotification.js';
9
8
  export * as CPUThrottlingOption from './CPUThrottlingOption.js';
@@ -187,10 +187,15 @@ const UIStrings = {
187
187
  * @description Text to save content as a specific file type.
188
188
  */
189
189
  saveAs: 'Save as…',
190
+ /**
191
+ * @description A context menu item in the Console view of the Console panel. Copies the message
192
+ * the user right-clicked to the clipboard.
193
+ */
194
+ copyMessage: 'Copy message',
190
195
  /**
191
196
  * @description Text to copy console log to clipboard.
192
197
  */
193
- copyConsole: 'Copy console',
198
+ copyConsole: 'Copy all messages',
194
199
  /**
195
200
  * @description A context menu item in the Console view of the Console panel.
196
201
  */
@@ -1351,6 +1356,11 @@ export class ConsoleView extends UI.Widget.VBox implements
1351
1356
  this.viewport.copyWithStyles.bind(this.viewport),
1352
1357
  {jslogContext: 'copy-visible-styled-selection'});
1353
1358
  }
1359
+ if (consoleViewMessage) {
1360
+ contextMenu.clipboardSection().appendItem(i18nString(UIStrings.copyMessage), () => {
1361
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(consoleViewMessage.toString());
1362
+ }, {jslogContext: 'copy-message'});
1363
+ }
1354
1364
 
1355
1365
  if (consoleMessage) {
1356
1366
  const request = Logs.NetworkLog.NetworkLog.requestForConsoleMessage(consoleMessage);
@@ -1861,9 +1861,13 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1861
1861
  return this.message.messageText;
1862
1862
  }
1863
1863
 
1864
+ toString(): string {
1865
+ return Components.Linkifier.Linkifier.untruncatedTextContent(this.contentElement());
1866
+ }
1867
+
1864
1868
  toExportString(): string {
1865
1869
  const lines = [];
1866
- const messageContent = Components.Linkifier.Linkifier.untruncatedTextContent(this.contentElement());
1870
+ const messageContent = this.toString();
1867
1871
  for (let i = 0; i < this.repeatCount(); ++i) {
1868
1872
  lines.push(messageContent);
1869
1873
  }
@@ -11,7 +11,7 @@
11
11
  }
12
12
 
13
13
  .console-pins {
14
- max-height: 200px;
14
+ max-height: var(--sys-size-25);
15
15
  overflow-y: auto;
16
16
  background: var(--sys-color-cdt-base-container);
17
17
 
@@ -125,7 +125,7 @@
125
125
  .message-level-icon,
126
126
  .command-result-icon {
127
127
  position: absolute;
128
- left: -17px;
128
+ left: calc(-1 * var(--sys-size-9));
129
129
  top: var(--sys-size-2);
130
130
  user-select: none;
131
131
  }
@@ -307,14 +307,15 @@
307
307
 
308
308
  .console-message-wrapper .nesting-level-marker + .console-message::after {
309
309
  position: absolute;
310
- left: -30px;
310
+ /* 24px (--sys-size-11) .console-message left margin + 6px (--sys-size-4) pseudo-element width */
311
+ left: calc(-1 * (var(--sys-size-11) + var(--sys-size-4)));
311
312
  top: 0;
312
313
  width: var(--sys-size-4);
313
314
  height: 100%;
314
315
  box-sizing: border-box;
315
316
  background-color: var(--sys-color-surface-yellow);
316
- border-top-left-radius: 5px;
317
- border-bottom-left-radius: 5px;
317
+ border-top-left-radius: var(--sys-shape-corner-extra-small);
318
+ border-bottom-left-radius: var(--sys-shape-corner-extra-small);
318
319
  content: "";
319
320
  }
320
321
 
@@ -66,6 +66,15 @@ import {getElementIssueDetails} from './ElementIssueUtils.js';
66
66
  import {ImagePreviewPopover} from './ImagePreviewPopover.js';
67
67
 
68
68
  const {html, nothing, render, Directives: {classMap, ifDefined, repeat, styleMap}} = Lit;
69
+ const {clonedRef} = UI.UIUtils;
70
+
71
+ /**
72
+ * Scrolls the rendered row of the highlighted node into view. The function has a
73
+ * stable identity, so that `clonedRef` calls it once per row that it is attached to.
74
+ */
75
+ const scrollHighlightedRowIntoView = (element: Element|undefined): void => {
76
+ element?.scrollIntoViewIfNeeded(/* center= */ true);
77
+ };
69
78
 
70
79
  const UIStrings = {
71
80
  /**
@@ -747,6 +756,7 @@ export const DEFAULT_VIEW: View = (input: ViewInput, _output: undefined, target:
747
756
  data-target-id=${ifDefined(node.domModel().target().id())}
748
757
  selectable=${input.selectEnabled ? 'true' : 'false'}
749
758
  ?selected=${isSelected && !input.selectedClosingTag}
759
+ ${input.currentHighlightedNode === node ? clonedRef(scrollHighlightedRowIntoView) : nothing}
750
760
  class=${classes}
751
761
  style=${styleMap({'--indent': `${computeLeftIndent(depth, isExpandable)}px`})}
752
762
  ?open=${hasChildren && isExpanded && !isEditingAsHTML}
@@ -1451,11 +1461,28 @@ export class DOMTreeWidget extends UI.Widget.Widget {
1451
1461
 
1452
1462
  #highlightNode(event: Common.EventTarget.EventTargetEvent<SDK.DOMModel.DOMNode>): void {
1453
1463
  void this.#highlightThrottler.schedule(() => {
1454
- this.#currentHighlightedNode = event.data;
1464
+ const node = this.#resolveInlinedTextNode(event.data);
1465
+ // The view expands the ancestors of the highlighted node. Raise the
1466
+ // children limits so that the node is not paginated away.
1467
+ if (node) {
1468
+ for (let child = node, ancestor = node.parentNode; ancestor; child = ancestor, ancestor = ancestor.parentNode) {
1469
+ this.#ensureChildVisible(ancestor, child);
1470
+ }
1471
+ }
1472
+ this.#currentHighlightedNode = node;
1455
1473
  this.requestUpdate();
1456
1474
  });
1457
1475
  }
1458
1476
 
1477
+ /** Short text nodes render inline in the row of their parent node. */
1478
+ #resolveInlinedTextNode(node: SDK.DOMModel.DOMNode|null): SDK.DOMModel.DOMNode|null {
1479
+ if (node?.nodeType() === Node.TEXT_NODE && node.parentNode &&
1480
+ (!nodeHasVisibleChildren(node.parentNode, this) || !getVisibleChildren(node.parentNode, this).includes(node))) {
1481
+ return node.parentNode;
1482
+ }
1483
+ return node;
1484
+ }
1485
+
1459
1486
  #onInspectModeWillBeToggled(): void {
1460
1487
  this.#clearHighlightedNode();
1461
1488
  this.performUpdate();
@@ -1466,6 +1493,12 @@ export class DOMTreeWidget extends UI.Widget.Widget {
1466
1493
  this.#currentHighlightedNode = null;
1467
1494
  }
1468
1495
 
1496
+ /** True if the view expands `node` only because it is an ancestor of the highlighted node. */
1497
+ #isExpandedOnlyForHighlight(node: SDK.DOMModel.DOMNode): boolean {
1498
+ const highlightedNode = this.#currentHighlightedNode;
1499
+ return highlightedNode !== null && !this.#expandedNodes.has(node) && isAncestorOf(node, highlightedNode);
1500
+ }
1501
+
1469
1502
  selectDOMNode(node: SDK.DOMModel.DOMNode|SDK.DOMModel.AdoptedStyleSheet|null, focus?: boolean,
1470
1503
  isClosingTag?: boolean): void {
1471
1504
  this.#imagePreviewPopover?.hide();
@@ -1475,10 +1508,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
1475
1508
  return;
1476
1509
  }
1477
1510
  this.#selectedAdoptedStyleSheet = null;
1478
- if (node?.nodeType() === Node.TEXT_NODE && node.parentNode &&
1479
- (!nodeHasVisibleChildren(node.parentNode, this) || !getVisibleChildren(node.parentNode, this).includes(node))) {
1480
- node = node.parentNode;
1481
- }
1511
+ node = this.#resolveInlinedTextNode(node);
1482
1512
  if (node) {
1483
1513
  const ancestors: SDK.DOMModel.DOMNode[] = [];
1484
1514
  for (let current: (SDK.DOMModel.DOMNode|null) = node.parentNode; current; current = current.parentNode) {
@@ -1829,6 +1859,18 @@ export class DOMTreeWidget extends UI.Widget.Widget {
1829
1859
  void this.expandRecursively(node);
1830
1860
  return;
1831
1861
  }
1862
+ if (expanded && this.#isExpandedOnlyForHighlight(node)) {
1863
+ // The tree reports the expansion that the view requested for the
1864
+ // highlighted node. Do not persist it, so that the node collapses
1865
+ // again when the highlight clears.
1866
+ return;
1867
+ }
1868
+ if (!expanded && !this.#expandedNodes.has(node)) {
1869
+ // The tree reports a collapse that the view requested itself, e.g.
1870
+ // for the ancestors of a previous highlight. The collapse must not
1871
+ // clear the current highlight.
1872
+ return;
1873
+ }
1832
1874
  this.setNodeExpanded(node, expanded);
1833
1875
  },
1834
1876
  onContextMenu: (node: SDK.DOMModel.DOMNode, event: MouseEvent) => {
@@ -135,7 +135,6 @@
135
135
  .node-text-container {
136
136
  line-height: var(--sys-typescale-body4-line-height);
137
137
  padding: 0 0.5ex;
138
- border-radius: 5px;
139
138
  }
140
139
 
141
140
  }
@@ -1,6 +1,7 @@
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 */
4
5
 
5
6
  import * as Common from '../../core/common/common.js';
6
7
  import * as UI from '../../ui/legacy/legacy.js';
@@ -33,7 +33,6 @@
33
33
  * step-buttons.
34
34
  */
35
35
  width: calc(4ch + 2ch + var(--sys-size-2));
36
- max-height: 18px;
37
36
  border: var(--sys-color-neutral-outline);
38
37
  border-radius: var(--sys-shape-corner-extra-small);
39
38
  margin: 0 var(--sys-size-2);
@@ -309,7 +309,7 @@ ul > li.plain-enum::before {
309
309
 
310
310
  .affected-resource-request {
311
311
  font-size: var(--sys-typescale-body4-size);
312
- line-height: 18px;
312
+ line-height: var(--sys-typescale-body4-line-height);
313
313
  border: 0;
314
314
  border-collapse: collapse;
315
315
  }
@@ -390,7 +390,7 @@ ul > li.plain-enum::before {
390
390
 
391
391
  .affected-resources > .parent {
392
392
  margin-top: 0;
393
- padding: var(--sys-size-2) 5px 0;
393
+ padding: var(--sys-size-2) var(--sys-size-3) 0;
394
394
  }
395
395
 
396
396
  .affected-resources > .parent.expanded {
@@ -290,19 +290,37 @@ const LayerDetailsViewBase: Common.ObjectWrapper.EventMixin<EventTypes, typeof U
290
290
  );
291
291
 
292
292
  export class LayerDetailsView extends LayerDetailsViewBase implements LayerView {
293
- private readonly layerViewHost: LayerViewHost;
294
- private layerSnapshotMap: Map<SDK.LayerTreeBase.Layer, SnapshotSelection>;
293
+ #layerViewHost?: LayerViewHost;
294
+ private layerSnapshotMap: Map<SDK.LayerTreeBase.Layer, SnapshotSelection> = new Map();
295
295
  private selection: Selection|null;
296
296
  private compositingReasons: string[] = [];
297
297
  private readonly view: typeof DEFAULT_VIEW;
298
298
 
299
- constructor(layerViewHost: LayerViewHost, view: typeof DEFAULT_VIEW = DEFAULT_VIEW) {
300
- super({useShadowDom: 'pure'});
299
+ constructor(layerViewHost?: LayerViewHost|HTMLElement, view: typeof DEFAULT_VIEW = DEFAULT_VIEW) {
300
+ super(layerViewHost instanceof HTMLElement ? layerViewHost : undefined, {useShadowDom: 'pure'});
301
301
  this.view = view;
302
- this.layerViewHost = layerViewHost;
303
- this.layerViewHost.registerView(this);
304
- this.layerSnapshotMap = this.layerViewHost.getLayerSnapshotMap();
305
302
  this.selection = null;
303
+ if (layerViewHost && !(layerViewHost instanceof HTMLElement)) {
304
+ this.layerViewHost = layerViewHost;
305
+ }
306
+ }
307
+
308
+ get layerViewHost(): LayerViewHost|undefined {
309
+ return this.#layerViewHost;
310
+ }
311
+
312
+ set layerViewHost(layerViewHost: LayerViewHost|undefined) {
313
+ if (this.#layerViewHost === layerViewHost) {
314
+ return;
315
+ }
316
+ this.#layerViewHost = layerViewHost;
317
+ if (this.#layerViewHost) {
318
+ this.#layerViewHost.registerView(this);
319
+ this.layerSnapshotMap = this.#layerViewHost.getLayerSnapshotMap();
320
+ if (this.isShowing()) {
321
+ this.update();
322
+ }
323
+ }
306
324
  }
307
325
 
308
326
  hoverObject(_selection: Selection|null): void {
@@ -330,7 +348,7 @@ export class LayerDetailsView extends LayerDetailsViewBase implements LayerView
330
348
  if (!this.selection) {
331
349
  return;
332
350
  }
333
- this.layerViewHost.selectObject(new ScrollRectSelection(this.selection.layer(), index));
351
+ this.#layerViewHost?.selectObject(new ScrollRectSelection(this.selection.layer(), index));
334
352
  }
335
353
 
336
354
  private invokeProfilerLink(): void {
@@ -366,15 +384,14 @@ export class LayerDetailsView extends LayerDetailsViewBase implements LayerView
366
384
  (layer ? this.layerSnapshotMap.get(layer) : null)) ||
367
385
  null;
368
386
 
369
- this.view(
370
- {
371
- layer,
372
- snapshotSelection,
373
- compositingReasons: this.compositingReasons,
374
- onScrollRectClick: this.onScrollRectClicked.bind(this),
375
- onPaintProfilerRequested: this.invokeProfilerLink.bind(this),
376
- },
377
- undefined, this.contentElement);
387
+ this.view({
388
+ layer,
389
+ snapshotSelection,
390
+ compositingReasons: this.compositingReasons,
391
+ onScrollRectClick: this.onScrollRectClicked.bind(this),
392
+ onPaintProfilerRequested: this.invokeProfilerLink.bind(this),
393
+ },
394
+ undefined, this.contentElement);
378
395
  }
379
396
  }
380
397
 
@@ -147,7 +147,7 @@ const LayerTreeOutlineBase: Common.ObjectWrapper.EventMixin<EventTypes, typeof U
147
147
 
148
148
  export class LayerTreeOutline extends LayerTreeOutlineBase implements Common.EventTarget.EventTarget<EventTypes>,
149
149
  LayerView {
150
- private layerViewHost: LayerViewHost;
150
+ #layerViewHost?: LayerViewHost;
151
151
  private layerTree?: SDK.LayerTreeBase.LayerTreeBase|null;
152
152
  private layerSnapshotMap?: Map<SDK.LayerTreeBase.Layer, SnapshotSelection>;
153
153
  #layerCount = 0;
@@ -157,28 +157,50 @@ export class LayerTreeOutline extends LayerTreeOutlineBase implements Common.Eve
157
157
  #view: View;
158
158
  #hoveredLayer: SDK.LayerTreeBase.Layer|null = null;
159
159
 
160
- constructor(layerViewHost: LayerViewHost, view: View = DEFAULT_VIEW) {
161
- super();
160
+ constructor(layerViewHost?: LayerViewHost|HTMLElement, view: View = DEFAULT_VIEW) {
161
+ super(layerViewHost instanceof HTMLElement ? layerViewHost : undefined);
162
162
  this.#view = view;
163
- this.layerViewHost = layerViewHost;
164
- this.layerViewHost.registerView(this);
163
+ if (layerViewHost && !(layerViewHost instanceof HTMLElement)) {
164
+ this.layerViewHost = layerViewHost;
165
+ }
166
+ }
167
+
168
+ get layerViewHost(): LayerViewHost|undefined {
169
+ return this.#layerViewHost;
170
+ }
171
+
172
+ set layerViewHost(layerViewHost: LayerViewHost|undefined) {
173
+ if (this.#layerViewHost === layerViewHost) {
174
+ return;
175
+ }
176
+ if (this.isShowing()) {
177
+ this.#layerViewHost?.showInternalLayersSetting().removeChangeListener(this.update, this);
178
+ }
179
+ this.#layerViewHost = layerViewHost;
180
+ if (this.#layerViewHost) {
181
+ this.#layerViewHost.registerView(this);
182
+ if (this.isShowing()) {
183
+ this.#layerViewHost.showInternalLayersSetting().addChangeListener(this.update, this);
184
+ this.update();
185
+ }
186
+ }
165
187
  }
166
188
 
167
189
  override wasShown(): void {
168
190
  super.wasShown();
169
- this.layerViewHost.showInternalLayersSetting().addChangeListener(this.update, this);
191
+ this.#layerViewHost?.showInternalLayersSetting().addChangeListener(this.update, this);
170
192
  this.update();
171
193
  }
172
194
 
173
195
  override willHide(): void {
174
- this.layerViewHost.showInternalLayersSetting().removeChangeListener(this.update, this);
196
+ this.#layerViewHost?.showInternalLayersSetting().removeChangeListener(this.update, this);
175
197
  super.willHide();
176
198
  }
177
199
 
178
200
  override performUpdate(): void {
179
201
  this.#view({
180
202
  treeData: this.#treeData,
181
- selectedLayer: this.layerViewHost.selection()?.layer() || null,
203
+ selectedLayer: this.#layerViewHost?.selection()?.layer() || null,
182
204
  hoveredLayer: this.#hoveredLayer,
183
205
  layerCount: this.#layerCount,
184
206
  totalLayerMemory: this.#totalLayerMemory,
@@ -218,7 +240,7 @@ export class LayerTreeOutline extends LayerTreeOutlineBase implements Common.Eve
218
240
  let layerCount = 0;
219
241
  let totalLayerMemory = 0;
220
242
 
221
- const showInternalLayers = this.layerViewHost.showInternalLayersSetting().get();
243
+ const showInternalLayers = this.#layerViewHost?.showInternalLayersSetting().get() ?? false;
222
244
  let root: SDK.LayerTreeBase.Layer|null = null;
223
245
  if (this.layerTree) {
224
246
  if (!showInternalLayers) {
@@ -279,36 +301,36 @@ export class LayerTreeOutline extends LayerTreeOutlineBase implements Common.Eve
279
301
  this.#totalLayerMemory = totalLayerMemory;
280
302
  this.requestUpdate();
281
303
 
282
- if (!this.layerViewHost.selection() && this.layerTree && this.#treeData.length > 0) {
304
+ if (!this.#layerViewHost?.selection() && this.layerTree && this.#treeData.length > 0) {
283
305
  const elementToSelect = this.layerTree.contentRoot() || this.layerTree.root();
284
306
  if (elementToSelect) {
285
- this.layerViewHost.selectObject(new LayerSelection(elementToSelect));
307
+ this.#layerViewHost?.selectObject(new LayerSelection(elementToSelect));
286
308
  }
287
309
  }
288
310
  }
289
311
 
290
312
  private onHover(layer: SDK.LayerTreeBase.Layer|null): void {
291
- this.layerViewHost.hoverObject(layer ? new LayerSelection(layer) : null);
313
+ this.#layerViewHost?.hoverObject(layer ? new LayerSelection(layer) : null);
292
314
  }
293
315
 
294
316
  private onSelect(layer: SDK.LayerTreeBase.Layer): void {
295
- if (this.layerViewHost.selection()?.layer() === layer) {
317
+ if (this.#layerViewHost?.selection()?.layer() === layer) {
296
318
  return;
297
319
  }
298
- this.layerViewHost.selectObject(new LayerSelection(layer));
320
+ this.#layerViewHost?.selectObject(new LayerSelection(layer));
299
321
  }
300
322
 
301
323
  private onContextMenu(event: MouseEvent, layer: SDK.LayerTreeBase.Layer|null): void {
302
324
  const selection = layer ? new LayerSelection(layer) : null;
303
325
  const contextMenu = new UI.ContextMenu.ContextMenu(event);
304
- this.layerSnapshotMap = this.layerViewHost.getLayerSnapshotMap();
305
- if (layer && this.layerSnapshotMap.has(layer) && selection) {
326
+ this.layerSnapshotMap = this.#layerViewHost?.getLayerSnapshotMap();
327
+ if (layer && this.layerSnapshotMap?.has(layer) && selection) {
306
328
  contextMenu.defaultSection().appendItem(
307
329
  i18nString(UIStrings.showPaintProfiler),
308
330
  () => this.dispatchEventToListeners(Events.PAINT_PROFILER_REQUESTED, selection),
309
331
  {jslogContext: 'layers.paint-profiler'});
310
332
  }
311
- this.layerViewHost.showContextMenu(contextMenu, selection);
333
+ this.#layerViewHost?.showContextMenu(contextMenu, selection);
312
334
  }
313
335
  }
314
336
 
@@ -149,7 +149,7 @@ const Layers3DViewBase: Common.ObjectWrapper.EventMixin<
149
149
 
150
150
  export class Layers3DView extends Layers3DViewBase
151
151
  implements LayerView {
152
- private readonly layerViewHost: LayerViewHost;
152
+ #layerViewHost?: LayerViewHost;
153
153
  private transformController: TransformController;
154
154
  private lastSelection: Record<string, Selection|null>;
155
155
  private layerTree: SDK.LayerTreeBase.LayerTreeBase|null;
@@ -180,12 +180,9 @@ export class Layers3DView extends Layers3DViewBase
180
180
  #error?: 'missing-root' | 'webgl-disabled';
181
181
  #canvasElement!: HTMLCanvasElement;
182
182
 
183
- constructor(layerViewHost: LayerViewHost, view: View = DEFAULT_VIEW) {
184
- super();
183
+ constructor(layerViewHost?: LayerViewHost|HTMLElement, view: View = DEFAULT_VIEW) {
184
+ super(layerViewHost instanceof HTMLElement ? layerViewHost : undefined);
185
185
  this.#view = view;
186
-
187
- this.layerViewHost = layerViewHost;
188
- this.layerViewHost.registerView(this);
189
186
  // Install transform controller, but still allow drag events to set focus on the element, which is needed
190
187
  // to correctly listen for keyboard shortcuts.
191
188
  this.transformController =
@@ -213,7 +210,31 @@ export class Layers3DView extends Layers3DViewBase
213
210
  this.rects = [];
214
211
 
215
212
  this.snapshotLayers = new Map();
216
- this.layerViewHost.setLayerSnapshotMap(this.snapshotLayers);
213
+ if (layerViewHost && !(layerViewHost instanceof HTMLElement)) {
214
+ this.layerViewHost = layerViewHost;
215
+ }
216
+ }
217
+
218
+ get layerViewHost(): LayerViewHost|undefined {
219
+ return this.#layerViewHost;
220
+ }
221
+
222
+ set layerViewHost(layerViewHost: LayerViewHost|undefined) {
223
+ if (this.#layerViewHost === layerViewHost) {
224
+ return;
225
+ }
226
+ if (this.isShowing()) {
227
+ this.#layerViewHost?.showInternalLayersSetting().removeChangeListener(this.updateData, this);
228
+ }
229
+ this.#layerViewHost = layerViewHost;
230
+ if (this.#layerViewHost) {
231
+ this.#layerViewHost.registerView(this);
232
+ this.#layerViewHost.setLayerSnapshotMap(this.snapshotLayers);
233
+ if (this.isShowing()) {
234
+ this.#layerViewHost.showInternalLayersSetting().addChangeListener(this.updateData, this);
235
+ this.updateData();
236
+ }
237
+ }
217
238
  }
218
239
 
219
240
  override performUpdate(): void {
@@ -267,7 +288,7 @@ export class Layers3DView extends Layers3DViewBase
267
288
  this.showPaintsSetting.removeChangeListener(this.updatePaints, this);
268
289
  this.showSlowScrollRectsSetting.removeChangeListener(this.updateData, this);
269
290
  this.#chromeWindowSetting.removeChangeListener(this.updateData, this);
270
- this.layerViewHost.showInternalLayersSetting().removeChangeListener(this.updateData, this);
291
+ this.#layerViewHost?.showInternalLayersSetting().removeChangeListener(this.updateData, this);
271
292
  this.textureManager.suspend();
272
293
  super.willHide();
273
294
  }
@@ -277,7 +298,7 @@ export class Layers3DView extends Layers3DViewBase
277
298
  this.showPaintsSetting.addChangeListener(this.updatePaints, this);
278
299
  this.showSlowScrollRectsSetting.addChangeListener(this.updateData, this);
279
300
  this.#chromeWindowSetting.addChangeListener(this.updateData, this);
280
- this.layerViewHost.showInternalLayersSetting().addChangeListener(this.updateData, this);
301
+ this.#layerViewHost?.showInternalLayersSetting().addChangeListener(this.updateData, this);
281
302
  this.textureManager.resume();
282
303
  this.performUpdate();
283
304
  this.resizeCanvas();
@@ -509,7 +530,7 @@ export class Layers3DView extends Layers3DViewBase
509
530
  private calculateDepthsAndVisibility(): void {
510
531
  this.depthByLayerId = new Map();
511
532
  let depth = 0;
512
- const showInternalLayers = this.layerViewHost.showInternalLayersSetting().get();
533
+ const showInternalLayers = this.#layerViewHost?.showInternalLayersSetting().get() ?? false;
513
534
  if (!this.layerTree) {
514
535
  return;
515
536
  }
@@ -895,7 +916,7 @@ export class Layers3DView extends Layers3DViewBase
895
916
  jslogContext: 'layers.paint-profiler',
896
917
  });
897
918
  }
898
- this.layerViewHost.showContextMenu(contextMenu, selection);
919
+ this.#layerViewHost?.showContextMenu(contextMenu, selection);
899
920
  }
900
921
 
901
922
  private onMouseMove(event: Event): void {
@@ -903,7 +924,7 @@ export class Layers3DView extends Layers3DViewBase
903
924
  if (mouseEvent.which) {
904
925
  return;
905
926
  }
906
- this.layerViewHost.hoverObject(this.selectionFromEventPoint(event));
927
+ this.#layerViewHost?.hoverObject(this.selectionFromEventPoint(event));
907
928
  }
908
929
 
909
930
  private onMouseDown(event: Event): void {
@@ -918,7 +939,7 @@ export class Layers3DView extends Layers3DViewBase
918
939
  if (this.mouseDownX && Math.abs(mouseEvent.clientX - this.mouseDownX) < maxDistanceInPixels &&
919
940
  Math.abs(mouseEvent.clientY - (this.mouseDownY || 0)) < maxDistanceInPixels) {
920
941
  this.#canvasElement.focus();
921
- this.layerViewHost.selectObject(this.selectionFromEventPoint(event));
942
+ this.#layerViewHost?.selectObject(this.selectionFromEventPoint(event));
922
943
  }
923
944
  delete this.mouseDownX;
924
945
  delete this.mouseDownY;
@@ -14,7 +14,7 @@ table {
14
14
 
15
15
  table td {
16
16
  font: var(--sys-typescale-body4-regular);
17
- line-height: 18px;
17
+ line-height: var(--sys-typescale-body4-line-height);
18
18
  padding: var(--sys-size-3) var(--sys-size-5);
19
19
  vertical-align: top;
20
20
  }
@@ -23,7 +23,3 @@ devtools-toolbar {
23
23
  canvas {
24
24
  flex: 1 1;
25
25
  }
26
-
27
- .layers-3d-view > canvas:focus-visible {
28
- outline: auto 5px -webkit-focus-ring-color;
29
- }
@@ -4,23 +4,6 @@
4
4
  * found in the LICENSE file.
5
5
  */
6
6
 
7
- .tree-outline {
8
- padding-left: 0;
9
- color: var(--sys-color-token-subtle);
10
- }
11
-
12
- li.storage-group-list-item {
13
- padding: 10px var(--sys-size-5) var(--sys-size-4);
14
- }
15
-
16
- li.storage-group-list-item:not(:first-child) {
17
- border-top: var(--sys-size-1) solid var(--sys-color-divider);
18
- }
19
-
20
- li.storage-group-list-item::before {
21
- display: none;
22
- }
23
-
24
7
  .player-entry-row {
25
8
  /* 28px icon-column/toolbar base (--sys-size-12) minus 2px compact
26
9
  * row offset (--sys-size-2) = 26px, matching the 26px child cells
@@ -61,7 +44,6 @@ li.storage-group-list-item::before {
61
44
  .player-entry-status-icon {
62
45
  width: var(--sys-size-12);
63
46
  min-width: var(--sys-size-12);
64
- height: 26px;
65
47
  border-right: var(--sys-size-1) solid var(--sys-color-divider);
66
48
  overflow: hidden;
67
49
  }
@@ -11,7 +11,7 @@
11
11
  .media-property-renderer {
12
12
  line-height: var(--sys-size-9);
13
13
  min-height: var(--sys-size-12);
14
- padding: var(--sys-size-3) 10px;
14
+ padding: var(--sys-size-3) var(--sys-size-5);
15
15
  display: block;
16
16
  overflow: hidden;
17
17