chrome-devtools-frontend 1.0.1730971 → 1.0.1732697

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 (210) hide show
  1. package/docs/get_the_code.md +1 -73
  2. package/front_end/Tests.js +15 -0
  3. package/front_end/core/host/AidaClient.ts +47 -3
  4. package/front_end/core/host/AidaClientTypes.ts +27 -3
  5. package/front_end/core/host/AidaGcaTranslation.ts +1 -1
  6. package/front_end/core/sdk/DOMModel.ts +8 -3
  7. package/front_end/core/sdk/NetworkManager.ts +2 -1
  8. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +2 -2
  9. package/front_end/generated/Deprecation.ts +0 -8
  10. package/front_end/generated/InspectorBackendCommands.ts +2 -1
  11. package/front_end/generated/SupportedCSSProperties.ts +2 -2
  12. package/front_end/generated/protocol.ts +9 -0
  13. package/front_end/models/ai-utils/debug.ts +127 -22
  14. package/front_end/models/ai_assistance/README.md +1 -1
  15. package/front_end/models/ai_assistance/agents/AiAgent.ts +10 -5
  16. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
  17. package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +4 -3
  18. package/front_end/models/ai_assistance/contexts/LighthouseContext.snapshot.txt +9 -2
  19. package/front_end/models/ai_assistance/contexts/LighthouseContext.ts +4 -3
  20. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +97 -11
  21. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +92 -43
  22. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +1 -1
  23. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +26 -26
  24. package/front_end/models/ai_assistance/skills/styling.md +4 -2
  25. package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +31 -36
  26. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -1
  27. package/front_end/models/ai_code_completion/ai_code_completion.ts +11 -2
  28. package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -1
  29. package/front_end/models/ai_code_generation/ai_code_generation.ts +11 -2
  30. package/front_end/models/bindings/CompilerScriptMapping.ts +0 -1
  31. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +0 -1
  32. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -1
  33. package/front_end/models/har/HARFormat.ts +1 -0
  34. package/front_end/models/har/Importer.ts +7 -1
  35. package/front_end/models/har/Log.snapshot.txt +2 -0
  36. package/front_end/models/har/Log.ts +2 -0
  37. package/front_end/models/javascript_metadata/NativeFunctions.ts +0 -4
  38. package/front_end/models/trace/LanternComputationData.ts +4 -0
  39. package/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +126 -1
  40. package/front_end/models/trace/lantern/types/Lantern.ts +3 -0
  41. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +33 -1
  42. package/front_end/panels/ai_assistance/ExternalHandler.ts +1 -1
  43. package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -0
  44. package/front_end/panels/ai_assistance/components/PermissionPrompt.ts +4 -4
  45. package/front_end/panels/ai_assistance/components/chatInput.css +1 -1
  46. package/front_end/panels/ai_assistance/components/chatMessage.css +3 -4
  47. package/front_end/panels/ai_assistance/components/exploreWidget.css +3 -3
  48. package/front_end/panels/animation/animationTimeline.css +11 -9
  49. package/front_end/panels/application/IndexedDBViews.ts +2 -2
  50. package/front_end/panels/application/PrivateVerificationTokensView.ts +217 -9
  51. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  52. package/front_end/panels/application/ServiceWorkersView.ts +1 -1
  53. package/front_end/panels/application/StorageView.ts +1 -1
  54. package/front_end/panels/application/appManifestView.css +0 -6
  55. package/front_end/panels/application/backgroundServiceView.css +0 -21
  56. package/front_end/panels/application/components/backForwardCacheView.css +1 -9
  57. package/front_end/panels/application/components/endpointsGrid.css +1 -1
  58. package/front_end/panels/application/components/permissionsPolicySection.css +1 -1
  59. package/front_end/panels/application/components/reportsGrid.css +1 -1
  60. package/front_end/panels/application/components/serviceWorkerRouterView.css +2 -2
  61. package/front_end/panels/application/components/trustTokensView.css +1 -1
  62. package/front_end/panels/application/cookieItemsView.css +0 -1
  63. package/front_end/panels/application/frameDetailsReportView.css +0 -10
  64. package/front_end/panels/application/indexedDBViews.css +0 -10
  65. package/front_end/panels/application/privateVerificationTokensView.css +12 -0
  66. package/front_end/panels/application/resourcesPanel.css +0 -23
  67. package/front_end/panels/application/serviceWorkerUpdateCycleView.css +7 -7
  68. package/front_end/panels/application/serviceWorkersView.css +4 -3
  69. package/front_end/panels/changes/CombinedDiffView.ts +1 -1
  70. package/front_end/panels/comments/CommentsPane.ts +7 -11
  71. package/front_end/panels/common/CommentThreadWidget.ts +11 -3
  72. package/front_end/panels/common/CommentsOverlayWidget.ts +337 -117
  73. package/front_end/panels/console/consoleContextSelector.css +1 -1
  74. package/front_end/panels/console/consolePinPane.css +1 -1
  75. package/front_end/panels/console/consolePrompt.css +4 -2
  76. package/front_end/panels/console/consoleView.css +5 -3
  77. package/front_end/panels/coverage/CoverageView.ts +0 -1
  78. package/front_end/panels/coverage/coverageView.css +4 -3
  79. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +0 -1
  80. package/front_end/panels/elements/AccessibilityTreeView.ts +1 -1
  81. package/front_end/panels/elements/CSSValueTraceView.ts +2 -4
  82. package/front_end/panels/elements/ComputedStyleWidget.ts +8 -19
  83. package/front_end/panels/elements/DOMTreeContextMenu.ts +1 -1
  84. package/front_end/panels/elements/DOMTreeWidget.ts +14 -0
  85. package/front_end/panels/elements/MetricsSidebarPane.ts +1 -1
  86. package/front_end/panels/elements/PlatformFontsWidget.ts +0 -1
  87. package/front_end/panels/elements/PropertiesWidget.ts +1 -1
  88. package/front_end/panels/elements/PropertyRenderer.ts +7 -27
  89. package/front_end/panels/elements/StylePropertyTreeElement.ts +61 -72
  90. package/front_end/panels/elements/StylesSidebarPane.ts +2 -0
  91. package/front_end/panels/elements/WebCustomData.ts +1 -1
  92. package/front_end/panels/elements/components/cssHintDetailsView.css +1 -1
  93. package/front_end/panels/elements/components/cssVariableValueView.css +3 -1
  94. package/front_end/panels/elements/components/elementsBreadcrumbs.css +1 -1
  95. package/front_end/panels/elements/components/elementsTreeExpandButton.css +3 -2
  96. package/front_end/panels/elements/components/stylePropertyEditor.css +2 -2
  97. package/front_end/panels/elements/layoutPane.css +1 -1
  98. package/front_end/panels/elements/metricsSidebarPane.css +6 -6
  99. package/front_end/panels/elements/platformFontsWidget.css +1 -1
  100. package/front_end/panels/elements/propertiesWidget.css +0 -5
  101. package/front_end/panels/elements/stylesSidebarPane.css +1 -1
  102. package/front_end/panels/emulation/DeviceModeView.ts +4 -3
  103. package/front_end/panels/emulation/deviceModeView.css +9 -10
  104. package/front_end/panels/event_listeners/eventListenersView.css +5 -5
  105. package/front_end/panels/explain/components/consoleInsight.css +5 -20
  106. package/front_end/panels/issues/issuesTree.css +11 -10
  107. package/front_end/panels/layer_viewer/LayerDetailsView.ts +4 -2
  108. package/front_end/panels/layer_viewer/TransformController.ts +106 -54
  109. package/front_end/panels/layer_viewer/layerTreeOutline.css +1 -1
  110. package/front_end/panels/lighthouse/lighthousePanel.css +5 -8
  111. package/front_end/panels/lighthouse/lighthouseStartView.css +1 -2
  112. package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +4 -4
  113. package/front_end/panels/linear_memory_inspector/components/valueInterpreterDisplay.css +1 -1
  114. package/front_end/panels/media/EventTimelineView.ts +1 -4
  115. package/front_end/panels/media/TickingFlameChart.ts +3 -2
  116. package/front_end/panels/media/playerListView.css +14 -7
  117. package/front_end/panels/media/playerMessagesView.css +11 -7
  118. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
  119. package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -7
  120. package/front_end/panels/network/NetworkConfigView.ts +1 -1
  121. package/front_end/panels/network/NetworkWaterfallColumn.ts +92 -55
  122. package/front_end/panels/network/binaryResourceView.css +0 -7
  123. package/front_end/panels/network/networkConfigView.css +3 -3
  124. package/front_end/panels/network/networkLogView.css +5 -11
  125. package/front_end/panels/network/networkManageCustomHeadersView.css +1 -1
  126. package/front_end/panels/network/networkTimingTable.css +6 -6
  127. package/front_end/panels/network/requestConditionsDrawer.css +1 -24
  128. package/front_end/panels/network/requestPayloadView.css +1 -1
  129. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
  130. package/front_end/panels/performance_monitor/performanceMonitor.css +2 -2
  131. package/front_end/panels/profiler/ModuleUIStrings.ts +12 -0
  132. package/front_end/panels/protocol_monitor/JSONEditor.css +4 -3
  133. package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
  134. package/front_end/panels/protocol_monitor/protocolMonitor.css +1 -1
  135. package/front_end/panels/recorder/createRecordingView.css +2 -2
  136. package/front_end/panels/recorder/extensionView.css +1 -1
  137. package/front_end/panels/recorder/recorderPanel.css +3 -3
  138. package/front_end/panels/recorder/recordingListView.css +1 -1
  139. package/front_end/panels/recorder/stepEditor.css +2 -2
  140. package/front_end/panels/recorder/stepView.css +0 -31
  141. package/front_end/panels/recorder/timelineSection.css +1 -1
  142. package/front_end/panels/screencast/screencastView.css +3 -2
  143. package/front_end/panels/search/searchView.css +4 -3
  144. package/front_end/panels/security/SecurityPanelSidebar.ts +0 -1
  145. package/front_end/panels/security/mainView.css +2 -2
  146. package/front_end/panels/security/originView.css +1 -5
  147. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +2 -1
  148. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +1 -2
  149. package/front_end/panels/sources/breakpointsView.css +3 -4
  150. package/front_end/panels/sources/tabbedEditorContainer.css +1 -1
  151. package/front_end/panels/sources/watchExpressionsSidebarPane.css +4 -3
  152. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +30 -10
  153. package/front_end/panels/timeline/TimelineSelectorStatsView.ts +1 -1
  154. package/front_end/panels/timeline/components/OriginMap.ts +1 -1
  155. package/front_end/panels/timeline/components/fieldSettingsDialog.css +1 -1
  156. package/front_end/panels/timeline/components/metricCard.css +1 -1
  157. package/front_end/panels/timeline/components/networkRequestDetails.css +0 -1
  158. package/front_end/panels/timeline/components/networkRequestTooltip.css +4 -4
  159. package/front_end/panels/timeline/components/relatedInsightChips.css +1 -1
  160. package/front_end/panels/timeline/timelineFlameChartView.css +4 -4
  161. package/front_end/panels/timeline/timelineFlamechartPopover.css +3 -3
  162. package/front_end/panels/timeline/timelineHistoryManager.css +1 -1
  163. package/front_end/panels/timeline/timelineMiniMap.css +3 -2
  164. package/front_end/panels/timeline/timelineStatusDialog.css +1 -1
  165. package/front_end/panels/web_audio/webAudio.css +0 -20
  166. package/front_end/third_party/chromium/README.chromium +1 -1
  167. package/front_end/ui/comments/CommentAnchorResolver.ts +166 -8
  168. package/front_end/ui/comments/CommentOverlayManager.ts +17 -2
  169. package/front_end/ui/components/buttons/button.css +0 -1
  170. package/front_end/ui/components/diff_view/diffView.css +2 -2
  171. package/front_end/ui/components/markdown_view/codeBlock.css +3 -3
  172. package/front_end/ui/components/markdown_view/markdownView.css +3 -3
  173. package/front_end/ui/components/menus/Menu.ts +1 -1
  174. package/front_end/ui/components/menus/menuItem.css +1 -1
  175. package/front_end/ui/components/panel_feedback/panelFeedback.css +5 -4
  176. package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +1 -1
  177. package/front_end/ui/components/report_view/reportValue.css +5 -2
  178. package/front_end/ui/components/suggestion_input/suggestionInput.css +6 -6
  179. package/front_end/ui/legacy/ContextMenu.ts +3 -0
  180. package/front_end/ui/legacy/GlassPane.ts +3 -3
  181. package/front_end/ui/legacy/SoftContextMenu.ts +7 -1
  182. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +2 -0
  183. package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +7 -6
  184. package/front_end/ui/legacy/components/inline_editor/colorSwatch.css +1 -2
  185. package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +3 -3
  186. package/front_end/ui/legacy/components/perf_ui/chartViewport.css +1 -1
  187. package/front_end/ui/legacy/components/perf_ui/filmStripView.css +1 -1
  188. package/front_end/ui/legacy/components/perf_ui/flameChart.css +12 -9
  189. package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +11 -7
  190. package/front_end/ui/legacy/components/perf_ui/pieChart.css +3 -4
  191. package/front_end/ui/legacy/components/source_frame/imageView.css +4 -4
  192. package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
  193. package/front_end/ui/legacy/components/utils/jsUtils.css +2 -1
  194. package/front_end/ui/legacy/dropTarget.css +1 -1
  195. package/front_end/ui/legacy/filter.css +4 -3
  196. package/front_end/ui/legacy/inspectorCommon.css +16 -48
  197. package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +1 -1
  198. package/front_end/ui/legacy/progressIndicator.css +1 -2
  199. package/front_end/ui/legacy/reportView.css +4 -1
  200. package/front_end/ui/legacy/searchableView.css +1 -1
  201. package/front_end/ui/legacy/suggestBox.css +2 -1
  202. package/front_end/ui/legacy/tabbedPane.css +7 -4
  203. package/front_end/ui/legacy/toolbar.css +2 -1
  204. package/front_end/ui/legacy/treeoutline.css +6 -5
  205. package/front_end/ui/legacy/viewContainers.css +3 -2
  206. package/front_end/ui/visual_logging/KnownContextValues.ts +15 -0
  207. package/inspector_overlay/highlight_anchor.ts +8 -11
  208. package/package.json +1 -1
  209. package/front_end/models/ai_code_completion/debug.ts +0 -33
  210. package/front_end/models/ai_code_generation/debug.ts +0 -33
@@ -6,7 +6,7 @@
6
6
  .media-messages-header {
7
7
  background-color: var(--sys-color-cdt-base-container);
8
8
  border-bottom: var(--sys-size-1) solid var(--sys-color-divider);
9
- min-height: 26px;
9
+ flex: none;
10
10
  }
11
11
 
12
12
  .media-messages-body {
@@ -14,8 +14,11 @@
14
14
  }
15
15
 
16
16
  .media-messages-level-dropdown-element {
17
- height: 18px;
18
- line-height: 18px;
17
+ /* 16px (--sys-size-8) + 2px (--sys-size-2) = 18px row height matching
18
+ * SoftDropDown.setRowHeight(18) so all 6 items (108px) fit the 108px
19
+ * GlassPane without vertical scrollbar clipping. */
20
+ height: calc(var(--sys-size-8) + var(--sys-size-2));
21
+ line-height: calc(var(--sys-size-8) + var(--sys-size-2));
19
22
  }
20
23
 
21
24
  .media-messages-level-dropdown-text {
@@ -24,7 +27,8 @@
24
27
 
25
28
  .media-messages-level-dropdown-checkbox {
26
29
  float: left;
27
- width: 18px;
30
+ /* 16px checkmark slot (--sys-size-8) plus 2px left padding (--sys-size-2) under border-box sizing. */
31
+ width: calc(var(--sys-size-8) + var(--sys-size-2));
28
32
  height: 100%;
29
33
  padding-left: var(--sys-size-2);
30
34
  }
@@ -32,7 +36,7 @@
32
36
  .media-messages-message-container {
33
37
  margin: var(--sys-size-3);
34
38
  font-size: var(--sys-typescale-body2-size);
35
- line-height: 18px;
39
+ line-height: var(--sys-typescale-body2-line-height);
36
40
  padding: var(--sys-size-3);
37
41
  user-select: text;
38
42
  }
@@ -47,7 +51,7 @@
47
51
  }
48
52
 
49
53
  .media-message-warning {
50
- border-radius: 5px;
54
+ border-radius: var(--sys-shape-corner-extra-small);
51
55
  background-color: var(--sys-color-surface-yellow);
52
56
  color: var(--sys-color-on-surface-yellow);
53
57
  }
@@ -74,7 +78,7 @@
74
78
  }
75
79
 
76
80
  .status-error-field-label {
77
- padding-right: 10px;
81
+ padding-right: var(--sys-size-5);
78
82
  color: var(--sys-color-token-subtle);
79
83
  }
80
84
 
@@ -738,6 +738,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
738
738
  // clang-format off
739
739
  render(
740
740
  html`
741
+ <style>${throttlingSettingsTabStyles}</style>
741
742
  <div class="settings-card-container-wrapper">
742
743
  <div class="settings-card-container throttling-conditions-settings">
743
744
  ${widget(CPUThrottlingCard)}
@@ -821,7 +822,6 @@ export class ThrottlingSettingsTab extends UI.Widget.VBox {
821
822
  useShadowDom: true,
822
823
  });
823
824
  this.#view = view;
824
- this.registerRequiredCSS(throttlingSettingsTabStyles);
825
825
 
826
826
  this.customUserConditions = SDK.NetworkManager.customUserNetworkConditionsSetting(settings);
827
827
  this.customUserConditions.addChangeListener(this.#conditionsUpdated, this);
@@ -40,7 +40,9 @@
40
40
  gap: var(--sys-size-3);
41
41
  padding: var(--sys-size-4);
42
42
  flex-shrink: 0;
43
- width: 74px;
43
+ /* 80px (--sys-size-19) minus 6px (--sys-size-4) padding step so all
44
+ * 7 columns (518px) fit inside the 532px card slot without overflow. */
45
+ width: calc(var(--sys-size-19) - var(--sys-size-4));
44
46
  }
45
47
 
46
48
  .input {
@@ -65,10 +67,6 @@
65
67
  color: var(--sys-color-on-surface);
66
68
  text-align: center;
67
69
  position: relative;
68
-
69
- & > input {
70
- scroll-margin-left: 5px;
71
- }
72
70
  }
73
71
 
74
72
  .conditions-list-text:last-child {
@@ -134,13 +132,13 @@
134
132
 
135
133
  .cpu-preset-calibrate .button-container {
136
134
  display: flex;
137
- gap: 10px;
135
+ gap: var(--sys-size-5);
138
136
  }
139
137
 
140
138
  .cpu-preset-calibrate .text-container {
141
139
  display: flex;
142
140
  flex-direction: column;
143
- gap: 10px;
141
+ gap: var(--sys-size-5);
144
142
  }
145
143
 
146
144
  .text-with-icon {
@@ -211,6 +211,7 @@ function renderUserAgentSection(input: NetworkConfigViewInput, output: NetworkCo
211
211
 
212
212
  export const DEFAULT_VIEW: View = (input, output, target) => {
213
213
  render(html`
214
+ <style>${networkConfigViewStyles}</style>
214
215
  ${renderCacheSection(input)}
215
216
  <div class="panel-section-separator"></div>
216
217
  ${renderNetworkThrottlingSection()}
@@ -247,7 +248,6 @@ export class NetworkConfigView extends UI.Widget.VBox {
247
248
  super({
248
249
  useShadowDom: true,
249
250
  });
250
- this.registerRequiredCSS(networkConfigViewStyles);
251
251
  this.#view = view;
252
252
 
253
253
  this.#cacheDisabledSetting.addChangeListener(() => this.requestUpdate());
@@ -1,7 +1,6 @@
1
1
  // Copyright 2016 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 * as Common from '../../core/common/common.js';
7
6
  import type * as SDK from '../../core/sdk/sdk.js';
@@ -10,6 +9,7 @@ import * as RenderCoordinator from '../../ui/components/render_coordinator/rende
10
9
  import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';
11
10
  import * as UI from '../../ui/legacy/legacy.js';
12
11
  import * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';
12
+ import {Directives, html, render} from '../../ui/lit/lit.js';
13
13
  import * as Settings from '../../ui/settings/settings.js';
14
14
 
15
15
  import type {NetworkNode} from './NetworkDataGridNode.js';
@@ -17,10 +17,47 @@ import {RequestTimeRangeNameToColor} from './NetworkOverview.js';
17
17
  import networkWaterfallColumnStyles from './networkWaterfallColumn.css.js';
18
18
  import {RequestTimingView} from './RequestTimingView.js';
19
19
 
20
+ const {ref} = Directives;
21
+
20
22
  const BAR_SPACING = 1;
21
23
 
24
+ export interface ViewInput {
25
+ onMouseMove: (offsetY: number, shiftKey: boolean) => void;
26
+ onMouseLeave: () => void;
27
+ onClick: (offsetY: number) => boolean;
28
+ }
29
+
30
+ export interface ViewOutput {
31
+ canvas?: HTMLCanvasElement;
32
+ }
33
+
34
+ export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
35
+
36
+ export const DEFAULT_VIEW: View = (input, output, target) => {
37
+ // clang-format off
38
+ render(html`
39
+ <style>${networkWaterfallColumnStyles}</style>
40
+ <canvas
41
+ tabindex="-1"
42
+ @mousemove=${(event: MouseEvent) => input.onMouseMove(event.offsetY, event.shiftKey)}
43
+ @mouseleave=${input.onMouseLeave}
44
+ @click=${(event: MouseEvent) => {
45
+ if (input.onClick(event.offsetY)) {
46
+ event.consume(true);
47
+ }
48
+ }}
49
+ ${ref(e => {
50
+ output.canvas = e instanceof HTMLCanvasElement ? e : undefined;
51
+ })}
52
+ ></canvas>
53
+ `, target);
54
+ // clang-format on
55
+ };
56
+
22
57
  export class NetworkWaterfallColumn extends UI.Widget.VBox {
23
- private canvas: HTMLCanvasElement;
58
+ readonly #view: View;
59
+ readonly #viewOutput: ViewOutput = {};
60
+ private canvas!: HTMLCanvasElement;
24
61
  private canvasPosition: DOMRect;
25
62
  private readonly leftPadding: number;
26
63
  private readonly fontSize: number;
@@ -45,15 +82,11 @@ export class NetworkWaterfallColumn extends UI.Widget.VBox {
45
82
  private readonly pathForStyle: Map<LayerStyle, Path2D>;
46
83
  private textLayers: TextLayer[];
47
84
 
48
- constructor(calculator: NetworkTimeCalculator.NetworkTimeCalculator) {
49
- // TODO(allada) Make this a shadowDOM when the NetworkWaterfallColumn gets moved into NetworkLogViewColumns.
85
+ constructor(calculator: NetworkTimeCalculator.NetworkTimeCalculator, view: View = DEFAULT_VIEW) {
86
+ // TODO(allada) Make this a shadowDOM when the NetworkWaterfallColumn gets
87
+ // moved into NetworkLogViewColumns.
50
88
  super();
51
- this.registerRequiredCSS(networkWaterfallColumnStyles);
52
-
53
- this.canvas = this.contentElement.createChild('canvas');
54
- this.canvas.tabIndex = -1;
55
- this.setDefaultFocusedElement(this.canvas);
56
- this.canvasPosition = this.canvas.getBoundingClientRect();
89
+ this.#view = view;
57
90
 
58
91
  this.leftPadding = 5;
59
92
  this.fontSize = 10;
@@ -81,10 +114,6 @@ export class NetworkWaterfallColumn extends UI.Widget.VBox {
81
114
 
82
115
  this.eventDividers = new Map();
83
116
 
84
- this.element.addEventListener('mousemove', this.onMouseMove.bind(this), true);
85
- this.element.addEventListener('mouseleave', _event => this.setHoveredNode(null, false), true);
86
- this.element.addEventListener('click', this.onClick.bind(this), true);
87
-
88
117
  this.styleForTimeRangeName = NetworkWaterfallColumn.buildRequestTimeRangeStyle();
89
118
 
90
119
  const resourceStyleTuple = NetworkWaterfallColumn.buildResourceTypeStyle();
@@ -93,30 +122,50 @@ export class NetworkWaterfallColumn extends UI.Widget.VBox {
93
122
 
94
123
  const baseLineColor = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-state-disabled');
95
124
  this.wiskerStyle = {borderColor: baseLineColor, lineWidth: 1};
96
- this.hoverDetailsStyle = {fillStyle: baseLineColor, lineWidth: 1, borderColor: baseLineColor};
125
+ this.hoverDetailsStyle = {
126
+ fillStyle: baseLineColor,
127
+ lineWidth: 1,
128
+ borderColor: baseLineColor,
129
+ };
97
130
 
98
131
  this.pathForStyle = new Map();
99
132
  this.textLayers = [];
133
+
134
+ this.performUpdate();
135
+ this.canvasPosition = this.canvas?.getBoundingClientRect() ?? new DOMRect();
136
+ }
137
+
138
+ override performUpdate(): void {
139
+ this.#view({
140
+ onMouseMove: (offsetY, shiftKey) => this.setHoveredNode(this.getNodeFromPoint(offsetY), shiftKey),
141
+ onMouseLeave: () => this.setHoveredNode(null, false),
142
+ onClick: offsetY => this.setSelectedNode(this.getNodeFromPoint(offsetY)),
143
+ },
144
+ this.#viewOutput, this.contentElement);
145
+ if (this.#viewOutput.canvas) {
146
+ this.canvas = this.#viewOutput.canvas;
147
+ this.setDefaultFocusedElement(this.canvas);
148
+ }
100
149
  }
101
150
 
102
151
  static buildRequestTimeRangeStyle(): Map<NetworkTimeCalculator.RequestTimeRangeNames, LayerStyle> {
103
152
  const styleMap = new Map<NetworkTimeCalculator.RequestTimeRangeNames, LayerStyle>();
104
- styleMap.set(
105
- NetworkTimeCalculator.RequestTimeRangeNames.CONNECTING,
106
- {fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.CONNECTING]});
107
- styleMap.set(
108
- NetworkTimeCalculator.RequestTimeRangeNames.SSL,
109
- {fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.SSL]});
110
- styleMap.set(
111
- NetworkTimeCalculator.RequestTimeRangeNames.DNS,
112
- {fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.DNS]});
113
- styleMap.set(
114
- NetworkTimeCalculator.RequestTimeRangeNames.PROXY,
115
- {fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.PROXY]});
153
+ styleMap.set(NetworkTimeCalculator.RequestTimeRangeNames.CONNECTING, {
154
+ fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.CONNECTING],
155
+ });
156
+ styleMap.set(NetworkTimeCalculator.RequestTimeRangeNames.SSL, {
157
+ fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.SSL],
158
+ });
159
+ styleMap.set(NetworkTimeCalculator.RequestTimeRangeNames.DNS, {
160
+ fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.DNS],
161
+ });
162
+ styleMap.set(NetworkTimeCalculator.RequestTimeRangeNames.PROXY, {
163
+ fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.PROXY],
164
+ });
116
165
  styleMap.set(NetworkTimeCalculator.RequestTimeRangeNames.BLOCKING, {fillStyle: '--network-waterfall-blocking'});
117
- styleMap.set(
118
- NetworkTimeCalculator.RequestTimeRangeNames.PUSH,
119
- {fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.PUSH]});
166
+ styleMap.set(NetworkTimeCalculator.RequestTimeRangeNames.PUSH, {
167
+ fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.PUSH],
168
+ });
120
169
  styleMap.set(NetworkTimeCalculator.RequestTimeRangeNames.QUEUEING, {
121
170
  fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.QUEUEING],
122
171
  lineWidth: 2,
@@ -128,15 +177,15 @@ export class NetworkWaterfallColumn extends UI.Widget.VBox {
128
177
  lineWidth: 2,
129
178
  borderColor: '#03A9F4',
130
179
  });
131
- styleMap.set(
132
- NetworkTimeCalculator.RequestTimeRangeNames.WAITING,
133
- {fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.WAITING]});
134
- styleMap.set(
135
- NetworkTimeCalculator.RequestTimeRangeNames.RECEIVING_PUSH,
136
- {fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.RECEIVING_PUSH]});
137
- styleMap.set(
138
- NetworkTimeCalculator.RequestTimeRangeNames.SERVICE_WORKER,
139
- {fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.SERVICE_WORKER]});
180
+ styleMap.set(NetworkTimeCalculator.RequestTimeRangeNames.WAITING, {
181
+ fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.WAITING],
182
+ });
183
+ styleMap.set(NetworkTimeCalculator.RequestTimeRangeNames.RECEIVING_PUSH, {
184
+ fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.RECEIVING_PUSH],
185
+ });
186
+ styleMap.set(NetworkTimeCalculator.RequestTimeRangeNames.SERVICE_WORKER, {
187
+ fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.SERVICE_WORKER],
188
+ });
140
189
  styleMap.set(NetworkTimeCalculator.RequestTimeRangeNames.SERVICE_WORKER_PREPARATION, {
141
190
  fillStyle: RequestTimeRangeNameToColor[NetworkTimeCalculator.RequestTimeRangeNames.SERVICE_WORKER_PREPARATION],
142
191
  });
@@ -228,17 +277,6 @@ export class NetworkWaterfallColumn extends UI.Widget.VBox {
228
277
  this.update();
229
278
  }
230
279
 
231
- private onMouseMove(event: MouseEvent): void {
232
- this.setHoveredNode(this.getNodeFromPoint(event.offsetY), event.shiftKey);
233
- }
234
-
235
- private onClick(event: MouseEvent): void {
236
- const handled = this.setSelectedNode(this.getNodeFromPoint(event.offsetY));
237
- if (handled) {
238
- event.consume(true);
239
- }
240
- }
241
-
242
280
  private getPopoverRequest(event: MouseEvent|KeyboardEvent): UI.PopoverHelper.PopoverRequest|null {
243
281
  if (event instanceof KeyboardEvent) {
244
282
  return null;
@@ -389,7 +427,7 @@ export class NetworkWaterfallColumn extends UI.Widget.VBox {
389
427
  this.offsetWidth = this.contentElement.offsetWidth - this.rightPadding;
390
428
  this.offsetHeight = this.contentElement.offsetHeight;
391
429
  this.calculator.setDisplayWidth(this.offsetWidth);
392
- this.canvasPosition = this.canvas.getBoundingClientRect();
430
+ this.canvasPosition = this.canvas?.getBoundingClientRect() ?? new DOMRect();
393
431
  }
394
432
 
395
433
  private timeToPosition(time: number): number {
@@ -585,10 +623,9 @@ export class NetworkWaterfallColumn extends UI.Widget.VBox {
585
623
  }
586
624
 
587
625
  if (!this.calculator.startAtZero) {
588
- const queueingRange =
589
- (NetworkTimeCalculator.calculateRequestTimeRanges(request, 0)
590
- .find(data => data.name === NetworkTimeCalculator.RequestTimeRangeNames.TOTAL) as
591
- NetworkTimeCalculator.RequestTimeRange);
626
+ const queueingRange = (NetworkTimeCalculator.calculateRequestTimeRanges(request, 0)
627
+ .find(data => data.name === NetworkTimeCalculator.RequestTimeRangeNames.TOTAL) as
628
+ NetworkTimeCalculator.RequestTimeRange);
592
629
  const leftLabelWidth = labels ? context.measureText(labels.left).width : 0;
593
630
  const leftTextPlacedInBar = leftLabelWidth < ranges.mid - ranges.start;
594
631
  const wiskerTextPadding = 13;
@@ -5,13 +5,6 @@
5
5
  */
6
6
 
7
7
  @scope to (devtools-widget > *) {
8
- .panel.network devtools-toolbar.binary-view-toolbar {
9
- border-top: var(--sys-size-1) solid var(--sys-color-divider);
10
- border-bottom: 0;
11
- padding-left: 5px;
12
- flex: none;
13
- }
14
-
15
8
  .binary-view-copied-text {
16
9
  opacity: 100%;
17
10
  }
@@ -19,7 +19,7 @@
19
19
 
20
20
  .network-config-title {
21
21
  margin-right: var(--sys-size-8);
22
- width: 130px;
22
+ width: var(--sys-size-21);
23
23
  }
24
24
 
25
25
  .network-config-fields {
@@ -27,7 +27,7 @@
27
27
  }
28
28
 
29
29
  .network-config-fields > span:first-of-type {
30
- padding: 3px 0;
30
+ padding: var(--sys-size-2) 0;
31
31
  }
32
32
 
33
33
  .panel-section-separator {
@@ -45,7 +45,7 @@
45
45
 
46
46
  .network-config-input-validation-error {
47
47
  color: var(--sys-color-error);
48
- margin: 5px 0;
48
+ margin: var(--sys-size-3) 0;
49
49
  }
50
50
 
51
51
  .network-config-input-validation-error:empty {
@@ -22,9 +22,9 @@
22
22
  }
23
23
 
24
24
  .network-summary-bar {
25
- flex: 0 0 27px;
26
- line-height: 27px;
27
- padding-left: 5px;
25
+ flex: 0 0 calc(var(--sys-size-12) - var(--sys-size-1)); /* 28px toolbar minus 1px top border */
26
+ align-items: center;
27
+ padding-left: var(--sys-size-4);
28
28
  background-color: var(--sys-color-cdt-base-container);
29
29
  border-top: var(--sys-size-1) solid var(--sys-color-divider);
30
30
  white-space: nowrap;
@@ -75,7 +75,8 @@
75
75
 
76
76
  .network-waterfall-header,
77
77
  .network-log-grid.data-grid thead {
78
- height: 31px;
78
+ /* 32px (--sys-size-13) header height minus 1px (--sys-size-1) bottom border offset. */
79
+ height: calc(var(--sys-size-13) - var(--sys-size-1));
79
80
  background-color: var(--sys-color-surface1);
80
81
  }
81
82
 
@@ -319,13 +320,6 @@ td.time-column {
319
320
  z-index: 0;
320
321
  }
321
322
 
322
- .network-log-grid.data-grid .resources-dividers-label-bar {
323
- background-color: transparent;
324
- border: none;
325
- height: 30px;
326
- pointer-events: none;
327
- }
328
-
329
323
  .network-log-grid.data-grid span.separator-in-cell {
330
324
  user-select: none;
331
325
  min-width: 1ex;
@@ -6,7 +6,7 @@
6
6
 
7
7
  .custom-headers-list {
8
8
  display: flex;
9
- height: 272px;
9
+ height: var(--sys-size-30);
10
10
  width: var(--sys-size-29);
11
11
  margin: 0 var(--sys-size-8);
12
12
  border: var(--sys-size-1) solid var(--sys-color-divider);
@@ -5,10 +5,10 @@
5
5
  */
6
6
 
7
7
  .network-timing-table {
8
- width: 380px;
8
+ width: var(--sys-size-32);
9
9
  border-spacing: 0;
10
- padding-left: 10px;
11
- padding-right: 10px;
10
+ padding-left: var(--sys-size-6);
11
+ padding-right: var(--sys-size-6);
12
12
  line-height: initial;
13
13
  table-layout: fixed;
14
14
  }
@@ -72,7 +72,7 @@ table.network-timing-table > tr:not(.network-timing-table-header, .network-timin
72
72
 
73
73
  .network-timing-row {
74
74
  position: relative;
75
- height: 15px;
75
+ height: var(--sys-size-7);
76
76
  }
77
77
 
78
78
  .network-timing-bar {
@@ -172,7 +172,7 @@ tr:has([aria-expanded="true"].network-fetch-timing-bar-clickable) ~ .network-fet
172
172
 
173
173
  .network-fetch-timing-bar-details,
174
174
  .router-evaluation-timing-bar-details {
175
- padding-left: 11px;
175
+ padding-left: var(--sys-size-5);
176
176
  width: fit-content;
177
177
  }
178
178
 
@@ -237,7 +237,7 @@ tr.synthetic {
237
237
  .network-timing-bar.ssl,
238
238
  .network-timing-bar.connecting,
239
239
  .network-timing-bar.blocking {
240
- height: 10px;
240
+ height: var(--sys-size-5);
241
241
  margin: auto;
242
242
  }
243
243
 
@@ -48,40 +48,17 @@
48
48
  flex: none;
49
49
  }
50
50
 
51
- .blocked-url-checkbox:focus {
52
- outline: auto 5px -webkit-focus-ring-color;
53
- }
54
-
55
51
  .blocked-url-label {
56
52
  white-space: nowrap;
57
53
  text-overflow: ellipsis;
58
54
  overflow: hidden;
59
55
  flex: auto;
60
- padding: 0 3px;
56
+ padding: 0 var(--sys-size-3);
61
57
  cursor: text;
62
58
 
63
59
  --devtools-text-prompt-min-width: 6em;
64
60
  }
65
61
 
66
- .blocked-url-edit-row {
67
- flex: none;
68
- display: flex;
69
- flex-direction: row;
70
- margin: 7px 5px 0;
71
- align-items: center;
72
- }
73
-
74
- .blocked-url-edit-value {
75
- user-select: none;
76
- flex: 1 1 0;
77
- }
78
-
79
- .blocked-url-edit-row input {
80
- width: 100%;
81
- text-align: inherit;
82
- height: var(--sys-size-10);
83
- }
84
-
85
62
  .conditions-selector {
86
63
  width: max-content;
87
64
  flex: none;
@@ -13,7 +13,7 @@
13
13
 
14
14
  .raw-payload-section {
15
15
  flex: 1 1 auto;
16
- min-height: 200px;
16
+ min-height: var(--sys-size-25);
17
17
  display: flex;
18
18
  flex-direction: column;
19
19
  border-top: var(--sys-size-1) solid var(--sys-color-divider);
@@ -81,6 +81,7 @@ type PerformanceMonitorView =
81
81
  const DEFAULT_VIEW: PerformanceMonitorView = (input, output, target) => {
82
82
  // clang-format off
83
83
  render(html`
84
+ <style>${performanceMonitorStyles}</style>
84
85
  <devtools-widget ${widget(ControlPane, {
85
86
  onMetricChanged: input.onMetricChanged,
86
87
  chartsInfo: input.chartsInfo,
@@ -130,7 +131,6 @@ export class PerformanceMonitorImpl extends UI.Widget.HBox<ShadowRoot> implement
130
131
  constructor(pollIntervalMs = 500, view: PerformanceMonitorView = DEFAULT_VIEW) {
131
132
  super({useShadowDom: 'pure'});
132
133
  this.view = view;
133
- this.registerRequiredCSS(performanceMonitorStyles);
134
134
 
135
135
  this.metricsBuffer = [];
136
136
  /** @constant */
@@ -37,7 +37,7 @@
37
37
 
38
38
  .perfmon-chart-suspend-overlay {
39
39
  display: flex;
40
- font-size: 26px;
40
+ font-size: var(--sys-typescale-headline1-size);
41
41
  align-items: center;
42
42
  justify-content: center;
43
43
  }
@@ -74,7 +74,7 @@
74
74
  }
75
75
 
76
76
  .perfmon-indicator-value {
77
- flex: 0 0 55px;
77
+ flex: 0 0 var(--sys-size-17);
78
78
  text-align: right;
79
79
  overflow: visible;
80
80
  align-self: center;
@@ -104,6 +104,18 @@ export const UIStrings = {
104
104
  * @description Text in heap snapshot loader of the Memory panel when taking a heap snapshot.
105
105
  */
106
106
  loadingLocations: 'Loading locations…',
107
+ /**
108
+ * @description Text in heap snapshot loader of the Memory panel when taking a heap snapshot.
109
+ */
110
+ loadingScopes: 'Loading scopes…',
111
+ /**
112
+ * @description Text in heap snapshot loader of the Memory panel when taking a heap snapshot.
113
+ */
114
+ loadingScopeContextVars: 'Loading scope context vars…',
115
+ /**
116
+ * @description Text in heap snapshot loader of the Memory panel when taking a heap snapshot.
117
+ */
118
+ loadingScopeUses: 'Loading scope uses…',
107
119
  /**
108
120
  * @description Text in heap snapshot loader of the Memory panel when taking a heap snapshot.
109
121
  */
@@ -22,7 +22,8 @@
22
22
  }
23
23
 
24
24
  .warning-icon {
25
- margin-left: -18px;
25
+ /* -18px: shift left by the 14px small icon (--sys-size-7) plus its 4px right margin (--sys-size-3). */
26
+ margin-left: calc(-1 * (var(--sys-size-7) + var(--sys-size-3)));
26
27
  margin-right: var(--sys-size-3);
27
28
  }
28
29
 
@@ -38,8 +39,8 @@
38
39
  font-family: var(--monospace-font-family);
39
40
  font-size: var(--monospace-font-size);
40
41
  align-items: center;
41
- line-height: 18px;
42
- margin-top: 3px;
42
+ line-height: var(--sys-typescale-body4-line-height);
43
+ margin-top: var(--sys-size-2);
43
44
  }
44
45
 
45
46
  .separator {
@@ -198,7 +198,6 @@ export class JSONEditor extends JSONEditorBase {
198
198
  constructor(element: HTMLElement, view: View = DEFAULT_VIEW) {
199
199
  super(element, {useShadowDom: true});
200
200
  this.#view = view;
201
- this.registerRequiredCSS(editorWidgetStyles);
202
201
  }
203
202
 
204
203
  get metadataByCommand(): Map<string, {parameters: Parameter[], description: string, replyArgs: string[]}> {
@@ -1265,6 +1264,7 @@ function renderParameters(
1265
1264
  export const DEFAULT_VIEW: View = (input, _output, target) => {
1266
1265
  // clang-format off
1267
1266
  render(html`
1267
+ <style>${editorWidgetStyles}</style>
1268
1268
  <div class="wrapper" @keydown=${input.onKeydown} jslog=${VisualLogging.pane('command-editor').track({resize: true})}>
1269
1269
  <div class="editor-wrapper">
1270
1270
  ${input.displayTargetSelector !== false ? renderTargetSelectorRow(input) : nothing}
@@ -13,7 +13,7 @@
13
13
  }
14
14
 
15
15
  .target-selector {
16
- max-width: 120px;
16
+ max-width: var(--sys-size-21);
17
17
  }
18
18
 
19
19
  .protocol-monitor-main {
@@ -30,14 +30,14 @@ h1 {
30
30
  font-weight: 500;
31
31
  font-size: var(--sys-typescale-body5-size);
32
32
  line-height: var(--sys-typescale-body5-line-height);
33
- letter-spacing: 0.8px;
33
+ letter-spacing: 0.07em;
34
34
  text-transform: uppercase;
35
35
  color: var(--sys-color-secondary);
36
36
  margin-bottom: var(--sys-size-5);
37
37
  margin-top: var(--sys-size-13);
38
38
  display: flex;
39
39
  align-items: center;
40
- gap: 3px;
40
+ gap: var(--sys-size-3);
41
41
  }
42
42
 
43
43
  .footer {
@@ -30,7 +30,7 @@ iframe {
30
30
 
31
31
  header {
32
32
  display: flex;
33
- padding: 3px var(--sys-size-5);
33
+ padding: var(--sys-size-3) var(--sys-size-5);
34
34
  justify-content: space-between;
35
35
  border-bottom: var(--sys-size-1) solid var(--sys-color-divider);
36
36
  }