chrome-devtools-frontend 1.0.1733843 → 1.0.1736236

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 (184) hide show
  1. package/.agents/rules/tests/test-view-and-presenter-isolation.md +4 -4
  2. package/.agents/rules/ui-and-widgets/ui-declarative-tree-and-prompt-patterns.md +61 -0
  3. package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +11 -7
  4. package/.agents/rules/ui-and-widgets/ui-modern-component-and-encapsulation-standards.md +13 -4
  5. package/.agents/rules/ui-and-widgets/ui-pure-view-and-presenter-separation.md +31 -2
  6. package/.agents/rules/ui-and-widgets/ui-reactive-widget-update-lifecycle.md +23 -4
  7. package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +34 -3
  8. package/.agents/skills/code-review/SKILL.md +27 -0
  9. package/.agents/skills/devtools-uistrings/SKILL.md +147 -0
  10. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +27 -1
  11. package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +100 -0
  12. package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +16 -0
  13. package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +13 -2
  14. package/.agents/skills/ui-widgets/SKILL.md +25 -25
  15. package/DIR_METADATA +8 -1
  16. package/docs/cookbook/localization.md +1 -1
  17. package/docs/ui_engineering.md +24 -0
  18. package/eslint.config.mjs +0 -1
  19. package/front_end/application_tokens.css +1 -1
  20. package/front_end/core/host/AidaClient.ts +147 -202
  21. package/front_end/core/host/AidaClientTypes.ts +9 -0
  22. package/front_end/core/host/AidaErrors.ts +416 -0
  23. package/front_end/core/host/AidaGcaTranslation.ts +11 -0
  24. package/front_end/core/host/InspectorFrontendHostAPI.ts +9 -2
  25. package/front_end/core/host/UserMetrics.ts +25 -0
  26. package/front_end/core/host/UserMetricsEnums.ts +25 -0
  27. package/front_end/core/host/host.ts +3 -1
  28. package/front_end/core/i18n/collect-ui-strings.js +20 -0
  29. package/front_end/core/root/Runtime.ts +12 -0
  30. package/front_end/core/sdk/CPUThrottlingManager.ts +3 -0
  31. package/front_end/core/sdk/EnhancedTracesParser.ts +8 -4
  32. package/front_end/core/sdk/NetworkManager.ts +0 -6
  33. package/front_end/core/sdk/OverlayModel.ts +0 -6
  34. package/front_end/core/sdk/PreloadingModel.ts +30 -13
  35. package/front_end/core/sdk/PrivateVerificationTokensModel.ts +0 -18
  36. package/front_end/core/sdk/RehydratingConnection.ts +5 -2
  37. package/front_end/core/sdk/ResourceTreeModel.ts +0 -42
  38. package/front_end/core/sdk/ScreenCaptureModel.ts +0 -84
  39. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -15
  40. package/front_end/core/sdk/StorageBucketsModel.ts +0 -15
  41. package/front_end/devtools_compatibility.js +57 -2
  42. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +4 -2
  43. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +203 -127
  44. package/front_end/entrypoints/inspector_main/renderingOptions.css +5 -0
  45. package/front_end/entrypoints/node_app/app/NodeMain.ts +0 -9
  46. package/front_end/entrypoints/node_app/app/nodeConnectionsPanel.css +0 -22
  47. package/front_end/generated/InspectorBackendCommands.ts +1 -1
  48. package/front_end/generated/SupportedCSSProperties.ts +0 -136
  49. package/front_end/generated/protocol-proxy-api.d.ts +231 -231
  50. package/front_end/generated/protocol.ts +1 -0
  51. package/front_end/models/ai_assistance/AiAgent2.ts +4 -1
  52. package/front_end/models/ai_assistance/ChangeManager.ts +3 -1
  53. package/front_end/models/ai_assistance/DOMHelpers.ts +118 -3
  54. package/front_end/models/ai_assistance/ExtensionScope.ts +31 -24
  55. package/front_end/models/ai_assistance/agents/AiAgent.ts +6 -0
  56. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +13 -13
  57. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +1 -1
  58. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  59. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +18 -8
  60. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +2 -2
  61. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +103 -81
  62. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +15 -203
  63. package/front_end/models/ai_assistance/injected.ts +6 -1
  64. package/front_end/models/ai_assistance/skills/lighthouse.md +1 -1
  65. package/front_end/models/ai_assistance/skills/styling.md +8 -10
  66. package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +1 -1
  67. package/front_end/models/ai_assistance/tools/SetElementStyles.ts +288 -0
  68. package/front_end/models/ai_assistance/tools/Tool.ts +1 -0
  69. package/front_end/models/ai_assistance/tools/ToolRegistry.ts +3 -0
  70. package/front_end/models/bindings/ResourceScriptMapping.ts +64 -16
  71. package/front_end/models/comment_manager/CD4ABridge.ts +12 -2
  72. package/front_end/models/comment_manager/CommentManager.ts +24 -4
  73. package/front_end/models/javascript_metadata/NativeFunctions.ts +41 -1
  74. package/front_end/models/project_settings/ProjectSettingsModel.ts +1 -1
  75. package/front_end/models/trace/handlers/FlowsHandler.ts +10 -0
  76. package/front_end/models/trace/handlers/SamplesHandler.ts +3 -2
  77. package/front_end/models/trace/handlers/ScriptsHandler.ts +25 -26
  78. package/front_end/models/trace/helpers/TreeHelpers.ts +4 -0
  79. package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -2
  80. package/front_end/models/trace/types/TraceEvents.ts +21 -22
  81. package/front_end/panels/ai_assistance/components/ChatMessage.ts +9 -1
  82. package/front_end/panels/ai_assistance/components/chatInput.css +4 -4
  83. package/front_end/panels/animation/AnimationTimeline.ts +3 -3
  84. package/front_end/panels/animation/animationTimeline.css +6 -4
  85. package/front_end/panels/application/IndexedDBModel.ts +0 -15
  86. package/front_end/panels/application/appManifestView.css +2 -5
  87. package/front_end/panels/application/components/backForwardCacheView.css +1 -5
  88. package/front_end/panels/application/components/serviceWorkerRouterView.css +2 -2
  89. package/front_end/panels/application/preloading/components/PreloadingString.ts +7 -0
  90. package/front_end/panels/comments/CommentsPane.ts +12 -7
  91. package/front_end/panels/comments/commentsPane.css +16 -2
  92. package/front_end/panels/common/CommentsOverlayWidget.ts +16 -10
  93. package/front_end/panels/common/CommentsStatusBarPill.ts +12 -5
  94. package/front_end/panels/common/commentsOverlay.css +7 -1
  95. package/front_end/panels/common/commentsStatusBarPill.css +30 -0
  96. package/front_end/panels/console/consolePrompt.css +0 -12
  97. package/front_end/panels/console/consoleView.css +2 -2
  98. package/front_end/panels/developer_resources/developerResourcesView.css +4 -3
  99. package/front_end/panels/elements/DOMTreeWidget.ts +29 -9
  100. package/front_end/panels/elements/StylePropertyTreeElement.ts +2 -1
  101. package/front_end/panels/elements/components/CSSHintDetailsView.ts +12 -5
  102. package/front_end/panels/elements/components/cssVariableValueView.css +1 -1
  103. package/front_end/panels/elements/components/elementsBreadcrumbs.css +2 -2
  104. package/front_end/panels/elements/domTreeWidget.css +6 -1
  105. package/front_end/panels/elements/elementsPanel.css +0 -6
  106. package/front_end/panels/elements/layoutPane.css +1 -1
  107. package/front_end/panels/elements/metricsSidebarPane.css +1 -1
  108. package/front_end/panels/elements/platformFontsWidget.css +1 -1
  109. package/front_end/panels/elements/stylesSidebarPane.css +0 -10
  110. package/front_end/panels/emulation/deviceModeView.css +6 -7
  111. package/front_end/panels/explain/components/consoleInsight.css +4 -4
  112. package/front_end/panels/issues/issuesTree.css +1 -26
  113. package/front_end/panels/lighthouse/lighthouseStartView.css +2 -2
  114. package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +1 -1
  115. package/front_end/panels/media/TickingFlameChart.ts +20 -3
  116. package/front_end/panels/media/playerMessagesView.css +2 -2
  117. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +24 -5
  118. package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +1 -6
  119. package/front_end/panels/network/networkLogView.css +2 -2
  120. package/front_end/panels/network/networkTimingTable.css +1 -1
  121. package/front_end/panels/performance_monitor/performanceMonitor.css +0 -4
  122. package/front_end/panels/protocol_monitor/JSONEditor.css +1 -1
  123. package/front_end/panels/protocol_monitor/JSONEditor.ts +4 -2
  124. package/front_end/panels/recorder/recorderPanel.css +3 -3
  125. package/front_end/panels/recorder/recordingListView.css +1 -1
  126. package/front_end/panels/screencast/screencastView.css +1 -1
  127. package/front_end/panels/search/searchResultsPane.css +1 -1
  128. package/front_end/panels/security/SecurityModel.ts +0 -6
  129. package/front_end/panels/security/SecurityPanel.ts +120 -108
  130. package/front_end/panels/security/originView.css +1 -1
  131. package/front_end/panels/sensors/locationsSettingsTab.css +3 -3
  132. package/front_end/panels/settings/EditFileSystemView.ts +159 -104
  133. package/front_end/panels/settings/editFileSystemView.css +30 -4
  134. package/front_end/panels/settings/emulation/devicesSettingsTab.css +0 -52
  135. package/front_end/panels/settings/settingsScreen.css +0 -7
  136. package/front_end/panels/sources/CallStackSidebarPane.ts +339 -221
  137. package/front_end/panels/sources/NavigatorView.ts +95 -8
  138. package/front_end/panels/sources/ThreadsSidebarPane.ts +8 -4
  139. package/front_end/panels/sources/breakpointsView.css +1 -3
  140. package/front_end/panels/sources/callStackSidebarPane.css +4 -0
  141. package/front_end/panels/sources/components/HeadersView.ts +15 -2
  142. package/front_end/panels/sources/watchExpressionsSidebarPane.css +0 -1
  143. package/front_end/panels/timeline/CountersGraph.ts +0 -4
  144. package/front_end/panels/timeline/TimelineLoader.ts +16 -6
  145. package/front_end/panels/timeline/TimelinePanel.ts +20 -12
  146. package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
  147. package/front_end/panels/timeline/components/DetailsView.ts +2 -1
  148. package/front_end/panels/timeline/components/cwvMetrics.css +1 -1
  149. package/front_end/panels/timeline/components/metricCard.css +1 -1
  150. package/front_end/panels/timeline/components/sidebarAnnotationsTab.css +4 -4
  151. package/front_end/panels/timeline/timelineFlameChartView.css +1 -1
  152. package/front_end/panels/webauthn/WebauthnPane.ts +13 -14
  153. package/front_end/panels/webauthn/webauthnPane.css +1 -1
  154. package/front_end/third_party/chromium/README.chromium +1 -1
  155. package/front_end/ui/comments/CommentOverlayManager.ts +34 -18
  156. package/front_end/ui/components/icon_button/FileSourceIcon.ts +6 -0
  157. package/front_end/ui/components/input/textInput.css +1 -1
  158. package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +6 -4
  159. package/front_end/ui/components/suggestion_input/suggestionInput.css +2 -2
  160. package/front_end/ui/components/text_editor/AiCodeGenerationTeaser.ts +14 -2
  161. package/front_end/ui/legacy/DockController.ts +17 -4
  162. package/front_end/ui/legacy/Treeoutline.ts +2 -2
  163. package/front_end/ui/legacy/UIUtils.ts +148 -10
  164. package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +3 -2
  165. package/front_end/ui/legacy/components/perf_ui/chartViewport.css +2 -2
  166. package/front_end/ui/legacy/components/perf_ui/filmStripView.css +2 -2
  167. package/front_end/ui/legacy/components/perf_ui/pieChart.css +1 -1
  168. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +5 -4
  169. package/front_end/ui/legacy/components/source_frame/imageView.css +1 -1
  170. package/front_end/ui/legacy/components/utils/TargetDetachedDialog.ts +0 -3
  171. package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
  172. package/front_end/ui/legacy/inspectorCommon.css +1 -14
  173. package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +3 -2
  174. package/front_end/ui/legacy/listWidget.css +0 -18
  175. package/front_end/ui/legacy/theme_support/ThemeSupport.ts +44 -9
  176. package/front_end/ui/lit/strip-whitespace.ts +1 -1
  177. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  178. package/package.json +3 -3
  179. package/front_end/generated/Deprecation.ts +0 -471
  180. package/front_end/panels/accessibility/axBreadcrumbs.css +0 -155
  181. package/front_end/panels/network/requestHeadersTree.css +0 -226
  182. package/front_end/panels/recorder/startView.css +0 -38
  183. package/front_end/panels/security/ipProtectionView.css +0 -141
  184. package/front_end/ui/legacy/components/inline_editor/animationNameSwatch.css +0 -27
@@ -318,25 +318,112 @@ export function renderGroupTrailingIcons(project: Workspace.Workspace.Project|nu
318
318
  return [];
319
319
  }
320
320
 
321
- export interface SourceTitleViewInput {
321
+ export interface NavigatorSourceTitleViewInput {
322
322
  title: string;
323
323
  editing: boolean;
324
- onCommit: (newTitle: string) => void;
324
+ onCommit: (detail: string) => void;
325
325
  onCancel: () => void;
326
326
  }
327
327
 
328
- export const renderSourceTitle = (input: SourceTitleViewInput, _output: undefined, target: HTMLElement): void => {
328
+ export type NavigatorSourceTitleView = (input: NavigatorSourceTitleViewInput, output: undefined, target: HTMLElement) =>
329
+ void;
330
+
331
+ export const DEFAULT_NAVIGATOR_SOURCE_TITLE_VIEW: NavigatorSourceTitleView = (input, _output, target) => {
332
+ const stopPropagationIfEditing = (event: Event): void => {
333
+ if (input.editing) {
334
+ event.stopPropagation();
335
+ }
336
+ };
337
+
329
338
  // clang-format off
330
339
  render(html`
331
340
  <devtools-prompt
332
341
  value=${input.title}
333
342
  ?editing=${input.editing}
334
343
  @commit=${(event: UI.TextPrompt.TextPromptElement.CommitEvent) => input.onCommit(event.detail)}
335
- @cancel=${input.onCancel}
336
- >${input.title}</devtools-prompt>`, target);
344
+ @cancel=${() => input.onCancel()}
345
+ @mousedown=${stopPropagationIfEditing}
346
+ @click=${stopPropagationIfEditing}
347
+ @dblclick=${stopPropagationIfEditing}>${input.title}</devtools-prompt>
348
+ `, target);
337
349
  // clang-format on
338
350
  };
339
351
 
352
+ export class NavigatorSourceTitleWidget extends UI.Widget.Widget {
353
+ #title = '';
354
+ #editing = false;
355
+ #view: NavigatorSourceTitleView;
356
+
357
+ onCommit?: (detail: string) => void;
358
+ onCancel?: () => void;
359
+
360
+ set title(title: string) {
361
+ if (this.#title === title) {
362
+ return;
363
+ }
364
+ this.#title = title;
365
+ this.requestUpdate();
366
+ }
367
+
368
+ get title(): string {
369
+ return this.#title;
370
+ }
371
+
372
+ set editing(editing: boolean) {
373
+ if (this.#editing === editing) {
374
+ return;
375
+ }
376
+ this.#editing = editing;
377
+ this.requestUpdate();
378
+ }
379
+
380
+ get editing(): boolean {
381
+ return this.#editing;
382
+ }
383
+
384
+ constructor(element?: HTMLElement, view: NavigatorSourceTitleView = DEFAULT_NAVIGATOR_SOURCE_TITLE_VIEW) {
385
+ super(element);
386
+ this.#view = view;
387
+ }
388
+
389
+ override wasShown(): void {
390
+ super.wasShown();
391
+ this.requestUpdate();
392
+ }
393
+
394
+ override performUpdate(): void {
395
+ const viewInput: NavigatorSourceTitleViewInput = {
396
+ title: this.#title,
397
+ editing: this.#editing,
398
+ onCommit: (detail: string) => this.onCommit?.(detail),
399
+ onCancel: () => this.onCancel?.(),
400
+ };
401
+ this.#view(viewInput, undefined, this.contentElement);
402
+ }
403
+ }
404
+
405
+ export const renderSourceTitleWidget =
406
+ (input: NavigatorSourceTitleViewInput, _output: undefined, target: HTMLElement): void => {
407
+ // clang-format off
408
+ render(html`
409
+ <devtools-widget style="display: contents" ${UI.Widget.widget(NavigatorSourceTitleWidget, {
410
+ title: input.title,
411
+ editing: input.editing,
412
+ onCommit: input.onCommit,
413
+ onCancel: input.onCancel,
414
+ })}></devtools-widget>
415
+ `, target);
416
+ // clang-format on
417
+ const widgetElement = target.firstElementChild as HTMLElement | null;
418
+ if (widgetElement) {
419
+ // Temporary adapter: instantiates and renders the widget synchronously
420
+ // for detached TreeOutlineInShadow elements. This will be removed once
421
+ // NavigatorView renders <devtools-tree> declaratively.
422
+ const widget = UI.Widget.Widget.getOrCreateWidget(widgetElement);
423
+ void widget.performUpdate();
424
+ }
425
+ };
426
+
340
427
  export const enum Events {
341
428
  UI_SOURCE_CODE_ADDED = 'ui-source-code-added',
342
429
  SOURCE_SELECTED = 'source-selected',
@@ -2008,13 +2095,13 @@ export class NavigatorUISourceCodeTreeNode extends NavigatorTreeNode {
2008
2095
  return;
2009
2096
  }
2010
2097
 
2011
- renderSourceTitle({
2098
+ renderSourceTitleWidget({
2012
2099
  title: this.title,
2013
2100
  editing: this.isEditing,
2014
2101
  onCommit: this.#handlePromptCommit.bind(this),
2015
2102
  onCancel: this.#handlePromptCancel.bind(this),
2016
2103
  },
2017
- undefined, this.treeElement.titleElement as HTMLElement);
2104
+ undefined, this.treeElement.titleElement as HTMLElement);
2018
2105
  this.updateIcon();
2019
2106
  this.updateTrailingIcons();
2020
2107
 
@@ -2033,7 +2120,7 @@ export class NavigatorUISourceCodeTreeNode extends NavigatorTreeNode {
2033
2120
  (this.#uiSourceCode.contentType().isScript() || isIgnoreListed) ? isIgnoreListed : null;
2034
2121
 
2035
2122
  let titleText = this.#uiSourceCode.displayName();
2036
- if (!ignoreIsDirty && this.#uiSourceCode.isDirty()) {
2123
+ if (!ignoreIsDirty && !this.isEditing && this.#uiSourceCode.isDirty()) {
2037
2124
  titleText = '*' + titleText;
2038
2125
  }
2039
2126
  this.title = titleText;
@@ -81,9 +81,17 @@ export class ThreadsSidebarPane extends UI.Widget.VBox implements
81
81
 
82
82
  override wasShown(): void {
83
83
  super.wasShown();
84
+ SDK.TargetManager.TargetManager.instance().addEventListener(SDK.TargetManager.Events.NAME_CHANGED,
85
+ this.#targetNameChanged);
84
86
  this.requestUpdate();
85
87
  }
86
88
 
89
+ override willHide(): void {
90
+ super.willHide();
91
+ SDK.TargetManager.TargetManager.instance().removeEventListener(SDK.TargetManager.Events.NAME_CHANGED,
92
+ this.#targetNameChanged);
93
+ }
94
+
87
95
  #getThreadName(debuggerModel: SDK.DebuggerModel.DebuggerModel): string {
88
96
  const executionContext = debuggerModel.runtimeModel().defaultExecutionContext();
89
97
  return executionContext?.label() || debuggerModel.target().name();
@@ -122,8 +130,6 @@ export class ThreadsSidebarPane extends UI.Widget.VBox implements
122
130
  debuggerModel.addEventListener(SDK.DebuggerModel.Events.DebuggerResumed, this.#updatePausedState);
123
131
  debuggerModel.runtimeModel().addEventListener(
124
132
  SDK.RuntimeModel.Events.ExecutionContextChanged, this.requestUpdate, this);
125
- SDK.TargetManager.TargetManager.instance().addEventListener(
126
- SDK.TargetManager.Events.NAME_CHANGED, this.#targetNameChanged);
127
133
 
128
134
  this.requestUpdate();
129
135
  }
@@ -134,8 +140,6 @@ export class ThreadsSidebarPane extends UI.Widget.VBox implements
134
140
  debuggerModel.removeEventListener(SDK.DebuggerModel.Events.DebuggerResumed, this.#updatePausedState);
135
141
  debuggerModel.runtimeModel().removeEventListener(
136
142
  SDK.RuntimeModel.Events.ExecutionContextChanged, this.requestUpdate, this);
137
- SDK.TargetManager.TargetManager.instance().removeEventListener(
138
- SDK.TargetManager.Events.NAME_CHANGED, this.#targetNameChanged);
139
143
 
140
144
  this.requestUpdate();
141
145
  }
@@ -234,7 +234,7 @@
234
234
  }
235
235
 
236
236
  .pause-on-caught-exceptions {
237
- margin-bottom: 3px;
237
+ margin-bottom: var(--sys-size-2);
238
238
  }
239
239
 
240
240
  /* TODO(crbug.com/1382762): Remove special casing with dependent toggles as soon as Node LTS caught up on independent pause of exception toggles. */
@@ -256,8 +256,6 @@
256
256
 
257
257
  .pause-on-uncaught-exceptions,
258
258
  .pause-on-caught-exceptions {
259
- line-height: 13px;
260
- height: 18px;
261
259
  padding-right: var(--sys-size-5);
262
260
 
263
261
  & > label {
@@ -33,6 +33,10 @@
33
33
  border-top: var(--sys-size-1) solid var(--sys-color-divider);
34
34
  }
35
35
 
36
+ .call-frame-list {
37
+ overflow-y: auto;
38
+ }
39
+
36
40
  .call-frame-item {
37
41
  padding: 3px var(--sys-size-5) 3px var(--sys-size-9);
38
42
  position: relative;
@@ -100,12 +100,25 @@ export class HeadersView extends UI.View.SimpleView {
100
100
  uiSourceCode: this.#uiSourceCode,
101
101
  parsingError: false,
102
102
  };
103
+ this.performUpdate();
104
+ }
105
+
106
+ override wasShown(): void {
107
+ super.wasShown();
103
108
  this.#uiSourceCode.addEventListener(Workspace.UISourceCode.Events.WorkingCopyChanged, this.#onWorkingCopyChanged,
104
109
  this);
105
110
  this.#uiSourceCode.addEventListener(Workspace.UISourceCode.Events.WorkingCopyCommitted,
106
111
  this.#onWorkingCopyCommitted, this);
107
- this.performUpdate();
108
- void this.#setInitialData();
112
+ if (this.#uiSourceCode.isDirty()) {
113
+ this.#setComponentData(this.#uiSourceCode.workingCopy());
114
+ } else {
115
+ void this.#setInitialData();
116
+ }
117
+ }
118
+
119
+ override willHide(): void {
120
+ super.willHide();
121
+ this.dispose();
109
122
  }
110
123
 
111
124
  override performUpdate(): void {
@@ -103,7 +103,6 @@ li.watch-expression-tree-item > span.tree-element-title {
103
103
 
104
104
  .watch-expression-text-prompt-proxy {
105
105
  margin: var(--sys-size-2) var(--sys-size-6) var(--sys-size-2) calc(-1 * var(--sys-size-3));
106
- padding-bottom: 3px;
107
106
  }
108
107
 
109
108
  .watch-expression-header {
@@ -200,10 +200,6 @@ export class CountersGraph extends UI.Widget.VBox {
200
200
  counter.appendSample(startTime, value);
201
201
  }
202
202
  }
203
-
204
- if (typeof counters.gpuMemoryLimitKB !== 'undefined') {
205
- this.gpuMemoryCounter.setLimit(counters.gpuMemoryLimitKB);
206
- }
207
203
  }
208
204
  this.#showNoEventsMessage = counterEventsFound === 0;
209
205
  this.requestUpdate();
@@ -115,7 +115,7 @@ export class TimelineLoader {
115
115
 
116
116
  static async loadFromURL(url: Platform.DevToolsPath.UrlString, client: Client): Promise<TimelineLoader> {
117
117
  const loader = new TimelineLoader(client);
118
- const stream = new Common.StringOutputStream.StringOutputStream();
118
+ let stream: Common.StringOutputStream.StringOutputStream|null = new Common.StringOutputStream.StringOutputStream();
119
119
  client.loadingStarted();
120
120
 
121
121
  const allowRemoteFilePaths =
@@ -124,15 +124,19 @@ export class TimelineLoader {
124
124
 
125
125
  async function finishedCallback(success: boolean, _headers: Record<string, string>,
126
126
  errorDescription: Host.ResourceLoader.LoadErrorDescription): Promise<void> {
127
- if (!success) {
127
+ if (!success || !stream) {
128
+ stream = null;
128
129
  return loader.reportErrorAndCancelLoading(errorDescription.message);
129
130
  }
130
131
  try {
131
- const txt = stream.data();
132
- const trace = JSON.parse(txt);
133
- loader.#processParsedFile(trace);
132
+ // Inline `stream.data()` and clear `stream` before `await loader.complete()`
133
+ // so the raw JSON text and chunked StringOutputStream are not retained in
134
+ // this async frame for the duration of trace processing.
135
+ loader.#processParsedFile(JSON.parse(stream.data()));
136
+ stream = null;
134
137
  await loader.complete();
135
138
  } catch (e: unknown) {
139
+ stream = null;
136
140
  const message = e instanceof Error ? e.message : '';
137
141
  return loader.reportErrorAndCancelLoading(i18nString(UIStrings.malformedTimelineDataS, {PH1: message}));
138
142
  }
@@ -201,6 +205,7 @@ export class TimelineLoader {
201
205
  }
202
206
 
203
207
  async #cleanup(): Promise<void> {
208
+ this.#collectedEvents = [];
204
209
  if (this.client) {
205
210
  await this.client.loadingComplete(
206
211
  /* collectedEvents */[], /* exclusiveFilter= */ null, /* metadata= */ null);
@@ -241,7 +246,12 @@ export class TimelineLoader {
241
246
  this.#metadata = RecordingMetadata.forCPUProfile();
242
247
  }
243
248
 
244
- await (this.client as Client).loadingComplete(this.#collectedEvents, this.filter, this.#metadata);
249
+ // Dispatch `loadingComplete` and clear the instance reference before awaiting
250
+ // so the loader does not retain the events array during trace processing.
251
+ const loadingCompletePromise =
252
+ (this.client as Client).loadingComplete(this.#collectedEvents, this.filter, this.#metadata);
253
+ this.#collectedEvents = [];
254
+ await loadingCompletePromise;
245
255
  this.#traceLoadedCallback?.(LoadingState.SUCCESS);
246
256
  }
247
257
 
@@ -477,6 +477,7 @@ export class TimelinePanel extends TimelinePanelBase implements Client, Timeline
477
477
  'flamechart-selected-navigation', 'Modern - normal scrolling', 'timeline.select-modern-navigation');
478
478
  #classicNavRadioButton = UI.UIUtils.createRadioButton(
479
479
  'flamechart-selected-navigation', 'Classic - scroll to zoom', 'timeline.select-classic-navigation');
480
+ #navigationSettingInitialized = false;
480
481
 
481
482
  #onMainEntryHovered: (event: Common.EventTarget.EventTargetEvent<number>) => void;
482
483
  #hiddenTracksInfoBarByParsedTrace = new WeakMap<Trace.TraceModel.ParsedTrace, UI.Infobar.Infobar|'DISMISSED'>();
@@ -1553,7 +1554,7 @@ export class TimelinePanel extends TimelinePanelBase implements Client, Timeline
1553
1554
  let fileName =
1554
1555
  (isCpuProfile ? `CPU-${isoDate}.cpuprofile` : `Trace-${isoDate}.json`) as Platform.DevToolsPath.RawPathString;
1555
1556
 
1556
- let blobParts: string[] = [];
1557
+ let blobParts: BlobPart[] = [];
1557
1558
  if (isCpuProfile) {
1558
1559
  const profile = Trace.Helpers.SamplesIntegrator.SamplesIntegrator.extractCpuProfileFromFakeTrace(traceEvents);
1559
1560
  blobParts = [JSON.stringify(profile)];
@@ -1566,7 +1567,12 @@ export class TimelinePanel extends TimelinePanelBase implements Client, Timeline
1566
1567
  sourceMaps: filteredMetadataSourceMaps,
1567
1568
  resources: filteredResources,
1568
1569
  });
1569
- blobParts = Array.from(formattedTraceIter);
1570
+ // Wrap each chunk in a Blob as soon as it is generated, so that each
1571
+ // chunk string can be garbage collected straight away. Collecting all
1572
+ // the strings first would hold the whole serialized trace in the JS heap.
1573
+ for (const chunk of formattedTraceIter) {
1574
+ blobParts.push(new Blob([chunk]));
1575
+ }
1570
1576
  }
1571
1577
 
1572
1578
  if (!blobParts.length) {
@@ -1761,7 +1767,6 @@ export class TimelinePanel extends TimelinePanelBase implements Client, Timeline
1761
1767
  }
1762
1768
 
1763
1769
  #launchRehydratedSession(traceJson: string): void {
1764
- let rehydratingWindow: Window|null = null;
1765
1770
  let pathToLaunch: string|null = null;
1766
1771
  const url = new URL(window.location.href);
1767
1772
  const pathToEntrypoint = url.pathname.slice(0, url.pathname.lastIndexOf('/'));
@@ -1771,19 +1776,21 @@ export class TimelinePanel extends TimelinePanelBase implements Client, Timeline
1771
1776
 
1772
1777
  // Clarifying the window the code is referring to
1773
1778
  const hostWindow = window;
1779
+ const rehydratingWindow = this.isDocked() ?
1780
+ hostWindow.open(pathToLaunch, /* target: */ '_blank', 'noopener=false,popup=false') :
1781
+ hostWindow.open(pathToLaunch, /* target: */ undefined, 'noopener=false,popup=true');
1782
+ if (!rehydratingWindow) {
1783
+ return;
1784
+ }
1785
+
1774
1786
  function onMessageHandler(ev: MessageEvent): void {
1775
- if (url && ev.data?.type === 'REHYDRATING_WINDOW_READY') {
1776
- rehydratingWindow?.postMessage({type: 'REHYDRATING_TRACE_FILE', traceJson}, url.origin);
1787
+ if (ev.source !== rehydratingWindow || ev.data?.type !== 'REHYDRATING_WINDOW_READY') {
1788
+ return;
1777
1789
  }
1790
+ rehydratingWindow?.postMessage({type: 'REHYDRATING_TRACE_FILE', traceJson}, url.origin);
1778
1791
  hostWindow.removeEventListener('message', onMessageHandler);
1779
1792
  }
1780
1793
  hostWindow.addEventListener('message', onMessageHandler);
1781
-
1782
- if (this.isDocked()) {
1783
- rehydratingWindow = hostWindow.open(pathToLaunch, /* target: */ '_blank', 'noopener=false,popup=false');
1784
- } else {
1785
- rehydratingWindow = hostWindow.open(pathToLaunch, /* target: */ undefined, 'noopener=false,popup=true');
1786
- }
1787
1794
  }
1788
1795
 
1789
1796
  async loadFromURL(url: Platform.DevToolsPath.UrlString): Promise<void> {
@@ -2306,7 +2313,8 @@ export class TimelinePanel extends TimelinePanelBase implements Client, Timeline
2306
2313
 
2307
2314
  // When the timeline is loaded for the first time, setup the shortcuts dialog and log what navigation setting is selected.
2308
2315
  // Logging the setting on the first timeline load will allow us to get an estimate number of people using each option.
2309
- if (this.#traceEngineModel.size() === 1) {
2316
+ if (!this.#navigationSettingInitialized && this.#traceEngineModel.size() === 1) {
2317
+ this.#navigationSettingInitialized = true;
2310
2318
  this.#setupNavigationSetting();
2311
2319
  if (Common.Settings.Settings.instance()
2312
2320
  .resolve(SettingUIRegistration.TimelineSettings.flamechartSelectedNavigationSettingDescriptor)
@@ -1049,7 +1049,7 @@ export class TimelineUIUtils {
1049
1049
  }
1050
1050
 
1051
1051
  if (Trace.Types.Events.isNavigationStart(event)) {
1052
- url = (event.args.data?.documentLoaderURL ?? event.args.data?.url) as Platform.DevToolsPath.UrlString;
1052
+ url = event.args.data?.documentLoaderURL as Platform.DevToolsPath.UrlString;
1053
1053
  if (url) {
1054
1054
  contentHelper.appendElementRow(i18nString(UIStrings.url), LegacyComponents.Linkifier.Linkifier.linkifyURL(url));
1055
1055
  }
@@ -207,7 +207,8 @@ export function generateInvalidationsList(
207
207
  for (const invalidation of invalidations) {
208
208
  backendNodeIds.add(invalidation.args.data.nodeId);
209
209
 
210
- let reason = invalidation.args.data.reason || 'unknown';
210
+ let reason = ('reason' in invalidation.args.data && invalidation.args.data.reason) ? invalidation.args.data.reason :
211
+ 'unknown';
211
212
 
212
213
  // ScheduleStyle events do not always have a reason, but if they tell us
213
214
  // via their data what changed, we can update the reason that we show to
@@ -58,7 +58,7 @@
58
58
  color: var(--app-color-performance-good);
59
59
  }
60
60
 
61
- .metric-score-unclassified {
61
+ .metric-value-unclassified {
62
62
  color: var(--sys-color-token-subtle);
63
63
  }
64
64
 
@@ -140,7 +140,7 @@ details.environment-recs[open] > summary::before {
140
140
 
141
141
  .bucket-summaries.histogram {
142
142
  display: grid;
143
- grid-template-columns: minmax(min-content, auto) minmax(var(--sys-size-14), 60px) max-content;
143
+ grid-template-columns: minmax(min-content, auto) minmax(var(--sys-size-14), var(--sys-size-18)) max-content;
144
144
  grid-auto-rows: 1fr;
145
145
  column-gap: var(--sys-size-5);
146
146
  place-items: center flex-end;
@@ -55,7 +55,7 @@
55
55
 
56
56
  .annotation-identifier {
57
57
  padding: var(--sys-size-3) var(--sys-size-5);
58
- border-radius: 10px;
58
+ border-radius: var(--sys-shape-corner-small);
59
59
  font-weight: bold;
60
60
 
61
61
  &.time-range {
@@ -76,14 +76,14 @@
76
76
  }
77
77
 
78
78
  .annotation-tutorial-container {
79
- padding: 10px;
79
+ padding: var(--sys-size-5);
80
80
  }
81
81
 
82
82
  .tutorial-card {
83
83
  display: block;
84
84
  position: relative;
85
- margin: 10px 0;
86
- padding: 10px;
85
+ margin: var(--sys-size-5) 0;
86
+ padding: var(--sys-size-5);
87
87
  border-radius: var(--sys-shape-corner-extra-small);
88
88
  overflow: hidden;
89
89
  border: var(--sys-size-1) solid var(--sys-color-divider);
@@ -162,7 +162,7 @@
162
162
  /* This overlay by default is shown at the bottom of the UI, not the top */
163
163
  top: unset;
164
164
  bottom: 0;
165
- height: 100px;
165
+ height: var(--sys-size-19);
166
166
 
167
167
  &.positioned-by-event {
168
168
  top: 0;
@@ -588,14 +588,6 @@ export class WebauthnPaneImpl extends UI.Panel.Panel implements
588
588
  credentials: [],
589
589
  });
590
590
  this.requestUpdate();
591
- this.#model.addEventListener(
592
- SDK.WebAuthnModel.Events.CREDENTIAL_ADDED, this.#addCredential.bind(this, authenticatorId));
593
- this.#model.addEventListener(
594
- SDK.WebAuthnModel.Events.CREDENTIAL_ASSERTED, this.#updateCredential.bind(this, authenticatorId));
595
- this.#model.addEventListener(
596
- SDK.WebAuthnModel.Events.CREDENTIAL_UPDATED, this.#updateCredential.bind(this, authenticatorId));
597
- this.#model.addEventListener(
598
- SDK.WebAuthnModel.Events.CREDENTIAL_DELETED, this.#deleteCredential.bind(this, authenticatorId));
599
591
  return authenticatorId;
600
592
  }
601
593
 
@@ -662,11 +654,19 @@ export class WebauthnPaneImpl extends UI.Panel.Panel implements
662
654
  modelAdded(model: SDK.WebAuthnModel.WebAuthnModel): void {
663
655
  if (model.target() === model.target().outermostTarget()) {
664
656
  this.#model = model;
657
+ model.addEventListener(SDK.WebAuthnModel.Events.CREDENTIAL_ADDED, this.#addCredential, this);
658
+ model.addEventListener(SDK.WebAuthnModel.Events.CREDENTIAL_ASSERTED, this.#updateCredential, this);
659
+ model.addEventListener(SDK.WebAuthnModel.Events.CREDENTIAL_UPDATED, this.#updateCredential, this);
660
+ model.addEventListener(SDK.WebAuthnModel.Events.CREDENTIAL_DELETED, this.#deleteCredential, this);
665
661
  }
666
662
  }
667
663
 
668
664
  modelRemoved(model: SDK.WebAuthnModel.WebAuthnModel): void {
669
665
  if (model.target() === model.target().outermostTarget()) {
666
+ model.removeEventListener(SDK.WebAuthnModel.Events.CREDENTIAL_ADDED, this.#addCredential, this);
667
+ model.removeEventListener(SDK.WebAuthnModel.Events.CREDENTIAL_ASSERTED, this.#updateCredential, this);
668
+ model.removeEventListener(SDK.WebAuthnModel.Events.CREDENTIAL_UPDATED, this.#updateCredential, this);
669
+ model.removeEventListener(SDK.WebAuthnModel.Events.CREDENTIAL_DELETED, this.#deleteCredential, this);
670
670
  this.#model = undefined;
671
671
  }
672
672
  }
@@ -699,10 +699,10 @@ export class WebauthnPaneImpl extends UI.Panel.Panel implements
699
699
  await this.#setVirtualAuthEnvEnabled(false);
700
700
  }
701
701
 
702
- #addCredential(authenticatorId: Protocol.WebAuthn.AuthenticatorId, {
702
+ #addCredential({
703
703
  data: event,
704
704
  }: Common.EventTarget.EventTargetEvent<Protocol.WebAuthn.CredentialAddedEvent>): void {
705
- const authenticator = this.#authenticators.get(authenticatorId);
705
+ const authenticator = this.#authenticators.get(event.authenticatorId);
706
706
  if (!authenticator) {
707
707
  return;
708
708
  }
@@ -711,12 +711,11 @@ export class WebauthnPaneImpl extends UI.Panel.Panel implements
711
711
  }
712
712
 
713
713
  #updateCredential(
714
- authenticatorId: Protocol.WebAuthn.AuthenticatorId,
715
714
  {
716
715
  data: event,
717
716
  }: Common.EventTarget
718
717
  .EventTargetEvent<Protocol.WebAuthn.CredentialAssertedEvent&Protocol.WebAuthn.CredentialUpdatedEvent>): void {
719
- const authenticator = this.#authenticators.get(authenticatorId);
718
+ const authenticator = this.#authenticators.get(event.authenticatorId);
720
719
  if (!authenticator) {
721
720
  return;
722
721
  }
@@ -729,10 +728,10 @@ export class WebauthnPaneImpl extends UI.Panel.Panel implements
729
728
  this.requestUpdate();
730
729
  }
731
730
 
732
- #deleteCredential(authenticatorId: Protocol.WebAuthn.AuthenticatorId, {
731
+ #deleteCredential({
733
732
  data: event,
734
733
  }: Common.EventTarget.EventTargetEvent<Protocol.WebAuthn.CredentialDeletedEvent>): void {
735
- const authenticator = this.#authenticators.get(authenticatorId);
734
+ const authenticator = this.#authenticators.get(event.authenticatorId);
736
735
  if (!authenticator) {
737
736
  return;
738
737
  }
@@ -86,7 +86,7 @@
86
86
  .authenticator-fields {
87
87
  border: none;
88
88
  flex: 0 0 auto;
89
- margin-bottom: 10px;
89
+ margin-bottom: var(--sys-size-5);
90
90
  }
91
91
 
92
92
  .authenticator-section-header {
@@ -1,7 +1,7 @@
1
1
  Name: Dependencies sourced from the upstream `chromium` repository
2
2
  URL: Internal
3
3
  Version: N/A
4
- Revision: b00d6cf8da7aceb173db8721210cd810c03d2ce4
4
+ Revision: c2918b8ff4f880d7323ba43b9b0bd608225c902e
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE