chrome-devtools-frontend 1.0.1376716 → 1.0.1380117

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 (434) hide show
  1. package/config/gni/devtools_grd_files.gni +15 -7
  2. package/config/gni/devtools_image_files.gni +2 -0
  3. package/front_end/Images/src/animation.svg +3 -0
  4. package/front_end/Images/src/brush-2.svg +3 -0
  5. package/front_end/core/common/SettingRegistration.ts +1 -1
  6. package/front_end/core/host/AidaClient.ts +1 -0
  7. package/front_end/core/host/InspectorFrontendHost.ts +4 -0
  8. package/front_end/core/i18n/ByteUtilities.test.ts +34 -0
  9. package/front_end/core/i18n/ByteUtilities.ts +65 -0
  10. package/front_end/core/i18n/NumberFormatter.ts +75 -0
  11. package/front_end/core/i18n/i18n.ts +4 -0
  12. package/front_end/core/i18n/time-utilities.test.ts +20 -2
  13. package/front_end/core/i18n/time-utilities.ts +125 -86
  14. package/front_end/core/platform/NumberUtilities.test.ts +3 -26
  15. package/front_end/core/platform/NumberUtilities.ts +0 -20
  16. package/front_end/core/root/Runtime.ts +6 -3
  17. package/front_end/core/sdk/CPUThrottlingManager.ts +4 -0
  18. package/front_end/core/sdk/CSSContainerQuery.test.ts +10 -16
  19. package/front_end/core/sdk/CSSContainerQuery.ts +3 -15
  20. package/front_end/core/sdk/CSSMatchedStyles.test.ts +4 -0
  21. package/front_end/core/sdk/CSSMatchedStyles.ts +5 -5
  22. package/front_end/core/sdk/CSSModel.ts +18 -0
  23. package/front_end/core/sdk/CSSPropertyParser.test.ts +16 -1
  24. package/front_end/core/sdk/CSSPropertyParser.ts +2 -2
  25. package/front_end/core/sdk/sdk-meta.ts +8 -0
  26. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +3 -3
  27. package/front_end/generated/ARIAProperties.js +4 -0
  28. package/front_end/generated/InspectorBackendCommands.js +8 -6
  29. package/front_end/generated/SupportedCSSProperties.js +17 -4
  30. package/front_end/generated/protocol-mapping.d.ts +15 -1
  31. package/front_end/generated/protocol-proxy-api.d.ts +14 -1
  32. package/front_end/generated/protocol.ts +26 -2
  33. package/front_end/models/extensions/ExtensionAPI.ts +9 -1
  34. package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +2 -0
  35. package/front_end/models/javascript_metadata/NativeFunctions.js +8 -21
  36. package/front_end/models/live-metrics/web-vitals-injected/{rollup.config.js → rollup.config.mjs} +1 -1
  37. package/front_end/models/persistence/EditFileSystemView.ts +19 -9
  38. package/front_end/models/persistence/WorkspaceSettingsTab.ts +50 -54
  39. package/front_end/models/persistence/editFileSystemView.css +35 -15
  40. package/front_end/models/persistence/workspaceSettingsTab.css +21 -87
  41. package/front_end/models/timeline_model/timeline_model.ts +0 -6
  42. package/front_end/models/trace/Processor.test.ts +18 -17
  43. package/front_end/models/trace/Processor.ts +10 -14
  44. package/front_end/models/trace/README.md +0 -1
  45. package/front_end/models/{timeline_model → trace/extras}/TimelineJSProfile.ts +19 -29
  46. package/front_end/models/{timeline_model/TimelineModelFilter.test.ts → trace/extras/TraceFilter.test.ts} +15 -17
  47. package/front_end/models/trace/extras/TraceFilter.ts +62 -0
  48. package/front_end/models/{timeline_model/TimelineProfileTree.test.ts → trace/extras/TraceTree.test.ts} +44 -43
  49. package/front_end/models/{timeline_model/TimelineProfileTree.ts → trace/extras/TraceTree.ts} +65 -59
  50. package/front_end/models/trace/extras/extras.ts +3 -0
  51. package/front_end/models/trace/handlers/AnimationHandler.ts +0 -8
  52. package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +1 -11
  53. package/front_end/models/trace/handlers/FramesHandler.test.ts +1 -6
  54. package/front_end/models/trace/handlers/FramesHandler.ts +1 -14
  55. package/front_end/models/trace/handlers/GPUHandler.test.ts +0 -2
  56. package/front_end/models/trace/handlers/GPUHandler.ts +1 -25
  57. package/front_end/models/trace/handlers/ImagePaintingHandler.ts +3 -0
  58. package/front_end/models/trace/handlers/InitiatorsHandler.test.ts +0 -1
  59. package/front_end/models/trace/handlers/InitiatorsHandler.ts +0 -20
  60. package/front_end/models/trace/handlers/InvalidationsHandler.test.ts +0 -1
  61. package/front_end/models/trace/handlers/InvalidationsHandler.ts +0 -18
  62. package/front_end/models/trace/handlers/LargestImagePaintHandler.test.ts +2 -2
  63. package/front_end/models/trace/handlers/LargestImagePaintHandler.ts +63 -3
  64. package/front_end/models/trace/handlers/LargestTextPaintHandler.ts +3 -0
  65. package/front_end/models/trace/handlers/LayerTreeHandler.test.ts +0 -2
  66. package/front_end/models/trace/handlers/LayerTreeHandler.ts +1 -18
  67. package/front_end/models/trace/handlers/LayoutShiftsHandler.test.ts +0 -3
  68. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +1 -20
  69. package/front_end/models/trace/handlers/MemoryHandler.test.ts +0 -1
  70. package/front_end/models/trace/handlers/MemoryHandler.ts +3 -0
  71. package/front_end/models/trace/handlers/MetaHandler.test.ts +1 -32
  72. package/front_end/models/trace/handlers/MetaHandler.ts +2 -30
  73. package/front_end/models/trace/handlers/NetworkRequestsHandler.test.ts +0 -26
  74. package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +4 -23
  75. package/front_end/models/trace/handlers/PageFramesHandler.ts +3 -0
  76. package/front_end/models/trace/handlers/RendererHandler.test.ts +0 -4
  77. package/front_end/models/trace/handlers/RendererHandler.ts +1 -24
  78. package/front_end/models/trace/handlers/SamplesHandler.test.ts +0 -5
  79. package/front_end/models/trace/handlers/SamplesHandler.ts +0 -26
  80. package/front_end/models/trace/handlers/ScreenshotsHandler.test.ts +0 -1
  81. package/front_end/models/trace/handlers/SelectorStatsHandler.ts +3 -0
  82. package/front_end/models/trace/handlers/ServerTimingsHandler.ts +1 -16
  83. package/front_end/models/trace/handlers/Threads.test.ts +1 -2
  84. package/front_end/models/trace/handlers/UserInteractionsHandler.test.ts +4 -27
  85. package/front_end/models/trace/handlers/UserInteractionsHandler.ts +16 -25
  86. package/front_end/models/trace/handlers/UserTimingsHandler.ts +0 -17
  87. package/front_end/models/trace/handlers/WorkersHandler.test.ts +0 -1
  88. package/front_end/models/trace/handlers/WorkersHandler.ts +0 -23
  89. package/front_end/models/trace/handlers/types.ts +1 -8
  90. package/front_end/models/trace/insights/{CumulativeLayoutShift.test.ts → CLSCulprits.test.ts} +21 -21
  91. package/front_end/models/trace/insights/{CumulativeLayoutShift.ts → CLSCulprits.ts} +24 -5
  92. package/front_end/models/trace/insights/Common.ts +5 -55
  93. package/front_end/models/trace/insights/DocumentLatency.test.ts +2 -2
  94. package/front_end/models/trace/insights/DocumentLatency.ts +26 -6
  95. package/front_end/models/trace/insights/FontDisplay.ts +24 -5
  96. package/front_end/models/trace/insights/InteractionToNextPaint.test.ts +1 -1
  97. package/front_end/models/trace/insights/InteractionToNextPaint.ts +26 -6
  98. package/front_end/models/trace/insights/LCPDiscovery.test.ts +58 -0
  99. package/front_end/models/trace/insights/LCPDiscovery.ts +101 -0
  100. package/front_end/models/trace/insights/{LargestContentfulPaint.test.ts → LCPPhases.test.ts} +6 -28
  101. package/front_end/models/trace/insights/{LargestContentfulPaint.ts → LCPPhases.ts} +37 -38
  102. package/front_end/models/trace/insights/{InsightRunners.ts → Models.ts} +4 -3
  103. package/front_end/models/trace/insights/RenderBlocking.test.ts +1 -1
  104. package/front_end/models/trace/insights/RenderBlocking.ts +33 -28
  105. package/front_end/models/trace/insights/SlowCSSSelector.ts +26 -5
  106. package/front_end/models/trace/insights/{ThirdPartyWeb.test.ts → ThirdParties.test.ts} +3 -3
  107. package/front_end/models/trace/insights/{ThirdPartyWeb.ts → ThirdParties.ts} +24 -5
  108. package/front_end/models/trace/insights/Viewport.test.ts +1 -1
  109. package/front_end/models/trace/insights/Viewport.ts +27 -9
  110. package/front_end/models/trace/insights/insights.ts +1 -1
  111. package/front_end/models/trace/insights/types.ts +11 -9
  112. package/front_end/models/trace/types/TraceEvents.ts +51 -22
  113. package/front_end/panels/application/SharedStorageItemsView.test.ts +3 -3
  114. package/front_end/panels/application/SharedStorageItemsView.ts +5 -3
  115. package/front_end/panels/application/StorageView.ts +3 -3
  116. package/front_end/panels/application/components/StorageMetadataView.ts +1 -2
  117. package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +34 -31
  118. package/front_end/panels/coverage/CoverageView.ts +3 -3
  119. package/front_end/panels/elements/ComputedStyleModel.ts +9 -2
  120. package/front_end/panels/elements/ComputedStyleWidget.test.ts +72 -0
  121. package/front_end/panels/elements/ComputedStyleWidget.ts +12 -0
  122. package/front_end/panels/elements/ElementStatePaneWidget.test.ts +84 -30
  123. package/front_end/panels/elements/ElementStatePaneWidget.ts +42 -24
  124. package/front_end/panels/elements/ElementsTreeElement.ts +24 -11
  125. package/front_end/panels/elements/MetricsSidebarPane.ts +12 -7
  126. package/front_end/panels/elements/PropertyMatchers.ts +3 -0
  127. package/front_end/panels/elements/StylePropertiesSection.ts +15 -6
  128. package/front_end/panels/elements/StylePropertyTreeElement.test.ts +3 -1
  129. package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -3
  130. package/front_end/panels/elements/stylePropertiesTreeOutline.css +2 -2
  131. package/front_end/panels/explain/components/ConsoleInsight.ts +8 -18
  132. package/front_end/panels/freestyler/AiAgent.test.ts +58 -1
  133. package/front_end/panels/freestyler/AiAgent.ts +58 -3
  134. package/front_end/panels/freestyler/DrJonesFileAgent.test.ts +99 -23
  135. package/front_end/panels/freestyler/DrJonesFileAgent.ts +53 -20
  136. package/front_end/panels/freestyler/DrJonesNetworkAgent.test.ts +15 -7
  137. package/front_end/panels/freestyler/DrJonesNetworkAgent.ts +36 -15
  138. package/front_end/panels/freestyler/DrJonesPerformanceAgent.test.ts +6 -6
  139. package/front_end/panels/freestyler/DrJonesPerformanceAgent.ts +48 -8
  140. package/front_end/panels/freestyler/FreestylerAgent.test.ts +15 -14
  141. package/front_end/panels/freestyler/FreestylerAgent.ts +52 -8
  142. package/front_end/panels/freestyler/FreestylerPanel.test.ts +539 -39
  143. package/front_end/panels/freestyler/FreestylerPanel.ts +349 -215
  144. package/front_end/panels/freestyler/components/FreestylerChatUi.test.ts +126 -34
  145. package/front_end/panels/freestyler/components/FreestylerChatUi.ts +320 -268
  146. package/front_end/panels/freestyler/components/UserActionRow.ts +156 -47
  147. package/front_end/panels/freestyler/components/freestylerChatUi.css +69 -34
  148. package/front_end/panels/freestyler/components/userActionRow.css +40 -67
  149. package/front_end/panels/freestyler/freestyler-meta.ts +3 -11
  150. package/front_end/panels/issues/components/HideIssuesMenu.ts +2 -11
  151. package/front_end/panels/layer_viewer/LayerDetailsView.ts +1 -2
  152. package/front_end/panels/layer_viewer/PaintProfilerView.ts +5 -5
  153. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +46 -0
  154. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +26 -17
  155. package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +25 -19
  156. package/front_end/panels/network/BinaryResourceView.ts +6 -7
  157. package/front_end/panels/network/EventSourceMessagesView.ts +1 -1
  158. package/front_end/panels/network/NetworkDataGridNode.ts +3 -3
  159. package/front_end/panels/network/NetworkLogView.ts +7 -8
  160. package/front_end/panels/network/RequestTimingView.test.ts +35 -1
  161. package/front_end/panels/network/RequestTimingView.ts +96 -0
  162. package/front_end/panels/network/ResourceWebSocketFrameView.ts +2 -2
  163. package/front_end/panels/network/networkTimingTable.css +2 -1
  164. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
  165. package/front_end/panels/profiler/HeapProfileView.ts +3 -3
  166. package/front_end/panels/profiler/HeapSnapshotView.ts +2 -2
  167. package/front_end/panels/profiler/HeapTimelineOverview.ts +12 -12
  168. package/front_end/panels/profiler/IsolateSelector.ts +3 -4
  169. package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +1 -1
  170. package/front_end/panels/profiler/ProfileSidebarTreeElement.ts +7 -6
  171. package/front_end/panels/profiler/ProfileView.ts +1 -1
  172. package/front_end/panels/recorder/components/RecordingView.ts +2 -2
  173. package/front_end/panels/recorder/injected/{rollup.config.js → rollup.config.mjs} +1 -1
  174. package/front_end/panels/recorder/recorderController.css +0 -4
  175. package/front_end/panels/security/CookieReportTreeElement.ts +1 -9
  176. package/front_end/panels/security/CookieReportView.ts +120 -0
  177. package/front_end/panels/security/SecurityPanel.ts +8 -2
  178. package/front_end/panels/security/cookieReportView.css +46 -0
  179. package/front_end/panels/security/sidebar.css +1 -2
  180. package/front_end/panels/sensors/LocationsSettingsTab.ts +26 -11
  181. package/front_end/panels/sensors/locationsSettingsTab.css +18 -18
  182. package/front_end/panels/settings/AISettingsTab.ts +6 -15
  183. package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
  184. package/front_end/panels/settings/SettingsScreen.ts +61 -56
  185. package/front_end/panels/settings/aiSettingsTab.css +3 -14
  186. package/front_end/panels/settings/components/SyncSection.ts +1 -2
  187. package/front_end/panels/settings/components/syncSection.css +0 -10
  188. package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +3 -1
  189. package/front_end/panels/settings/keybindsSettingsTab.css +7 -10
  190. package/front_end/panels/settings/settingsScreen.css +27 -125
  191. package/front_end/panels/sources/DebuggerPlugin.ts +9 -4
  192. package/front_end/panels/sources/NavigatorView.ts +11 -13
  193. package/front_end/panels/timeline/ActiveFilters.ts +3 -4
  194. package/front_end/panels/timeline/AnimationsTrackAppender.ts +1 -2
  195. package/front_end/panels/timeline/CountersGraph.ts +2 -4
  196. package/front_end/panels/timeline/EventsTimelineTreeView.ts +7 -8
  197. package/front_end/panels/timeline/README.md +2 -1
  198. package/front_end/panels/timeline/TimelineController.ts +14 -4
  199. package/front_end/panels/timeline/TimelineEventOverview.ts +3 -4
  200. package/front_end/panels/timeline/TimelineFilters.ts +3 -4
  201. package/front_end/panels/timeline/TimelineFlameChartDataProvider.test.ts +1 -1
  202. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -10
  203. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -2
  204. package/front_end/panels/timeline/TimelineFlameChartView.ts +21 -12
  205. package/front_end/panels/timeline/TimelineLoader.test.ts +1 -2
  206. package/front_end/panels/timeline/TimelineLoader.ts +3 -4
  207. package/front_end/panels/timeline/TimelineMiniMap.ts +10 -0
  208. package/front_end/panels/timeline/TimelinePanel.ts +20 -8
  209. package/front_end/panels/timeline/TimelineTreeView.test.ts +12 -13
  210. package/front_end/panels/timeline/TimelineTreeView.ts +35 -40
  211. package/front_end/panels/timeline/TimelineUIUtils.test.ts +2 -2
  212. package/front_end/panels/timeline/TimelineUIUtils.ts +12 -14
  213. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +6 -7
  214. package/front_end/panels/timeline/components/LiveMetricsView.test.ts +3 -3
  215. package/front_end/panels/timeline/components/LiveMetricsView.ts +14 -26
  216. package/front_end/panels/timeline/components/MetricCard.test.ts +1 -1
  217. package/front_end/panels/timeline/components/MetricCard.ts +46 -0
  218. package/front_end/panels/timeline/components/NetworkRequestDetails.ts +3 -4
  219. package/front_end/panels/timeline/components/SidebarSingleInsightSet.test.ts +2 -0
  220. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +41 -36
  221. package/front_end/panels/timeline/components/insights/CLSCulprits.ts +19 -33
  222. package/front_end/panels/timeline/components/insights/DocumentLatency.ts +29 -40
  223. package/front_end/panels/timeline/components/insights/FontDisplay.ts +17 -23
  224. package/front_end/panels/timeline/components/insights/Helpers.ts +12 -16
  225. package/front_end/panels/timeline/components/insights/InteractionToNextPaint.ts +14 -26
  226. package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +25 -37
  227. package/front_end/panels/timeline/components/insights/LCPPhases.ts +20 -47
  228. package/front_end/panels/timeline/components/insights/RenderBlocking.ts +19 -28
  229. package/front_end/panels/timeline/components/insights/SidebarInsight.ts +1 -2
  230. package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +18 -31
  231. package/front_end/panels/timeline/components/insights/Table.ts +5 -3
  232. package/front_end/panels/timeline/components/insights/ThirdParties.ts +18 -25
  233. package/front_end/panels/timeline/components/insights/Viewport.ts +14 -25
  234. package/front_end/panels/timeline/components/liveMetricsView.css +5 -13
  235. package/front_end/panels/timeline/components/metricCard.css +11 -0
  236. package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -1
  237. package/front_end/panels/timeline/overlays/OverlaysImpl.test.ts +5 -5
  238. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +13 -12
  239. package/front_end/panels/timeline/timelineFlameChartView.css +1 -1
  240. package/front_end/panels/timeline/utils/AICallTree.test.ts +105 -0
  241. package/front_end/panels/timeline/utils/AICallTree.ts +25 -24
  242. package/front_end/testing/EnvironmentHelpers.ts +5 -18
  243. package/front_end/testing/InsightHelpers.ts +4 -4
  244. package/front_end/testing/TraceHelpers.ts +1 -1
  245. package/front_end/third_party/puppeteer/README.chromium +2 -2
  246. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +2 -3
  247. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
  248. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
  249. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts +14 -3
  250. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
  251. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js +16 -2
  252. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
  253. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.d.ts +34 -5
  254. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.d.ts.map +1 -1
  255. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.js +51 -2
  256. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.js.map +1 -1
  257. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.d.ts.map +1 -1
  258. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.js +10 -8
  259. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.js.map +1 -1
  260. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
  261. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
  262. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
  263. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.d.ts +14 -4
  264. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.d.ts.map +1 -1
  265. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.js +57 -23
  266. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.js.map +1 -1
  267. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.d.ts +1 -1
  268. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.d.ts.map +1 -1
  269. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.js +13 -10
  270. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.js.map +1 -1
  271. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.d.ts +15 -4
  272. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.d.ts.map +1 -1
  273. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.js +55 -26
  274. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.js.map +1 -1
  275. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts +0 -8
  276. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
  277. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js +2 -11
  278. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js.map +1 -1
  279. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +2 -1
  280. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  281. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +5 -2
  282. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
  283. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts +7 -0
  284. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts.map +1 -1
  285. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js +9 -1
  286. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js.map +1 -1
  287. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.d.ts.map +1 -1
  288. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.js +5 -3
  289. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.js.map +1 -1
  290. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.d.ts +1 -1
  291. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.d.ts.map +1 -1
  292. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.js +0 -3
  293. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.js.map +1 -1
  294. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +1 -1
  295. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +1 -1
  296. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
  297. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
  298. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  299. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  300. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  301. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  302. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  303. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.d.ts +14 -0
  304. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.d.ts.map +1 -0
  305. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.js +18 -0
  306. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.js.map +1 -0
  307. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +51 -10
  308. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +215 -97
  309. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +2 -3
  310. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
  311. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
  312. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts +14 -3
  313. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
  314. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js +16 -2
  315. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
  316. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts +34 -5
  317. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts.map +1 -1
  318. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.js +51 -2
  319. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.js.map +1 -1
  320. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.d.ts.map +1 -1
  321. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.js +10 -8
  322. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.js.map +1 -1
  323. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
  324. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
  325. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
  326. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.d.ts +14 -4
  327. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.d.ts.map +1 -1
  328. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.js +57 -23
  329. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.js.map +1 -1
  330. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.d.ts +1 -1
  331. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.d.ts.map +1 -1
  332. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.js +13 -10
  333. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.js.map +1 -1
  334. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.d.ts +15 -4
  335. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.d.ts.map +1 -1
  336. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.js +55 -26
  337. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.js.map +1 -1
  338. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts +0 -8
  339. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
  340. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js +1 -9
  341. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js.map +1 -1
  342. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +2 -1
  343. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  344. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +5 -2
  345. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
  346. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts +7 -0
  347. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts.map +1 -1
  348. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js +7 -0
  349. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js.map +1 -1
  350. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.d.ts.map +1 -1
  351. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.js +5 -3
  352. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.js.map +1 -1
  353. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts +1 -1
  354. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts.map +1 -1
  355. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.js +0 -3
  356. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.js.map +1 -1
  357. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +1 -1
  358. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +1 -1
  359. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
  360. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
  361. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  362. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  363. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  364. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.d.ts +14 -0
  365. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.d.ts.map +1 -0
  366. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.js +15 -0
  367. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.js.map +1 -0
  368. package/front_end/third_party/puppeteer/package/lib/types.d.ts +51 -10
  369. package/front_end/third_party/puppeteer/package/package.json +4 -4
  370. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +2 -3
  371. package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +21 -3
  372. package/front_end/third_party/puppeteer/package/src/api/Input.ts +57 -8
  373. package/front_end/third_party/puppeteer/package/src/bidi/ElementHandle.ts +9 -7
  374. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +1 -0
  375. package/front_end/third_party/puppeteer/package/src/bidi/Input.ts +72 -31
  376. package/front_end/third_party/puppeteer/package/src/cdp/ElementHandle.ts +14 -9
  377. package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +71 -26
  378. package/front_end/third_party/puppeteer/package/src/common/CallbackRegistry.ts +1 -15
  379. package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +8 -1
  380. package/front_end/third_party/puppeteer/package/src/common/Errors.ts +7 -0
  381. package/front_end/third_party/puppeteer/package/src/common/WaitTask.ts +9 -9
  382. package/front_end/third_party/puppeteer/package/src/environment.ts +1 -4
  383. package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
  384. package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
  385. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  386. package/front_end/third_party/puppeteer/package/src/util/incremental-id-generator.ts +20 -0
  387. package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +1 -0
  388. package/front_end/ui/components/buttons/Button.test.ts +14 -0
  389. package/front_end/ui/components/buttons/Button.ts +27 -4
  390. package/front_end/ui/components/cards/card.css +7 -4
  391. package/front_end/ui/components/dialogs/Dialog.ts +2 -4
  392. package/front_end/ui/components/dialogs/ShortcutDialog.ts +15 -13
  393. package/front_end/ui/components/dialogs/dialog.css +2 -6
  394. package/front_end/ui/components/dialogs/shortcutDialog.css +33 -41
  395. package/front_end/ui/components/docs/freestyler/basic.ts +6 -8
  396. package/front_end/ui/components/docs/freestyler/empty_state.ts +6 -8
  397. package/front_end/ui/components/docs/performance_panel/track_example.html +1 -1
  398. package/front_end/ui/components/markdown_view/MarkdownView.test.ts +39 -17
  399. package/front_end/ui/components/markdown_view/MarkdownView.ts +77 -14
  400. package/front_end/ui/components/markdown_view/markdownView.css +15 -0
  401. package/front_end/ui/components/settings/SettingCheckbox.ts +3 -2
  402. package/front_end/ui/legacy/ContextMenu.ts +2 -2
  403. package/front_end/ui/legacy/InplaceEditor.ts +18 -14
  404. package/front_end/ui/legacy/TabbedPane.ts +0 -14
  405. package/front_end/ui/legacy/UIUtils.ts +0 -7
  406. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +7 -2
  407. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +8 -4
  408. package/front_end/ui/legacy/components/data_grid/ViewportDataGrid.ts +20 -11
  409. package/front_end/ui/legacy/components/inline_editor/LinkSwatch.test.ts +19 -0
  410. package/front_end/ui/legacy/components/inline_editor/LinkSwatch.ts +1 -1
  411. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +1 -1
  412. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +5 -22
  413. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +129 -100
  414. package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +4 -2
  415. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewCalculator.test.ts +9 -4
  416. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewCalculator.ts +6 -6
  417. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +22 -4
  418. package/front_end/ui/legacy/components/perf_ui/flameChart.css +0 -2
  419. package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.test.ts +49 -0
  420. package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +23 -46
  421. package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -1
  422. package/front_end/ui/legacy/components/utils/ImagePreview.ts +1 -1
  423. package/front_end/ui/legacy/textPrompt.css +1 -1
  424. package/front_end/ui/legacy/toolbar.css +4 -5
  425. package/front_end/ui/visual_logging/KnownContextValues.ts +174 -0
  426. package/front_end/ui/visual_logging/LoggingConfig.ts +6 -2
  427. package/package.json +7 -6
  428. package/scripts/build/ninja/bundle.gni +3 -3
  429. package/scripts/build/{rollup.config.js → rollup.config.mjs} +4 -4
  430. package/scripts/devtools_paths.py +8 -4
  431. package/scripts/eslint_rules/tests/check_test_definitions_test.js +8 -3
  432. package/scripts/tools/update_goldens_v2.py +1 -1
  433. package/front_end/models/timeline_model/TimelineModelFilter.ts +0 -61
  434. /package/front_end/Images/{rollup.config.js → rollup.config.mjs} +0 -0
@@ -9,12 +9,13 @@ import * as i18n from '../../../../core/i18n/i18n.js';
9
9
  import * as Platform from '../../../../core/platform/platform.js';
10
10
  import * as SDK from '../../../../core/sdk/sdk.js';
11
11
  import type * as Protocol from '../../../../generated/protocol.js';
12
+ import type {SlowCSSSelectorInsightModel} from '../../../../models/trace/insights/SlowCSSSelector.js';
12
13
  import * as Trace from '../../../../models/trace/trace.js';
13
14
  import type * as Linkifier from '../../../../ui/components/linkifier/linkifier.js';
14
15
  import * as LitHtml from '../../../../ui/lit-html/lit-html.js';
15
16
  import type * as Overlays from '../../overlays/overlays.js';
16
17
 
17
- import {BaseInsight, shouldRenderForCategory} from './Helpers.js';
18
+ import {BaseInsightComponent, shouldRenderForCategory} from './Helpers.js';
18
19
  import type * as SidebarInsight from './SidebarInsight.js';
19
20
  import type {TableData} from './Table.js';
20
21
  import {Category} from './types.js';
@@ -22,17 +23,6 @@ import {Category} from './types.js';
22
23
  const {html} = LitHtml;
23
24
 
24
25
  const UIStrings = {
25
- /**
26
- *@description Title of an insight that provides details about slow CSS selectors.
27
- */
28
- title: 'CSS Selector costs',
29
-
30
- /**
31
- * @description Text to describe how to improve the performance of CSS selectors.
32
- */
33
- description:
34
- 'If Recalculate Style costs remain high, selector optimization can reduce them. [Optimize the selectors](https://developer.chrome.com/docs/devtools/performance/selector-stats) with both high elapsed time and high slow-path %. Simpler selectors, fewer selectors, a smaller DOM, and a shallower DOM will all reduce matching costs.',
35
-
36
26
  /**
37
27
  *@description Column name for count of elements that the engine attempted to match against a style rule
38
28
  */
@@ -58,13 +48,10 @@ const UIStrings = {
58
48
  const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/SlowCSSSelector.ts', UIStrings);
59
49
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
60
50
 
61
- export class SlowCSSSelector extends BaseInsight {
51
+ export class SlowCSSSelector extends BaseInsightComponent<SlowCSSSelectorInsightModel> {
62
52
  static override readonly litTagName = LitHtml.literal`devtools-performance-slow-css-selector`;
63
53
  override insightCategory: Category = Category.ALL;
64
54
  override internalName: string = 'slow-css-selector';
65
- override userVisibleTitle: string = i18nString(UIStrings.title);
66
- override description: string = i18nString(UIStrings.description);
67
- #slowCSSSelector: Trace.Insights.InsightRunners.SlowCSSSelector.SlowCSSSelectorInsightResult|null = null;
68
55
  #selectorLocations: Map<string, Protocol.CSS.SourceRange[]> = new Map();
69
56
 
70
57
  override createOverlays(): Overlays.Overlays.TimelineOverlay[] {
@@ -133,17 +120,21 @@ export class SlowCSSSelector extends BaseInsight {
133
120
  }
134
121
 
135
122
  renderSlowCSSSelector(): LitHtml.LitTemplate {
123
+ if (!this.model) {
124
+ return LitHtml.nothing;
125
+ }
126
+
136
127
  const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
137
128
  const cssModel = target?.model(SDK.CSSModel.CSSModel);
138
129
  const time = (us: Trace.Types.Timing.MicroSeconds): string =>
139
130
  i18n.TimeUtilities.millisToString(Platform.Timing.microSecondsToMilliSeconds(us));
140
131
 
141
132
  // clang-format off
142
- return this.#slowCSSSelector ? html`
133
+ return html`
143
134
  <div class="insights">
144
135
  <devtools-performance-sidebar-insight .data=${{
145
- title: this.userVisibleTitle,
146
- description: this.description,
136
+ title: this.model.title,
137
+ description: this.model.description,
147
138
  internalName: this.internalName,
148
139
  expanded: this.isActive(),
149
140
  } as SidebarInsight.InsightDetails}
@@ -155,9 +146,9 @@ export class SlowCSSSelector extends BaseInsight {
155
146
  insight: this,
156
147
  headers: [i18nString(UIStrings.total), ''],
157
148
  rows: [
158
- {values: [i18nString(UIStrings.elapsed), i18n.TimeUtilities.millisToString(this.#slowCSSSelector.totalElapsedMs)]},
159
- {values: [i18nString(UIStrings.matchAttempts), this.#slowCSSSelector.totalMatchAttempts]},
160
- {values: [i18nString(UIStrings.matchCount), this.#slowCSSSelector.totalMatchCount]},
149
+ {values: [i18nString(UIStrings.elapsed), i18n.TimeUtilities.millisToString(this.model.totalElapsedMs)]},
150
+ {values: [i18nString(UIStrings.matchAttempts), this.model.totalMatchAttempts]},
151
+ {values: [i18nString(UIStrings.matchCount), this.model.totalMatchCount]},
161
152
  ],
162
153
  } as TableData}>
163
154
  </devtools-performance-table>`}
@@ -167,7 +158,7 @@ export class SlowCSSSelector extends BaseInsight {
167
158
  .data=${{
168
159
  insight: this,
169
160
  headers: [i18nString(UIStrings.topSelectors), i18nString(UIStrings.elapsed)],
170
- rows: this.#slowCSSSelector.topElapsedMs.map(selector => {
161
+ rows: this.model.topElapsedMs.map(selector => {
171
162
  return {
172
163
  values: [
173
164
  html`${selector.selector} ${LitHtml.Directives.until(this.getSelectorLinks(cssModel, selector))}`,
@@ -182,7 +173,7 @@ export class SlowCSSSelector extends BaseInsight {
182
173
  .data=${{
183
174
  insight: this,
184
175
  headers: [i18nString(UIStrings.topSelectors), i18nString(UIStrings.matchAttempts)],
185
- rows: this.#slowCSSSelector.topMatchAttempts.map(selector => {
176
+ rows: this.model.topMatchAttempts.map(selector => {
186
177
  return {
187
178
  values: [
188
179
  html`${selector.selector} ${LitHtml.Directives.until(this.getSelectorLinks(cssModel, selector))}` as unknown as string,
@@ -194,20 +185,16 @@ export class SlowCSSSelector extends BaseInsight {
194
185
  </div>
195
186
  </div>
196
187
  </devtools-performance-sidebar-insight>
197
- </div>` : LitHtml.nothing;
188
+ </div>`;
198
189
  // clang-format on
199
190
  }
200
191
 
201
192
  #hasDataToRender(): boolean {
202
- this.#slowCSSSelector =
203
- Trace.Insights.Common.getInsight('SlowCSSSelector', this.data.insights, this.data.insightSetKey);
204
- return this.#slowCSSSelector !== null && this.#slowCSSSelector.topElapsedMs.length !== 0 &&
205
- this.#slowCSSSelector.topMatchAttempts.length !== 0;
193
+ return this.model !== null && this.model.topElapsedMs.length !== 0 && this.model.topMatchAttempts.length !== 0;
206
194
  }
207
195
 
208
196
  override getRelatedEvents(): Trace.Types.Events.Event[] {
209
- const insight = Trace.Insights.Common.getInsight('SlowCSSSelector', this.data.insights, this.data.insightSetKey);
210
- return insight?.relatedEvents ?? [];
197
+ return this.model?.relatedEvents ?? [];
211
198
  }
212
199
 
213
200
  override render(): void {
@@ -6,7 +6,7 @@ import * as ComponentHelpers from '../../../../ui/components/helpers/helpers.js'
6
6
  import * as LitHtml from '../../../../ui/lit-html/lit-html.js';
7
7
  import type * as Overlays from '../../overlays/overlays.js';
8
8
 
9
- import type {BaseInsight} from './Helpers.js';
9
+ import type {BaseInsightComponent} from './Helpers.js';
10
10
  import tableStyles from './table.css.js';
11
11
 
12
12
  const {html} = LitHtml;
@@ -33,7 +33,8 @@ export type TableState = {
33
33
  };
34
34
 
35
35
  export interface TableData {
36
- insight: BaseInsight;
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
+ insight: BaseInsightComponent<any>;
37
38
  headers: string[];
38
39
  rows: TableDataRow[];
39
40
  }
@@ -47,7 +48,8 @@ export class Table extends HTMLElement {
47
48
 
48
49
  readonly #shadow = this.attachShadow({mode: 'open'});
49
50
  readonly #boundRender = this.#render.bind(this);
50
- #insight?: BaseInsight;
51
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
+ #insight?: BaseInsightComponent<any>;
51
53
  #state?: TableState;
52
54
  #headers?: string[];
53
55
  #rows?: TableDataRow[];
@@ -6,11 +6,12 @@ import './Table.js';
6
6
 
7
7
  import * as i18n from '../../../../core/i18n/i18n.js';
8
8
  import * as Platform from '../../../../core/platform/platform.js';
9
- import * as Trace from '../../../../models/trace/trace.js';
9
+ import type {ThirdPartiesInsightModel} from '../../../../models/trace/insights/ThirdParties.js';
10
+ import type * as Trace from '../../../../models/trace/trace.js';
10
11
  import * as LitHtml from '../../../../ui/lit-html/lit-html.js';
11
12
  import type * as Overlays from '../../overlays/overlays.js';
12
13
 
13
- import {BaseInsight, shouldRenderForCategory} from './Helpers.js';
14
+ import {BaseInsightComponent, shouldRenderForCategory} from './Helpers.js';
14
15
  import {Category} from './types.js';
15
16
 
16
17
  const {html} = LitHtml;
@@ -21,14 +22,6 @@ type ThirdPartiesEntries = Array<[
21
22
  ]>;
22
23
 
23
24
  const UIStrings = {
24
- /** Title of an insight that provides details about the code on a web page that the user doesn't control (referred to as "third-party code"). */
25
- title: 'Third parties',
26
- /**
27
- * @description Description of a DevTools insight that identifies the code on the page that the user doesn't control.
28
- * This is displayed after a user expands the section to see more. No character length limits.
29
- */
30
- description: 'Third party code can significantly impact load performance. ' +
31
- '[Reduce and defer loading of third party code](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/) to prioritize your page\'s content.',
32
25
  /** Label for a table column that displays the name of a third-party provider. */
33
26
  columnThirdParty: 'Third party',
34
27
  /** Label for a column in a data table; entries will be the download size of a web resource in kilobytes. */
@@ -40,26 +33,23 @@ const UIStrings = {
40
33
  const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/ThirdParties.ts', UIStrings);
41
34
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
42
35
 
43
- export class ThirdParties extends BaseInsight {
36
+ export class ThirdParties extends BaseInsightComponent<ThirdPartiesInsightModel> {
44
37
  static override readonly litTagName = LitHtml.literal`devtools-performance-third-parties`;
45
38
  override insightCategory: Category = Category.ALL;
46
39
  override internalName: string = 'third-parties';
47
- override userVisibleTitle: string = i18nString(UIStrings.title);
48
- override description: string = i18nString(UIStrings.description);
49
40
 
50
41
  #overlaysForEntity = new Map<Trace.Extras.ThirdParties.Entity, Overlays.Overlays.TimelineOverlay[]>();
51
42
 
52
43
  override createOverlays(): Overlays.Overlays.TimelineOverlay[] {
53
44
  this.#overlaysForEntity.clear();
54
45
 
55
- const insight = Trace.Insights.Common.getInsight('ThirdPartyWeb', this.data.insights, this.data.insightSetKey);
56
- if (!insight) {
46
+ if (!this.model) {
57
47
  return [];
58
48
  }
59
49
 
60
50
  const overlays: Overlays.Overlays.TimelineOverlay[] = [];
61
- for (const [entity, requests] of insight.requestsByEntity) {
62
- if (entity === insight.firstPartyEntity) {
51
+ for (const [entity, requests] of this.model.requestsByEntity) {
52
+ if (entity === this.model.firstPartyEntity) {
63
53
  continue;
64
54
  }
65
55
 
@@ -80,7 +70,11 @@ export class ThirdParties extends BaseInsight {
80
70
  return overlays;
81
71
  }
82
72
 
83
- #render(entries: ThirdPartiesEntries): LitHtml.TemplateResult {
73
+ #render(entries: ThirdPartiesEntries): LitHtml.LitTemplate {
74
+ if (!this.model) {
75
+ return LitHtml.nothing;
76
+ }
77
+
84
78
  const topTransferSizeEntries = entries.sort((a, b) => b[1].transferSize - a[1].transferSize).slice(0, 6);
85
79
  const topMainThreadTimeEntries = entries.sort((a, b) => b[1].mainThreadTime - a[1].mainThreadTime).slice(0, 6);
86
80
 
@@ -88,8 +82,8 @@ export class ThirdParties extends BaseInsight {
88
82
  return html`
89
83
  <div class="insights">
90
84
  <devtools-performance-sidebar-insight .data=${{
91
- title: this.userVisibleTitle,
92
- description: this.description,
85
+ title: this.model.title,
86
+ description: this.model.description,
93
87
  internalName: this.internalName,
94
88
  expanded: this.isActive(),
95
89
  }}
@@ -103,7 +97,7 @@ export class ThirdParties extends BaseInsight {
103
97
  rows: topTransferSizeEntries.map(([entity, summary]) => ({
104
98
  values: [
105
99
  entity.name,
106
- Platform.NumberUtilities.bytesToString(summary.transferSize),
100
+ i18n.ByteUtilities.bytesToString(summary.transferSize),
107
101
  ],
108
102
  overlays: this.#overlaysForEntity.get(entity),
109
103
  })),
@@ -133,13 +127,12 @@ export class ThirdParties extends BaseInsight {
133
127
  }
134
128
 
135
129
  override getRelatedEvents(): Trace.Types.Events.Event[] {
136
- const insight = Trace.Insights.Common.getInsight('ThirdPartyWeb', this.data.insights, this.data.insightSetKey);
137
- return insight?.relatedEvents ?? [];
130
+ return this.model?.relatedEvents ?? [];
138
131
  }
139
132
 
140
133
  override render(): void {
141
- const insight = Trace.Insights.Common.getInsight('ThirdPartyWeb', this.data.insights, this.data.insightSetKey);
142
- const entries = insight && [...insight.summaryByEntity.entries()].filter(kv => kv[0] !== insight.firstPartyEntity);
134
+ const model = this.model;
135
+ const entries = model && [...model.summaryByEntity.entries()].filter(kv => kv[0] !== model.firstPartyEntity);
143
136
  const shouldShow = entries?.length;
144
137
 
145
138
  const matchesCategory = shouldRenderForCategory({
@@ -4,50 +4,39 @@
4
4
 
5
5
  import './NodeLink.js';
6
6
 
7
- import * as i18n from '../../../../core/i18n/i18n.js';
8
- import * as Trace from '../../../../models/trace/trace.js';
7
+ import type {ViewportInsightModel} from '../../../../models/trace/insights/Viewport.js';
8
+ import type * as Trace from '../../../../models/trace/trace.js';
9
9
  import * as LitHtml from '../../../../ui/lit-html/lit-html.js';
10
10
  import type * as Overlays from '../../overlays/overlays.js';
11
11
 
12
- import {BaseInsight, shouldRenderForCategory} from './Helpers.js';
12
+ import {BaseInsightComponent, shouldRenderForCategory} from './Helpers.js';
13
13
  import {Category} from './types.js';
14
14
 
15
15
  const {html} = LitHtml;
16
16
 
17
- const UIStrings = {
18
- /** Title of an insight that provides details about if the page's viewport is optimized for mobile viewing. */
19
- title: 'Viewport not optimized for mobile',
20
- /**
21
- * @description Text to tell the user how a viewport meta element can improve performance. \xa0 is a non-breaking space
22
- */
23
- description:
24
- 'The page\'s viewport is not mobile-optimized, so tap interactions may be [delayed by up to 300\xA0ms](https://developer.chrome.com/blog/300ms-tap-delay-gone-away/).',
25
- };
26
-
27
- const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/Viewport.ts', UIStrings);
28
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
29
-
30
- export class Viewport extends BaseInsight {
17
+ export class Viewport extends BaseInsightComponent<ViewportInsightModel> {
31
18
  static override readonly litTagName = LitHtml.literal`devtools-performance-viewport`;
32
19
  override insightCategory: Category = Category.INP;
33
20
  override internalName: string = 'viewport';
34
- override userVisibleTitle: string = i18nString(UIStrings.title);
35
- override description: string = i18nString(UIStrings.description);
36
21
 
37
22
  override createOverlays(): Overlays.Overlays.TimelineOverlay[] {
38
23
  // TODO(b/351757418): create overlay for synthetic input delay events
39
24
  return [];
40
25
  }
41
26
 
42
- #render(insight: Trace.Insights.Types.InsightResults['Viewport']): LitHtml.TemplateResult {
27
+ #render(insight: Trace.Insights.Types.InsightModels['Viewport']): LitHtml.LitTemplate {
28
+ if (!this.model) {
29
+ return LitHtml.nothing;
30
+ }
31
+
43
32
  const backendNodeId = insight.viewportEvent?.args.data.node_id;
44
33
 
45
34
  // clang-format off
46
35
  return html`
47
36
  <div class="insights">
48
37
  <devtools-performance-sidebar-insight .data=${{
49
- title: this.userVisibleTitle,
50
- description: this.description,
38
+ title: this.model.title,
39
+ description: this.model.description,
51
40
  expanded: this.isActive(),
52
41
  internalName: this.internalName,
53
42
  estimatedSavingsTime: insight.metricSavings?.INP,
@@ -65,14 +54,14 @@ export class Viewport extends BaseInsight {
65
54
  }
66
55
 
67
56
  override render(): void {
68
- const viewportInsight = Trace.Insights.Common.getInsight('Viewport', this.data.insights, this.data.insightSetKey);
69
- const shouldShow = viewportInsight && viewportInsight.mobileOptimized === false;
57
+ const model = this.model;
58
+ const shouldShow = model && model.mobileOptimized === false;
70
59
 
71
60
  const matchesCategory = shouldRenderForCategory({
72
61
  activeCategory: this.data.activeCategory,
73
62
  insightCategory: this.insightCategory,
74
63
  });
75
- const output = shouldShow && matchesCategory ? this.#render(viewportInsight) : LitHtml.nothing;
64
+ const output = shouldShow && matchesCategory ? this.#render(model) : LitHtml.nothing;
76
65
  LitHtml.render(output, this.shadow, {host: this});
77
66
  }
78
67
  }
@@ -73,11 +73,6 @@
73
73
  margin-bottom: 10px;
74
74
  }
75
75
 
76
- .section-title-help {
77
- height: var(--sys-typescale-headline4-line-height);
78
- vertical-align: top;
79
- }
80
-
81
76
  .settings-card {
82
77
  border-radius: var(--sys-shape-corner-small);
83
78
  padding: 14px 16px 16px;
@@ -135,6 +130,10 @@
135
130
  min-width: 0;
136
131
  }
137
132
 
133
+ .local-field-link {
134
+ margin-top: 8px;
135
+ }
136
+
138
137
  .logs-section {
139
138
  margin-top: 24px;
140
139
  display: flex;
@@ -293,13 +292,6 @@ x-link { /* stylelint-disable-line selector-type-no-unknown */
293
292
  margin-top: 8px;
294
293
  }
295
294
 
296
- .setting-hint {
297
- margin-left: 6px;
298
- vertical-align: bottom;
299
- height: 18px;
300
- width: 18px;
301
- }
302
-
303
295
  .environment-recs-title {
304
296
  margin-top: 12px;
305
297
  font-weight: var(--ref-typeface-weight-medium);
@@ -336,7 +328,7 @@ x-link { /* stylelint-disable-line selector-type-no-unknown */
336
328
 
337
329
  .phase-table {
338
330
  border-top: 1px solid var(--sys-color-divider);
339
- padding: 7px 0;
331
+ padding: 7px 4px;
340
332
  margin-left: var(--phase-table-margin);
341
333
  }
342
334
 
@@ -10,9 +10,15 @@
10
10
  background-color: var(--sys-color-surface3);
11
11
  height: 100%;
12
12
  box-sizing: border-box;
13
+
14
+ &:not(:hover) .title-help {
15
+ visibility: hidden;
16
+ }
13
17
  }
14
18
 
15
19
  .title {
20
+ display: flex;
21
+ justify-content: space-between;
16
22
  font-size: var(--sys-typescale-headline5-size);
17
23
  line-height: var(--sys-typescale-headline5-line-height);
18
24
  font-weight: var(--ref-typeface-weight-medium);
@@ -20,6 +26,11 @@
20
26
  margin-bottom: 6px;
21
27
  }
22
28
 
29
+ .title-help {
30
+ height: var(--sys-typescale-headline5-line-height);
31
+ margin-left: 4px;
32
+ }
33
+
23
34
  .metric-values-section {
24
35
  position: relative;
25
36
  display: flex;
@@ -49,8 +49,8 @@
49
49
  details:first-child & {
50
50
  border-top: 1px solid var(--sys-color-divider);
51
51
  }
52
- }
53
52
  }
53
+ }
54
54
 
55
55
  .zoom-button {
56
56
  margin-left: auto;
@@ -398,15 +398,15 @@ describeWithEnvironment('Overlays', () => {
398
398
  assert.isOk(overlayDOM);
399
399
  });
400
400
 
401
- it('only renders one CURSOR_TIMESTAMP_MARKER as it is a singleton', async function() {
401
+ it('only renders one TIMESTAMP_MARKER as it is a singleton', async function() {
402
402
  const {parsedTrace} = await TraceLoader.traceEngine(this, 'web-dev.json.gz');
403
403
  const {overlays, container} = setupChartWithDimensionsAndAnnotationOverlayListeners(parsedTrace);
404
404
  overlays.add({
405
- type: 'CURSOR_TIMESTAMP_MARKER',
405
+ type: 'TIMESTAMP_MARKER',
406
406
  timestamp: parsedTrace.Meta.traceBounds.min,
407
407
  });
408
408
  overlays.add({
409
- type: 'CURSOR_TIMESTAMP_MARKER',
409
+ type: 'TIMESTAMP_MARKER',
410
410
  timestamp: parsedTrace.Meta.traceBounds.max,
411
411
  });
412
412
  await overlays.update();
@@ -979,8 +979,8 @@ describeWithEnvironment('Overlays', () => {
979
979
  });
980
980
 
981
981
  it('defines a log for cursor timestamp marker', () => {
982
- const overlay: Overlays.Overlays.CursorTimestampMarker = {
983
- type: 'CURSOR_TIMESTAMP_MARKER',
982
+ const overlay: Overlays.Overlays.TimestampMarker = {
983
+ type: 'TIMESTAMP_MARKER',
984
984
  timestamp: 1_000 as Trace.Types.Timing.MicroSeconds,
985
985
  };
986
986
  const context = Overlays.Overlays.jsLogContext(overlay);
@@ -155,7 +155,7 @@ function traceWindowForOverlay(overlay: TimelineOverlay): Trace.Types.Timing.Tra
155
155
  }
156
156
  break;
157
157
  }
158
- case 'CURSOR_TIMESTAMP_MARKER': {
158
+ case 'TIMESTAMP_MARKER': {
159
159
  overlayMinBounds.push(overlay.timestamp);
160
160
  break;
161
161
  }
@@ -212,7 +212,8 @@ export function entriesForOverlay(overlay: TimelineOverlay): readonly OverlayEnt
212
212
  }
213
213
  break;
214
214
  }
215
- case 'CURSOR_TIMESTAMP_MARKER': {
215
+ case 'TIMESTAMP_MARKER': {
216
+ // This overlay type isn't associated to any entry, so just break here.
216
217
  break;
217
218
  }
218
219
  case 'CANDY_STRIPED_TIME_RANGE': {
@@ -255,8 +256,8 @@ export interface TimespanBreakdown {
255
256
  renderLocation?: 'BOTTOM_OF_TIMELINE'|'BELOW_EVENT'|'ABOVE_EVENT';
256
257
  }
257
258
 
258
- export interface CursorTimestampMarker {
259
- type: 'CURSOR_TIMESTAMP_MARKER';
259
+ export interface TimestampMarker {
260
+ type: 'TIMESTAMP_MARKER';
260
261
  timestamp: Trace.Types.Timing.MicroSeconds;
261
262
  }
262
263
 
@@ -264,7 +265,7 @@ export interface CursorTimestampMarker {
264
265
  * All supported overlay types.
265
266
  */
266
267
  export type TimelineOverlay = EntrySelected|EntryOutline|TimeRangeLabel|EntryLabel|EntriesLink|TimespanBreakdown|
267
- CursorTimestampMarker|CandyStripedTimeRange;
268
+ TimestampMarker|CandyStripedTimeRange;
268
269
 
269
270
  export interface TimelineOverlaySetOptions {
270
271
  updateTraceWindow: boolean;
@@ -275,9 +276,9 @@ export interface TimelineOverlaySetOptions {
275
276
  * exist at any given time. If one exists and the add() method is called, the
276
277
  * new overlay will replace the existing one.
277
278
  */
278
- type SingletonOverlay = EntrySelected|CursorTimestampMarker;
279
+ type SingletonOverlay = EntrySelected|TimestampMarker;
279
280
  export function overlayIsSingleton(overlay: TimelineOverlay): overlay is SingletonOverlay {
280
- return overlay.type === 'CURSOR_TIMESTAMP_MARKER' || overlay.type === 'ENTRY_SELECTED';
281
+ return overlay.type === 'TIMESTAMP_MARKER' || overlay.type === 'ENTRY_SELECTED';
281
282
  }
282
283
 
283
284
  /**
@@ -790,7 +791,7 @@ export class Overlays extends EventTarget {
790
791
  break;
791
792
  }
792
793
 
793
- case 'CURSOR_TIMESTAMP_MARKER': {
794
+ case 'TIMESTAMP_MARKER': {
794
795
  const {visibleWindow} = this.#dimensions.trace;
795
796
  // Only update the position if the timestamp of this marker is within
796
797
  // the visible bounds.
@@ -827,7 +828,7 @@ export class Overlays extends EventTarget {
827
828
  }
828
829
  }
829
830
 
830
- #positionTimestampMarker(overlay: CursorTimestampMarker, element: HTMLElement): void {
831
+ #positionTimestampMarker(overlay: TimestampMarker, element: HTMLElement): void {
831
832
  // Because we are adjusting the x position, we can use either chart here.
832
833
  const x = this.#xPixelForMicroSeconds('main', overlay.timestamp);
833
834
  element.style.left = `${x}px`;
@@ -1470,7 +1471,7 @@ export class Overlays extends EventTarget {
1470
1471
  }
1471
1472
  break;
1472
1473
  }
1473
- case 'CURSOR_TIMESTAMP_MARKER':
1474
+ case 'TIMESTAMP_MARKER':
1474
1475
  break;
1475
1476
  case 'CANDY_STRIPED_TIME_RANGE':
1476
1477
  break;
@@ -1504,7 +1505,7 @@ export class Overlays extends EventTarget {
1504
1505
  component?.checkSectionLabelPositioning();
1505
1506
  break;
1506
1507
  }
1507
- case 'CURSOR_TIMESTAMP_MARKER':
1508
+ case 'TIMESTAMP_MARKER':
1508
1509
  break;
1509
1510
  case 'CANDY_STRIPED_TIME_RANGE':
1510
1511
  break;
@@ -1830,7 +1831,7 @@ export function jsLogContext(overlay: TimelineOverlay): string|null {
1830
1831
  case 'TIMESPAN_BREAKDOWN': {
1831
1832
  return 'timeline.overlays.timespan-breakdown';
1832
1833
  }
1833
- case 'CURSOR_TIMESTAMP_MARKER': {
1834
+ case 'TIMESTAMP_MARKER': {
1834
1835
  return 'timeline.overlays.cursor-timestamp-marker';
1835
1836
  }
1836
1837
  case 'CANDY_STRIPED_TIME_RANGE': {
@@ -111,7 +111,7 @@
111
111
  }
112
112
  }
113
113
 
114
- .overlay-type-CURSOR_TIMESTAMP_MARKER {
114
+ .overlay-type-TIMESTAMP_MARKER {
115
115
  top: 0;
116
116
  bottom: 0;
117
117
  width: 2px;