chrome-devtools-frontend 1.0.1544076 → 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 (178) hide show
  1. package/config/typescript/tsconfig.eslint.json +1 -0
  2. package/docs/styleguide/ux/styles.md +1 -1
  3. package/eslint.config.mjs +1 -1
  4. package/front_end/Images/src/arrow-down.svg +8 -1
  5. package/front_end/Images/src/arrow-up.svg +8 -1
  6. package/front_end/core/common/ParsedURL.ts +1 -1
  7. package/front_end/core/common/common.ts +0 -2
  8. package/front_end/core/host/AidaClient.ts +1 -1
  9. package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
  10. package/front_end/core/host/UserMetrics.ts +0 -5
  11. package/front_end/core/platform/HostRuntime.ts +18 -0
  12. package/front_end/core/platform/KeyboardUtilities.ts +2 -2
  13. package/front_end/core/platform/StringUtilities.ts +1 -1
  14. package/front_end/core/platform/api/HostRuntime.ts +20 -0
  15. package/front_end/core/platform/api/api.ts +7 -0
  16. package/front_end/core/platform/browser/HostRuntime.ts +14 -0
  17. package/front_end/core/platform/browser/browser.ts +7 -0
  18. package/front_end/core/platform/node/HostRuntime.ts +13 -0
  19. package/front_end/core/platform/node/node.ts +7 -0
  20. package/front_end/core/platform/platform.ts +2 -2
  21. package/front_end/core/protocol_client/CDPConnection.ts +3 -3
  22. package/front_end/core/protocol_client/DevToolsCDPConnection.ts +2 -1
  23. package/front_end/core/sdk/CSSMetadata.ts +17 -5
  24. package/front_end/core/sdk/NetworkManager.ts +6 -8
  25. package/front_end/core/sdk/NetworkRequest.ts +4 -0
  26. package/front_end/core/sdk/SDKModel.ts +4 -2
  27. package/front_end/core/sdk/SourceMapScopesInfo.ts +141 -23
  28. package/front_end/core/sdk/Target.ts +5 -14
  29. package/front_end/core/sdk/TargetManager.ts +39 -18
  30. package/front_end/core/sdk/sdk-meta.ts +62 -0
  31. package/front_end/devtools_compatibility.js +0 -1
  32. package/front_end/entrypoints/main/MainImpl.ts +2 -2
  33. package/front_end/foundation/Universe.ts +2 -2
  34. package/front_end/generated/Deprecation.ts +11 -0
  35. package/front_end/generated/InspectorBackendCommands.ts +3 -6
  36. package/front_end/generated/SupportedCSSProperties.js +4 -25
  37. package/front_end/generated/protocol-mapping.d.ts +0 -15
  38. package/front_end/generated/protocol-proxy-api.d.ts +0 -11
  39. package/front_end/generated/protocol.ts +5 -36
  40. package/front_end/models/ai_assistance/AiConversation.ts +188 -0
  41. package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -172
  42. package/front_end/models/ai_assistance/ConversationHandler.ts +5 -5
  43. package/front_end/models/ai_assistance/agents/AiAgent.ts +1 -3
  44. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +6 -2
  45. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
  46. package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -9
  47. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  48. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +313 -313
  49. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +8 -6
  50. package/front_end/models/ai_assistance/performance/AICallTree.snapshot.txt +33 -33
  51. package/front_end/models/ai_assistance/performance/AICallTree.ts +9 -3
  52. package/front_end/models/bindings/CSSWorkspaceBinding.ts +5 -3
  53. package/front_end/models/bindings/SASSSourceMapping.ts +6 -4
  54. package/front_end/models/cpu_profile/CPUProfileDataModel.ts +10 -7
  55. package/front_end/models/crux-manager/CrUXManager.ts +7 -4
  56. package/front_end/models/issues_manager/GenericIssue.ts +12 -9
  57. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
  58. package/front_end/models/trace/handlers/SamplesHandler.ts +3 -0
  59. package/front_end/models/trace/helpers/Trace.ts +13 -0
  60. package/front_end/models/trace/types/TraceEvents.ts +2 -1
  61. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +29 -0
  62. package/front_end/models/workspace/IgnoreListManager.ts +1 -2
  63. package/front_end/models/workspace/UISourceCode.ts +50 -0
  64. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +11 -10
  65. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +8 -0
  66. package/front_end/panels/ai_assistance/components/ChatView.ts +2 -2
  67. package/front_end/panels/ai_assistance/components/UserActionRow.ts +2 -1
  68. package/front_end/panels/animation/AnimationTimeline.ts +0 -8
  69. package/front_end/panels/application/ApplicationPanelSidebar.ts +6 -7
  70. package/front_end/panels/application/{components/FrameDetailsView.ts → FrameDetailsView.ts} +140 -171
  71. package/front_end/panels/application/{components/OriginTrialTreeView.ts → OriginTrialTreeView.ts} +9 -9
  72. package/front_end/panels/application/application.ts +4 -0
  73. package/front_end/panels/application/components/StackTrace.ts +89 -88
  74. package/front_end/panels/application/components/components.ts +2 -4
  75. package/front_end/panels/application/{components/frameDetailsReportView.css → frameDetailsReportView.css} +5 -1
  76. package/front_end/panels/common/AiCodeGenerationTeaser.ts +80 -0
  77. package/front_end/panels/common/BadgeNotification.ts +2 -1
  78. package/front_end/panels/common/DOMLinkifier.ts +7 -2
  79. package/front_end/panels/common/GdpSignUpDialog.ts +2 -1
  80. package/front_end/panels/common/common.ts +2 -1
  81. package/front_end/panels/console/ConsolePrompt.ts +3 -1
  82. package/front_end/panels/console/ConsoleViewport.ts +1 -2
  83. package/front_end/panels/elements/ElementIssueUtils.ts +2 -2
  84. package/front_end/panels/elements/ElementStatePaneWidget.ts +2 -1
  85. package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
  86. package/front_end/panels/elements/StylePropertyTreeElement.ts +23 -19
  87. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  88. package/front_end/panels/elements/cssValueTraceView.css +1 -1
  89. package/front_end/panels/elements/elements-meta.ts +1 -22
  90. package/front_end/panels/explain/components/ConsoleInsight.ts +44 -57
  91. package/front_end/panels/explain/components/consoleInsight.css +46 -1
  92. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +1 -2
  93. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +3 -6
  94. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +19 -0
  95. package/front_end/panels/network/RequestConditionsDrawer.ts +54 -24
  96. package/front_end/panels/network/networkLogView.css +11 -0
  97. package/front_end/panels/network/networkTimingTable.css +8 -6
  98. package/front_end/panels/network/requestConditionsDrawer.css +10 -1
  99. package/front_end/panels/profiler/ProfilesPanel.ts +1 -2
  100. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +2 -1
  101. package/front_end/panels/settings/KeybindsSettingsTab.ts +20 -21
  102. package/front_end/panels/settings/SettingsScreen.ts +3 -2
  103. package/front_end/panels/sources/CoveragePlugin.ts +5 -5
  104. package/front_end/panels/sources/Plugin.ts +1 -1
  105. package/front_end/panels/sources/ProfilePlugin.ts +22 -14
  106. package/front_end/panels/sources/UISourceCodeFrame.ts +2 -1
  107. package/front_end/panels/sources/sources-meta.ts +0 -62
  108. package/front_end/panels/timeline/README.md +1 -9
  109. package/front_end/panels/timeline/ThreadAppender.ts +0 -7
  110. package/front_end/panels/timeline/TimelinePanel.ts +1 -1
  111. package/front_end/panels/timeline/TimelineUIUtils.ts +2 -0
  112. package/front_end/panels/timeline/components/ExportTraceOptions.ts +15 -1
  113. package/front_end/panels/timeline/components/LiveMetricsView.ts +51 -6
  114. package/front_end/panels/timeline/components/MetricCard.ts +2 -2
  115. package/front_end/panels/timeline/components/exportTraceOptions.css +11 -2
  116. package/front_end/panels/timeline/components/insights/NodeLink.ts +2 -3
  117. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -1
  118. package/front_end/panels/timeline/timeline-meta.ts +0 -10
  119. package/front_end/panels/timeline/timeline.ts +0 -2
  120. package/front_end/panels/whats_new/ReleaseNoteView.ts +2 -1
  121. package/front_end/panels/whats_new/WhatsNewImpl.ts +3 -2
  122. package/front_end/third_party/chromium/README.chromium +1 -1
  123. package/front_end/tsconfig.json +1 -0
  124. package/front_end/ui/components/buttons/Button.docs.ts +6 -5
  125. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +1 -0
  126. package/front_end/ui/components/snackbars/Snackbars.docs.ts +1 -1
  127. package/front_end/ui/components/spinners/Spinners.docs.ts +1 -1
  128. package/front_end/ui/components/survey_link/SurveyLink.docs.ts +2 -1
  129. package/front_end/ui/components/switch/Switch.docs.ts +1 -1
  130. package/front_end/ui/components/tooltips/Tooltip.docs.ts +3 -3
  131. package/front_end/ui/helpers/OpenInNewTab.ts +87 -0
  132. package/front_end/ui/helpers/helpers.ts +5 -0
  133. package/front_end/ui/legacy/ARIAUtils.ts +2 -2
  134. package/front_end/ui/legacy/ActionRegistration.ts +11 -0
  135. package/front_end/ui/legacy/ContextMenu.docs.ts +12 -11
  136. package/front_end/ui/legacy/RadioButton.docs.ts +1 -1
  137. package/front_end/ui/legacy/SelectMenu.docs.ts +1 -1
  138. package/front_end/ui/legacy/Slider.docs.ts +1 -1
  139. package/front_end/ui/legacy/SoftDropDown.ts +2 -2
  140. package/front_end/ui/legacy/TextPrompt.ts +3 -2
  141. package/front_end/ui/legacy/Treeoutline.ts +2 -1
  142. package/front_end/ui/legacy/UIUtils.ts +11 -43
  143. package/front_end/ui/legacy/Widget.ts +3 -2
  144. package/front_end/ui/legacy/XLink.ts +4 -4
  145. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +2 -1
  146. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +2 -2
  147. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +144 -143
  148. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +62 -39
  149. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +1 -1
  150. package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +2 -2
  151. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -7
  152. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +1 -2
  153. package/front_end/ui/legacy/components/utils/Linkifier.ts +2 -1
  154. package/front_end/ui/legacy/inspectorCommon.css +2 -2
  155. package/front_end/ui/legacy/legacy.ts +2 -0
  156. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  157. package/mcp/tsconfig.json +16 -0
  158. package/package.json +2 -2
  159. package/front_end/core/common/Linkifier.ts +0 -55
  160. package/front_end/panels/explain/components/consoleInsightSourcesList.css +0 -51
  161. package/front_end/panels/timeline/CLSLinkifier.ts +0 -58
  162. package/front_end/ui/components/docs/README.md +0 -6
  163. package/front_end/ui/components/docs/building-ui-documentation/ComponentEvents.md +0 -54
  164. package/front_end/ui/components/docs/building-ui-documentation/ComponentPerformance.md +0 -136
  165. package/front_end/ui/components/docs/building-ui-documentation/CreatingComponents.md +0 -242
  166. package/front_end/ui/components/docs/building-ui-documentation/README.md +0 -23
  167. package/front_end/ui/components/docs/building-ui-documentation/StylingComponents.md +0 -66
  168. package/front_end/ui/components/docs/building-ui-documentation/TestingComponents.md +0 -111
  169. package/front_end/ui/components/docs/component_docs.ts +0 -24
  170. package/front_end/ui/components/docs/component_docs_styles.css +0 -53
  171. package/front_end/ui/components/docs/create_breadcrumbs.ts +0 -44
  172. package/front_end/ui/components/docs/slider/basic.html +0 -20
  173. package/front_end/ui/components/docs/switch/basic.html +0 -20
  174. /package/front_end/models/issues_manager/descriptions/{genericFormAriaLabelledByToNonExistingId.md → genericFormAriaLabelledByToNonExistingIdError.md} +0 -0
  175. /package/front_end/models/issues_manager/descriptions/{genericFormLabelHasNeitherForNorNestedInput.md → genericFormLabelHasNeitherForNorNestedInputError.md} +0 -0
  176. /package/front_end/panels/application/{components/originTrialTokenRows.css → originTrialTokenRows.css} +0 -0
  177. /package/front_end/panels/application/{components/originTrialTreeView.css → originTrialTreeView.css} +0 -0
  178. /package/front_end/{core/platform → ui/legacy}/DOMUtilities.ts +0 -0
@@ -675,7 +675,7 @@ Network requests data:
675
675
 
676
676
  static callFrameDataFormatDescription = `Each call frame is presented in the following format:
677
677
 
678
- 'id;eventKey;name;duration;selfTime;urlIndex;childRange;[S]'
678
+ 'id;eventKey;name;duration;selfTime;urlIndex;childRange;[line];[column];[S]'
679
679
 
680
680
  Key definitions:
681
681
 
@@ -686,15 +686,17 @@ Key definitions:
686
686
  * selfTime: The time spent directly within the call frame, excluding its children's execution.
687
687
  * urlIndex: Index referencing the "All URLs" list. Empty if no specific script URL is associated.
688
688
  * childRange: Specifies the direct children of this node using their IDs. If empty ('' or 'S' at the end), the node has no children. If a single number (e.g., '4'), the node has one child with that ID. If in the format 'firstId-lastId' (e.g., '4-5'), it indicates a consecutive range of child IDs from 'firstId' to 'lastId', inclusive.
689
+ * line: An optional field for a call frame's line number. This is where the function is defined.
690
+ * column: An optional field for a call frame's column number. This is where the function is defined.
689
691
  * S: _Optional_. The letter 'S' terminates the line if that call frame was selected by the user.
690
692
 
691
693
  Example Call Tree:
692
694
 
693
- 1;r-123;main;500;100;;
694
- 2;r-124;update;200;50;;3
695
- 3;p-49575-15428179-2834-374;animate;150;20;0;4-5;S
696
- 4;p-49575-15428179-3505-1162;calculatePosition;80;80;;
697
- 5;p-49575-15428179-5391-2767;applyStyles;50;50;;
695
+ 1;r-123;main;500;100;0;1;;
696
+ 2;r-124;update;200;50;;3;0;1;
697
+ 3;p-49575-15428179-2834-374;animate;150;20;0;4-5;0;1;S
698
+ 4;p-49575-15428179-3505-1162;calculatePosition;80;80;0;1;;
699
+ 5;p-49575-15428179-5391-2767;applyStyles;50;50;0;1;;
698
700
  `;
699
701
 
700
702
  /**
@@ -9,14 +9,14 @@ Content:
9
9
 
10
10
  # Call tree:
11
11
 
12
- 1;p-1-1-0-2;(anonymous);2370;;0;2
13
- 2;p-1-1-0-3;executeUserEntryPoint;2370;;1;3
14
- 3;p-1-1-0-4;Module._load;2370;;2;4
15
- 4;p-1-1-0-5;Module.load;2370;;2;5
16
- 5;p-1-1-0-6;Module._extensions..js;2370;;2;6
17
- 6;p-1-1-0-7;Module._compile;2370;;2;7
18
- 7;p-1-1-0-8;callAndPauseOnStart;2370;;;8;S
19
- 8;p-1-1-0-9;(anonymous);2370;2370;3;
12
+ 1;p-1-1-0-2;(anonymous);2370;;0;2;0;0
13
+ 2;p-1-1-0-3;executeUserEntryPoint;2370;;1;3;126;30
14
+ 3;p-1-1-0-4;Module._load;2370;;2;4;949;23
15
+ 4;p-1-1-0-5;Module.load;2370;;2;5;1193;32
16
+ 5;p-1-1-0-6;Module._extensions..js;2370;;2;6;1388;36
17
+ 6;p-1-1-0-7;Module._compile;2370;;2;7;1329;36
18
+ 7;p-1-1-0-8;callAndPauseOnStart;2370;;;8;;;S
19
+ 8;p-1-1-0-9;(anonymous);2370;2370;3;;0;0
20
20
  === end content
21
21
 
22
22
  Title: AICallTree serializes a simple tree
@@ -27,12 +27,12 @@ Content:
27
27
 
28
28
  # Call tree:
29
29
 
30
- 1;r-36071;Task;0.2;;;2
31
- 2;r-36072;Timer fired;0.2;;;3
32
- 3;r-36076;Function call;0.2;;0;4
33
- 4;p-74406-259-16342-528;_ds.q.ns;0.2;;0;5;S
34
- 5;p-74406-259-16342-529;clearTimeout;0.2;0;;6
35
- 6;r-36082;Recalculate style;0.2;0.2;;
30
+ 1;r-36071;Task;0.2;;;2;;
31
+ 2;r-36072;Timer fired;0.2;;;3;;
32
+ 3;r-36076;Function call;0.2;;0;4;190;175
33
+ 4;p-74406-259-16342-528;_ds.q.ns;0.2;;0;5;190;175;S
34
+ 5;p-74406-259-16342-529;clearTimeout;0.2;0;;6;;
35
+ 6;r-36082;Recalculate style;0.2;0.2;0;;136;87
36
36
  === end content
37
37
 
38
38
  Title: AICallTree serializes a simple tree in a concise format
@@ -43,12 +43,12 @@ Content:
43
43
 
44
44
  # Call tree:
45
45
 
46
- 1;r-36071;Task;0.2;;;2
47
- 2;r-36072;Timer fired;0.2;;;3
48
- 3;r-36076;Function call;0.2;;0;4
49
- 4;p-74406-259-16342-528;_ds.q.ns;0.2;;0;5;S
50
- 5;p-74406-259-16342-529;clearTimeout;0.2;0;;6
51
- 6;r-36082;Recalculate style;0.2;0.2;;
46
+ 1;r-36071;Task;0.2;;;2;;
47
+ 2;r-36072;Timer fired;0.2;;;3;;
48
+ 3;r-36076;Function call;0.2;;0;4;190;175
49
+ 4;p-74406-259-16342-528;_ds.q.ns;0.2;;0;5;190;175;S
50
+ 5;p-74406-259-16342-529;clearTimeout;0.2;0;;6;;
51
+ 6;r-36082;Recalculate style;0.2;0.2;0;;136;87
52
52
  === end content
53
53
 
54
54
  Title: AICallTree serializes a tree in a concise format
@@ -59,17 +59,17 @@ Content:
59
59
 
60
60
  # Call tree:
61
61
 
62
- 1;r-5764;Task;0.9;0;;2;S
63
- 2;r-5765;Timer fired;0.9;0;;3
64
- 3;r-5766;Function call;0.9;0.1;0;4
65
- 4;p-73704-775-2873-705;(anonymous);0.8;;0;5
66
- 5;p-73704-775-2873-706;(anonymous);0.8;;0;6-8
67
- 6;p-73704-775-2873-707;Ot.getEntriesByType;0.1;;0;8
68
- 7;p-73704-775-2874-709;le.createOobTrace;0.6;0.2;0;9-11
69
- 8;p-73704-775-2873-708;getEntriesByType;0.1;0.1;;
70
- 9;p-73704-775-2875-710;le;0.1;0.1;0;
71
- 10;p-73704-775-2877-711;ie;0.2;;0;11-13
72
- 11;p-73704-775-2877-712;Ot.requiredApisAvailable;0.2;0.2;0;
73
- 12;p-73704-775-2879-713;oe;0;;0;13
74
- 13;p-73704-775-2879-714;setTimeout;0;0;;
62
+ 1;r-5764;Task;0.9;0;;2;;;S
63
+ 2;r-5765;Timer fired;0.9;0;;3;;
64
+ 3;r-5766;Function call;0.9;0.1;0;4;0;32324
65
+ 4;p-73704-775-2873-705;(anonymous);0.8;;0;5;0;32324
66
+ 5;p-73704-775-2873-706;(anonymous);0.8;;0;6-8;0;32342
67
+ 6;p-73704-775-2873-707;Ot.getEntriesByType;0.1;;0;8;0;20337
68
+ 7;p-73704-775-2874-709;le.createOobTrace;0.6;0.2;0;9-11;0;30481
69
+ 8;p-73704-775-2873-708;getEntriesByType;0.1;0.1;;;;
70
+ 9;p-73704-775-2875-710;le;0.1;0.1;0;;0;31269
71
+ 10;p-73704-775-2877-711;ie;0.2;;0;11-13;0;25861
72
+ 11;p-73704-775-2877-712;Ot.requiredApisAvailable;0.2;0.2;0;;0;20761
73
+ 12;p-73704-775-2879-713;oe;0;;0;13;0;26165
74
+ 13;p-73704-775-2879-714;setTimeout;0;0;;;;
75
75
  === end content
@@ -286,10 +286,12 @@ export class AICallTree {
286
286
  * 5. `urlIndex`: An index referencing a URL in the `allUrls` array. If no URL is present, this is an empty string.
287
287
  * 6. `childRange`: A string indicating the range of IDs for the node's children. Children should always have consecutive IDs.
288
288
  * If there is only one child, it's a single ID.
289
- * 7. `[S]`: An optional marker indicating that this node is the selected node.
289
+ * 7. `[line]`: An optional field for a call frame's line number.
290
+ * 8. `[column]`: An optional field for a call frame's column number.
291
+ * 9. `[S]`: An optional marker indicating that this node is the selected node.
290
292
  *
291
293
  * Example:
292
- * `1;Parse HTML;2.5;0.3;0;2-5;S`
294
+ * `1;Parse HTML;2.5;0.3;0;2-5;10;11;S`
293
295
  * This represents:
294
296
  * - Node ID 1
295
297
  * - Name "Parse HTML"
@@ -297,6 +299,7 @@ export class AICallTree {
297
299
  * - Self time of 0.3ms
298
300
  * - URL index 0 (meaning the URL is the first one in the `allUrls` array)
299
301
  * - Child range of IDs 2 to 5
302
+ * - Line, column is 10:11
300
303
  * - This node is the selected node (S marker)
301
304
  */
302
305
  stringifyNode(
@@ -331,7 +334,8 @@ export class AICallTree {
331
334
  const selfTimeStr = roundToTenths(node.selfTime);
332
335
 
333
336
  // 6. URL Index
334
- const url = SourceMapsResolver.SourceMapsResolver.resolvedURLForEntry(parsedTrace, event);
337
+ const location = SourceMapsResolver.SourceMapsResolver.codeLocationForEntry(parsedTrace, event);
338
+ const url = location?.url;
335
339
  let urlIndexStr = '';
336
340
  if (url) {
337
341
  const existingIndex = allUrls.indexOf(url);
@@ -361,6 +365,8 @@ export class AICallTree {
361
365
  line += ';' + selfTimeStr;
362
366
  line += ';' + urlIndexStr;
363
367
  line += ';' + childRangeStr;
368
+ line += ';' + (location?.line ?? '');
369
+ line += ';' + (location?.column ?? '');
364
370
 
365
371
  if (selectedMarker) {
366
372
  line += ';' + selectedMarker;
@@ -63,7 +63,7 @@ export class CSSWorkspaceBinding implements SDK.TargetManager.SDKModelObserver<S
63
63
  }
64
64
 
65
65
  modelAdded(cssModel: SDK.CSSModel.CSSModel): void {
66
- this.#modelToInfo.set(cssModel, new ModelInfo(cssModel, this.#resourceMapping));
66
+ this.#modelToInfo.set(cssModel, new ModelInfo(cssModel, this.#resourceMapping, this));
67
67
  }
68
68
 
69
69
  modelRemoved(cssModel: SDK.CSSModel.CSSModel): void {
@@ -157,7 +157,8 @@ export class ModelInfo {
157
157
  #sassSourceMapping: SASSSourceMapping;
158
158
  readonly #locations: Platform.MapUtilities.Multimap<SDK.CSSStyleSheetHeader.CSSStyleSheetHeader, LiveLocation>;
159
159
  readonly #unboundLocations: Platform.MapUtilities.Multimap<Platform.DevToolsPath.UrlString, LiveLocation>;
160
- constructor(cssModel: SDK.CSSModel.CSSModel, resourceMapping: ResourceMapping) {
160
+ constructor(
161
+ cssModel: SDK.CSSModel.CSSModel, resourceMapping: ResourceMapping, cssWorkspaceBinding: CSSWorkspaceBinding) {
161
162
  this.#eventListeners = [
162
163
  cssModel.addEventListener(
163
164
  SDK.CSSModel.Events.StyleSheetAdded,
@@ -176,7 +177,8 @@ export class ModelInfo {
176
177
  this.#resourceMapping = resourceMapping;
177
178
  this.#stylesSourceMapping = new StylesSourceMapping(cssModel, resourceMapping.workspace);
178
179
  const sourceMapManager = cssModel.sourceMapManager();
179
- this.#sassSourceMapping = new SASSSourceMapping(cssModel.target(), sourceMapManager, resourceMapping.workspace);
180
+ this.#sassSourceMapping =
181
+ new SASSSourceMapping(cssModel.target(), sourceMapManager, resourceMapping.workspace, cssWorkspaceBinding);
180
182
 
181
183
  this.#locations = new Platform.MapUtilities.Multimap();
182
184
  this.#unboundLocations = new Platform.MapUtilities.Multimap();
@@ -10,7 +10,7 @@ import * as TextUtils from '../text_utils/text_utils.js';
10
10
  import * as Workspace from '../workspace/workspace.js';
11
11
 
12
12
  import {ContentProviderBasedProject} from './ContentProviderBasedProject.js';
13
- import {CSSWorkspaceBinding, type SourceMapping} from './CSSWorkspaceBinding.js';
13
+ import type {CSSWorkspaceBinding, SourceMapping} from './CSSWorkspaceBinding.js';
14
14
  import {NetworkProject} from './NetworkProject.js';
15
15
 
16
16
  export class SASSSourceMapping implements SourceMapping {
@@ -18,12 +18,14 @@ export class SASSSourceMapping implements SourceMapping {
18
18
  readonly #project: ContentProviderBasedProject;
19
19
  readonly #eventListeners: Common.EventTarget.EventDescriptor[];
20
20
  readonly #bindings: Map<string, Binding>;
21
+ readonly #cssWorkspaceBinding: CSSWorkspaceBinding;
21
22
 
22
23
  constructor(
23
24
  target: SDK.Target.Target,
24
25
  sourceMapManager: SDK.SourceMapManager.SourceMapManager<SDK.CSSStyleSheetHeader.CSSStyleSheetHeader>,
25
- workspace: Workspace.Workspace.WorkspaceImpl) {
26
+ workspace: Workspace.Workspace.WorkspaceImpl, cssWorkspaceBinding: CSSWorkspaceBinding) {
26
27
  this.#sourceMapManager = sourceMapManager;
28
+ this.#cssWorkspaceBinding = cssWorkspaceBinding;
27
29
  this.#project = new ContentProviderBasedProject(
28
30
  workspace, 'cssSourceMaps:' + target.id(), Workspace.Workspace.projectTypes.Network, '',
29
31
  false /* isServiceProject */);
@@ -58,7 +60,7 @@ export class SASSSourceMapping implements SourceMapping {
58
60
  }
59
61
  binding.addSourceMap(sourceMap, header.frameId);
60
62
  }
61
- await CSSWorkspaceBinding.instance().updateLocations(header);
63
+ await this.#cssWorkspaceBinding.updateLocations(header);
62
64
  this.sourceMapAttachedForTest(sourceMap);
63
65
  }
64
66
 
@@ -78,7 +80,7 @@ export class SASSSourceMapping implements SourceMapping {
78
80
  }
79
81
  }
80
82
  }
81
- await CSSWorkspaceBinding.instance().updateLocations(header);
83
+ await this.#cssWorkspaceBinding.updateLocations(header);
82
84
  }
83
85
 
84
86
  rawLocationToUILocation(rawLocation: SDK.CSSModel.CSSLocation): Workspace.UISourceCode.UILocation|null {
@@ -56,7 +56,15 @@ export class CPUProfileDataModel extends ProfileTreeModel {
56
56
  * for CPU profiles coming from traces.
57
57
  */
58
58
  traceIds?: Record<string, number>;
59
+ /**
60
+ * Each item in the `lines` array contains the script line executing
61
+ * when the sample in that array position was taken.
62
+ */
59
63
  lines?: number[];
64
+ /**
65
+ * Same as `lines` above, but with the script column.
66
+ */
67
+ columns?: number[];
60
68
  totalHitCount: number;
61
69
  profileHead: CPUProfileNode;
62
70
  /**
@@ -90,14 +98,8 @@ export class CPUProfileDataModel extends ProfileTreeModel {
90
98
  this.traceIds = profile.traceIds;
91
99
  this.samples = profile.samples;
92
100
 
93
- // Lines are available only in profiles coming from tracing.
94
- // Elements in the lines array have a 1 to 1 correspondence with
95
- // samples, by array position. They can be 1 or 0 and indicate if
96
- // there is line data for a given sample, i.e. if a given sample
97
- // needs to be included to calculate the line level execution time
98
- // data, which we show in the sources panel after recording a
99
- // profile.
100
101
  this.lines = profile.lines;
102
+ this.columns = profile.columns;
101
103
  this.totalHitCount = 0;
102
104
  this.profileHead = this.translateProfileTree(profile.nodes);
103
105
  this.initialize(this.profileHead);
@@ -557,6 +559,7 @@ export type ExtendedProfileNode = Protocol.Profiler.ProfileNode&{parent?: number
557
559
  export type ExtendedProfile = Protocol.Profiler.Profile&{
558
560
  nodes: Protocol.Profiler.ProfileNode[] | ExtendedProfileNode[],
559
561
  lines?: number[],
562
+ columns?: number[],
560
563
  /**
561
564
  * A sample can be manually collected with v8::CpuProfiler::collectSample.
562
565
  * When this is done an id (trace id) can be passed to the API to
@@ -87,6 +87,7 @@ export interface CrUXResponse {
87
87
 
88
88
  export type PageResult = Record<`${PageScope}-${DeviceScope}`, CrUXResponse|null>&{
89
89
  warnings: string[],
90
+ normalizedUrl: string,
90
91
  };
91
92
 
92
93
  export interface OriginMapping {
@@ -194,10 +195,12 @@ export class CrUXManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
194
195
  'url-PHONE': null,
195
196
  'url-TABLET': null,
196
197
  warnings: [],
198
+ normalizedUrl: '',
197
199
  };
198
200
 
199
201
  try {
200
202
  const normalizedUrl = this.#normalizeUrl(pageUrl);
203
+ pageResult.normalizedUrl = normalizedUrl.href;
201
204
  const promises: Array<Promise<void>> = [];
202
205
 
203
206
  for (const pageScope of pageScopeList) {
@@ -250,11 +253,11 @@ export class CrUXManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
250
253
  */
251
254
  async #getFieldDataForCurrentPage(): Promise<PageResult> {
252
255
  const currentUrl = this.#mainDocumentUrl || await this.#getInspectedURL();
253
- const urlForCrux = this.#configSetting.get().overrideEnabled ? this.#configSetting.get().override || '' :
254
- this.#getMappedUrl(currentUrl);
256
+ const normalizedUrl = this.#configSetting.get().overrideEnabled ? this.#configSetting.get().override || '' :
257
+ this.#getMappedUrl(currentUrl);
255
258
 
256
- const result = await this.getFieldDataForPage(urlForCrux);
257
- if (currentUrl !== urlForCrux) {
259
+ const result = await this.getFieldDataForPage(normalizedUrl);
260
+ if (currentUrl !== normalizedUrl) {
258
261
  result.warnings.push(i18nString(UIStrings.fieldOverrideWarning));
259
262
  }
260
263
  return result;
@@ -129,8 +129,8 @@ export const genericFormDuplicateIdForInputError = {
129
129
  }],
130
130
  };
131
131
 
132
- export const genericFormAriaLabelledByToNonExistingId = {
133
- file: 'genericFormAriaLabelledByToNonExistingId.md',
132
+ export const genericFormAriaLabelledByToNonExistingIdError = {
133
+ file: 'genericFormAriaLabelledByToNonExistingIdError.md',
134
134
  links: [{
135
135
  link: 'https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label',
136
136
  linkTitle: i18nLazyString(UIStrings.labelFormlementsPageTitle),
@@ -169,8 +169,8 @@ export const genericFormLabelForMatchesNonExistingIdError = {
169
169
  }],
170
170
  };
171
171
 
172
- export const genericFormLabelHasNeitherForNorNestedInput = {
173
- file: 'genericFormLabelHasNeitherForNorNestedInput.md',
172
+ export const genericFormLabelHasNeitherForNorNestedInputError = {
173
+ file: 'genericFormLabelHasNeitherForNorNestedInputError.md',
174
174
  links: [{
175
175
  link: 'https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label',
176
176
  linkTitle: i18nLazyString(UIStrings.labelFormlementsPageTitle),
@@ -193,7 +193,10 @@ const issueDescriptions = new Map<Protocol.Audits.GenericIssueErrorType, LazyMar
193
193
  genericFormAutocompleteAttributeEmptyError,
194
194
  ],
195
195
  [Protocol.Audits.GenericIssueErrorType.FormDuplicateIdForInputError, genericFormDuplicateIdForInputError],
196
- [Protocol.Audits.GenericIssueErrorType.FormAriaLabelledByToNonExistingId, genericFormAriaLabelledByToNonExistingId],
196
+ [
197
+ Protocol.Audits.GenericIssueErrorType.FormAriaLabelledByToNonExistingIdError,
198
+ genericFormAriaLabelledByToNonExistingIdError
199
+ ],
197
200
  [
198
201
  Protocol.Audits.GenericIssueErrorType.FormEmptyIdAndNameAttributesForInputError,
199
202
  genericFormEmptyIdAndNameAttributesForInputError,
@@ -207,8 +210,8 @@ const issueDescriptions = new Map<Protocol.Audits.GenericIssueErrorType, LazyMar
207
210
  genericFormLabelForMatchesNonExistingIdError,
208
211
  ],
209
212
  [
210
- Protocol.Audits.GenericIssueErrorType.FormLabelHasNeitherForNorNestedInput,
211
- genericFormLabelHasNeitherForNorNestedInput,
213
+ Protocol.Audits.GenericIssueErrorType.FormLabelHasNeitherForNorNestedInputError,
214
+ genericFormLabelHasNeitherForNorNestedInputError,
212
215
  ],
213
216
  [
214
217
  Protocol.Audits.GenericIssueErrorType.FormInputHasWrongButWellIntendedAutocompleteValueError,
@@ -225,14 +228,14 @@ const issueTypes = new Map<Protocol.Audits.GenericIssueErrorType, IssueKind>([
225
228
  [Protocol.Audits.GenericIssueErrorType.FormInputWithNoLabelError, IssueKind.IMPROVEMENT],
226
229
  [Protocol.Audits.GenericIssueErrorType.FormAutocompleteAttributeEmptyError, IssueKind.PAGE_ERROR],
227
230
  [Protocol.Audits.GenericIssueErrorType.FormDuplicateIdForInputError, IssueKind.PAGE_ERROR],
228
- [Protocol.Audits.GenericIssueErrorType.FormAriaLabelledByToNonExistingId, IssueKind.IMPROVEMENT],
231
+ [Protocol.Audits.GenericIssueErrorType.FormAriaLabelledByToNonExistingIdError, IssueKind.IMPROVEMENT],
229
232
  [Protocol.Audits.GenericIssueErrorType.FormEmptyIdAndNameAttributesForInputError, IssueKind.IMPROVEMENT],
230
233
  [
231
234
  Protocol.Audits.GenericIssueErrorType.FormInputAssignedAutocompleteValueToIdOrNameAttributeError,
232
235
  IssueKind.IMPROVEMENT,
233
236
  ],
234
237
  [Protocol.Audits.GenericIssueErrorType.FormLabelForMatchesNonExistingIdError, IssueKind.PAGE_ERROR],
235
- [Protocol.Audits.GenericIssueErrorType.FormLabelHasNeitherForNorNestedInput, IssueKind.IMPROVEMENT],
238
+ [Protocol.Audits.GenericIssueErrorType.FormLabelHasNeitherForNorNestedInputError, IssueKind.IMPROVEMENT],
236
239
  [Protocol.Audits.GenericIssueErrorType.FormInputHasWrongButWellIntendedAutocompleteValueError, IssueKind.IMPROVEMENT],
237
240
 
238
241
  ]);
@@ -9079,6 +9079,10 @@ export const NativeFunctions = [
9079
9079
  name: "setBindGroup",
9080
9080
  signatures: [["index","bindGroup","?dynamicOffsets"],["index","bindGroup","dynamicOffsetsData","dynamicOffsetsDataStart","dynamicOffsetsDataLength"]]
9081
9081
  },
9082
+ {
9083
+ name: "setImmediates",
9084
+ signatures: [["rangeOffset","data","?dataOffset","?size"]]
9085
+ },
9082
9086
  {
9083
9087
  name: "writeBuffer",
9084
9088
  signatures: [["buffer","bufferOffset","data","?dataElementOffset","?dataElementCount"],["buffer","bufferOffset","data","?dataByteOffset","?byteSize"]]
@@ -217,9 +217,11 @@ export function handleEvent(event: Types.Events.Event): void {
217
217
 
218
218
  const timeDeltas = event.args.data?.timeDeltas || [];
219
219
  const lines = event.args.data?.lines || Array(samples.length).fill(0);
220
+ const columns = event.args.data?.columns || Array(samples.length).fill(0);
220
221
  cdpProfile.samples?.push(...samples);
221
222
  cdpProfile.timeDeltas?.push(...timeDeltas);
222
223
  cdpProfile.lines?.push(...lines);
224
+ cdpProfile.columns?.push(...columns);
223
225
 
224
226
  if (traceIds) {
225
227
  cdpProfile.traceIds ??= {};
@@ -270,6 +272,7 @@ function getOrCreatePreProcessedData(
270
272
  samples: [],
271
273
  timeDeltas: [],
272
274
  lines: [],
275
+ columns: [],
273
276
  },
274
277
  profileId,
275
278
  }));
@@ -577,6 +577,19 @@ export function getStackTraceTopCallFrameInEventPayload(event: Types.Events.Even
577
577
  }
578
578
  }
579
579
 
580
+ export function rawCallFrameForEntry(entry: Types.Events.Event): Protocol.Runtime.CallFrame|null {
581
+ if (Types.Events.isProfileCall(entry)) {
582
+ return entry.callFrame;
583
+ }
584
+
585
+ const topCallFrame = getStackTraceTopCallFrameInEventPayload(entry);
586
+ if (topCallFrame) {
587
+ return topCallFrame as Protocol.Runtime.CallFrame;
588
+ }
589
+
590
+ return null;
591
+ }
592
+
580
593
  /**
581
594
  * Given a 1-based call frame creates a 0-based one.
582
595
  */
@@ -174,8 +174,9 @@ export interface ProfileChunk extends Sample {
174
174
  data?: ArgsData & {
175
175
  cpuProfile?: PartialProfile,
176
176
  timeDeltas?: Micro[],
177
- lines?: Micro[],
177
+ lines?: number[],
178
178
  source?: ProfileSource,
179
+ columns?: number[],
179
180
  },
180
181
  };
181
182
  }
@@ -92,6 +92,7 @@ export class SourceMapsResolver extends EventTarget {
92
92
  if (resolvedCallFrameURL) {
93
93
  return resolvedCallFrameURL;
94
94
  }
95
+
95
96
  // If no source mapping was found for an entry's URL, then default
96
97
  // to the URL value contained in the event itself, if any.
97
98
  const url = Trace.Handlers.Helpers.getNonResolvedURL(entry, parsedTrace.data);
@@ -101,6 +102,34 @@ export class SourceMapsResolver extends EventTarget {
101
102
  return null;
102
103
  }
103
104
 
105
+ static codeLocationForEntry(parsedTrace: Trace.TraceModel.ParsedTrace, entry: Trace.Types.Events.Event):
106
+ {url: Platform.DevToolsPath.UrlString, line?: number, column?: number}|null {
107
+ const uiLocation = SourceMapsResolver.resolvedCodeLocationForEntry(entry)?.devtoolsLocation;
108
+ if (uiLocation) {
109
+ return {url: uiLocation.uiSourceCode.url(), line: uiLocation.lineNumber, column: uiLocation.columnNumber};
110
+ }
111
+
112
+ // If no source mapping was found for an entry's URL, then default
113
+ // to the frame contained in the event itself, if any.
114
+ const rawCallFrame = Trace.Helpers.Trace.rawCallFrameForEntry(entry);
115
+ if (rawCallFrame) {
116
+ const line = rawCallFrame.lineNumber >= 0 ? rawCallFrame.lineNumber : undefined;
117
+ const column = rawCallFrame.columnNumber >= 0 ? rawCallFrame.columnNumber : undefined;
118
+ return {url: rawCallFrame.url as Platform.DevToolsPath.UrlString, line, column};
119
+ }
120
+
121
+ // Lastly, look for just a url.
122
+ let url = Trace.Handlers.Helpers.getNonResolvedURL(entry, parsedTrace.data);
123
+ if (url) {
124
+ url = Workspace.Workspace.WorkspaceImpl.instance().uiSourceCodeForURL(url)?.url() ?? url;
125
+ }
126
+ if (url) {
127
+ return {url};
128
+ }
129
+
130
+ return null;
131
+ }
132
+
104
133
  static storeResolvedCodeDataForCallFrame(
105
134
  callFrame: Protocol.Runtime.CallFrame, resolvedCodeLocationData: ResolvedCodeLocationData): void {
106
135
  const keyForCallFrame = this.keyForCodeLocation(callFrame);
@@ -257,8 +257,7 @@ export class IgnoreListManager extends Common.ObjectWrapper.ObjectWrapper<EventT
257
257
  private async updateScriptRanges(script: SDK.Script.Script, sourceMap: SDK.SourceMap.SourceMap|undefined):
258
258
  Promise<void> {
259
259
  let hasIgnoreListedMappings = false;
260
- if (!IgnoreListManager.instance().isUserIgnoreListedURL(
261
- script.sourceURL, {isContentScript: script.isContentScript()})) {
260
+ if (!this.isUserIgnoreListedURL(script.sourceURL, {isContentScript: script.isContentScript()})) {
262
261
  hasIgnoreListedMappings =
263
262
  sourceMap?.sourceURLs().some(
264
263
  url => this.isUserIgnoreListedURL(url, {isKnownThirdParty: sourceMap.hasIgnoreListHint(url)})) ??
@@ -35,7 +35,9 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
35
35
  #contentType: Common.ResourceType.ResourceType;
36
36
  #requestContentPromise: Promise<TextUtils.ContentData.ContentDataOrError>|null = null;
37
37
  #decorations = new Map<string, any>();
38
+ #formattedDecorations = new Map<string, any>();
38
39
  #hasCommits = false;
40
+ #prettied = false;
39
41
  #messages: Set<Message>|null = null;
40
42
  #content: TextUtils.ContentData.ContentDataOrError|null = null;
41
43
  #forceLoadOnCheckContent = false;
@@ -497,6 +499,9 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
497
499
  }
498
500
 
499
501
  getDecorationData(type: string): any {
502
+ if (this.#prettied && this.#formattedDecorations.get(type)) {
503
+ return this.#formattedDecorations.get(type);
504
+ }
500
505
  return this.#decorations.get(type);
501
506
  }
502
507
 
@@ -508,6 +513,45 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
508
513
  return this.#disableEdit;
509
514
  }
510
515
 
516
+ formatChanged(format: {originalToFormatted(lineNumber: number, columnNumber?: number): number[]}|null): void {
517
+ if (this.#prettied === Boolean(format)) {
518
+ return;
519
+ }
520
+ this.#prettied = Boolean(format);
521
+ if (!format) {
522
+ this.dispatchEventToListeners(Events.DecorationChanged, DecoratorType.PERFORMANCE);
523
+ return;
524
+ }
525
+ const performanceDecorations = this.#decorations.get(DecoratorType.PERFORMANCE);
526
+ if (!performanceDecorations) {
527
+ return;
528
+ }
529
+ let formattedPerformanceDecorations: Map<number, Map<number, number>> =
530
+ this.#formattedDecorations.get(DecoratorType.PERFORMANCE);
531
+ if (!formattedPerformanceDecorations) {
532
+ formattedPerformanceDecorations = new Map<number, Map<number, number>>();
533
+ this.#formattedDecorations.set(DecoratorType.PERFORMANCE, formattedPerformanceDecorations);
534
+ } else {
535
+ formattedPerformanceDecorations.clear();
536
+ }
537
+
538
+ for (const [lineNumber, columnData] of performanceDecorations) {
539
+ for (const [columnNumber, data] of columnData) {
540
+ const [formattedLineNumber, formattedColumnNumber] =
541
+ format.originalToFormatted(lineNumber - 1, columnNumber - 1);
542
+ const oneBasedFormattedLineNumber = formattedLineNumber + 1;
543
+ const oneBasedFormattedColumnNumber = formattedColumnNumber + 1;
544
+ let lineData = formattedPerformanceDecorations.get(oneBasedFormattedLineNumber);
545
+ if (!lineData) {
546
+ lineData = new Map();
547
+ formattedPerformanceDecorations.set(oneBasedFormattedLineNumber, lineData);
548
+ }
549
+ lineData.set(oneBasedFormattedColumnNumber, (lineData.get(oneBasedFormattedColumnNumber) || 0) + data);
550
+ }
551
+ }
552
+ this.dispatchEventToListeners(Events.DecorationChanged, 'performance');
553
+ }
554
+
511
555
  isIgnoreListed(): boolean {
512
556
  return IgnoreListManager.instance().isUserOrSourceMapIgnoreListedUISourceCode(this);
513
557
  }
@@ -696,3 +740,9 @@ export class UISourceCodeMetadata {
696
740
  this.contentSize = contentSize;
697
741
  }
698
742
  }
743
+
744
+ export const enum DecoratorType {
745
+ PERFORMANCE = 'performance',
746
+ MEMORY = 'memory',
747
+ COVERAGE = 'coverage',
748
+ }