chrome-devtools-frontend 1.0.1545096 → 1.0.1547147

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 (124) hide show
  1. package/docs/styleguide/ux/styles.md +1 -1
  2. package/eslint.config.mjs +1 -1
  3. package/front_end/Images/src/arrow-down.svg +8 -1
  4. package/front_end/Images/src/arrow-up.svg +8 -1
  5. package/front_end/core/host/AidaClient.ts +1 -1
  6. package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
  7. package/front_end/core/host/UserMetrics.ts +0 -5
  8. package/front_end/core/platform/HostRuntime.ts +18 -0
  9. package/front_end/core/platform/KeyboardUtilities.ts +2 -2
  10. package/front_end/core/platform/StringUtilities.ts +1 -1
  11. package/front_end/core/platform/api/HostRuntime.ts +20 -0
  12. package/front_end/core/platform/api/api.ts +7 -0
  13. package/front_end/core/platform/browser/HostRuntime.ts +14 -0
  14. package/front_end/core/platform/browser/browser.ts +7 -0
  15. package/front_end/core/platform/node/HostRuntime.ts +13 -0
  16. package/front_end/core/platform/node/node.ts +7 -0
  17. package/front_end/core/platform/platform.ts +2 -2
  18. package/front_end/core/sdk/SourceMapScopesInfo.ts +141 -23
  19. package/front_end/core/sdk/Target.ts +5 -14
  20. package/front_end/core/sdk/TargetManager.ts +26 -4
  21. package/front_end/core/sdk/sdk-meta.ts +62 -0
  22. package/front_end/devtools_compatibility.js +0 -1
  23. package/front_end/entrypoints/main/MainImpl.ts +2 -2
  24. package/front_end/foundation/Universe.ts +2 -2
  25. package/front_end/generated/Deprecation.ts +7 -0
  26. package/front_end/generated/InspectorBackendCommands.ts +1 -1
  27. package/front_end/generated/SupportedCSSProperties.js +4 -2
  28. package/front_end/generated/protocol.ts +3 -2
  29. package/front_end/models/ai_assistance/AiConversation.ts +188 -0
  30. package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -172
  31. package/front_end/models/ai_assistance/ConversationHandler.ts +5 -5
  32. package/front_end/models/ai_assistance/agents/AiAgent.ts +1 -3
  33. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +6 -2
  34. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
  35. package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -9
  36. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  37. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +313 -313
  38. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +8 -6
  39. package/front_end/models/ai_assistance/performance/AICallTree.snapshot.txt +33 -33
  40. package/front_end/models/ai_assistance/performance/AICallTree.ts +9 -3
  41. package/front_end/models/bindings/CSSWorkspaceBinding.ts +5 -3
  42. package/front_end/models/bindings/SASSSourceMapping.ts +6 -4
  43. package/front_end/models/cpu_profile/CPUProfileDataModel.ts +10 -7
  44. package/front_end/models/crux-manager/CrUXManager.ts +7 -4
  45. package/front_end/models/issues_manager/GenericIssue.ts +12 -9
  46. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
  47. package/front_end/models/trace/handlers/SamplesHandler.ts +3 -0
  48. package/front_end/models/trace/helpers/Trace.ts +13 -0
  49. package/front_end/models/trace/types/TraceEvents.ts +2 -1
  50. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +29 -0
  51. package/front_end/models/workspace/IgnoreListManager.ts +1 -2
  52. package/front_end/models/workspace/UISourceCode.ts +50 -0
  53. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +9 -9
  54. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +8 -0
  55. package/front_end/panels/ai_assistance/components/ChatView.ts +2 -2
  56. package/front_end/panels/animation/AnimationTimeline.ts +0 -8
  57. package/front_end/panels/application/FrameDetailsView.ts +8 -8
  58. package/front_end/panels/application/components/StackTrace.ts +84 -85
  59. package/front_end/panels/common/AiCodeGenerationTeaser.ts +80 -0
  60. package/front_end/panels/common/common.ts +2 -1
  61. package/front_end/panels/console/ConsolePrompt.ts +3 -1
  62. package/front_end/panels/console/ConsoleViewport.ts +1 -2
  63. package/front_end/panels/elements/ElementIssueUtils.ts +2 -2
  64. package/front_end/panels/elements/StylePropertyTreeElement.ts +23 -19
  65. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  66. package/front_end/panels/elements/cssValueTraceView.css +1 -1
  67. package/front_end/panels/elements/elements-meta.ts +1 -0
  68. package/front_end/panels/explain/components/ConsoleInsight.ts +44 -57
  69. package/front_end/panels/explain/components/consoleInsight.css +46 -1
  70. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +1 -2
  71. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +19 -0
  72. package/front_end/panels/network/RequestConditionsDrawer.ts +54 -24
  73. package/front_end/panels/network/networkLogView.css +11 -0
  74. package/front_end/panels/network/networkTimingTable.css +8 -6
  75. package/front_end/panels/network/requestConditionsDrawer.css +10 -1
  76. package/front_end/panels/profiler/ProfilesPanel.ts +1 -2
  77. package/front_end/panels/settings/KeybindsSettingsTab.ts +20 -21
  78. package/front_end/panels/sources/CoveragePlugin.ts +5 -5
  79. package/front_end/panels/sources/Plugin.ts +1 -1
  80. package/front_end/panels/sources/ProfilePlugin.ts +22 -14
  81. package/front_end/panels/sources/UISourceCodeFrame.ts +2 -1
  82. package/front_end/panels/sources/sources-meta.ts +0 -62
  83. package/front_end/panels/timeline/README.md +1 -9
  84. package/front_end/panels/timeline/ThreadAppender.ts +0 -7
  85. package/front_end/panels/timeline/TimelinePanel.ts +1 -1
  86. package/front_end/panels/timeline/TimelineUIUtils.ts +2 -0
  87. package/front_end/panels/timeline/components/ExportTraceOptions.ts +15 -1
  88. package/front_end/panels/timeline/components/LiveMetricsView.ts +37 -1
  89. package/front_end/panels/timeline/components/exportTraceOptions.css +11 -2
  90. package/front_end/third_party/chromium/README.chromium +1 -1
  91. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +1 -0
  92. package/front_end/ui/legacy/ARIAUtils.ts +2 -2
  93. package/front_end/ui/legacy/ActionRegistration.ts +11 -0
  94. package/front_end/ui/legacy/SoftDropDown.ts +2 -2
  95. package/front_end/ui/legacy/TextPrompt.ts +3 -2
  96. package/front_end/ui/legacy/Treeoutline.ts +2 -1
  97. package/front_end/ui/legacy/UIUtils.ts +11 -10
  98. package/front_end/ui/legacy/Widget.ts +3 -2
  99. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +2 -2
  100. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +62 -39
  101. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +1 -1
  102. package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +2 -2
  103. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -7
  104. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +1 -2
  105. package/front_end/ui/legacy/inspectorCommon.css +2 -2
  106. package/front_end/ui/legacy/legacy.ts +2 -0
  107. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  108. package/package.json +1 -1
  109. package/front_end/panels/explain/components/consoleInsightSourcesList.css +0 -51
  110. package/front_end/ui/components/docs/README.md +0 -6
  111. package/front_end/ui/components/docs/building-ui-documentation/ComponentEvents.md +0 -54
  112. package/front_end/ui/components/docs/building-ui-documentation/ComponentPerformance.md +0 -136
  113. package/front_end/ui/components/docs/building-ui-documentation/CreatingComponents.md +0 -242
  114. package/front_end/ui/components/docs/building-ui-documentation/README.md +0 -23
  115. package/front_end/ui/components/docs/building-ui-documentation/StylingComponents.md +0 -66
  116. package/front_end/ui/components/docs/building-ui-documentation/TestingComponents.md +0 -111
  117. package/front_end/ui/components/docs/component_docs.ts +0 -24
  118. package/front_end/ui/components/docs/component_docs_styles.css +0 -53
  119. package/front_end/ui/components/docs/create_breadcrumbs.ts +0 -44
  120. package/front_end/ui/components/docs/slider/basic.html +0 -20
  121. package/front_end/ui/components/docs/switch/basic.html +0 -20
  122. /package/front_end/models/issues_manager/descriptions/{genericFormAriaLabelledByToNonExistingId.md → genericFormAriaLabelledByToNonExistingIdError.md} +0 -0
  123. /package/front_end/models/issues_manager/descriptions/{genericFormLabelHasNeitherForNorNestedInput.md → genericFormLabelHasNeitherForNorNestedInputError.md} +0 -0
  124. /package/front_end/{core/platform → ui/legacy}/DOMUtilities.ts +0 -0
@@ -7,10 +7,10 @@ import * as i18n from '../../core/i18n/i18n.js';
7
7
  import type * as Platform from '../../core/platform/platform.js';
8
8
  import * as SDK from '../../core/sdk/sdk.js';
9
9
  import * as TextUtils from '../../models/text_utils/text_utils.js';
10
- import type * as Workspace from '../../models/workspace/workspace.js';
10
+ import * as Workspace from '../../models/workspace/workspace.js';
11
11
  import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
12
12
  import type * as TextEditor from '../../ui/components/text_editor/text_editor.js';
13
- import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
13
+ import type * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
14
14
  import * as UI from '../../ui/legacy/legacy.js';
15
15
  import * as Coverage from '../coverage/coverage.js';
16
16
 
@@ -123,7 +123,7 @@ export class CoveragePlugin extends Plugin {
123
123
  }
124
124
 
125
125
  private getCoverageManager(): Coverage.CoverageDecorationManager.CoverageDecorationManager|undefined {
126
- return this.uiSourceCode.getDecorationData(SourceFrame.SourceFrame.DecoratorType.COVERAGE);
126
+ return this.uiSourceCode.getDecorationData(Workspace.UISourceCode.DecoratorType.COVERAGE);
127
127
  }
128
128
 
129
129
  override editorInitialized(editor: TextEditor.TextEditor.TextEditor): void {
@@ -132,9 +132,9 @@ export class CoveragePlugin extends Plugin {
132
132
  }
133
133
  }
134
134
 
135
- override decorationChanged(type: SourceFrame.SourceFrame.DecoratorType, editor: TextEditor.TextEditor.TextEditor):
135
+ override decorationChanged(type: Workspace.UISourceCode.DecoratorType, editor: TextEditor.TextEditor.TextEditor):
136
136
  void {
137
- if (type === SourceFrame.SourceFrame.DecoratorType.COVERAGE) {
137
+ if (type === Workspace.UISourceCode.DecoratorType.COVERAGE) {
138
138
  this.startDecoUpdate(editor);
139
139
  }
140
140
  }
@@ -41,7 +41,7 @@ export class Plugin {
41
41
  void {
42
42
  }
43
43
 
44
- decorationChanged(_type: SourceFrame.SourceFrame.DecoratorType, _editor: TextEditor.TextEditor.TextEditor): void {
44
+ decorationChanged(_type: Workspace.UISourceCode.DecoratorType, _editor: TextEditor.TextEditor.TextEditor): void {
45
45
  }
46
46
 
47
47
  editorExtension(): CodeMirror.Extension {
@@ -5,10 +5,9 @@
5
5
 
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
7
  import * as Platform from '../../core/platform/platform.js';
8
- import type * as Workspace from '../../models/workspace/workspace.js';
8
+ import * as Workspace from '../../models/workspace/workspace.js';
9
9
  import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
10
10
  import type * as TextEditor from '../../ui/components/text_editor/text_editor.js';
11
- import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
12
11
 
13
12
  import {Plugin} from './Plugin.js';
14
13
 
@@ -90,22 +89,31 @@ class PerformanceMarker extends CodeMirror.GutterMarker {
90
89
  }
91
90
 
92
91
  function markersFromProfileData(
93
- map: Map<number, number>, state: CodeMirror.EditorState,
94
- type: SourceFrame.SourceFrame.DecoratorType): CodeMirror.RangeSet<CodeMirror.GutterMarker> {
95
- const markerType = type === SourceFrame.SourceFrame.DecoratorType.PERFORMANCE ? PerformanceMarker : MemoryMarker;
92
+ map: Map<number, number>|Map<number, Map<number, number>>, state: CodeMirror.EditorState,
93
+ type: Workspace.UISourceCode.DecoratorType): CodeMirror.RangeSet<CodeMirror.GutterMarker> {
94
+ const markerType = type === Workspace.UISourceCode.DecoratorType.PERFORMANCE ? PerformanceMarker : MemoryMarker;
96
95
  const markers: Array<CodeMirror.Range<CodeMirror.GutterMarker>> = [];
96
+ const aggregatedByLine = new Map<number, number>();
97
97
  for (const [line, value] of map) {
98
98
  if (line <= state.doc.lines) {
99
- const {from} = state.doc.line(line);
100
- markers.push(new markerType(value).range(from));
99
+ if (value instanceof Map) {
100
+ for (const [, data] of value) {
101
+ aggregatedByLine.set(line, (aggregatedByLine.get(line) || 0) + data);
102
+ }
103
+ continue;
104
+ }
105
+ aggregatedByLine.set(line, value);
101
106
  }
102
107
  }
108
+ for (const [line, value] of aggregatedByLine) {
109
+ const {from} = state.doc.line(line);
110
+ markers.push(new markerType(value).range(from));
111
+ }
103
112
  return CodeMirror.RangeSet.of(markers, true);
104
113
  }
105
114
 
106
- const makeLineLevelProfilePlugin = (type: SourceFrame.SourceFrame.DecoratorType): typeof Plugin =>
107
- class extends Plugin {
108
- updateEffect = CodeMirror.StateEffect.define<Map<number, number>>();
115
+ const makeLineLevelProfilePlugin = (type: Workspace.UISourceCode.DecoratorType): typeof Plugin => class extends Plugin {
116
+ updateEffect = CodeMirror.StateEffect.define<Map<number, number>|Map<number, Map<number, number>>>();
109
117
  field: CodeMirror.StateField<CodeMirror.RangeSet<CodeMirror.GutterMarker>>;
110
118
  gutter: CodeMirror.Extension;
111
119
  compartment: CodeMirror.Compartment = new CodeMirror.Compartment();
@@ -134,7 +142,7 @@ const makeLineLevelProfilePlugin = (type: SourceFrame.SourceFrame.DecoratorType)
134
142
  return uiSourceCode.contentType().hasScripts();
135
143
  }
136
144
 
137
- private getLineMap(): Map<number, number>|undefined {
145
+ private getLineMap(): Map<number, number>|Map<number, Map<number, number>>|undefined {
138
146
  return this.uiSourceCode.getDecorationData(type);
139
147
  }
140
148
 
@@ -144,7 +152,7 @@ const makeLineLevelProfilePlugin = (type: SourceFrame.SourceFrame.DecoratorType)
144
152
  !map ? [] : [this.field.init(state => markersFromProfileData(map, state, type)), this.gutter, theme]);
145
153
  }
146
154
 
147
- override decorationChanged(type: SourceFrame.SourceFrame.DecoratorType, editor: TextEditor.TextEditor.TextEditor):
155
+ override decorationChanged(type: Workspace.UISourceCode.DecoratorType, editor: TextEditor.TextEditor.TextEditor):
148
156
  void {
149
157
  const installed = Boolean(editor.state.field(this.field, false));
150
158
  const map = this.getLineMap();
@@ -189,6 +197,6 @@ const theme = CodeMirror.EditorView.baseTheme({
189
197
  },
190
198
  });
191
199
 
192
- export const MemoryProfilePlugin = makeLineLevelProfilePlugin(SourceFrame.SourceFrame.DecoratorType.MEMORY);
200
+ export const MemoryProfilePlugin = makeLineLevelProfilePlugin(Workspace.UISourceCode.DecoratorType.MEMORY);
193
201
 
194
- export const PerformanceProfilePlugin = makeLineLevelProfilePlugin(SourceFrame.SourceFrame.DecoratorType.PERFORMANCE);
202
+ export const PerformanceProfilePlugin = makeLineLevelProfilePlugin(Workspace.UISourceCode.DecoratorType.PERFORMANCE);
@@ -238,6 +238,7 @@ export class UISourceCodeFrame extends Common.ObjectWrapper
238
238
  }
239
239
 
240
240
  override async setContent(content: string): Promise<void> {
241
+ this.#uiSourceCode.formatChanged(this.formattedMap);
241
242
  this.disposePlugins();
242
243
  this.loadPlugins();
243
244
  await super.setContent(content);
@@ -423,7 +424,7 @@ export class UISourceCodeFrame extends Common.ObjectWrapper
423
424
 
424
425
  private onDecorationChanged(event: Common.EventTarget.EventTargetEvent<string>): void {
425
426
  for (const plugin of this.plugins) {
426
- plugin.decorationChanged(event.data as SourceFrame.SourceFrame.DecoratorType, this.textEditor);
427
+ plugin.decorationChanged(event.data as Workspace.UISourceCode.DecoratorType, this.textEditor);
427
428
  }
428
429
  }
429
430
 
@@ -232,18 +232,6 @@ const UIStrings = {
232
232
  * @description Title of a setting under the Sources category that can be invoked through the Command Menu
233
233
  */
234
234
  doNotAutomaticallyRevealFilesIn: 'Do not automatically reveal files in sidebar',
235
- /**
236
- * @description Setting under the Sources category to toggle usage of JavaScript source maps.
237
- */
238
- javaScriptSourceMaps: 'JavaScript source maps',
239
- /**
240
- * @description Title of a setting under the Sources category that can be invoked through the Command Menu
241
- */
242
- enableJavaScriptSourceMaps: 'Enable JavaScript source maps',
243
- /**
244
- * @description Title of a setting under the Sources category that can be invoked through the Command Menu
245
- */
246
- disableJavaScriptSourceMaps: 'Disable JavaScript source maps',
247
235
  /**
248
236
  * @description Title of a setting under the Sources category.
249
237
  *'tab moves focus' is the name of the setting, which means that when the user
@@ -373,18 +361,6 @@ const UIStrings = {
373
361
  * @description Title of a setting under the Sources category that can be invoked through the Command Menu
374
362
  */
375
363
  doNotDisplayVariableValuesInline: 'Do not display variable values inline while debugging',
376
- /**
377
- * @description Title of a setting under the Sources category
378
- */
379
- cssSourceMaps: 'CSS source maps',
380
- /**
381
- * @description Title of a setting under the Sources category that can be invoked through the Command Menu
382
- */
383
- enableCssSourceMaps: 'Enable CSS source maps',
384
- /**
385
- * @description Title of a setting under the Sources category that can be invoked through the Command Menu
386
- */
387
- disableCssSourceMaps: 'Disable CSS source maps',
388
364
  /**
389
365
  * @description Title of a setting under the Sources category in Settings
390
366
  */
@@ -1556,25 +1532,6 @@ Common.Settings.registerSettingExtension({
1556
1532
  ],
1557
1533
  });
1558
1534
 
1559
- Common.Settings.registerSettingExtension({
1560
- category: Common.Settings.SettingCategory.SOURCES,
1561
- storageType: Common.Settings.SettingStorageType.SYNCED,
1562
- title: i18nLazyString(UIStrings.javaScriptSourceMaps),
1563
- settingName: 'js-source-maps-enabled',
1564
- settingType: Common.Settings.SettingType.BOOLEAN,
1565
- defaultValue: true,
1566
- options: [
1567
- {
1568
- value: true,
1569
- title: i18nLazyString(UIStrings.enableJavaScriptSourceMaps),
1570
- },
1571
- {
1572
- value: false,
1573
- title: i18nLazyString(UIStrings.disableJavaScriptSourceMaps),
1574
- },
1575
- ],
1576
- });
1577
-
1578
1535
  Common.Settings.registerSettingExtension({
1579
1536
  category: Common.Settings.SettingCategory.SOURCES,
1580
1537
  storageType: Common.Settings.SettingStorageType.SYNCED,
@@ -1799,25 +1756,6 @@ Common.Settings.registerSettingExtension({
1799
1756
  ],
1800
1757
  });
1801
1758
 
1802
- Common.Settings.registerSettingExtension({
1803
- category: Common.Settings.SettingCategory.SOURCES,
1804
- storageType: Common.Settings.SettingStorageType.SYNCED,
1805
- title: i18nLazyString(UIStrings.cssSourceMaps),
1806
- settingName: 'css-source-maps-enabled',
1807
- settingType: Common.Settings.SettingType.BOOLEAN,
1808
- defaultValue: true,
1809
- options: [
1810
- {
1811
- value: true,
1812
- title: i18nLazyString(UIStrings.enableCssSourceMaps),
1813
- },
1814
- {
1815
- value: false,
1816
- title: i18nLazyString(UIStrings.disableCssSourceMaps),
1817
- },
1818
- ],
1819
- });
1820
-
1821
1759
  Common.Settings.registerSettingExtension({
1822
1760
  category: Common.Settings.SettingCategory.SOURCES,
1823
1761
  storageType: Common.Settings.SettingStorageType.SYNCED,
@@ -14,15 +14,7 @@ The first method is to run DevTools! Load up the Chrome for Testing version that
14
14
 
15
15
  DevTools, navigate to the Performance Panel and record or import a trace. There are a number of trace files saved in `devtools-frontend/test/unittests/fixtures/traces` that you can use.
16
16
 
17
- #### Option 2: the components server
18
-
19
- You can also use the DevTools component server. This server runs standalone parts of DevTools in the browser. To do this, run `npm run components-server` in the terminal, which will run a server on `localhost:8090`.
20
-
21
- You can then navigate to the Performance Panel examples using the link on the index page. This runs the real Performance Panel code in isolation, and you can additionally preload a trace by appending `?trace=name-of-trace-file-from-fixtures`. This is a nicer development cycle because you do not have to manually import a trace after each change. Note though that some parts of the experience are stubbed, so you always should test your work in proper DevTools too.
22
-
23
- These examples can also be used to create screenshot tests, which are an important tool for the Performance Panel because it is the only way to test `<canvas>` output. We define these as interaction tests (`devtools-frontend/tests/interactions/panels/performance`).
24
-
25
- #### Option 3: bundled DevTools in the browser
17
+ #### Option 2: bundled DevTools in the browser
26
18
 
27
19
  This option loads the DevTools frontend in a browser tab in Chrome, but requires a little more setup to easily load traces.
28
20
 
@@ -135,13 +135,6 @@ const UIStrings = {
135
135
  const str_ = i18n.i18n.registerUIStrings('panels/timeline/ThreadAppender.ts', UIStrings);
136
136
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
137
137
 
138
- /**
139
- * This appender is only triggered when the Renderer handler is run. At
140
- * the moment this only happens in the basic component server example.
141
- * In the future, once this appender fully supports the behaviour of the
142
- * old engine's thread/sync tracks we can always run it by enabling the
143
- * Renderer and Samples handler by default.
144
- **/
145
138
  export class ThreadAppender implements TrackAppender {
146
139
  readonly appenderName: TrackAppenderName = 'Thread';
147
140
 
@@ -946,7 +946,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
946
946
  }
947
947
 
948
948
  const agent = conversationHandler.createAgent(AiAssistanceModel.AiHistoryStorage.ConversationType.PERFORMANCE);
949
- const conversation = new AiAssistanceModel.AiHistoryStorage.Conversation(
949
+ const conversation = new AiAssistanceModel.AiConversation.AiConversation(
950
950
  AiAssistanceModel.AiHistoryStorage.ConversationType.PERFORMANCE,
951
951
  [],
952
952
  agent.id,
@@ -1646,6 +1646,8 @@ export class TimelineUIUtils {
1646
1646
  private static renderEventJson(event: Trace.Types.Events.Event, contentHelper: TimelineDetailsContentHelper): void {
1647
1647
  contentHelper.addSection(i18nString(UIStrings.traceEvent));
1648
1648
 
1649
+ contentHelper.appendElementRow('eventKey', new Trace.EventsSerializer.EventsSerializer().keyForEvent(event) ?? '?');
1650
+
1649
1651
  const eventWithArgsFirst = {
1650
1652
  ...{args: event.args},
1651
1653
  ...event,
@@ -14,6 +14,7 @@ import * as Dialogs from '../../../ui/components/dialogs/dialogs.js';
14
14
  import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
15
15
  import * as UI from '../../../ui/legacy/legacy.js';
16
16
  import * as Lit from '../../../ui/lit/lit.js';
17
+ import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
17
18
 
18
19
  import exportTraceOptionsStyles from './exportTraceOptions.css.js';
19
20
 
@@ -44,6 +45,10 @@ const UIStrings = {
44
45
  * @description Text for the compression option.
45
46
  */
46
47
  shouldCompress: 'Compress with gzip',
48
+ /**
49
+ * @description Text for the explanation link
50
+ */
51
+ explanation: 'Explanation',
47
52
  /**
48
53
  * @description Text for the save trace button
49
54
  */
@@ -292,7 +297,16 @@ export class ExportTraceOptions extends HTMLElement {
292
297
  'script-source-maps',
293
298
  this.#includeSourceMapsCheckbox, i18nString(UIStrings.includeSourcemap), this.#state.includeSourceMaps): ''}
294
299
  ${this.#renderCheckbox('compress-with-gzip', this.#shouldCompressCheckbox, i18nString(UIStrings.shouldCompress), this.#state.shouldCompress)}
295
- <div class='export-trace-options-row'><div class='export-trace-blank'></div><devtools-button
300
+ <div class='export-trace-options-row export-trace-options-row-last'>
301
+ <div class="export-trace-explanation">
302
+ <x-link
303
+ href="https://developer.chrome.com/docs/devtools/performance/save-trace"
304
+ class=devtools-link
305
+ jslog=${VisualLogging.link().track({click: true, keydown:'Enter|Space'}).context('save-trace-explanation')}>
306
+ ${i18nString(UIStrings.explanation)}
307
+ </x-link>
308
+ </div>
309
+ <devtools-button
296
310
  class="setup-button"
297
311
  data-export-button
298
312
  @click=${this.#onExportClick.bind(this)}
@@ -58,6 +58,14 @@ const UIStrings = {
58
58
  * @description Title of a view that shows performance metrics from the local environment.
59
59
  */
60
60
  localMetrics: 'Local metrics',
61
+ /**
62
+ *@description Text for the link to the historical field data for the specific URL or origin that is shown. This link text appears in parenthesis after the collection period information in the field data dialog. The link opens the CrUX Vis viewer (https://cruxvis.withgoogle.com).
63
+ */
64
+ fieldDataHistoryLink: 'View history',
65
+ /**
66
+ *@description Tooltip for the CrUX Vis viewer link which shows the history of the field data for the specific URL or origin.
67
+ */
68
+ fieldDataHistoryTooltip: 'View field data history in CrUX Vis',
61
69
  /**
62
70
  * @description Accessible label for a section that logs user interactions and layout shifts. A layout shift is an event that shifts content in the layout of the page causing a jarring experience for the user.
63
71
  */
@@ -840,6 +848,32 @@ export class LiveMetricsView extends LegacyWrapper.LegacyWrapper.WrappableCompon
840
848
  });
841
849
  }
842
850
 
851
+ #renderFieldDataHistoryLink(): Lit.LitTemplate {
852
+ if (!this.#cruxManager.getConfigSetting().get().enabled) {
853
+ return Lit.nothing;
854
+ }
855
+ const normalizedUrl = this.#cruxManager.pageResult?.normalizedUrl;
856
+ if (!normalizedUrl) {
857
+ return Lit.nothing;
858
+ }
859
+ const tmp = new URL('https://cruxvis.withgoogle.com/');
860
+ tmp.searchParams.set('view', 'cwvsummary');
861
+ tmp.searchParams.set('url', normalizedUrl);
862
+ // identifier must be 'origin' or 'url'.
863
+ const identifier = this.#cruxManager.fieldPageScope;
864
+ tmp.searchParams.set('identifier', identifier);
865
+ // device must be one 'PHONE', 'DESKTOP', 'TABLET', or 'ALL'.
866
+ const device = this.#cruxManager.getSelectedDeviceScope();
867
+ tmp.searchParams.set('device', device);
868
+ const cruxVis = `${tmp.origin}/#/${tmp.search}`;
869
+ return html`
870
+ (<x-link href=${cruxVis}
871
+ class="local-field-link"
872
+ title=${i18nString(UIStrings.fieldDataHistoryTooltip)}
873
+ >${i18nString(UIStrings.fieldDataHistoryLink)}</x-link>)
874
+ `;
875
+ }
876
+
843
877
  #renderCollectionPeriod(): Lit.LitTemplate {
844
878
  const range = this.#getCollectionPeriodRange();
845
879
 
@@ -851,11 +885,13 @@ export class LiveMetricsView extends LegacyWrapper.LegacyWrapper.WrappableCompon
851
885
  PH1: dateEl,
852
886
  });
853
887
 
888
+ const fieldDataHistoryLink = range ? this.#renderFieldDataHistoryLink() : Lit.nothing;
889
+
854
890
  const warnings = this.#cruxManager.pageResult?.warnings || [];
855
891
 
856
892
  return html`
857
893
  <div class="field-data-message">
858
- <div>${message}</div>
894
+ <div>${message} ${fieldDataHistoryLink}</div>
859
895
  ${warnings.map(warning => html`
860
896
  <div class="field-data-warning">${warning}</div>
861
897
  `)}
@@ -19,13 +19,22 @@
19
19
  height: 24px;
20
20
  }
21
21
 
22
- .export-trace-blank {
22
+ .export-trace-explanation {
23
23
  flex: 1;
24
- min-width: var(--sys-size-25)
24
+ min-width: var(--sys-size-25);
25
25
  }
26
26
  }
27
27
 
28
+ .export-trace-options-row-last {
29
+ align-items: center;
30
+ }
31
+
28
32
  .info-tooltip-container {
29
33
  max-width: var(--sys-size-28);
30
34
  white-space: normal;
31
35
  }
36
+
37
+ x-link {
38
+ color: var(--sys-color-primary);
39
+ text-decoration-line: underline;
40
+ }
@@ -1,7 +1,7 @@
1
1
  Name: Dependencies sourced from the upstream `chromium` repository
2
2
  URL: https://chromium.googlesource.com/chromium/src
3
3
  Version: N/A
4
- Revision: ee4cd283ea61d6cd89c8035af63ff05876860e3a
4
+ Revision: 9964dcba17c15a0ec11126abaa933c551bae04d5
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE
@@ -69,6 +69,7 @@ export const markdownLinks = new Map<string, string>([
69
69
  ],
70
70
  ['storagePartitioningExplainer', 'https://developers.google.com/privacy-sandbox/cookies/storage-partitioning'],
71
71
  ['storageAccessAPI', 'https://developer.mozilla.org/en-US/docs/Web/API/StorageAccessHandle/createObjectURL'],
72
+ ['https://goo.gle/ps-status', 'https://goo.gle/ps-status'],
72
73
  ]);
73
74
 
74
75
  export const getMarkdownLink = (key: string): string => {
@@ -5,6 +5,7 @@
5
5
  import * as Platform from '../../core/platform/platform.js';
6
6
 
7
7
  import {Dialog} from './Dialog.js';
8
+ import {getEnclosingShadowRootForNode} from './DOMUtilities.js';
8
9
 
9
10
  let id = 0;
10
11
 
@@ -348,8 +349,7 @@ export function setActiveDescendant(element: Element, activedescendant: Element|
348
349
 
349
350
  if (activedescendant.isConnected && element.isConnected) {
350
351
  console.assert(
351
- Platform.DOMUtilities.getEnclosingShadowRootForNode(activedescendant) ===
352
- Platform.DOMUtilities.getEnclosingShadowRootForNode(element),
352
+ getEnclosingShadowRootForNode(activedescendant) === getEnclosingShadowRootForNode(element),
353
353
  'elements are not in the same shadow dom');
354
354
  }
355
355
 
@@ -215,6 +215,10 @@ export class Action extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
215
215
  return this.actionRegistration.bindings;
216
216
  }
217
217
 
218
+ configurableBindings(): boolean {
219
+ return this.actionRegistration.configurableBindings ?? true;
220
+ }
221
+
218
222
  experiment(): string|undefined {
219
223
  return this.actionRegistration.experiment;
220
224
  }
@@ -536,6 +540,13 @@ export interface ActionRegistration {
536
540
  * are flavors of the current appliaction context.
537
541
  */
538
542
  bindings?: Binding[];
543
+ /**
544
+ * Whether the action's bindings should be displayed for configuration in the
545
+ * Settings UI. Setting this to `false` will hide the action from the Shortcuts
546
+ * tab. Defaults to `true`.
547
+ */
548
+ // TODO(crbug.com/436764687): Consider removing this again if parametrized actions get moved to a separate mechanism
549
+ configurableBindings?: boolean;
539
550
  /**
540
551
  * The name of the experiment an action is associated with. Enabling and disabling the declared
541
552
  * experiment will enable and disable the action respectively.
@@ -5,12 +5,12 @@
5
5
 
6
6
  import type * as Common from '../../core/common/common.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
- import * as Platform from '../../core/platform/platform.js';
9
8
  import * as Geometry from '../../models/geometry/geometry.js';
10
9
  import * as IconButton from '../components/icon_button/icon_button.js';
11
10
  import * as VisualLogging from '../visual_logging/visual_logging.js';
12
11
 
13
12
  import * as ARIAUtils from './ARIAUtils.js';
13
+ import {appendStyle} from './DOMUtilities.js';
14
14
  import {AnchorBehavior, GlassPane, MarginBehavior, PointerEventsBehavior} from './GlassPane.js';
15
15
  import {ListControl, type ListDelegate, ListMode} from './ListControl.js';
16
16
  import {Events as ListModelEvents, type ItemsReplacedEvent, type ListModel} from './ListModel.js';
@@ -54,7 +54,7 @@ export class SoftDropDown<T> implements ListDelegate<T> {
54
54
  );
55
55
  }
56
56
  this.element.classList.add('soft-dropdown');
57
- Platform.DOMUtilities.appendStyle(this.element, softDropDownButtonStyles);
57
+ appendStyle(this.element, softDropDownButtonStyles);
58
58
  this.titleElement = this.element.createChild('span', 'title');
59
59
  const dropdownArrowIcon = IconButton.Icon.create('triangle-down');
60
60
  this.element.appendChild(dropdownArrowIcon);
@@ -38,6 +38,7 @@ import * as TextUtils from '../../models/text_utils/text_utils.js';
38
38
  import * as VisualLogging from '../visual_logging/visual_logging.js';
39
39
 
40
40
  import * as ARIAUtils from './ARIAUtils.js';
41
+ import {appendStyle, rangeOfWord} from './DOMUtilities.js';
41
42
  import {SuggestBox, type SuggestBoxDelegate, type Suggestion} from './SuggestBox.js';
42
43
  import textPromptStyles from './textPrompt.css.js';
43
44
  import {Tooltip} from './Tooltip.js';
@@ -344,7 +345,7 @@ export class TextPrompt extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
344
345
  this.boundClearAutocomplete = this.clearAutocomplete.bind(this);
345
346
  this.boundOnBlur = this.onBlur.bind(this);
346
347
  this.proxyElement = element.ownerDocument.createElement('span');
347
- Platform.DOMUtilities.appendStyle(this.proxyElement, textPromptStyles);
348
+ appendStyle(this.proxyElement, textPromptStyles);
348
349
  this.contentElement = this.proxyElement.createChild('div', 'text-prompt-root');
349
350
  this.proxyElement.style.display = this.proxyElementDisplay;
350
351
  if (element.parentElement) {
@@ -740,7 +741,7 @@ export class TextPrompt extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
740
741
  return;
741
742
  }
742
743
 
743
- const wordQueryRange = Platform.DOMUtilities.rangeOfWord(
744
+ const wordQueryRange = rangeOfWord(
744
745
  selectionRange.startContainer, selectionRange.startOffset, this.completionStopCharacters, this.element(),
745
746
  'backward');
746
747
 
@@ -45,6 +45,7 @@ import * as Lit from '../lit/lit.js';
45
45
  import * as VisualLogging from '../visual_logging/visual_logging.js';
46
46
 
47
47
  import * as ARIAUtils from './ARIAUtils.js';
48
+ import {appendStyle} from './DOMUtilities.js';
48
49
  import {type Config, InplaceEditor} from './InplaceEditor.js';
49
50
  import {Keys} from './KeyboardShortcut.js';
50
51
  import type {SearchableView} from './SearchableView.js';
@@ -428,7 +429,7 @@ export class TreeOutlineInShadow extends TreeOutline {
428
429
 
429
430
  registerRequiredCSS(...cssFiles: Array<string&{_tag: 'CSS-in-JS'}>): void {
430
431
  for (const cssFile of cssFiles) {
431
- Platform.DOMUtilities.appendStyle(this.shadowRoot, cssFile);
432
+ appendStyle(this.shadowRoot, cssFile);
432
433
  }
433
434
  }
434
435
 
@@ -53,6 +53,7 @@ import * as ARIAUtils from './ARIAUtils.js';
53
53
  import checkboxTextLabelStyles from './checkboxTextLabel.css.js';
54
54
  import confirmDialogStyles from './confirmDialog.css.js';
55
55
  import {Dialog} from './Dialog.js';
56
+ import {appendStyle, deepActiveElement, rangeOfWord} from './DOMUtilities.js';
56
57
  import {GlassPane, PointerEventsBehavior, SizeBehavior} from './GlassPane.js';
57
58
  import inspectorCommonStyles from './inspectorCommon.css.js';
58
59
  import {InspectorView} from './InspectorView.js';
@@ -358,7 +359,7 @@ export function isEditing(): boolean {
358
359
  return true;
359
360
  }
360
361
 
361
- const focused = Platform.DOMUtilities.deepActiveElement(document);
362
+ const focused = deepActiveElement(document);
362
363
  if (!focused) {
363
364
  return false;
364
365
  }
@@ -580,8 +581,8 @@ export function handleElementValueModifications(
580
581
  }
581
582
 
582
583
  const originalValue = element.textContent;
583
- const wordRange = Platform.DOMUtilities.rangeOfWord(
584
- selectionRange.startContainer, selectionRange.startOffset, StyleValueDelimiters, element);
584
+ const wordRange =
585
+ rangeOfWord(selectionRange.startContainer, selectionRange.startOffset, StyleValueDelimiters, element);
585
586
  const wordString = wordRange.toString();
586
587
 
587
588
  if (suggestionHandler?.(wordString)) {
@@ -655,8 +656,8 @@ export function addPlatformClass(element: HTMLElement): void {
655
656
  }
656
657
 
657
658
  export function installComponentRootStyles(element: HTMLElement): void {
658
- Platform.DOMUtilities.appendStyle(element, inspectorCommonStyles);
659
- Platform.DOMUtilities.appendStyle(element, Buttons.textButtonStyles);
659
+ appendStyle(element, inspectorCommonStyles);
660
+ appendStyle(element, Buttons.textButtonStyles);
660
661
 
661
662
  // Detect overlay scrollbar enable by checking for nonzero scrollbar width.
662
663
  if (!Host.Platform.isMac() && measuredScrollbarWidth(element.ownerDocument) === 0) {
@@ -681,7 +682,7 @@ export class ElementFocusRestorer {
681
682
  private previous: HTMLElement|null;
682
683
  constructor(element: Element) {
683
684
  this.element = (element as HTMLElement | null);
684
- this.previous = (Platform.DOMUtilities.deepActiveElement(element.ownerDocument) as HTMLElement | null);
685
+ this.previous = (deepActiveElement(element.ownerDocument) as HTMLElement | null);
685
686
  (element as HTMLElement).focus();
686
687
  }
687
688
 
@@ -1930,7 +1931,7 @@ function updateWidgetfocusWidgetForNode(node: Node|null): void {
1930
1931
  function focusChanged(event: Event): void {
1931
1932
  const target = event.target as HTMLElement;
1932
1933
  const document = target ? target.ownerDocument : null;
1933
- const element = document ? Platform.DOMUtilities.deepActiveElement(document) : null;
1934
+ const element = document ? deepActiveElement(document) : null;
1934
1935
  updateWidgetfocusWidgetForNode(element);
1935
1936
  }
1936
1937
 
@@ -1953,11 +1954,11 @@ export function createShadowRootWithCoreStyles(element: Element, options: {
1953
1954
  const {cssFile, delegatesFocus} = options;
1954
1955
 
1955
1956
  const shadowRoot = element.attachShadow({mode: 'open', delegatesFocus});
1956
- Platform.DOMUtilities.appendStyle(shadowRoot, inspectorCommonStyles, Buttons.textButtonStyles);
1957
+ appendStyle(shadowRoot, inspectorCommonStyles, Buttons.textButtonStyles);
1957
1958
  if (Array.isArray(cssFile)) {
1958
- Platform.DOMUtilities.appendStyle(shadowRoot, ...cssFile);
1959
+ appendStyle(shadowRoot, ...cssFile);
1959
1960
  } else if (cssFile) {
1960
- Platform.DOMUtilities.appendStyle(shadowRoot, cssFile);
1961
+ appendStyle(shadowRoot, cssFile);
1961
1962
  }
1962
1963
  shadowRoot.addEventListener('focus', focusChanged, true);
1963
1964
  return shadowRoot;
@@ -35,6 +35,7 @@ import * as Platform from '../../core/platform/platform.js';
35
35
  import * as Geometry from '../../models/geometry/geometry.js';
36
36
  import * as Lit from '../../ui/lit/lit.js';
37
37
 
38
+ import {appendStyle, deepActiveElement} from './DOMUtilities.js';
38
39
  import {cloneCustomElement, createShadowRootWithCoreStyles} from './UIUtils.js';
39
40
 
40
41
  // Remember the original DOM mutation methods here, since we
@@ -766,7 +767,7 @@ export class Widget {
766
767
 
767
768
  registerRequiredCSS(...cssFiles: Array<string&{_tag: 'CSS-in-JS'}>): void {
768
769
  for (const cssFile of cssFiles) {
769
- Platform.DOMUtilities.appendStyle(this.#shadowRoot ?? this.element, cssFile);
770
+ appendStyle(this.#shadowRoot ?? this.element, cssFile);
770
771
  }
771
772
  }
772
773
 
@@ -1106,7 +1107,7 @@ export class WidgetFocusRestorer {
1106
1107
  private previous: HTMLElement|null;
1107
1108
  constructor(widget: Widget) {
1108
1109
  this.widget = widget;
1109
- this.previous = (Platform.DOMUtilities.deepActiveElement(widget.element.ownerDocument) as HTMLElement | null);
1110
+ this.previous = (deepActiveElement(widget.element.ownerDocument) as HTMLElement | null);
1110
1111
  widget.focus();
1111
1112
  }
1112
1113