chrome-devtools-frontend 1.0.1548980 → 1.0.1549484

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 (188) hide show
  1. package/docs/contributing/settings-experiments-features.md +35 -0
  2. package/docs/styleguide/ux/patterns.md +27 -0
  3. package/eslint.config.mjs +1 -0
  4. package/front_end/Tests.js +2 -0
  5. package/front_end/core/host/InspectorFrontendHost.ts +26 -558
  6. package/front_end/core/host/InspectorFrontendHostAPI.ts +6 -3
  7. package/front_end/core/host/InspectorFrontendHostStub.ts +558 -0
  8. package/front_end/core/host/ResourceLoader.ts +9 -23
  9. package/front_end/core/host/UserMetrics.ts +4 -4
  10. package/front_end/core/root/DevToolsContext.ts +4 -0
  11. package/front_end/core/root/Runtime.ts +10 -0
  12. package/front_end/core/sdk/CSSMatchedStyles.ts +2 -2
  13. package/front_end/core/sdk/CSSModel.ts +24 -24
  14. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +11 -11
  15. package/front_end/core/sdk/CSSQuery.ts +1 -1
  16. package/front_end/core/sdk/CSSRule.ts +2 -2
  17. package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
  18. package/front_end/core/sdk/CSSStyleSheetHeader.ts +1 -1
  19. package/front_end/core/sdk/DOMModel.ts +3 -0
  20. package/front_end/core/sdk/NetworkManager.ts +29 -31
  21. package/front_end/core/sdk/NetworkRequest.ts +4 -0
  22. package/front_end/core/sdk/OverlayModel.ts +2 -2
  23. package/front_end/core/sdk/PageResourceLoader.ts +63 -37
  24. package/front_end/core/sdk/SourceMap.ts +6 -0
  25. package/front_end/core/sdk/SourceMapCache.ts +21 -0
  26. package/front_end/core/sdk/SourceMapManager.ts +7 -6
  27. package/front_end/core/sdk/SourceMapScopesInfo.ts +6 -2
  28. package/front_end/core/sdk/TargetManager.ts +14 -2
  29. package/front_end/core/sdk/sdk-meta.ts +13 -0
  30. package/front_end/entrypoints/formatter_worker/FormatterActions.ts +1 -0
  31. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +1 -1
  32. package/front_end/entrypoints/main/MainImpl.ts +13 -3
  33. package/front_end/foundation/Universe.ts +1 -1
  34. package/front_end/generated/Deprecation.ts +18 -4
  35. package/front_end/generated/InspectorBackendCommands.ts +33 -31
  36. package/front_end/generated/SupportedCSSProperties.js +41 -41
  37. package/front_end/generated/protocol-mapping.d.ts +12 -0
  38. package/front_end/generated/protocol-proxy-api.d.ts +11 -0
  39. package/front_end/generated/protocol.ts +70 -35
  40. package/front_end/models/ai_assistance/AiConversation.ts +5 -4
  41. package/front_end/models/ai_assistance/ChangeManager.ts +4 -4
  42. package/front_end/models/ai_assistance/ConversationHandler.ts +0 -15
  43. package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -6
  44. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +135 -3
  45. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +24 -0
  46. package/front_end/models/bindings/CompilerScriptMapping.ts +43 -0
  47. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +19 -0
  48. package/front_end/models/bindings/ResourceMapping.ts +73 -0
  49. package/front_end/models/bindings/ResourceScriptMapping.ts +50 -0
  50. package/front_end/models/issues_manager/GenericIssue.ts +17 -0
  51. package/front_end/models/issues_manager/descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
  52. package/front_end/models/javascript_metadata/NativeFunctions.js +7 -3
  53. package/front_end/models/source_map_scopes/FunctionCodeResolver.snapshot.txt +98 -0
  54. package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +270 -0
  55. package/front_end/models/source_map_scopes/source_map_scopes.ts +2 -0
  56. package/front_end/models/workspace/UISourceCode.ts +51 -44
  57. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +76 -34
  58. package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -0
  59. package/front_end/panels/ai_assistance/components/ChatView.ts +23 -11
  60. package/front_end/panels/application/AppManifestView.ts +3 -2
  61. package/front_end/panels/application/FrameDetailsView.ts +5 -6
  62. package/front_end/panels/application/ServiceWorkersView.ts +2 -2
  63. package/front_end/panels/application/TrustTokensTreeElement.ts +2 -6
  64. package/front_end/panels/application/components/PermissionsPolicySection.ts +201 -157
  65. package/front_end/panels/application/components/ProtocolHandlersView.ts +117 -80
  66. package/front_end/panels/application/components/ServiceWorkerRouterView.ts +47 -41
  67. package/front_end/panels/application/components/StorageMetadataView.ts +31 -34
  68. package/front_end/panels/application/components/TrustTokensView.ts +76 -68
  69. package/front_end/panels/console/ConsoleView.ts +3 -2
  70. package/front_end/panels/console/ConsoleViewMessage.ts +6 -4
  71. package/front_end/panels/console/console-meta.ts +0 -13
  72. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +3 -1
  73. package/front_end/panels/elements/CSSRuleValidator.ts +7 -7
  74. package/front_end/panels/elements/CSSRuleValidatorHelper.ts +2 -2
  75. package/front_end/panels/elements/ElementsTreeElement.ts +16 -13
  76. package/front_end/panels/elements/ElementsTreeOutline.ts +2 -1
  77. package/front_end/panels/elements/LayoutPane.ts +12 -10
  78. package/front_end/panels/elements/StylePropertyTreeElement.ts +12 -12
  79. package/front_end/panels/elements/components/AdornerManager.ts +3 -3
  80. package/front_end/panels/elements/components/StylePropertyEditor.ts +6 -6
  81. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +27 -49
  82. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +15 -11
  83. package/front_end/panels/media/PlayerListView.ts +100 -73
  84. package/front_end/panels/media/playerListView.css +5 -0
  85. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +3 -3
  86. package/front_end/panels/network/RequestConditionsDrawer.ts +5 -5
  87. package/front_end/panels/network/components/DirectSocketConnectionView.ts +17 -0
  88. package/front_end/panels/network/resourceChunkView.css +4 -0
  89. package/front_end/panels/security/CookieControlsView.ts +1 -1
  90. package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
  91. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
  92. package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
  93. package/front_end/panels/settings/SettingsScreen.ts +6 -6
  94. package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
  95. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +1 -1
  96. package/front_end/panels/snippets/SnippetsQuickOpen.ts +4 -2
  97. package/front_end/panels/sources/CSSPlugin.ts +1 -1
  98. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +13 -5
  99. package/front_end/panels/sources/GoToLineQuickOpen.ts +4 -2
  100. package/front_end/panels/sources/NavigatorView.ts +2 -2
  101. package/front_end/panels/sources/OpenFileQuickOpen.ts +7 -8
  102. package/front_end/panels/sources/OutlineQuickOpen.ts +6 -3
  103. package/front_end/panels/sources/ProfilePlugin.ts +21 -12
  104. package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
  105. package/front_end/panels/sources/filteredUISourceCodeListProvider.css +41 -0
  106. package/front_end/panels/timeline/TimelinePanel.ts +17 -18
  107. package/front_end/panels/timeline/TimelineSelectorStatsView.ts +3 -3
  108. package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
  109. package/front_end/panels/timeline/docs/flame_chart_migration.md +11 -16
  110. package/front_end/panels/utils/utils.ts +17 -3
  111. package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -20
  112. package/front_end/panels/whats_new/resources/WNDT.md +8 -8
  113. package/front_end/third_party/chromium/README.chromium +1 -1
  114. package/front_end/third_party/puppeteer/third_party/mitt/README.chromium +1 -0
  115. package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -0
  116. package/front_end/third_party/puppeteer/third_party/rxjs/README.chromium +1 -0
  117. package/front_end/ui/components/adorners/Adorner.ts +1 -1
  118. package/front_end/ui/components/annotations/AnnotationRepository.ts +98 -0
  119. package/front_end/ui/components/annotations/AnnotationType.ts +10 -0
  120. package/front_end/ui/components/annotations/annotations.ts +6 -0
  121. package/front_end/ui/components/buttons/Button.ts +1 -1
  122. package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
  123. package/front_end/ui/components/chrome_link/ChromeLink.ts +1 -1
  124. package/front_end/ui/components/dialogs/ButtonDialog.ts +1 -1
  125. package/front_end/ui/components/dialogs/Dialog.ts +1 -1
  126. package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -0
  127. package/front_end/ui/components/diff_view/DiffView.ts +1 -1
  128. package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
  129. package/front_end/ui/components/highlighting/HighlightElement.ts +1 -0
  130. package/front_end/ui/components/highlighting/MarkupHighlight.ts +162 -0
  131. package/front_end/ui/components/highlighting/highlighting.ts +7 -0
  132. package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
  133. package/front_end/ui/components/icon_button/Icon.ts +4 -2
  134. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  135. package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
  136. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -1
  137. package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +1 -1
  138. package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
  139. package/front_end/ui/components/list/List.ts +184 -0
  140. package/front_end/ui/components/list/list.css +90 -0
  141. package/front_end/ui/components/{cards/cards.ts → list/lists.ts} +3 -3
  142. package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
  143. package/front_end/ui/components/markdown_view/MarkdownImage.ts +1 -1
  144. package/front_end/ui/components/markdown_view/MarkdownLink.ts +1 -1
  145. package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -1
  146. package/front_end/ui/components/menus/Menu.ts +1 -1
  147. package/front_end/ui/components/menus/SelectMenu.ts +1 -1
  148. package/front_end/ui/components/node_text/NodeText.ts +1 -1
  149. package/front_end/ui/components/panel_feedback/FeedbackButton.ts +1 -1
  150. package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
  151. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
  152. package/front_end/ui/components/panel_introduction_steps/PanelIntroductionSteps.ts +1 -1
  153. package/front_end/ui/components/report_view/ReportView.ts +1 -1
  154. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
  155. package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
  156. package/front_end/ui/components/settings/SettingDeprecationWarning.ts +1 -1
  157. package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
  158. package/front_end/ui/components/spinners/Spinner.ts +1 -1
  159. package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
  160. package/front_end/ui/components/suggestion_input/SuggestionInput.ts +1 -0
  161. package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
  162. package/front_end/ui/components/switch/SwitchImpl.ts +1 -1
  163. package/front_end/ui/components/text_editor/TextEditor.ts +1 -0
  164. package/front_end/ui/components/text_prompt/TextPrompt.ts +1 -1
  165. package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
  166. package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -1
  167. package/front_end/ui/kit/kit.ts +5 -0
  168. package/front_end/ui/legacy/TabbedPane.ts +98 -0
  169. package/front_end/ui/legacy/UIUtils.ts +0 -184
  170. package/front_end/ui/legacy/ViewManager.ts +23 -8
  171. package/front_end/ui/legacy/ViewRegistration.ts +21 -22
  172. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +5 -4
  173. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +73 -35
  174. package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +11 -2
  175. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +12 -13
  176. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +7 -16
  177. package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +5 -6
  178. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +18 -65
  179. package/front_end/ui/legacy/components/source_frame/JSONView.ts +2 -1
  180. package/front_end/ui/legacy/tabbedPane.css +10 -0
  181. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  182. package/inspector_overlay/README.md +3 -3
  183. package/mcp/HostBindings.ts +310 -0
  184. package/mcp/mcp.ts +17 -0
  185. package/mcp/tsconfig.json +6 -1
  186. package/package.json +26 -24
  187. /package/front_end/ui/{components → kit}/cards/Card.ts +0 -0
  188. /package/front_end/ui/{components → kit}/cards/card.css +0 -0
@@ -2,6 +2,17 @@
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
4
 
5
+ // This file supports the gutter decorations visible in the Sources panel when a
6
+ // performance trace is active, showing either the runtime sample measures or the
7
+ // memory sampling (memory is behind the LiveHeapProfile experiment).
8
+ //
9
+ // When profiles are added, the associated UISourceCodes are given the profile data
10
+ // as decorations. The raw profile locations are mapped to original source files in
11
+ // this way.
12
+ //
13
+ // Note, while this is called "LineLevel", it's the profile data is actually granular
14
+ // to the column.
15
+
5
16
  import type * as Platform from '../../../../core/platform/platform.js';
6
17
  import * as SDK from '../../../../core/sdk/sdk.js';
7
18
  import type * as Protocol from '../../../../generated/protocol.js';
@@ -29,8 +40,12 @@ export class Performance {
29
40
  return performanceInstance;
30
41
  }
31
42
 
32
- reset(): void {
43
+ initialize(profiles: CPUProfile.CPUProfileDataModel.CPUProfileDataModel[], target: SDK.Target.Target|null): void {
33
44
  this.helper.reset();
45
+ for (const profile of profiles) {
46
+ this.appendCPUProfile(profile, target);
47
+ }
48
+ void this.helper.update();
34
49
  }
35
50
 
36
51
  private appendLegacyCPUProfile(
@@ -56,12 +71,13 @@ export class Performance {
56
71
  }
57
72
  }
58
73
 
59
- appendCPUProfile(profile: CPUProfile.CPUProfileDataModel.CPUProfileDataModel, target: SDK.Target.Target|null): void {
74
+ private appendCPUProfile(profile: CPUProfile.CPUProfileDataModel.CPUProfileDataModel, target: SDK.Target.Target|null):
75
+ void {
60
76
  if (!profile.lines) {
61
77
  this.appendLegacyCPUProfile(profile, target);
62
- this.helper.scheduleUpdate();
63
78
  return;
64
79
  }
80
+
65
81
  if (!profile.samples || !profile.columns) {
66
82
  return;
67
83
  }
@@ -83,12 +99,12 @@ export class Performance {
83
99
  const time = profile.timestamps[i] - profile.timestamps[i - 1];
84
100
  this.helper.addLocationData(target, scriptIdOrUrl, {line, column}, time);
85
101
  }
86
- this.helper.scheduleUpdate();
87
102
  }
88
103
  }
89
104
 
90
105
  let memoryInstance: Memory;
91
106
 
107
+ // Note: this is used only by LiveHeapProfile (a drawer panel) if the experiment is enabled.
92
108
  export class Memory {
93
109
  private readonly helper: Helper;
94
110
  private constructor() {
@@ -108,12 +124,23 @@ export class Memory {
108
124
 
109
125
  reset(): void {
110
126
  this.helper.reset();
127
+ void this.helper.update();
128
+ }
129
+
130
+ initialize(profilesAndTargets: Array<{
131
+ profile: Protocol.HeapProfiler.SamplingHeapProfile,
132
+ target: SDK.Target.Target,
133
+ }>): void {
134
+ this.helper.reset();
135
+ for (const {profile, target} of profilesAndTargets) {
136
+ this.appendHeapProfile(profile, target);
137
+ }
138
+ void this.helper.update();
111
139
  }
112
140
 
113
- appendHeapProfile(profile: Protocol.HeapProfiler.SamplingHeapProfile, target: SDK.Target.Target|null): void {
141
+ private appendHeapProfile(profile: Protocol.HeapProfiler.SamplingHeapProfile, target: SDK.Target.Target|null): void {
114
142
  const helper = this.helper;
115
143
  processNode(profile.head);
116
- helper.scheduleUpdate();
117
144
 
118
145
  function processNode(node: Protocol.HeapProfiler.SamplingHeapProfileNode): void {
119
146
  node.children.forEach(processNode);
@@ -125,8 +152,8 @@ export class Memory {
125
152
  return;
126
153
  }
127
154
  const line = node.callFrame.lineNumber + 1;
128
- // Since no column number is provided by the heap profile, default to 1 (beginning of line).
129
- helper.addLocationData(target, script, {line, column: 1}, node.selfSize);
155
+ const column = node.callFrame.columnNumber + 1;
156
+ helper.addLocationData(target, script, {line, column}, node.selfSize);
130
157
  }
131
158
  }
132
159
  }
@@ -134,13 +161,14 @@ export class Memory {
134
161
  export class Helper {
135
162
  private readonly type: Workspace.UISourceCode.DecoratorType;
136
163
  private readonly locationPool = new Bindings.LiveLocation.LiveLocationPool();
137
- private updateTimer: number|null = null;
164
+
138
165
  /**
139
166
  * Given a location in a script (with line and column numbers being 1-based) stores
140
167
  * the time spent at that location in a performance profile.
141
168
  */
142
- private locationData =
143
- new Map<SDK.Target.Target|null, Map<Platform.DevToolsPath.UrlString|number, Map<number, Map<number, number>>>>();
169
+ private locationData = new Map<
170
+ SDK.Target.Target|null,
171
+ Map<Platform.DevToolsPath.UrlString|number, Workspace.UISourceCode.LineColumnProfileMap>>();
144
172
  constructor(type: Workspace.UISourceCode.DecoratorType) {
145
173
  this.type = type;
146
174
  this.reset();
@@ -149,7 +177,6 @@ export class Helper {
149
177
  reset(): void {
150
178
  // The second map uses string keys for script URLs and numbers for scriptId.
151
179
  this.locationData = new Map();
152
- this.scheduleUpdate();
153
180
  }
154
181
 
155
182
  /**
@@ -176,20 +203,10 @@ export class Helper {
176
203
  lineData.set(column, (lineData.get(column) || 0) + data);
177
204
  }
178
205
 
179
- scheduleUpdate(): void {
180
- if (this.updateTimer) {
181
- return;
182
- }
183
- this.updateTimer = window.setTimeout(() => {
184
- this.updateTimer = null;
185
- void this.doUpdate();
186
- }, 0);
187
- }
188
-
189
- private async doUpdate(): Promise<void> {
206
+ async update(): Promise<void> {
190
207
  this.locationPool.disposeAll();
191
208
  // Map from sources to line->value profile maps.
192
- const decorationsBySource = new Map<Workspace.UISourceCode.UISourceCode, Map<number, Map<number, number>>>();
209
+ const decorationsBySource: Workspace.UISourceCode.ProfileDataMap = new Map();
193
210
  const pending: Array<Promise<void>> = [];
194
211
  for (const [target, scriptToLineMap] of this.locationData) {
195
212
  const debuggerModel = target ? target.model(SDK.DebuggerModel.DebuggerModel) : null;
@@ -211,18 +228,21 @@ export class Helper {
211
228
  String(scriptIdOrUrl) as Protocol.Runtime.ScriptId, zeroBasedLine, zeroBasedColumn || 0);
212
229
  if (rawLocation) {
213
230
  pending.push(workspaceBinding.rawLocationToUILocation(rawLocation).then(uiLocation => {
214
- if (uiLocation) {
215
- let lineMap = decorationsBySource.get(uiLocation.uiSourceCode);
216
- if (!lineMap) {
217
- lineMap = new Map<number, Map<number, number>>();
218
- decorationsBySource.set(uiLocation.uiSourceCode, lineMap);
219
- }
220
- let columnMap = lineMap.get(lineNumber);
221
- if (!columnMap) {
222
- columnMap = new Map<number, number>();
223
- lineMap.set(lineNumber, columnMap);
231
+ if (!uiLocation) {
232
+ return;
233
+ }
234
+
235
+ this.addLineColumnData(
236
+ decorationsBySource, uiLocation.uiSourceCode, uiLocation.lineNumber + 1,
237
+ (uiLocation.columnNumber ?? 0) + 1, data);
238
+
239
+ // If the above was a source mapped UILocation, then we also need to add it to the generated UILocation.
240
+ if (uiLocation.uiSourceCode.contentType().isFromSourceMap()) {
241
+ const script = rawLocation.script();
242
+ const uiSourceCode = script ? workspaceBinding.uiSourceCodeForScript(script) : null;
243
+ if (uiSourceCode) {
244
+ this.addLineColumnData(decorationsBySource, uiSourceCode, lineNumber, columnNumber, data);
224
245
  }
225
- columnMap.set((zeroBasedColumn || 0) + 1, data);
226
246
  }
227
247
  }));
228
248
  }
@@ -247,4 +267,22 @@ export class Helper {
247
267
  }
248
268
  }
249
269
  }
270
+
271
+ private addLineColumnData(
272
+ decorationsBySource: Workspace.UISourceCode.ProfileDataMap, uiSourceCode: Workspace.UISourceCode.UISourceCode,
273
+ lineOneIndexed: number, columnOneIndexed: number, data: number): void {
274
+ let lineMap = decorationsBySource.get(uiSourceCode);
275
+ if (!lineMap) {
276
+ lineMap = new Map();
277
+ decorationsBySource.set(uiSourceCode, lineMap);
278
+ }
279
+
280
+ let columnMap = lineMap.get(lineOneIndexed);
281
+ if (!columnMap) {
282
+ columnMap = new Map();
283
+ lineMap.set(lineOneIndexed, columnMap);
284
+ }
285
+
286
+ columnMap.set(columnOneIndexed, (columnMap.get(columnOneIndexed) ?? 0) + data);
287
+ }
250
288
  }
@@ -5,6 +5,7 @@
5
5
  import * as Common from '../../../../core/common/common.js';
6
6
  import * as Host from '../../../../core/host/host.js';
7
7
  import * as SDK from '../../../../core/sdk/sdk.js';
8
+ import type * as Protocol from '../../../../generated/protocol.js';
8
9
 
9
10
  import {Memory} from './LineLevelProfile.js';
10
11
 
@@ -64,15 +65,23 @@ export class LiveHeapProfile implements Common.Runnable.Runnable,
64
65
  if (sessionId !== this.sessionId) {
65
66
  break;
66
67
  }
67
- Memory.instance().reset();
68
+
69
+ const profilesAndTargets: Array<{
70
+ profile: Protocol.HeapProfiler.SamplingHeapProfile,
71
+ target: SDK.Target.Target,
72
+ }> = [];
68
73
  for (let i = 0; i < profiles.length; ++i) {
69
74
  const profile = profiles[i];
70
75
  if (!profile) {
71
76
  continue;
72
77
  }
73
78
 
74
- Memory.instance().appendHeapProfile(profile, models[i].target());
79
+ const target = models[i].target();
80
+ profilesAndTargets.push({profile, target});
75
81
  }
82
+
83
+ Memory.instance().initialize(profilesAndTargets);
84
+
76
85
  await Promise.race([
77
86
  new Promise(r => window.setTimeout(r, Host.InspectorFrontendHost.isUnderTest() ? 10 : 5000)),
78
87
  new Promise(r => {
@@ -201,7 +201,7 @@ export class CommandMenu {
201
201
  locations.set(name, category);
202
202
  }
203
203
  }
204
- const views = UI.ViewManager.getRegisteredViewExtensions();
204
+ const views = UI.ViewManager.ViewManager.instance().getRegisteredViewExtensions();
205
205
  for (const view of views) {
206
206
  const viewLocation = view.location();
207
207
  const category = viewLocation && locations.get(viewLocation);
@@ -340,19 +340,23 @@ export class CommandMenuProvider extends Provider {
340
340
  return score;
341
341
  }
342
342
 
343
- override renderItem(itemIndex: number, query: string, titleElement: Element, subtitleElement: Element): void {
343
+ override renderItem(itemIndex: number, query: string, wrapperElement: Element): void {
344
344
  const command = this.commands[itemIndex];
345
345
 
346
+ const itemElement = wrapperElement.createChild('div');
347
+ const titleElement = itemElement.createChild('div');
348
+
346
349
  titleElement.removeChildren();
347
350
  const icon = IconButton.Icon.create(categoryIcons[command.category]);
348
- titleElement.parentElement?.parentElement?.insertBefore(icon, titleElement.parentElement);
351
+ wrapperElement.insertBefore(icon, itemElement);
349
352
  UI.UIUtils.createTextChild(titleElement, command.title);
350
353
  FilteredListWidget.highlightRanges(titleElement, query, true);
351
354
 
355
+ const subtitleElement = itemElement.createChild('div');
352
356
  if (command.featurePromotionId) {
353
357
  const badge = UI.UIUtils.maybeCreateNewBadge(command.featurePromotionId);
354
358
  if (badge) {
355
- titleElement.parentElement?.insertBefore(badge, subtitleElement);
359
+ itemElement.insertBefore(badge, subtitleElement);
356
360
  }
357
361
  }
358
362
 
@@ -360,16 +364,11 @@ export class CommandMenuProvider extends Provider {
360
364
 
361
365
  const deprecationWarning = command.deprecationWarning;
362
366
  if (deprecationWarning) {
363
- const deprecatedTagElement = titleElement.parentElement?.createChild('span', 'deprecated-tag');
364
- if (deprecatedTagElement) {
365
- deprecatedTagElement.textContent = i18nString(UIStrings.deprecated);
366
- deprecatedTagElement.title = deprecationWarning;
367
- }
368
- }
369
- const tagElement = titleElement.parentElement?.parentElement?.createChild('span', 'tag');
370
- if (!tagElement) {
371
- return;
367
+ const deprecatedTagElement = itemElement.createChild('span', 'deprecated-tag');
368
+ deprecatedTagElement.textContent = i18nString(UIStrings.deprecated);
369
+ deprecatedTagElement.title = deprecationWarning;
372
370
  }
371
+ const tagElement = wrapperElement.createChild('span', 'tag');
373
372
  tagElement.textContent = command.category;
374
373
  }
375
374
 
@@ -9,6 +9,7 @@ import * as Platform from '../../../../core/platform/platform.js';
9
9
  import * as Geometry from '../../../../models/geometry/geometry.js';
10
10
  import * as TextUtils from '../../../../models/text_utils/text_utils.js';
11
11
  import * as Diff from '../../../../third_party/diff/diff.js';
12
+ import * as Highlighting from '../../../../ui/components/highlighting/highlighting.js';
12
13
  import * as TextPrompt from '../../../../ui/components/text_prompt/text_prompt.js';
13
14
  import * as VisualLogging from '../../../visual_logging/visual_logging.js';
14
15
  import * as UI from '../../legacy.js';
@@ -147,7 +148,7 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
147
148
  ranges = rangesForMatch(text.toUpperCase(), query.toUpperCase());
148
149
  }
149
150
  if (ranges) {
150
- UI.UIUtils.highlightRangesWithStyleClass(element, ranges, 'highlight');
151
+ Highlighting.highlightRangesWithStyleClass(element, ranges, 'highlight');
151
152
  return true;
152
153
  }
153
154
  return false;
@@ -282,20 +283,14 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
282
283
 
283
284
  createElementForItem(item: number): Element {
284
285
  const wrapperElement = document.createElement('div');
285
- wrapperElement.className = 'filtered-list-widget-item-wrapper';
286
-
287
- const itemElement = wrapperElement.createChild('div');
288
- const renderAsTwoRows = this.provider?.renderAsTwoRows();
289
- itemElement.className = 'filtered-list-widget-item ' + (renderAsTwoRows ? 'two-rows' : 'one-row');
290
- const titleElement = itemElement.createChild('div', 'filtered-list-widget-title');
291
- const subtitleElement = itemElement.createChild('div', 'filtered-list-widget-subtitle');
292
- subtitleElement.textContent = '\u200B';
286
+ wrapperElement.className = 'filtered-list-widget-item';
287
+
293
288
  if (this.provider) {
294
- this.provider.renderItem(item, this.cleanValue(), titleElement, subtitleElement);
289
+ this.provider.renderItem(item, this.cleanValue(), wrapperElement);
295
290
  wrapperElement.setAttribute(
296
291
  'jslog', `${VisualLogging.item(this.provider.jslogContextAt(item)).track({click: true})}`);
297
292
  }
298
- UI.ARIAUtils.markAsOption(itemElement);
293
+ UI.ARIAUtils.markAsOption(wrapperElement);
299
294
  return wrapperElement;
300
295
  }
301
296
 
@@ -627,17 +622,13 @@ export class Provider {
627
622
  return 1;
628
623
  }
629
624
 
630
- renderItem(_itemIndex: number, _query: string, _titleElement: Element, _subtitleElement: Element): void {
625
+ renderItem(_itemIndex: number, _query: string, _wrapperElement: Element): void {
631
626
  }
632
627
 
633
628
  jslogContextAt(_itemIndex: number): string {
634
629
  return this.jslogContext;
635
630
  }
636
631
 
637
- renderAsTwoRows(): boolean {
638
- return false;
639
- }
640
-
641
632
  selectItem(_itemIndex: number|null, _promptValue: string): void {
642
633
  }
643
634
 
@@ -44,13 +44,16 @@ export class HelpQuickOpen extends Provider {
44
44
  return -this.providers[itemIndex].prefix.length;
45
45
  }
46
46
 
47
- override renderItem(itemIndex: number, _query: string, titleElement: Element, _subtitleElement: Element): void {
47
+ override renderItem(itemIndex: number, _query: string, wrapperElement: Element): void {
48
48
  const provider = this.providers[itemIndex];
49
49
 
50
+ const itemElement = wrapperElement.createChild('div');
51
+ const titleElement = itemElement.createChild('div');
52
+
50
53
  const iconElement = new IconButton.Icon.Icon();
51
54
  iconElement.name = provider.iconName;
52
55
  iconElement.classList.add('large');
53
- titleElement.parentElement?.parentElement?.insertBefore(iconElement, titleElement.parentElement);
56
+ wrapperElement.insertBefore(iconElement, itemElement);
54
57
 
55
58
  UI.UIUtils.createTextChild(titleElement, provider.title);
56
59
  }
@@ -64,10 +67,6 @@ export class HelpQuickOpen extends Provider {
64
67
  QuickOpenImpl.show(this.providers[itemIndex].prefix);
65
68
  }
66
69
  }
67
-
68
- override renderAsTwoRows(): boolean {
69
- return false;
70
- }
71
70
  }
72
71
 
73
72
  registerProvider({
@@ -58,16 +58,20 @@ devtools-text-prompt {
58
58
  overflow: hidden auto;
59
59
  }
60
60
 
61
- .filtered-list-widget-item-wrapper {
61
+ .filtered-list-widget-item {
62
62
  color: var(--sys-color-on-surface);
63
63
  display: flex;
64
64
  font-family: ".SFNSDisplay-Regular", "Helvetica Neue", "Lucida Grande", sans-serif;
65
65
  padding: 0 var(--sys-size-7);
66
66
  gap: var(--sys-size-7);
67
67
  height: var(--sys-size-14);
68
+ white-space: break-spaces;
69
+ overflow: hidden;
70
+ text-overflow: ellipsis;
71
+ font-size: var(--sys-typescale-body4-size);
68
72
  }
69
73
 
70
- .filtered-list-widget-item-wrapper devtools-icon {
74
+ .filtered-list-widget-item devtools-icon {
71
75
  align-self: center;
72
76
  flex: none;
73
77
  width: 18px;
@@ -78,84 +82,38 @@ devtools-text-prompt {
78
82
  }
79
83
  }
80
84
 
81
- .filtered-list-widget-item-wrapper.selected {
85
+ .filtered-list-widget-item.selected {
82
86
  background-color: var(--sys-color-state-hover-on-subtle);
83
87
  }
84
88
 
85
- .filtered-list-widget-item {
86
- white-space: break-spaces;
87
- overflow: hidden;
88
- text-overflow: ellipsis;
89
- align-self: center;
90
- font-size: var(--sys-typescale-body4-size);
89
+ .filtered-list-widget-item > div {
91
90
  flex: auto;
92
- }
93
-
94
- .filtered-list-widget-item.is-ignore-listed * {
95
- color: var(--sys-color-state-disabled);
96
- }
97
-
98
- .filtered-list-widget-item span.highlight {
99
- font-weight: var(--ref-typeface-weight-bold);
100
- }
101
-
102
- .filtered-list-widget-item .filtered-list-widget-title {
103
91
  white-space: nowrap;
104
- flex: initial;
105
92
  overflow: hidden;
106
93
  text-overflow: ellipsis;
107
- }
108
-
109
- .filtered-list-widget-item .filtered-list-widget-subtitle {
110
- flex: none;
111
- overflow: hidden;
112
- text-overflow: ellipsis;
113
- color: var(--sys-color-on-surface-subtle);
114
- padding-left: var(--sys-size-3);
94
+ line-height: var(--sys-typescale-body3-line-height);
95
+ align-items: center;
96
+ align-content: center;
115
97
  display: flex;
116
- white-space: pre;
98
+ gap: var(--sys-size-4);
117
99
  }
118
100
 
119
- .filtered-list-widget-item .filtered-list-widget-subtitle .first-part {
120
- flex-shrink: 1000;
121
- overflow: hidden;
122
- text-overflow: ellipsis;
101
+ .filtered-list-widget-item span.highlight {
102
+ font-weight: var(--ref-typeface-weight-bold);
123
103
  }
124
104
 
125
- .filtered-list-widget-item-wrapper .tag {
105
+ .filtered-list-widget-item .tag {
126
106
  font-size: var(--sys-typescale-body5-size);
127
107
  line-height: var(--sys-typescale-headline5-line-height);
128
108
  align-self: center;
129
109
  flex-shrink: 0;
130
110
  }
131
111
 
132
- .filtered-list-widget-item-wrapper .deprecated-tag {
112
+ .filtered-list-widget-item .deprecated-tag {
133
113
  font-size: 11px;
134
114
  color: var(--sys-color-token-subtle);
135
115
  }
136
116
 
137
- .filtered-list-widget-item.one-row {
138
- line-height: var(--sys-typescale-body3-line-height);
139
- align-items: center;
140
- align-content: center;
141
- display: flex;
142
- gap: var(--sys-size-4);
143
- }
144
-
145
- .filtered-list-widget-item.one-row .filtered-list-widget-title {
146
- display: inline;
147
- }
148
-
149
- .filtered-list-widget-item.two-rows {
150
- display: grid;
151
- align-content: center;
152
- gap: var(--sys-size-2);
153
- }
154
-
155
- .filtered-list-widget-item-wrapper:not(.search-mode) .filtered-list-widget-item.two-rows .filtered-list-widget-title {
156
- font-weight: var(--ref-typeface-weight-bold);
157
- }
158
-
159
117
  .not-found-text {
160
118
  height: 34px;
161
119
  line-height: 34px;
@@ -179,18 +137,13 @@ devtools-text-prompt {
179
137
  border-color: ButtonText;
180
138
  }
181
139
 
182
- .filtered-list-widget-item-wrapper .filtered-list-widget-title,
183
- .filtered-list-widget-item-wrapper .filtered-list-widget-subtitle,
140
+ .filtered-list-widget-item,
184
141
  .quickpick-description {
185
142
  color: ButtonText;
186
143
  }
187
144
 
188
- .filtered-list-widget-item-wrapper.selected {
145
+ .filtered-list-widget-item.selected {
189
146
  background-color: Highlight;
190
- }
191
-
192
- .filtered-list-widget-item-wrapper.selected .filtered-list-widget-item .filtered-list-widget-title,
193
- .filtered-list-widget-item-wrapper.selected .filtered-list-widget-item .filtered-list-widget-subtitle {
194
147
  color: HighlightText;
195
148
  }
196
149
 
@@ -6,6 +6,7 @@
6
6
  import * as i18n from '../../../../core/i18n/i18n.js';
7
7
  import * as Platform from '../../../../core/platform/platform.js';
8
8
  import * as SDK from '../../../../core/sdk/sdk.js';
9
+ import * as Highlighting from '../../../components/highlighting/highlighting.js';
9
10
  import * as VisualLogging from '../../../visual_logging/visual_logging.js';
10
11
  import * as UI from '../../legacy.js';
11
12
  import * as ObjectUI from '../object_ui/object_ui.js';
@@ -172,7 +173,7 @@ export class JSONView extends UI.Widget.VBox implements UI.SearchableView.Search
172
173
  const newFocusElement = this.currentSearchTreeElements[index];
173
174
  if (newFocusElement) {
174
175
  this.updateSearchIndex(index);
175
- newFocusElement.setSearchRegex(this.searchRegex, UI.UIUtils.highlightedCurrentSearchResultClassName);
176
+ newFocusElement.setSearchRegex(this.searchRegex, Highlighting.highlightedCurrentSearchResultClassName);
176
177
  newFocusElement.reveal();
177
178
  } else {
178
179
  this.updateSearchIndex(0);
@@ -520,3 +520,13 @@
520
520
  --tabbed-pane-close-icon-color: HighlightText;
521
521
  }
522
522
  }
523
+
524
+ .tabbed-pane-header-tab.ai .ai-icon {
525
+ background-color: var(--sys-color-primary);
526
+ border-radius: 50%;
527
+ margin-left: 4px;
528
+ }
529
+
530
+ .tabbed-pane-header-tab.ai .ai-icon devtools-icon {
531
+ color: var(--sys-color-on-primary);
532
+ }
@@ -1754,6 +1754,9 @@ export const knownContextValues = new Set([
1754
1754
  'grid-gap',
1755
1755
  'grid-how',
1756
1756
  'grid-lanes',
1757
+ 'grid-lanes-direction',
1758
+ 'grid-lanes-fill',
1759
+ 'grid-lanes-flow',
1757
1760
  'grid-overlays',
1758
1761
  'grid-row',
1759
1762
  'grid-row-end',
@@ -5,7 +5,7 @@ Inspector Overlay provides JS/CSS modules which are responsible for rendering th
5
5
  ## How build works
6
6
 
7
7
  - Overlay modules are built using rollup and copied to $root_gen_dir.
8
- - CSS files are imported using a custom rollup plugin that transforms CSS into a CSSStyleSheet. *Only use CSS imports in the bundle entrypoint*.
8
+ - CSS files are imported using a custom rollup plugin that transforms CSS into a CSSStyleSheet. _Only use CSS imports in the bundle entrypoint_.
9
9
  - `inspector_overlay_resources.grd` file is copied as well and it defines how modules are packaged in a `.pak` file.
10
10
  - The Chromium build uses `inspector_overlay_resources.grd` and produces a `.pak` file.
11
11
  - `inspector_overlay_agent.cc` extracts the modules and inlines them onto the overlay page.
@@ -41,7 +41,7 @@ generated modules and notify you if they are too big.
41
41
 
42
42
  ## Tests
43
43
 
44
- Overlay modules can be unit tested like other parts of DevTools. For an example, see `test/unittests/front_end/inspector_overlay/common_test.ts`.
44
+ Overlay modules can be unit tested like other parts of DevTools. For an example, see `test/unittests/front_end/inspector_overlay/common.test.ts`.
45
45
 
46
46
  ## Lifecycle of the overlay
47
47
 
@@ -56,4 +56,4 @@ Then when the overlay is being painted, the following calls are made by the back
56
56
  - `reset(params)` to notify the overlay about actual params of the page such as viewport size, device scale factor and others.
57
57
  - Invokes tool-specific methods such as `drawHighlight`.
58
58
 
59
- In the overlay code, these calls are received through a global `dispatch(methodName, ...args)` function.
59
+ In the overlay code, these calls are received through a global `dispatch(methodName, ...args)` function.