chrome-devtools-frontend 1.0.1652307 → 1.0.1656291

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 (267) hide show
  1. package/.agents/skills/fixing-skipped-tests/SKILL.md +32 -0
  2. package/.agents/skills/migrate-chromium-test/SKILL.md +144 -0
  3. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +116 -0
  4. package/.agents/skills/ui-eng-vision-logic-consolidator/SKILL.md +82 -0
  5. package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +123 -0
  6. package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +125 -0
  7. package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +75 -0
  8. package/AUTHORS +1 -0
  9. package/config/owner/COMMON_OWNERS +0 -4
  10. package/docs/get_the_code.md +1 -2
  11. package/docs/playbook.md +1 -1
  12. package/docs/ui_engineering.md +3 -1
  13. package/eslint.config.mjs +0 -5
  14. package/front_end/Tests.js +1 -0
  15. package/front_end/core/common/Settings.ts +47 -30
  16. package/front_end/core/sdk/CPUThrottlingManager.ts +23 -167
  17. package/front_end/core/sdk/CSSMetadata.ts +23 -0
  18. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +8 -4
  19. package/front_end/core/sdk/ConsoleModel.ts +13 -11
  20. package/front_end/core/sdk/DOMDebuggerModel.ts +11 -5
  21. package/front_end/core/sdk/DOMModel.ts +4 -0
  22. package/front_end/core/sdk/EmulationModel.ts +4 -0
  23. package/front_end/core/sdk/EventBreakpointsModel.ts +9 -5
  24. package/front_end/core/sdk/IsolateManager.ts +6 -6
  25. package/front_end/core/sdk/ResourceTreeModel.ts +8 -5
  26. package/front_end/core/sdk/TargetManager.ts +17 -0
  27. package/front_end/entrypoints/devtools_app/devtools_app.ts +0 -1
  28. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +459 -74
  29. package/front_end/entrypoints/main/MainImpl.ts +12 -42
  30. package/front_end/foundation/Universe.ts +116 -3
  31. package/front_end/generated/InspectorBackendCommands.ts +11 -6
  32. package/front_end/generated/SupportedCSSProperties.js +124 -34
  33. package/front_end/generated/protocol-mapping.d.ts +8 -0
  34. package/front_end/generated/protocol-proxy-api.d.ts +15 -0
  35. package/front_end/generated/protocol.ts +94 -1
  36. package/front_end/models/ai_assistance/AiConversation.ts +2 -7
  37. package/front_end/models/ai_assistance/README.md +4 -3
  38. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
  39. package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +1 -1
  40. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
  41. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +13 -320
  42. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
  43. package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -358
  44. package/front_end/models/ai_assistance/ai_assistance.ts +6 -8
  45. package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +295 -0
  46. package/front_end/models/ai_assistance/contexts/RequestContext.snapshot.txt +0 -1
  47. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +0 -2
  48. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +10 -10
  49. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +12 -11
  50. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
  51. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -14
  52. package/front_end/models/ai_assistance/skills/accessibility.md +4 -2
  53. package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +142 -0
  54. package/front_end/models/ai_assistance/tools/GetStyles.ts +1 -1
  55. package/front_end/models/ai_assistance/tools/README.md +21 -1
  56. package/front_end/models/ai_assistance/tools/{ResolveLighthousePath.ts → ResolveDevtoolsNodePath.ts} +18 -17
  57. package/front_end/models/ai_assistance/tools/Tool.ts +6 -1
  58. package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -2
  59. package/front_end/models/autofill_manager/AutofillManager.ts +6 -15
  60. package/front_end/models/bindings/NetworkProject.ts +4 -8
  61. package/front_end/models/breakpoints/BreakpointManager.ts +9 -9
  62. package/front_end/models/emulation/DeviceModeModel.ts +24 -0
  63. package/front_end/models/emulation/EmulatedDevices.ts +108 -0
  64. package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +36 -0
  65. package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +8 -0
  66. package/front_end/models/issues_manager/IssuesManager.ts +10 -6
  67. package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +4 -5
  68. package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
  69. package/front_end/models/live-metrics/LiveMetrics.ts +6 -6
  70. package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +5 -5
  71. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +3 -3
  72. package/front_end/models/logs/LogManager.ts +25 -10
  73. package/front_end/models/logs/NetworkLog.ts +24 -19
  74. package/front_end/models/persistence/AutomaticFileSystemManager.ts +14 -13
  75. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +26 -14
  76. package/front_end/models/persistence/IsolatedFileSystem.ts +9 -11
  77. package/front_end/models/persistence/IsolatedFileSystemManager.ts +22 -11
  78. package/front_end/models/persistence/NetworkPersistenceManager.ts +73 -44
  79. package/front_end/models/persistence/PersistenceImpl.ts +4 -5
  80. package/front_end/models/project_settings/ProjectSettingsModel.ts +12 -11
  81. package/front_end/models/trace/EntityMapper.ts +1 -1
  82. package/front_end/models/trace/handlers/ScreenshotsHandler.ts +14 -59
  83. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +12 -38
  84. package/front_end/panels/ai_assistance/ExportConversation.ts +4 -1
  85. package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
  86. package/front_end/panels/application/DeviceBoundSessionsView.ts +15 -3
  87. package/front_end/panels/application/FrameDetailsView.ts +2 -1
  88. package/front_end/panels/application/IndexedDBViews.ts +38 -36
  89. package/front_end/panels/application/ServiceWorkersView.ts +23 -16
  90. package/front_end/panels/application/components/AdsView.ts +4 -0
  91. package/front_end/panels/autofill/AutofillView.ts +1 -1
  92. package/front_end/panels/autofill/autofill-meta.ts +3 -2
  93. package/front_end/panels/common/CPUThrottlingOption.ts +142 -0
  94. package/front_end/panels/common/ThrottlingUtils.ts +9 -4
  95. package/front_end/panels/common/common.ts +1 -1
  96. package/front_end/panels/console/ConsoleViewMessage.ts +45 -0
  97. package/front_end/panels/elements/AccessibilityTreeUtils.ts +26 -15
  98. package/front_end/panels/elements/AccessibilityTreeView.ts +12 -9
  99. package/front_end/panels/elements/ElementsPanel.ts +0 -74
  100. package/front_end/panels/elements/ElementsTreeOutline.ts +5 -4
  101. package/front_end/panels/emulation/DeviceModeToolbar.ts +46 -45
  102. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +118 -68
  103. package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
  104. package/front_end/panels/layer_viewer/layerTreeOutline.css +20 -13
  105. package/front_end/panels/layers/LayersPanel.ts +1 -1
  106. package/front_end/panels/mobile_throttling/CalibrationController.ts +6 -5
  107. package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +1 -1
  108. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +40 -13
  109. package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +13 -17
  110. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +79 -30
  111. package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -0
  112. package/front_end/panels/network/LinkPreloadGenerator.ts +101 -0
  113. package/front_end/panels/network/NetworkLogView.ts +28 -9
  114. package/front_end/panels/network/NetworkPanel.ts +1 -63
  115. package/front_end/panels/network/RequestInitiatorView.ts +29 -4
  116. package/front_end/panels/network/components/HeaderSectionRow.css +9 -7
  117. package/front_end/panels/network/components/HeaderSectionRow.ts +20 -1
  118. package/front_end/panels/network/components/RequestHeaderSection.css +5 -3
  119. package/front_end/panels/network/components/RequestHeaderSection.ts +1 -2
  120. package/front_end/panels/network/components/RequestHeadersView.css +1 -1
  121. package/front_end/panels/network/network.ts +2 -0
  122. package/front_end/panels/profiler/HeapSnapshotView.ts +121 -33
  123. package/front_end/panels/profiler/ModuleUIStrings.ts +4 -0
  124. package/front_end/panels/security/SecurityPanel.ts +36 -23
  125. package/front_end/panels/settings/SettingsScreen.ts +18 -103
  126. package/front_end/panels/settings/settings-meta.ts +0 -24
  127. package/front_end/panels/timeline/TimelineController.ts +3 -2
  128. package/front_end/panels/timeline/TimelineHistoryManager.ts +38 -37
  129. package/front_end/panels/timeline/TimelinePanel.ts +52 -11
  130. package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +20 -18
  131. package/front_end/panels/timeline/components/LiveMetricsView.ts +38 -38
  132. package/front_end/panels/timeline/components/MetricCard.ts +18 -18
  133. package/front_end/panels/timeline/components/liveMetricsView.css +6 -6
  134. package/front_end/panels/timeline/components/metricCard.css +4 -4
  135. package/front_end/panels/timeline/timelineFlamechartPopover.css +2 -0
  136. package/front_end/panels/utils/utils.ts +25 -24
  137. package/front_end/panels/whats_new/ReleaseNoteText.ts +3 -3
  138. package/front_end/panels/whats_new/resources/WNDT.md +1 -1
  139. package/front_end/third_party/chromium/README.chromium +1 -1
  140. package/front_end/third_party/puppeteer/README.chromium +2 -2
  141. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +34 -55
  142. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +96 -83
  143. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +10 -1
  144. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
  146. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
  149. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.d.ts.map +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.js.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts +3 -2
  152. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
  153. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
  154. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
  156. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.d.ts +1 -1
  157. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.js +1 -1
  158. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
  159. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
  161. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +2 -1
  162. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.d.ts.map +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.js.map +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +2 -2
  166. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
  167. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +5 -2
  168. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
  169. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
  171. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +23 -13
  173. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +4 -1
  176. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Input.js +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.d.ts.map +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.js.map +1 -1
  180. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
  182. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +3 -41
  183. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
  184. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  187. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +4 -2
  188. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
  189. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts +5 -0
  190. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +1 -1
  193. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts +1 -1
  194. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts.map +1 -1
  195. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js +5 -5
  196. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js.map +1 -1
  197. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
  199. package/front_end/third_party/puppeteer/package/lib/types.d.ts +34 -55
  200. package/front_end/third_party/puppeteer/package/package.json +4 -4
  201. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +13 -1
  202. package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +2 -3
  203. package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +3 -1
  204. package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +3 -2
  205. package/front_end/third_party/puppeteer/package/src/api/Realm.ts +1 -2
  206. package/front_end/third_party/puppeteer/package/src/api/Target.ts +1 -1
  207. package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +1 -2
  208. package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +3 -1
  209. package/front_end/third_party/puppeteer/package/src/bidi/core/Realm.ts +1 -3
  210. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +13 -3
  211. package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +1 -1
  212. package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +24 -13
  213. package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +4 -1
  214. package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +1 -1
  215. package/front_end/third_party/puppeteer/package/src/cdp/LifecycleWatcher.ts +1 -4
  216. package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +2 -4
  217. package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +7 -76
  218. package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +1 -4
  219. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +4 -1
  220. package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +5 -0
  221. package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
  222. package/front_end/third_party/puppeteer/package/src/util/httpUtils.ts +5 -5
  223. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  224. package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -1
  225. package/front_end/ui/components/dialogs/Dialog.ts +3 -0
  226. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +0 -7
  227. package/front_end/ui/helpers/OpenInNewTab.ts +15 -7
  228. package/front_end/ui/legacy/InspectorDrawerView.ts +7 -5
  229. package/front_end/ui/legacy/ListWidget.ts +12 -0
  230. package/front_end/ui/legacy/SplitWidget.ts +12 -11
  231. package/front_end/ui/legacy/TabbedPane.ts +1 -108
  232. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -0
  233. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +192 -139
  234. package/front_end/ui/legacy/components/data_grid/DataGridExporter.ts +89 -0
  235. package/front_end/ui/legacy/components/data_grid/dataGrid.css +10 -0
  236. package/front_end/ui/legacy/components/data_grid/data_grid.ts +3 -1
  237. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +8 -1
  238. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +110 -17
  239. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +89 -40
  240. package/front_end/ui/legacy/treeoutline.css +1 -1
  241. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  242. package/package.json +4 -3
  243. package/front_end/Images/navigationControls.png +0 -0
  244. package/front_end/Images/navigationControls_2x.png +0 -0
  245. package/front_end/Images/popoverArrows.png +0 -0
  246. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -746
  247. package/front_end/entrypoints/greendev_floaty/floaty.css +0 -301
  248. package/front_end/entrypoints/greendev_floaty/floaty.html +0 -38
  249. package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -415
  250. package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +0 -834
  251. package/front_end/models/ai_assistance/agents/GreenDevAgentAntigravityCliSocketClient.ts +0 -53
  252. package/front_end/models/ai_assistance/agents/GreenDevAgentGeminiCliSocketClient.ts +0 -117
  253. package/front_end/models/annotations/AnnotationRepository.ts +0 -238
  254. package/front_end/models/annotations/AnnotationType.ts +0 -10
  255. package/front_end/models/annotations/README.md +0 -7
  256. package/front_end/models/annotations/annotations.ts +0 -6
  257. package/front_end/models/greendev/Prototypes.ts +0 -68
  258. package/front_end/models/greendev/README.md +0 -5
  259. package/front_end/models/greendev/greendev.ts +0 -5
  260. package/front_end/panels/common/Annotation.ts +0 -184
  261. package/front_end/panels/common/AnnotationManager.ts +0 -208
  262. package/front_end/panels/common/annotation.css +0 -40
  263. package/front_end/panels/greendev/GreenDevPanel.css +0 -282
  264. package/front_end/panels/greendev/GreenDevPanel.ts +0 -364
  265. package/front_end/panels/greendev/GreenDevShared.ts +0 -13
  266. package/front_end/panels/greendev/greendev-meta.ts +0 -52
  267. package/front_end/panels/greendev/greendev.ts +0 -9
@@ -7,8 +7,8 @@ import * as Common from '../../core/common/common.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
8
  import * as Platform from '../../core/platform/platform.js';
9
9
  import * as Trace from '../../models/trace/trace.js';
10
- import {createIcon} from '../../ui/kit/kit.js';
11
10
  import * as UI from '../../ui/legacy/legacy.js';
11
+ import {html, type LitTemplate, render} from '../../ui/lit/lit.js';
12
12
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
13
13
 
14
14
  import {
@@ -361,39 +361,43 @@ export class TimelineHistoryManager {
361
361
  };
362
362
  parsedTraceIndexToPerformancePreviewData.set(parsedTraceIndex, data);
363
363
 
364
- preview.appendChild(this.#buildTextDetails(parsedTrace.metadata, domain));
365
- const screenshotAndOverview = preview.createChild('div', 'hbox');
366
- screenshotAndOverview.appendChild(this.#buildScreenshotThumbnail(filmStrip));
367
- screenshotAndOverview.appendChild(this.#buildOverview(parsedTrace));
364
+ // eslint-disable-next-line @devtools/no-lit-render-outside-of-view
365
+ render(html`
366
+ ${this.#renderTextDetails(parsedTrace.metadata, domain)}
367
+ <div class="hbox">
368
+ ${this.#renderScreenshotThumbnail(filmStrip)}
369
+ ${this.#buildOverview(parsedTrace)}
370
+ </div>
371
+ `,
372
+ preview, {host: this});
373
+
368
374
  return data.preview;
369
375
  }
370
376
 
371
- #buildTextDetails(metadata: Trace.Types.File.MetaData|null, title: string): Element {
372
- const container = document.createElement('div');
373
- container.classList.add('text-details');
374
- container.classList.add('hbox');
375
- const nameSpan = container.createChild('span', 'name');
376
- nameSpan.textContent = title;
377
- UI.ARIAUtils.setLabel(nameSpan, title);
378
-
377
+ #renderTextDetails(metadata: Trace.Types.File.MetaData|null, title: string): LitTemplate {
378
+ let metadataText = '';
379
379
  if (metadata) {
380
380
  const parts = [
381
381
  metadata.emulatedDeviceTitle,
382
382
  metadata.cpuThrottling ? i18nString(UIStrings.dSlowdown, {PH1: metadata.cpuThrottling}) : undefined,
383
383
  metadata.networkThrottling,
384
384
  ].filter(Boolean);
385
- container.createChild('span', 'metadata').textContent = listFormatter.format(parts as string[]);
385
+ metadataText = listFormatter.format(parts as string[]);
386
386
  }
387
387
 
388
- return container;
388
+ return html`
389
+ <div class="text-details hbox">
390
+ <span class="name">${title}</span>
391
+ ${metadataText ? html`<span class="metadata">${metadataText}</span>` : ''}
392
+ </div>
393
+ `;
389
394
  }
390
395
 
391
- #buildScreenshotThumbnail(filmStrip: Trace.Extras.FilmStrip.Data|null): Element {
392
- const container = document.createElement('div');
393
- container.classList.add('screenshot-thumb');
396
+ #renderScreenshotThumbnail(filmStrip: Trace.Extras.FilmStrip.Data|null): LitTemplate {
394
397
  const thumbnailAspectRatio = 3 / 2;
395
- container.style.width = this.totalHeight * thumbnailAspectRatio + 'px';
396
- container.style.height = this.totalHeight + 'px';
398
+ const width = this.totalHeight * thumbnailAspectRatio + 'px';
399
+ const height = this.totalHeight + 'px';
400
+ const container = html`<div class="screenshot-thumb" style="width: ${width}; height: ${height}"></div>`;
397
401
  if (!filmStrip) {
398
402
  return container;
399
403
  }
@@ -403,12 +407,11 @@ export class TimelineHistoryManager {
403
407
  }
404
408
  // TODO(paulirish): Adopt Util.ImageCache
405
409
  const uri = Trace.Handlers.ModelHandlers.Screenshots.screenshotImageDataUri(lastFrame.screenshotEvent);
406
- void UI.UIUtils.loadImage(uri).then(img => {
407
- if (img) {
408
- container.appendChild(img);
409
- }
410
- });
411
- return container;
410
+ return html`
411
+ <div class="screenshot-thumb" style="width: ${width}; height: ${height}">
412
+ <img src=${uri}>
413
+ </div>
414
+ `;
412
415
  }
413
416
 
414
417
  #buildOverview(parsedTrace: Trace.TraceModel.ParsedTrace): Element {
@@ -582,14 +585,14 @@ export class DropDown implements UI.ListControl.ListDelegate<number> {
582
585
 
583
586
  div.style.width = `${previewWidth}px`;
584
587
 
585
- const icon = createIcon('arrow-back');
586
- icon.title = i18nString(UIStrings.backButtonTooltip);
587
- icon.classList.add('back-arrow');
588
- div.appendChild(icon);
588
+ // eslint-disable-next-line @devtools/no-lit-render-outside-of-view
589
+ render(html`
590
+ <devtools-icon class="back-arrow" title=${
591
+ i18nString(UIStrings.backButtonTooltip)} name="arrow-back"></devtools-icon>
592
+ <span>${this.#landingPageTitle}</span>
593
+ `,
594
+ div, {host: this});
589
595
 
590
- const text = document.createElement('span');
591
- text.innerText = this.#landingPageTitle;
592
- div.appendChild(text);
593
596
  return div;
594
597
  }
595
598
 
@@ -619,14 +622,11 @@ export class DropDown implements UI.ListControl.ListDelegate<number> {
619
622
  }
620
623
 
621
624
  export class ToolbarButton extends UI.Toolbar.ToolbarItem {
622
- private contentElement: HTMLElement;
623
-
624
625
  constructor(action: UI.ActionRegistration.Action) {
625
626
  const element = document.createElement('button');
626
627
  element.classList.add('history-dropdown-button');
627
628
  element.setAttribute('jslog', `${VisualLogging.dropDown('history')}`);
628
629
  super(element);
629
- this.contentElement = this.element.createChild('span', 'content');
630
630
  this.element.addEventListener('click', () => void action.execute(), false);
631
631
  this.setEnabled(action.enabled());
632
632
  action.addEventListener(UI.ActionRegistration.Events.ENABLED, event => this.setEnabled(event.data));
@@ -634,6 +634,7 @@ export class ToolbarButton extends UI.Toolbar.ToolbarItem {
634
634
  }
635
635
 
636
636
  setText(text: string): void {
637
- this.contentElement.textContent = text;
637
+ // eslint-disable-next-line @devtools/no-lit-render-outside-of-view
638
+ render(html`<span class="content">${text}</span>`, this.element, {host: this});
638
639
  }
639
640
  }
@@ -316,6 +316,9 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
316
316
 
317
317
  let timelinePanelInstance: TimelinePanel|undefined;
318
318
 
319
+ // Total time to wait for source maps to load before giving up so trace processing can proceed.
320
+ const SOURCE_MAP_LOAD_TIMEOUT_MS = 5000;
321
+
319
322
  /**
320
323
  * Represents the states that the timeline panel can be in.
321
324
  * If you need to change the panel's view, use the {@link TimelinePanel.#changeView} method.
@@ -2149,14 +2152,21 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2149
2152
  // Annotation Overlays.
2150
2153
  currentManager?.addEventListener(AnnotationModifiedEvent.eventName, this.#onAnnotationModifiedEventBound);
2151
2154
 
2152
- // To calculate the activity we might want to zoom in, we use the top-most main-thread track
2153
- const topMostMainThreadAppender =
2154
- this.flameChart.getMainDataProvider().compatibilityTracksAppenderInstance().threadAppenders().at(0);
2155
- if (topMostMainThreadAppender) {
2156
- const zoomedInBounds = Trace.Extras.MainThreadActivity.calculateWindow(
2157
- parsedTrace.data.Meta.traceBounds, topMostMainThreadAppender.getEntries());
2158
-
2159
- TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(zoomedInBounds);
2155
+ // To calculate the activity we might want to zoom in, we use the top-most main-thread track.
2156
+ // If the trace has an active breadcrumb that is not the initial full trace breadcrumb, we do
2157
+ // not zoom in, but keep the window at the active breadcrumb bounds.
2158
+ const breadcrumbs = currentManager?.getTimelineBreadcrumbs();
2159
+ const hasActiveBreadcrumb = breadcrumbs ? breadcrumbs.activeBreadcrumb !== breadcrumbs.initialBreadcrumb : false;
2160
+ if (!hasActiveBreadcrumb) {
2161
+ const topMostMainThreadAppender =
2162
+ this.flameChart.getMainDataProvider().compatibilityTracksAppenderInstance().threadAppenders().at(0);
2163
+ const zoomWindow = calculateAutoZoomWindow(
2164
+ parsedTrace.data.Meta.traceBounds,
2165
+ topMostMainThreadAppender?.getEntries(),
2166
+ );
2167
+ if (zoomWindow) {
2168
+ TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(zoomWindow);
2169
+ }
2160
2170
  }
2161
2171
 
2162
2172
  // Add overlays for annotations loaded from the trace file
@@ -2642,12 +2652,19 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2642
2652
  };
2643
2653
 
2644
2654
  metadata.sourceMaps = [];
2655
+ await this.#handleSourceMapPromise(parsedTrace, handleScript);
2656
+ }
2645
2657
 
2658
+ async #handleSourceMapPromise(parsedTrace: Trace.TraceModel.ParsedTrace,
2659
+ handleScript: (script: Trace.Handlers.ModelHandlers.Scripts.Script) => Promise<void>):
2660
+ Promise<void> {
2646
2661
  const promises = [];
2647
2662
  for (const script of parsedTrace?.data.Scripts.scripts.values() ?? []) {
2648
2663
  promises.push(handleScript(script));
2649
2664
  }
2650
- await Promise.all(promises);
2665
+
2666
+ const timeout = new Promise<void>(resolve => setTimeout(resolve, SOURCE_MAP_LOAD_TIMEOUT_MS));
2667
+ await Promise.race([Promise.allSettled(promises), timeout]);
2651
2668
  }
2652
2669
 
2653
2670
  #createSourceMapResolver(isFreshRecording: boolean, metadata: Trace.Types.File.MetaData|null):
@@ -2681,7 +2698,8 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2681
2698
  return await debuggerModel.sourceMapManager().sourceMapForClientPromise(script);
2682
2699
  }
2683
2700
 
2684
- return async function resolveSourceMap(params: Trace.Types.Configuration.ResolveSourceMapParams) {
2701
+ async function resolveSourceMap(params: Trace.Types.Configuration.ResolveSourceMapParams):
2702
+ Promise<SDK.SourceMap.SourceMap|null> {
2685
2703
  const {scriptId, scriptUrl, sourceUrl, sourceMapUrl, frame, cachedRawSourceMap} = params;
2686
2704
 
2687
2705
  if (cachedRawSourceMap) {
@@ -2738,7 +2756,13 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2738
2756
  const payload = await SDK.SourceMapManager.tryLoadSourceMap(
2739
2757
  TimelinePanel.instance().#resourceLoader, sourceMapUrl, initiator);
2740
2758
  return payload ? new SDK.SourceMap.SourceMap(sourceUrl, sourceMapUrl, payload) : null;
2741
- };
2759
+ }
2760
+
2761
+ const timeout = new Promise<null>(resolve => setTimeout(() => resolve(null), SOURCE_MAP_LOAD_TIMEOUT_MS));
2762
+ return function resolveSourceMapWithTimeout(params: Trace.Types.Configuration.ResolveSourceMapParams):
2763
+ Promise<SDK.SourceMap.SourceMap|null> {
2764
+ return Promise.race([resolveSourceMap(params), timeout]);
2765
+ };
2742
2766
  }
2743
2767
 
2744
2768
  async #retainResourceContentsForEnhancedTrace(
@@ -3206,3 +3230,20 @@ export interface EventTypes {
3206
3230
  [Events.IS_VIEWING_TRACE]: boolean;
3207
3231
  [Events.RECORDING_COMPLETED]: {traceIndex: number}|{errorText: string};
3208
3232
  }
3233
+
3234
+ /**
3235
+ * Calculates the window to auto-zoom into when a trace is loaded.
3236
+ * We only auto-zoom to the main thread activity if there is no active breadcrumb,
3237
+ * as we want to preserve the active breadcrumb's window if one exists.
3238
+ *
3239
+ * @returns the window to zoom into, or null if no auto-zoom should be applied.
3240
+ */
3241
+ export function calculateAutoZoomWindow(
3242
+ traceBounds: Trace.Types.Timing.TraceWindowMicro,
3243
+ topMostMainThreadAppenderEntries: readonly Trace.Types.Events.Event[]|undefined,
3244
+ ): Trace.Types.Timing.TraceWindowMicro|null {
3245
+ if (!topMostMainThreadAppenderEntries || topMostMainThreadAppenderEntries.length === 0) {
3246
+ return null;
3247
+ }
3248
+ return Trace.Extras.MainThreadActivity.calculateWindow(traceBounds, topMostMainThreadAppenderEntries);
3249
+ }
@@ -12,6 +12,7 @@ import type * as Menus from '../../../ui/components/menus/menus.js';
12
12
  import * as UI from '../../../ui/legacy/legacy.js';
13
13
  import * as Lit from '../../../ui/lit/lit.js';
14
14
  import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
15
+ import * as PanelsCommon from '../../common/common.js';
15
16
  import * as MobileThrottling from '../../mobile_throttling/mobile_throttling.js';
16
17
 
17
18
  import cpuThrottlingSelectorStyles from './cpuThrottlingSelector.css.js';
@@ -57,22 +58,22 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
57
58
 
58
59
  interface CPUThrottlingGroup {
59
60
  name: string;
60
- items: SDK.CPUThrottlingManager.CPUThrottlingOption[];
61
+ items: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption[];
61
62
  showCustomAddOption?: boolean;
62
63
  }
63
64
 
64
65
  interface ViewInput {
65
- recommendedOption: SDK.CPUThrottlingManager.CPUThrottlingOption|null;
66
- currentOption: SDK.CPUThrottlingManager.CPUThrottlingOption;
66
+ recommendedOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption|null;
67
+ currentOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption;
67
68
  groups: CPUThrottlingGroup[];
68
- throttling: SDK.CPUThrottlingManager.CalibratedCPUThrottling;
69
+ throttling: PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling;
69
70
  onMenuItemSelected: (event: Menus.SelectMenu.SelectMenuItemSelectedEvent) => void;
70
71
  onCalibrateClick: () => void;
71
72
  }
72
73
 
73
74
  export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLElement): void => {
74
75
  let recommendedInfoEl;
75
- if (input.recommendedOption && input.currentOption === SDK.CPUThrottlingManager.NoThrottlingOption) {
76
+ if (input.recommendedOption && input.currentOption === PanelsCommon.CPUThrottlingOption.NoThrottlingOption) {
76
77
  recommendedInfoEl = html`<devtools-icon
77
78
  title=${i18nString(UIStrings.recommendedThrottlingReason)}
78
79
  name=info></devtools-icon>`;
@@ -134,31 +135,32 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
134
135
  type View = typeof DEFAULT_VIEW;
135
136
 
136
137
  export class CPUThrottlingSelector extends UI.Widget.Widget {
137
- #currentOption: SDK.CPUThrottlingManager.CPUThrottlingOption;
138
- #recommendedOption: SDK.CPUThrottlingManager.CPUThrottlingOption|null = null;
138
+ #currentOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption;
139
+ #recommendedOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption|null = null;
139
140
  #groups: CPUThrottlingGroup[] = [];
140
- #calibratedThrottlingSetting: Common.Settings.Setting<SDK.CPUThrottlingManager.CalibratedCPUThrottling>;
141
+ #calibratedThrottlingSetting: Common.Settings.Setting<PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling>;
141
142
  readonly #view: View;
143
+ readonly #cpuThrottlingManager = SDK.CPUThrottlingManager.CPUThrottlingManager.instance();
142
144
 
143
145
  constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
144
146
  super(element);
145
- this.#currentOption = SDK.CPUThrottlingManager.CPUThrottlingManager.instance().cpuThrottlingOption();
147
+ this.#currentOption = MobileThrottling.ThrottlingManager.throttlingManager().cpuThrottlingOption();
146
148
  this.#calibratedThrottlingSetting =
147
- Common.Settings.Settings.instance().createSetting<SDK.CPUThrottlingManager.CalibratedCPUThrottling>(
149
+ Common.Settings.Settings.instance().createSetting<PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling>(
148
150
  'calibrated-cpu-throttling', {}, Common.Settings.SettingStorageType.GLOBAL);
149
151
  this.#resetGroups();
150
152
  this.#view = view;
151
153
  }
152
154
 
153
- set recommendedOption(recommendedOption: SDK.CPUThrottlingManager.CPUThrottlingOption|null) {
155
+ set recommendedOption(recommendedOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption|null) {
154
156
  this.#recommendedOption = recommendedOption;
155
157
  this.requestUpdate();
156
158
  }
157
159
 
158
160
  override wasShown(): void {
159
161
  super.wasShown();
160
- SDK.CPUThrottlingManager.CPUThrottlingManager.instance().addEventListener(
161
- SDK.CPUThrottlingManager.Events.RATE_CHANGED, this.#onOptionChange, this);
162
+ this.#cpuThrottlingManager.addEventListener(SDK.CPUThrottlingManager.Events.RATE_CHANGED, this.#onOptionChange,
163
+ this);
162
164
  this.#calibratedThrottlingSetting.addChangeListener(this.#onCalibratedSettingChanged, this);
163
165
  this.#onOptionChange();
164
166
  }
@@ -166,12 +168,12 @@ export class CPUThrottlingSelector extends UI.Widget.Widget {
166
168
  override willHide(): void {
167
169
  super.willHide();
168
170
  this.#calibratedThrottlingSetting.removeChangeListener(this.#onCalibratedSettingChanged, this);
169
- SDK.CPUThrottlingManager.CPUThrottlingManager.instance().removeEventListener(
170
- SDK.CPUThrottlingManager.Events.RATE_CHANGED, this.#onOptionChange, this);
171
+ this.#cpuThrottlingManager.removeEventListener(SDK.CPUThrottlingManager.Events.RATE_CHANGED, this.#onOptionChange,
172
+ this);
171
173
  }
172
174
 
173
175
  #onOptionChange(): void {
174
- this.#currentOption = SDK.CPUThrottlingManager.CPUThrottlingManager.instance().cpuThrottlingOption();
176
+ this.#currentOption = MobileThrottling.ThrottlingManager.throttlingManager().cpuThrottlingOption();
175
177
 
176
178
  this.requestUpdate();
177
179
  }
@@ -185,9 +187,9 @@ export class CPUThrottlingSelector extends UI.Widget.Widget {
185
187
  let option;
186
188
  if (typeof event.itemValue === 'string') {
187
189
  if (event.itemValue === 'low-tier-mobile') {
188
- option = SDK.CPUThrottlingManager.CalibratedLowTierMobileThrottlingOption;
190
+ option = PanelsCommon.CPUThrottlingOption.CalibratedLowTierMobileThrottlingOption;
189
191
  } else if (event.itemValue === 'mid-tier-mobile') {
190
- option = SDK.CPUThrottlingManager.CalibratedMidTierMobileThrottlingOption;
192
+ option = PanelsCommon.CPUThrottlingOption.CalibratedMidTierMobileThrottlingOption;
191
193
  }
192
194
  } else {
193
195
  const rate = Number(event.itemValue);
@@ -236,31 +236,31 @@ const UIStrings = {
236
236
  */
237
237
  clearCurrentLog: 'Clear the current log',
238
238
  /**
239
- * @description Title for a page load phase that measures the time between when the page load starts and the time when the first byte of the initial document is downloaded.
239
+ * @description Title for a page load subpart that measures the time between when the page load starts and the time when the first byte of the initial document is downloaded.
240
240
  */
241
241
  timeToFirstByte: 'Time to first byte',
242
242
  /**
243
- * @description Title for a page load phase that measures the time between when the first byte of the initial document is downloaded and when the request for the largest image content starts.
243
+ * @description Title for a page load subpart that measures the time between when the first byte of the initial document is downloaded and when the request for the largest image content starts.
244
244
  */
245
245
  resourceLoadDelay: 'Resource load delay',
246
246
  /**
247
- * @description Title for a page load phase that measures the time between when the request for the largest image content starts and when it finishes.
247
+ * @description Title for a page load subpart that measures the time between when the request for the largest image content starts and when it finishes.
248
248
  */
249
249
  resourceLoadDuration: 'Resource load duration',
250
250
  /**
251
- * @description Title for a page load phase that measures the time between when the request for the largest image content finishes and when the largest image element is rendered on the page.
251
+ * @description Title for a page load subpart that measures the time between when the request for the largest image content finishes and when the largest image element is rendered on the page.
252
252
  */
253
253
  elementRenderDelay: 'Element render delay',
254
254
  /**
255
- * @description Title for a phase during a user interaction that measures the time between when the interaction starts and when the browser starts running interaction handlers.
255
+ * @description Title for a subpart during a user interaction that measures the time between when the interaction starts and when the browser starts running interaction handlers.
256
256
  */
257
257
  inputDelay: 'Input delay',
258
258
  /**
259
- * @description Title for a phase during a user interaction that measures the time between when the browser starts running interaction handlers and when the browser finishes running interaction handlers.
259
+ * @description Title for a subpart during a user interaction that measures the time between when the browser starts running interaction handlers and when the browser finishes running interaction handlers.
260
260
  */
261
261
  processingDuration: 'Processing duration',
262
262
  /**
263
- * @description Title for a phase during a user interaction that measures the time between when the browser finishes running interaction handlers and when the browser renders the next visual frame that shows the result of the interaction.
263
+ * @description Title for a subpart during a user interaction that measures the time between when the browser finishes running interaction handlers and when the browser renders the next visual frame that shows the result of the interaction.
264
264
  */
265
265
  presentationDelay: 'Presentation delay',
266
266
  /**
@@ -276,11 +276,11 @@ const UIStrings = {
276
276
  */
277
277
  showClsCluster: 'Go to worst layout shift cluster.',
278
278
  /**
279
- * @description Column header for table cell values representing the phase/component/stage/section of a larger duration.
279
+ * @description Column header for table cell values representing the subpart/component/stage/section of a larger duration.
280
280
  */
281
- phase: 'Phase',
281
+ subpart: 'Subpart',
282
282
  /**
283
- * @description Column header for table cell values representing a phase duration (in milliseconds) that was measured in the developers local environment.
283
+ * @description Column header for table cell values representing a subpart duration (in milliseconds) that was measured in the developers local environment.
284
284
  */
285
285
  duration: 'Local duration (ms)',
286
286
  /**
@@ -328,7 +328,7 @@ export interface ViewOutput {
328
328
 
329
329
  export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement|DocumentFragment) => void;
330
330
 
331
- function getLcpFieldPhases(cruxManager: CrUXManager.CrUXManager): LiveMetrics.LcpValue['phases']|null {
331
+ function getLcpFieldSubparts(cruxManager: CrUXManager.CrUXManager): LiveMetrics.LcpValue['subparts']|null {
332
332
  const ttfb =
333
333
  cruxManager.getSelectedFieldMetricData('largest_contentful_paint_image_time_to_first_byte')?.percentiles?.p75;
334
334
  const loadDelay =
@@ -484,9 +484,9 @@ function renderLcpCard(input: ViewInput): Lit.LitTemplate {
484
484
  const fieldData = input.cruxManager.getSelectedFieldMetricData('largest_contentful_paint');
485
485
  const nodeLink =
486
486
  input.lcpValue?.nodeRef && PanelsCommon.DOMLinkifier.Linkifier.instance().linkify(input.lcpValue?.nodeRef);
487
- const phases = input.lcpValue?.phases;
487
+ const subparts = input.lcpValue?.subparts;
488
488
 
489
- const fieldPhases = getLcpFieldPhases(input.cruxManager);
489
+ const fieldSubparts = getLcpFieldSubparts(input.cruxManager);
490
490
 
491
491
  // clang-format off
492
492
  return html`
@@ -496,11 +496,11 @@ function renderLcpCard(input: ViewInput): Lit.LitTemplate {
496
496
  fieldValue: fieldData?.percentiles?.p75,
497
497
  histogram: fieldData?.histogram,
498
498
  warnings: input.lcpValue?.warnings,
499
- phases: phases && [
500
- [i18nString(UIStrings.timeToFirstByte), phases.timeToFirstByte, fieldPhases?.timeToFirstByte],
501
- [i18nString(UIStrings.resourceLoadDelay), phases.resourceLoadDelay, fieldPhases?.resourceLoadDelay],
502
- [i18nString(UIStrings.resourceLoadDuration), phases.resourceLoadTime, fieldPhases?.resourceLoadTime],
503
- [i18nString(UIStrings.elementRenderDelay), phases.elementRenderDelay, fieldPhases?.elementRenderDelay],
499
+ subparts: subparts && [
500
+ [i18nString(UIStrings.timeToFirstByte), subparts.timeToFirstByte, fieldSubparts?.timeToFirstByte],
501
+ [i18nString(UIStrings.resourceLoadDelay), subparts.resourceLoadDelay, fieldSubparts?.resourceLoadDelay],
502
+ [i18nString(UIStrings.resourceLoadDuration), subparts.resourceLoadTime, fieldSubparts?.resourceLoadTime],
503
+ [i18nString(UIStrings.elementRenderDelay), subparts.elementRenderDelay, fieldSubparts?.elementRenderDelay],
504
504
  ],
505
505
  })}>
506
506
  ${nodeLink ? html`
@@ -551,7 +551,7 @@ function renderClsCard(input: ViewInput): Lit.LitTemplate {
551
551
 
552
552
  function renderInpCard(input: ViewInput): Lit.LitTemplate {
553
553
  const fieldData = input.cruxManager.getSelectedFieldMetricData('interaction_to_next_paint');
554
- const phases = input.inpValue?.phases;
554
+ const subparts = input.inpValue?.subparts;
555
555
  const interaction = input.inpValue && input.interactions.get(input.inpValue.interactionId);
556
556
 
557
557
  // clang-format off
@@ -562,10 +562,10 @@ function renderInpCard(input: ViewInput): Lit.LitTemplate {
562
562
  fieldValue: fieldData?.percentiles?.p75,
563
563
  histogram: fieldData?.histogram,
564
564
  warnings: input.inpValue?.warnings,
565
- phases: phases && [
566
- [i18nString(UIStrings.inputDelay), phases.inputDelay],
567
- [i18nString(UIStrings.processingDuration), phases.processingDuration],
568
- [i18nString(UIStrings.presentationDelay), phases.presentationDelay],
565
+ subparts: subparts && [
566
+ [i18nString(UIStrings.inputDelay), subparts.inputDelay],
567
+ [i18nString(UIStrings.processingDuration), subparts.processingDuration],
568
+ [i18nString(UIStrings.presentationDelay), subparts.presentationDelay],
569
569
  ],
570
570
  })}>
571
571
  ${interaction ? html`
@@ -873,30 +873,30 @@ function renderInteractionsLog(input: ViewInput, output: ViewOutput): Lit.LitTem
873
873
  ></devtools-icon>` : nothing}
874
874
  <span class="interaction-duration">${metricValue}</span>
875
875
  </summary>
876
- <div class="phase-table" role="table">
877
- <div class="phase-table-row phase-table-header-row" role="row">
878
- <div role="columnheader">${i18nString(UIStrings.phase)}</div>
876
+ <div class="subpart-table" role="table">
877
+ <div class="subpart-table-row subpart-table-header-row" role="row">
878
+ <div role="columnheader">${i18nString(UIStrings.subpart)}</div>
879
879
  <div role="columnheader">
880
880
  ${interaction.longAnimationFrameTimings.length ? html`
881
- <button
882
- class="log-extra-details-button"
883
- title=${i18nString(UIStrings.logToConsole)}
884
- @click=${() => input.logExtraInteractionDetails(interaction)}
885
- >${i18nString(UIStrings.duration)}</button>
886
- ` : i18nString(UIStrings.duration)}
881
+ <button
882
+ class="log-extra-details-button"
883
+ title=${i18nString(UIStrings.logToConsole)}
884
+ @click=${() => input.logExtraInteractionDetails(interaction)}
885
+ >${i18nString(UIStrings.duration)}</button>
886
+ ` : i18nString(UIStrings.duration)}
887
887
  </div>
888
888
  </div>
889
- <div class="phase-table-row" role="row">
889
+ <div class="subpart-table-row" role="row">
890
890
  <div role="cell">${i18nString(UIStrings.inputDelay)}</div>
891
- <div role="cell">${Math.round(interaction.phases.inputDelay)}</div>
891
+ <div role="cell">${Math.round(interaction.subparts.inputDelay)}</div>
892
892
  </div>
893
- <div class="phase-table-row" role="row">
893
+ <div class="subpart-table-row" role="row">
894
894
  <div role="cell">${i18nString(UIStrings.processingDuration)}</div>
895
- <div role="cell">${Math.round(interaction.phases.processingDuration)}</div>
895
+ <div role="cell">${Math.round(interaction.subparts.processingDuration)}</div>
896
896
  </div>
897
- <div class="phase-table-row" role="row">
897
+ <div class="subpart-table-row" role="row">
898
898
  <div role="cell">${i18nString(UIStrings.presentationDelay)}</div>
899
- <div role="cell">${Math.round(interaction.phases.presentationDelay)}</div>
899
+ <div role="cell">${Math.round(interaction.subparts.presentationDelay)}</div>
900
900
  </div>
901
901
  </div>
902
902
  </details>
@@ -123,9 +123,9 @@ const UIStrings = {
123
123
  */
124
124
  recDynamicContentCLS: 'Dynamic content can influence what layout shifts happen.',
125
125
  /**
126
- * @description Column header for table cell values representing the phase/component/stage/section of a larger duration.
126
+ * @description Column header for table cell values representing the subpart/component/stage/section of a larger duration.
127
127
  */
128
- phase: 'Phase',
128
+ subpart: 'Subpart',
129
129
  /**
130
130
  * @description Tooltip text for a link that goes to documentation explaining the Largest Contentful Paint (LCP) metric. "LCP" is an acronym and should not be translated.
131
131
  */
@@ -145,7 +145,7 @@ const UIStrings = {
145
145
  const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/MetricCard.ts', UIStrings);
146
146
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
147
147
 
148
- export type PhaseTable = Array<[string, Trace.Types.Timing.Milli, Trace.Types.Timing.Milli?]>;
148
+ export type SubpartTable = Array<[string, Trace.Types.Timing.Milli, Trace.Types.Timing.Milli?]>;
149
149
 
150
150
  export interface MetricCardData {
151
151
  metric: 'LCP'|'CLS'|'INP';
@@ -153,7 +153,7 @@ export interface MetricCardData {
153
153
  fieldValue?: number|string;
154
154
  histogram?: CrUXManager.MetricResponse['histogram'];
155
155
  tooltipContainer?: HTMLElement;
156
- phases?: PhaseTable;
156
+ subparts?: SubpartTable;
157
157
  warnings?: string[];
158
158
  }
159
159
 
@@ -566,30 +566,30 @@ export class MetricCard extends HTMLElement {
566
566
  // clang-format on
567
567
  }
568
568
 
569
- #renderPhaseTable(phases: PhaseTable): Lit.LitTemplate {
570
- const hasFieldData = phases.every(phase => phase[2] !== undefined);
569
+ #renderSubpartTable(subparts: SubpartTable): Lit.LitTemplate {
570
+ const hasFieldData = subparts.every(subpart => subpart[2] !== undefined);
571
571
 
572
572
  // clang-format off
573
573
  return html`
574
574
  <hr class="divider">
575
- <div class="phase-table" role="table">
576
- <div class="phase-table-row phase-table-header-row" role="row">
577
- <div role="columnheader" style="grid-column: 1">${i18nString(UIStrings.phase)}</div>
578
- <div role="columnheader" class="phase-table-value" style="grid-column: 2">${i18nString(UIStrings.localValue)}</div>
575
+ <div class="subpart-table" role="table">
576
+ <div class="subpart-table-row subpart-table-header-row" role="row">
577
+ <div role="columnheader" style="grid-column: 1">${i18nString(UIStrings.subpart)}</div>
578
+ <div role="columnheader" class="subpart-table-value" style="grid-column: 2">${i18nString(UIStrings.localValue)}</div>
579
579
  ${hasFieldData ? html`
580
580
  <div
581
581
  role="columnheader"
582
- class="phase-table-value"
582
+ class="subpart-table-value"
583
583
  style="grid-column: 3"
584
584
  title=${i18nString(UIStrings.field75thPercentile)}>${i18nString(UIStrings.fieldP75)}</div>
585
585
  ` : nothing}
586
586
  </div>
587
- ${phases.map(phase => html`
588
- <div class="phase-table-row" role="row">
589
- <div role="cell">${phase[0]}</div>
590
- <div role="cell" class="phase-table-value">${i18n.TimeUtilities.preciseMillisToString(phase[1])}</div>
591
- ${phase[2] !== undefined ? html`
592
- <div role="cell" class="phase-table-value">${i18n.TimeUtilities.preciseMillisToString(phase[2])}</div>
587
+ ${subparts.map(subpart => html`
588
+ <div class="subpart-table-row" role="row">
589
+ <div role="cell">${subpart[0]}</div>
590
+ <div role="cell" class="subpart-table-value">${i18n.TimeUtilities.preciseMillisToString(subpart[1])}</div>
591
+ ${subpart[2] !== undefined ? html`
592
+ <div role="cell" class="subpart-table-value">${i18n.TimeUtilities.preciseMillisToString(subpart[2])}</div>
593
593
  ` : nothing}
594
594
  </div>
595
595
  `)}
@@ -659,7 +659,7 @@ export class MetricCard extends HTMLElement {
659
659
  ${this.#renderDetailedCompareString()}
660
660
  <hr class="divider">
661
661
  ${this.#renderFieldHistogram()}
662
- ${localValue && this.#data.phases ? this.#renderPhaseTable(this.#data.phases) : nothing}
662
+ ${localValue && this.#data.subparts ? this.#renderSubpartTable(this.#data.subparts) : nothing}
663
663
  </div>
664
664
  </div>
665
665
  </div>
@@ -175,7 +175,7 @@
175
175
  }
176
176
 
177
177
  .interaction {
178
- --phase-table-margin: 120px;
178
+ --subpart-table-margin: 120px;
179
179
  --details-indicator-width: 18px;
180
180
 
181
181
  summary {
@@ -200,7 +200,7 @@
200
200
 
201
201
  .interaction-type {
202
202
  font-weight: var(--ref-typeface-weight-medium);
203
- width: calc(var(--phase-table-margin) - var(--details-indicator-width));
203
+ width: calc(var(--subpart-table-margin) - var(--details-indicator-width));
204
204
  flex-shrink: 0;
205
205
  }
206
206
 
@@ -344,18 +344,18 @@ devtools-link {
344
344
  }
345
345
  }
346
346
 
347
- .phase-table {
347
+ .subpart-table {
348
348
  border-top: 1px solid var(--sys-color-divider);
349
349
  padding: 7px 4px;
350
- margin-left: var(--phase-table-margin);
350
+ margin-left: var(--subpart-table-margin);
351
351
  }
352
352
 
353
- .phase-table-row {
353
+ .subpart-table-row {
354
354
  display: flex;
355
355
  justify-content: space-between;
356
356
  }
357
357
 
358
- .phase-table-header-row {
358
+ .subpart-table-header-row {
359
359
  font-weight: var(--ref-typeface-weight-medium);
360
360
  margin-bottom: 4px;
361
361
  }