chrome-devtools-frontend 1.0.1526630 → 1.0.1529186

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 (339) hide show
  1. package/docs/ui_engineering.md +159 -0
  2. package/eslint.config.mjs +6 -1
  3. package/front_end/core/host/UserMetrics.ts +2 -1
  4. package/front_end/core/i18n/i18nImpl.ts +6 -1
  5. package/front_end/core/protocol_client/protocol_client.ts +1 -1
  6. package/front_end/core/root/Runtime.ts +38 -4
  7. package/front_end/core/sdk/CSSMatchedStyles.ts +50 -7
  8. package/front_end/core/sdk/CSSRule.ts +35 -6
  9. package/front_end/core/sdk/Connections.ts +2 -1
  10. package/front_end/core/sdk/DOMModel.ts +4 -0
  11. package/front_end/core/sdk/DebuggerModel.ts +5 -1
  12. package/front_end/core/sdk/NetworkManager.ts +267 -34
  13. package/front_end/core/sdk/PreloadingModel.ts +82 -17
  14. package/front_end/core/sdk/RehydratingConnection.snapshot.txt +1 -1
  15. package/front_end/core/sdk/RehydratingConnection.ts +29 -4
  16. package/front_end/core/sdk/ScopeTreeCache.ts +8 -3
  17. package/front_end/core/sdk/SourceMap.ts +41 -11
  18. package/front_end/core/sdk/SourceMapManager.ts +13 -2
  19. package/front_end/core/sdk/SourceMapScopesInfo.ts +49 -2
  20. package/front_end/core/sdk/TargetManager.ts +0 -22
  21. package/front_end/core/sdk/TraceObject.ts +8 -7
  22. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +81 -0
  23. package/front_end/entrypoints/inspector_main/InspectorMain.ts +3 -1
  24. package/front_end/entrypoints/main/GlobalAiButton.ts +1 -0
  25. package/front_end/entrypoints/main/MainImpl.ts +42 -28
  26. package/front_end/generated/InspectorBackendCommands.js +3 -2
  27. package/front_end/generated/SupportedCSSProperties.js +2 -0
  28. package/front_end/generated/protocol.ts +17 -3
  29. package/front_end/models/ai_assistance/BuiltInAi.ts +111 -0
  30. package/front_end/models/ai_assistance/ConversationHandler.ts +15 -14
  31. package/front_end/models/ai_assistance/ai_assistance.ts +53 -24
  32. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +105 -0
  33. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +6 -1
  34. package/front_end/models/extensions/ExtensionView.ts +3 -0
  35. package/front_end/models/javascript_metadata/NativeFunctions.js +31 -27
  36. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +31 -29
  37. package/front_end/models/persistence/NetworkPersistenceManager.ts +3 -5
  38. package/front_end/models/persistence/PersistenceImpl.ts +0 -5
  39. package/front_end/models/persistence/persistence-meta.ts +0 -31
  40. package/front_end/models/persistence/persistence.ts +0 -6
  41. package/front_end/models/source_map_scopes/NamesResolver.ts +5 -11
  42. package/front_end/models/stack_trace/Trie.ts +9 -0
  43. package/front_end/models/trace/lantern/types/Lantern.ts +1 -1
  44. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -0
  45. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +1 -0
  46. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +120 -113
  47. package/front_end/panels/ai_assistance/PatchWidget.ts +9 -8
  48. package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +2 -0
  49. package/front_end/panels/ai_assistance/components/ChatView.ts +29 -29
  50. package/front_end/panels/ai_assistance/components/UserActionRow.ts +1 -0
  51. package/front_end/panels/animation/AnimationTimeline.ts +1 -0
  52. package/front_end/panels/application/CookieItemsView.ts +1 -0
  53. package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -0
  54. package/front_end/panels/application/ServiceWorkerCacheViews.ts +2 -0
  55. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +11 -5
  56. package/front_end/panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts +2 -2
  57. package/front_end/panels/application/preloading/components/PreloadingString.ts +7 -5
  58. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +22 -10
  59. package/front_end/panels/changes/CombinedDiffView.ts +1 -0
  60. package/front_end/{models/persistence → panels/common}/PersistenceUtils.ts +15 -17
  61. package/front_end/panels/common/common.ts +1 -0
  62. package/front_end/panels/console/ConsoleInsightTeaser.ts +369 -0
  63. package/front_end/panels/console/ConsolePanel.ts +2 -0
  64. package/front_end/panels/console/ConsolePrompt.ts +12 -2
  65. package/front_end/panels/console/ConsoleSidebar.ts +1 -1
  66. package/front_end/panels/console/ConsoleView.ts +12 -0
  67. package/front_end/panels/console/ConsoleViewMessage.ts +44 -0
  68. package/front_end/panels/{explain → console}/PromptBuilder.ts +12 -7
  69. package/front_end/panels/console/console-meta.ts +14 -0
  70. package/front_end/panels/console/console.ts +6 -0
  71. package/front_end/panels/console/consoleInsightTeaser.css +83 -0
  72. package/front_end/panels/coverage/CoverageListView.ts +29 -11
  73. package/front_end/panels/coverage/CoverageView.ts +292 -284
  74. package/front_end/panels/coverage/coverageView.css +17 -0
  75. package/front_end/panels/elements/ComputedStyleWidget.ts +1 -0
  76. package/front_end/panels/elements/LayoutPane.ts +1 -0
  77. package/front_end/panels/elements/NodeStackTraceWidget.ts +1 -0
  78. package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -1
  79. package/front_end/panels/elements/stylePropertiesTreeOutline.css +17 -0
  80. package/front_end/panels/emulation/DeviceModeView.ts +2 -0
  81. package/front_end/panels/explain/ActionDelegate.ts +4 -2
  82. package/front_end/panels/explain/components/ConsoleInsight.ts +14 -12
  83. package/front_end/panels/explain/explain-meta.ts +7 -0
  84. package/front_end/panels/explain/explain.ts +0 -1
  85. package/front_end/panels/js_timeline/js_timeline-meta.ts +1 -1
  86. package/front_end/panels/layer_viewer/Layers3DView.ts +2 -0
  87. package/front_end/panels/lighthouse/LighthouseReportSelector.ts +1 -0
  88. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +1 -0
  89. package/front_end/panels/media/MainView.ts +1 -0
  90. package/front_end/panels/media/TickingFlameChart.ts +2 -0
  91. package/front_end/panels/network/BlockedURLsPane.ts +237 -108
  92. package/front_end/panels/network/EventSourceMessagesView.ts +1 -0
  93. package/front_end/panels/network/NetworkItemView.ts +1 -0
  94. package/front_end/panels/network/NetworkLogView.ts +9 -7
  95. package/front_end/panels/network/NetworkOverview.ts +1 -0
  96. package/front_end/panels/network/RequestCookiesView.ts +1 -0
  97. package/front_end/panels/network/RequestHTMLView.ts +1 -0
  98. package/front_end/panels/network/RequestInitiatorView.ts +1 -0
  99. package/front_end/panels/network/RequestPayloadView.ts +1 -0
  100. package/front_end/panels/network/RequestPreviewView.ts +1 -0
  101. package/front_end/panels/network/RequestResponseView.ts +1 -0
  102. package/front_end/panels/network/RequestTimingView.ts +2 -0
  103. package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -0
  104. package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -0
  105. package/front_end/panels/network/components/RequestHeadersView.ts +2 -0
  106. package/front_end/panels/network/components/RequestTrustTokensView.ts +2 -0
  107. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -0
  108. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +2 -0
  109. package/front_end/panels/profiler/HeapSnapshotView.ts +7 -0
  110. package/front_end/panels/profiler/IsolateSelector.ts +1 -0
  111. package/front_end/panels/profiler/LiveHeapProfileView.ts +1 -0
  112. package/front_end/panels/profiler/ProfileView.ts +1 -0
  113. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -0
  114. package/front_end/panels/recorder/RecorderPanel.ts +2 -0
  115. package/front_end/panels/screencast/ScreencastView.ts +1 -0
  116. package/front_end/panels/search/SearchView.ts +1 -0
  117. package/front_end/panels/settings/AISettingsTab.ts +3 -3
  118. package/front_end/{models/persistence → panels/settings}/EditFileSystemView.ts +3 -6
  119. package/front_end/panels/settings/WorkspaceSettingsTab.ts +4 -1
  120. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
  121. package/front_end/panels/settings/settings.ts +2 -0
  122. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +12 -0
  123. package/front_end/panels/sources/BreakpointsView.ts +1 -0
  124. package/front_end/panels/sources/DebuggerPlugin.ts +1 -0
  125. package/front_end/{models/persistence → panels/sources}/PersistenceActions.ts +8 -12
  126. package/front_end/panels/sources/TabbedEditorContainer.ts +2 -1
  127. package/front_end/panels/sources/UISourceCodeFrame.ts +17 -2
  128. package/front_end/panels/sources/sources-meta.ts +15 -0
  129. package/front_end/panels/sources/sources.ts +2 -0
  130. package/front_end/panels/timeline/README.md +2 -2
  131. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -1
  132. package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -3
  133. package/front_end/panels/timeline/TimelineLayersView.ts +1 -0
  134. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +114 -37
  135. package/front_end/panels/timeline/TimelinePanel.ts +43 -62
  136. package/front_end/panels/timeline/TimelineTreeView.ts +1 -0
  137. package/front_end/panels/timeline/components/LiveMetricsView.ts +4 -8
  138. package/front_end/panels/timeline/components/Sidebar.ts +2 -0
  139. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
  140. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +7 -7
  141. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
  142. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -4
  143. package/front_end/panels/utils/utils.ts +2 -1
  144. package/front_end/panels/web_audio/WebAudioView.ts +1 -0
  145. package/front_end/third_party/chromium/README.chromium +1 -1
  146. package/front_end/third_party/diff/diff_match_patch.js +1 -1
  147. package/front_end/third_party/lighthouse/README.chromium +2 -2
  148. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1530 -2426
  149. package/front_end/third_party/lighthouse/locales/ar-XB.json +107 -455
  150. package/front_end/third_party/lighthouse/locales/ar.json +107 -455
  151. package/front_end/third_party/lighthouse/locales/bg.json +96 -444
  152. package/front_end/third_party/lighthouse/locales/ca.json +96 -444
  153. package/front_end/third_party/lighthouse/locales/cs.json +96 -444
  154. package/front_end/third_party/lighthouse/locales/da.json +96 -444
  155. package/front_end/third_party/lighthouse/locales/de.json +96 -444
  156. package/front_end/third_party/lighthouse/locales/el.json +96 -444
  157. package/front_end/third_party/lighthouse/locales/en-GB.json +96 -444
  158. package/front_end/third_party/lighthouse/locales/en-US.json +116 -467
  159. package/front_end/third_party/lighthouse/locales/en-XA.json +93 -441
  160. package/front_end/third_party/lighthouse/locales/en-XL.json +116 -467
  161. package/front_end/third_party/lighthouse/locales/es-419.json +96 -444
  162. package/front_end/third_party/lighthouse/locales/es.json +96 -444
  163. package/front_end/third_party/lighthouse/locales/fi.json +96 -444
  164. package/front_end/third_party/lighthouse/locales/fil.json +96 -444
  165. package/front_end/third_party/lighthouse/locales/fr.json +96 -444
  166. package/front_end/third_party/lighthouse/locales/he.json +118 -466
  167. package/front_end/third_party/lighthouse/locales/hi.json +96 -444
  168. package/front_end/third_party/lighthouse/locales/hr.json +100 -448
  169. package/front_end/third_party/lighthouse/locales/hu.json +96 -444
  170. package/front_end/third_party/lighthouse/locales/id.json +96 -444
  171. package/front_end/third_party/lighthouse/locales/it.json +96 -444
  172. package/front_end/third_party/lighthouse/locales/ja.json +96 -444
  173. package/front_end/third_party/lighthouse/locales/ko.json +97 -445
  174. package/front_end/third_party/lighthouse/locales/lt.json +96 -444
  175. package/front_end/third_party/lighthouse/locales/lv.json +97 -445
  176. package/front_end/third_party/lighthouse/locales/nl.json +96 -444
  177. package/front_end/third_party/lighthouse/locales/no.json +96 -444
  178. package/front_end/third_party/lighthouse/locales/pl.json +96 -444
  179. package/front_end/third_party/lighthouse/locales/pt-PT.json +96 -444
  180. package/front_end/third_party/lighthouse/locales/pt.json +97 -445
  181. package/front_end/third_party/lighthouse/locales/ro.json +97 -445
  182. package/front_end/third_party/lighthouse/locales/ru.json +96 -444
  183. package/front_end/third_party/lighthouse/locales/sk.json +96 -444
  184. package/front_end/third_party/lighthouse/locales/sl.json +96 -444
  185. package/front_end/third_party/lighthouse/locales/sr-Latn.json +96 -444
  186. package/front_end/third_party/lighthouse/locales/sr.json +96 -444
  187. package/front_end/third_party/lighthouse/locales/sv.json +96 -444
  188. package/front_end/third_party/lighthouse/locales/ta.json +96 -444
  189. package/front_end/third_party/lighthouse/locales/te.json +97 -445
  190. package/front_end/third_party/lighthouse/locales/th.json +96 -444
  191. package/front_end/third_party/lighthouse/locales/tr.json +96 -444
  192. package/front_end/third_party/lighthouse/locales/uk.json +96 -444
  193. package/front_end/third_party/lighthouse/locales/vi.json +96 -444
  194. package/front_end/third_party/lighthouse/locales/zh-HK.json +96 -444
  195. package/front_end/third_party/lighthouse/locales/zh-TW.json +97 -445
  196. package/front_end/third_party/lighthouse/locales/zh.json +96 -444
  197. package/front_end/third_party/lighthouse/report/bundle.d.ts +8 -14
  198. package/front_end/third_party/lighthouse/report/bundle.js +10 -49
  199. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
  200. package/front_end/third_party/web-vitals/README.chromium +5 -8
  201. package/front_end/third_party/web-vitals/package/README.md +191 -152
  202. package/front_end/third_party/web-vitals/package/dist/modules/attribution/index.d.ts +0 -1
  203. package/front_end/third_party/web-vitals/package/dist/modules/attribution/index.js +0 -1
  204. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.d.ts +2 -2
  205. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.js +45 -26
  206. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.d.ts +2 -2
  207. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +3 -3
  208. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +10 -10
  209. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +307 -206
  210. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +2 -2
  211. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +69 -49
  212. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.d.ts +2 -2
  213. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +2 -2
  214. package/front_end/third_party/web-vitals/package/dist/modules/index.d.ts +0 -1
  215. package/front_end/third_party/web-vitals/package/dist/modules/index.js +0 -1
  216. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +33 -0
  217. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +111 -0
  218. package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.d.ts +4 -0
  219. package/front_end/third_party/web-vitals/package/dist/modules/{attribution/deprecated.js → lib/LCPEntryManager.js} +6 -7
  220. package/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.d.ts +6 -0
  221. package/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.js +44 -0
  222. package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.js +1 -1
  223. package/front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js +1 -1
  224. package/front_end/third_party/web-vitals/package/dist/modules/lib/getActivationStart.js +1 -1
  225. package/front_end/third_party/web-vitals/package/dist/modules/lib/getNavigationEntry.js +5 -7
  226. package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.d.ts +1 -1
  227. package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js +9 -12
  228. package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.d.ts +1 -0
  229. package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +52 -33
  230. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +0 -2
  231. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js +2 -2
  232. package/front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.d.ts +6 -0
  233. package/front_end/third_party/web-vitals/package/dist/modules/{deprecated.js → lib/initUnique.js} +11 -4
  234. package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +3 -6
  235. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +6 -6
  236. package/front_end/third_party/web-vitals/package/dist/modules/lib/{whenIdle.d.ts → whenIdleOrHidden.d.ts} +1 -1
  237. package/front_end/third_party/web-vitals/package/dist/modules/lib/{whenIdle.js → whenIdleOrHidden.js} +10 -8
  238. package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +17 -35
  239. package/front_end/third_party/web-vitals/package/dist/modules/onFCP.js +3 -5
  240. package/front_end/third_party/web-vitals/package/dist/modules/onINP.d.ts +9 -7
  241. package/front_end/third_party/web-vitals/package/dist/modules/onINP.js +27 -19
  242. package/front_end/third_party/web-vitals/package/dist/modules/onLCP.js +33 -26
  243. package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.js +2 -4
  244. package/front_end/third_party/web-vitals/package/dist/modules/types/base.d.ts +6 -5
  245. package/front_end/third_party/web-vitals/package/dist/modules/types/cls.d.ts +5 -3
  246. package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +80 -33
  247. package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +6 -2
  248. package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +28 -4
  249. package/front_end/third_party/web-vitals/package/dist/modules/types.js +0 -1
  250. package/front_end/third_party/web-vitals/package/package.json +4 -10
  251. package/front_end/third_party/web-vitals/package/src/attribution/index.ts +0 -1
  252. package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +58 -33
  253. package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +4 -4
  254. package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +382 -258
  255. package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +96 -69
  256. package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +3 -3
  257. package/front_end/third_party/web-vitals/package/src/index.ts +0 -1
  258. package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +146 -0
  259. package/front_end/third_party/web-vitals/package/src/{attribution/deprecated.ts → lib/LCPEntryManager.ts} +6 -9
  260. package/front_end/third_party/web-vitals/package/src/lib/LayoutShiftManager.ts +50 -0
  261. package/front_end/third_party/web-vitals/package/src/lib/bindReporter.ts +1 -1
  262. package/front_end/third_party/web-vitals/package/src/lib/generateUniqueID.ts +1 -1
  263. package/front_end/third_party/web-vitals/package/src/lib/getActivationStart.ts +1 -1
  264. package/front_end/third_party/web-vitals/package/src/lib/getNavigationEntry.ts +5 -8
  265. package/front_end/third_party/web-vitals/package/src/lib/getSelector.ts +12 -12
  266. package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +57 -35
  267. package/front_end/third_party/web-vitals/package/src/lib/initMetric.ts +2 -2
  268. package/front_end/third_party/web-vitals/package/src/{deprecated.ts → lib/initUnique.ts} +14 -8
  269. package/front_end/third_party/web-vitals/package/src/lib/observe.ts +3 -11
  270. package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +12 -6
  271. package/front_end/third_party/web-vitals/package/src/lib/{whenIdle.ts → whenIdleOrHidden.ts} +10 -8
  272. package/front_end/third_party/web-vitals/package/src/onCLS.ts +17 -38
  273. package/front_end/third_party/web-vitals/package/src/onFCP.ts +3 -6
  274. package/front_end/third_party/web-vitals/package/src/onINP.ts +33 -28
  275. package/front_end/third_party/web-vitals/package/src/onLCP.ts +36 -29
  276. package/front_end/third_party/web-vitals/package/src/onTTFB.ts +2 -5
  277. package/front_end/third_party/web-vitals/package/src/types/base.ts +5 -5
  278. package/front_end/third_party/web-vitals/package/src/types/cls.ts +5 -3
  279. package/front_end/third_party/web-vitals/package/src/types/inp.ts +88 -33
  280. package/front_end/third_party/web-vitals/package/src/types/lcp.ts +6 -2
  281. package/front_end/third_party/web-vitals/package/src/types.ts +47 -4
  282. package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +75 -0
  283. package/front_end/third_party/web-vitals/rebuild.sh +32 -18
  284. package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +5 -10
  285. package/front_end/third_party/web-vitals/web-vitals.ts +0 -2
  286. package/front_end/ui/components/docs/console_insight/basic.ts +3 -2
  287. package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +2 -0
  288. package/front_end/ui/components/text_editor/TextEditor.ts +0 -2
  289. package/front_end/ui/legacy/InspectorView.ts +2 -0
  290. package/front_end/ui/legacy/ListWidget.ts +2 -2
  291. package/front_end/ui/legacy/SplitWidget.ts +2 -0
  292. package/front_end/ui/legacy/TabbedPane.ts +1 -0
  293. package/front_end/ui/legacy/TargetCrashedScreen.ts +1 -0
  294. package/front_end/ui/legacy/UIUtils.ts +8 -19
  295. package/front_end/ui/legacy/ViewManager.ts +1 -0
  296. package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +7 -20
  297. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -0
  298. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -0
  299. package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -0
  300. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +1 -0
  301. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -0
  302. package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -0
  303. package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -0
  304. package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -0
  305. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +1 -0
  306. package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +2 -0
  307. package/front_end/ui/visual_logging/KnownContextValues.ts +25 -0
  308. package/mcp/README.md +7 -0
  309. package/mcp/mcp.ts +8 -0
  310. package/package.json +1 -1
  311. package/front_end/models/live-metrics/web-vitals-injected/OnEachInteraction.ts +0 -34
  312. package/front_end/third_party/web-vitals/package/attribution.d.ts +0 -16
  313. package/front_end/third_party/web-vitals/package/attribution.js +0 -18
  314. package/front_end/third_party/web-vitals/package/dist/modules/attribution/deprecated.d.ts +0 -7
  315. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFID.d.ts +0 -11
  316. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFID.js +0 -46
  317. package/front_end/third_party/web-vitals/package/dist/modules/deprecated.d.ts +0 -5
  318. package/front_end/third_party/web-vitals/package/dist/modules/lib/interactions.d.ts +0 -31
  319. package/front_end/third_party/web-vitals/package/dist/modules/lib/interactions.js +0 -107
  320. package/front_end/third_party/web-vitals/package/dist/modules/lib/onHidden.d.ts +0 -1
  321. package/front_end/third_party/web-vitals/package/dist/modules/lib/onHidden.js +0 -22
  322. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/firstInputPolyfill.d.ts +0 -7
  323. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/firstInputPolyfill.js +0 -147
  324. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.d.ts +0 -1
  325. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.js +0 -25
  326. package/front_end/third_party/web-vitals/package/dist/modules/onFID.d.ts +0 -13
  327. package/front_end/third_party/web-vitals/package/dist/modules/onFID.js +0 -70
  328. package/front_end/third_party/web-vitals/package/dist/modules/types/fid.d.ts +0 -46
  329. package/front_end/third_party/web-vitals/package/dist/modules/types/fid.js +0 -16
  330. package/front_end/third_party/web-vitals/package/src/attribution/onFID.ts +0 -62
  331. package/front_end/third_party/web-vitals/package/src/lib/interactions.ts +0 -139
  332. package/front_end/third_party/web-vitals/package/src/lib/onHidden.ts +0 -23
  333. package/front_end/third_party/web-vitals/package/src/lib/polyfills/firstInputPolyfill.ts +0 -174
  334. package/front_end/third_party/web-vitals/package/src/onFID.ts +0 -105
  335. package/front_end/third_party/web-vitals/package/src/types/fid.ts +0 -65
  336. package/front_end/ui/components/text_editor/textEditor.css +0 -18
  337. package/front_end/ui/legacy/inlineButton.css +0 -22
  338. /package/front_end/entrypoints/{rehydrated_devtools_app/rehydrated_devtools_app.ts → trace_app/trace_app.ts} +0 -0
  339. /package/front_end/{models/persistence → panels/settings}/editFileSystemView.css +0 -0
@@ -812,6 +812,165 @@ export const DEFAULT_VIEW = (input, _output, target) => {
812
812
  };
813
813
  ```
814
814
 
815
+ ## Binding an action to a button
816
+
817
+ Use the `bindToAction` directive to create a button that is bound to a registered action. The button's properties (e.g., `title`, `disabled`) will be automatically updated when the action's state changes.
818
+
819
+ **Before:**
820
+ ```typescript
821
+ class SomeWidget extends UI.Widget.Widget implements UI.Toolbar.ItemsProvider {
822
+ constructor() {
823
+ super();
824
+ this.toolbarItemsInternal = [];
825
+ this.toolbarItemsInternal.push(UI.Toolbar.Toolbar.createActionButton('elements.refresh-event-listeners'));
826
+ }
827
+
828
+ toolbarItems(): UI.Toolbar.ToolbarItem[] {
829
+ return this.toolbarItemsInternal;
830
+ }
831
+ }
832
+ ```
833
+
834
+ **After:**
835
+ ```typescript
836
+ export const DEFAULT_VIEW = (input, _output, target) => {
837
+ const {bindToAction} = UI.UIUtils;
838
+ render(html`
839
+ <div>
840
+ <devtools-toolbar>
841
+ <devtools-button ${bindToAction('elements.refresh-event-listeners')}></devtools-button>
842
+ </devtools-toolbar>
843
+ </div>`,
844
+ target, {host: input});
845
+ };
846
+ ```
847
+
848
+ ## Binding a setting to a checkbox
849
+
850
+ Use the `bindToSetting` directive to bind a boolean setting to a `<devtools-checkbox>` component.
851
+
852
+ **Before:**
853
+ ```typescript
854
+ class SomeWidget extends UI.Widget.Widget {
855
+ constructor() {
856
+ super();
857
+ const toolbar = this.contentElement.createChild('devtools-toolbar');
858
+ const showAllPropertiesSetting = Common.Settings.Settings.instance().createSetting('show-all-properties', false);
859
+ toolbar.appendToolbarItem(new UI.Toolbar.ToolbarSettingCheckbox(
860
+ showAllPropertiesSetting, i18nString(UIStrings.showAllTooltip), i18nString(UIStrings.showAll)));
861
+ }
862
+ }
863
+ ```
864
+
865
+ **After:**
866
+ ```typescript
867
+ export const DEFAULT_VIEW = (input, _output, target) => {
868
+ const {bindToSetting} = UI.SettingsUI;
869
+ const showAllPropertiesSetting = Common.Settings.Settings.instance().createSetting('show-all-properties', false);
870
+ render(html`
871
+ <div>
872
+ <devtools-toolbar>
873
+ <devtools-checkbox title=${i18nString(UIStrings.showAllTooltip)} ${bindToSetting(showAllPropertiesSetting)}>
874
+ ${i18nString(UIStrings.showAll)}
875
+ </devtools-checkbox>
876
+ </devtools-toolbar>
877
+ </div>`,
878
+ target, {host: input});
879
+ };
880
+ ```
881
+
882
+ ## Migrating `UI.Toolbar.ToolbarComboBox`
883
+
884
+ Replace the imperative creation of a `ToolbarComboBox` with a declarative `<select>` element.
885
+
886
+ **Before:**
887
+ ```typescript
888
+ class SomeWidget extends UI.Widget.Widget {
889
+ constructor() {
890
+ super();
891
+ const toolbar = this.contentElement.createChild('devtools-toolbar');
892
+ toolbar.appendToolbarItem(new UI.Toolbar.ToolbarComboBox(
893
+ this.someToolbarComboBoxClicked.bind(this), 'Combox',
894
+ 'the-toolbar-combox', 'some-toolbar-combox'));
895
+ }
896
+ }
897
+ ```
898
+
899
+ **After:**
900
+ ```typescript
901
+ export const DEFAULT_VIEW = (input, _output, target) => {
902
+ render(html`
903
+ <div>
904
+ <devtools-toolbar>
905
+ <select class="the-toolbar-combox" title="Combox" aria-label="Combox"
906
+ jslog=${VisualLogging.dropDown('some-toolbar-combox').track({change: true})}
907
+ @change=${this.someToolbarComboBoxClicked.bind(this)}></select>
908
+ </devtools-toolbar>
909
+ </div>`,
910
+ target, {host: input});
911
+ };
912
+ ```
913
+
914
+ ## Migrating various Toolbar items
915
+
916
+ Replace various imperative `UI.Toolbar` methods like `appendSeparator`, `appendSpacer`, and `setEnabled` with their declarative equivalents.
917
+
918
+ **Before:**
919
+ ```typescript
920
+ class SomeWidget extends UI.Widget.Widget {
921
+ constructor() {
922
+ super();
923
+ const toolbar = this.contentElement.createChild('devtools-toolbar');
924
+ toolbar.wrappable = true;
925
+ toolbar.appendSeparator();
926
+ const combo = new UI.Toolbar.ToolbarComboBox(this.onSelect.bind(this), 'aria-label', undefined, 'combo-box');
927
+ combo.createOption('Option 1', '1', 'option-1');
928
+ const option2 = document.createElement('option');
929
+ option2.value = '2';
930
+ option2.textContent = 'Option 2';
931
+ combo.addOption(option2);
932
+ toolbar.appendToolbarItem(combo);
933
+ toolbar.appendSpacer();
934
+ const button = new UI.Toolbar.ToolbarButton('Click me', 'largeicon-add');
935
+ button.setEnabled(false);
936
+ toolbar.appendToolbarItem(button);
937
+ const otherButton = new UI.Toolbar.ToolbarButton('Other button', 'largeicon-delete');
938
+ otherButton.setEnabled(this.isEnabled);
939
+ toolbar.appendToolbarItem(otherButton);
940
+ toolbar.appendToolbarItem(new UI.Toolbar.ToolbarSeparator());
941
+ toolbar.appendToolbarItem(new UI.Toolbar.ToolbarSeparator(false));
942
+ toolbar.appendToolbarItem(new UI.Toolbar.ToolbarSeparator(true));
943
+ }
944
+ }
945
+ ```
946
+
947
+ **After:**
948
+ ```typescript
949
+ export const DEFAULT_VIEW = (input, _output, target) => {
950
+ render(html`
951
+ <div>
952
+ <devtools-toolbar wrappable>
953
+ <div class="toolbar-divider"></div>
954
+ <select title="aria-label" aria-label="aria-label"
955
+ jslog=${VisualLogging.dropDown('combo-box').track({change: true})}
956
+ @change=${this.onSelect.bind(this)}>
957
+ <option value="1" jslog=${VisualLogging.item('option-1').track({click: true})}>Option 1</option>
958
+ <option value="2">Option 2</option>
959
+ </select>
960
+ <div class="toolbar-spacer"></div>
961
+ <devtools-button title="Click me" .variant=${Buttons.Button.Variant.TOOLBAR}
962
+ .iconName=${'largeicon-add'} disabled></devtools-button>
963
+ <devtools-button title="Other button" ?disabled=${!this.isEnabled}
964
+ .variant=${Buttons.Button.Variant.TOOLBAR} .iconName=${'largeicon-delete'}></devtools-button>
965
+ <div class="toolbar-divider"></div>
966
+ <div class="toolbar-divider"></div>
967
+ <div class="toolbar-spacer"></div>
968
+ </devtools-toolbar>
969
+ </div>`,
970
+ target, {host: input});
971
+ };
972
+ ```
973
+
815
974
  ## Migrating `iframe` creation
816
975
 
817
976
  Replace `document.createElement('iframe')` and `setAttribute` calls with a declarative `<iframe>` tag in a lit-html template.
package/eslint.config.mjs CHANGED
@@ -646,7 +646,12 @@ export default defineConfig([
646
646
  'rulesdir/check-css-import': 'error',
647
647
  'rulesdir/enforce-optional-properties-last': 'error',
648
648
  'rulesdir/check-enumerated-histograms': 'error',
649
- 'rulesdir/check-was-shown-methods': 'error',
649
+ 'rulesdir/require-super-calls-in-overridden-methods': [
650
+ 'error',
651
+ {
652
+ methodNames: ['wasShown', 'willHide'],
653
+ },
654
+ ],
650
655
  'rulesdir/static-custom-event-names': 'error',
651
656
  'rulesdir/lit-no-attribute-quotes': 'error',
652
657
  'rulesdir/lit-template-result-or-nothing': 'error',
@@ -514,7 +514,8 @@ export enum Action {
514
514
  AiCodeCompletionSuggestionAccepted = 187,
515
515
  AiCodeCompletionError = 188,
516
516
  AttributeLinkClicked = 189,
517
- MAX_VALUE = 190,
517
+ InsightRequestedViaTeaser = 190,
518
+ MAX_VALUE = 191,
518
519
  /* eslint-enable @typescript-eslint/naming-convention */
519
520
  }
520
521
 
@@ -68,7 +68,7 @@ export async function fetchAndRegisterLocaleData(
68
68
  locale: Intl.UnicodeBCP47LocaleIdentifier, location = self.location.toString()): Promise<void> {
69
69
  const localeDataTextPromise = fetch(getLocaleFetchUrl(locale, location)).then(result => result.json());
70
70
  const timeoutPromise =
71
- new Promise<never>((_, reject) => window.setTimeout(() => reject(new Error('timed out fetching locale')), 2500));
71
+ new Promise<never>((_, reject) => window.setTimeout(() => reject(new Error('timed out fetching locale')), 5000));
72
72
  const localeData = await Promise.race([timeoutPromise, localeDataTextPromise]);
73
73
  i18nInstance.registerLocaleData(locale, localeData);
74
74
  }
@@ -81,6 +81,11 @@ export function resetLocaleDataForTest(): void {
81
81
  i18nInstance.resetLocaleDataForTest();
82
82
  }
83
83
 
84
+ export function registerLocaleDataForTest(
85
+ locale: Intl.UnicodeBCP47LocaleIdentifier, messages: I18n.I18n.LocalizedMessages): void {
86
+ i18nInstance.registerLocaleData(locale, messages);
87
+ }
88
+
84
89
  /**
85
90
  * Returns an anonymous function that wraps a call to retrieve a localized string.
86
91
  * This is introduced so that localized strings can be declared in environments where
@@ -15,7 +15,7 @@ export {
15
15
  // Create the global here because registering commands will involve putting
16
16
  // items onto the global.
17
17
  // @ts-expect-error Global namespace instantiation
18
- self.Protocol = self.Protocol || {};
18
+ globalThis.Protocol = globalThis.Protocol || {};
19
19
 
20
20
  // FIXME: This instance of InspectorBackend should not be a side effect of importing this module.
21
21
  InspectorBackendCommands.registerCommands(InspectorBackend.inspectorBackend);
@@ -4,12 +4,11 @@
4
4
 
5
5
  import * as Platform from '../platform/platform.js';
6
6
 
7
- const queryParamsObject = new URLSearchParams(location.search);
8
-
9
7
  let runtimePlatform = '';
10
8
 
11
9
  let runtimeInstance: Runtime|undefined;
12
10
  let isNode: boolean|undefined;
11
+ let isTraceAppEntry: boolean|undefined;
13
12
 
14
13
  /**
15
14
  * Returns the base URL (similar to `<base>`).
@@ -71,12 +70,21 @@ export class Runtime {
71
70
  runtimeInstance = undefined;
72
71
  }
73
72
 
73
+ static queryParamsObject: URLSearchParams;
74
+
75
+ static getSearchParams(): URLSearchParams {
76
+ if (!Runtime.queryParamsObject) {
77
+ Runtime.queryParamsObject = new URLSearchParams(location.search);
78
+ }
79
+ return Runtime.queryParamsObject;
80
+ }
81
+
74
82
  static queryParam(name: string): string|null {
75
- return queryParamsObject.get(name);
83
+ return Runtime.getSearchParams().get(name);
76
84
  }
77
85
 
78
86
  static setQueryParamForTesting(name: string, value: string): void {
79
- queryParamsObject.set(name, value);
87
+ Runtime.getSearchParams().set(name, value);
80
88
  }
81
89
 
82
90
  static isNode(): boolean {
@@ -86,6 +94,17 @@ export class Runtime {
86
94
  return isNode;
87
95
  }
88
96
 
97
+ /**
98
+ * Returns true if viewing the slimmed-down devtools meant for just viewing a
99
+ * performance trace, e.g. devtools://devtools/bundled/trace_app.html?traceURL=http://...
100
+ */
101
+ static isTraceApp(): boolean {
102
+ if (isTraceAppEntry === undefined) {
103
+ isTraceAppEntry = getPathName().includes('trace_app');
104
+ }
105
+ return isTraceAppEntry;
106
+ }
107
+
89
108
  static setPlatform(platform: string): void {
90
109
  runtimePlatform = platform;
91
110
  }
@@ -504,6 +523,18 @@ interface DevToolsStartingStyleDebugging {
504
523
  enabled: boolean;
505
524
  }
506
525
 
526
+ interface AiPromptApi {
527
+ enabled: boolean;
528
+ }
529
+
530
+ interface DevToolsIndividualRequestThrottling {
531
+ enabled: boolean;
532
+ }
533
+
534
+ export interface DevToolsEnableDurableMessages {
535
+ enabled: boolean;
536
+ }
537
+
507
538
  /**
508
539
  * The host configuration that we expect from the DevTools back-end.
509
540
  *
@@ -531,6 +562,7 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
531
562
  devToolsVeLogging: HostConfigVeLogging,
532
563
  devToolsWellKnown: HostConfigWellKnown,
533
564
  devToolsPrivacyUI: HostConfigPrivacyUI,
565
+ devToolsIndividualRequestThrottling: DevToolsIndividualRequestThrottling,
534
566
  devToolsIpProtectionPanelInDevTools: HostConfigIPProtection,
535
567
  /**
536
568
  * OffTheRecord here indicates that the user's profile is either incognito,
@@ -550,6 +582,8 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
550
582
  devToolsLiveEdit: LiveEdit,
551
583
  devToolsFlexibleLayout: DevToolsFlexibleLayout,
552
584
  devToolsStartingStyleDebugging: DevToolsStartingStyleDebugging,
585
+ devToolsAiPromptApi: AiPromptApi,
586
+ devToolsEnableDurableMessages: DevToolsEnableDurableMessages,
553
587
  }>;
554
588
 
555
589
  /**
@@ -447,7 +447,7 @@ export class CSSMatchedStyles {
447
447
  if (!addedAttributesStyle) {
448
448
  addAttributesStyle.call(this);
449
449
  }
450
- nodeCascades.push(new NodeCascade(this, nodeStyles, false /* #isInherited */));
450
+ nodeCascades.push(new NodeCascade(this, nodeStyles, this.#node, false /* #isInherited */));
451
451
 
452
452
  // Walk the node structure and identify styles with inherited properties.
453
453
  let parentNode: (DOMNode|null) = this.#node.parentNode;
@@ -514,8 +514,9 @@ export class CSSMatchedStyles {
514
514
  inheritedStyles.push(inheritedRule.style);
515
515
  this.#inheritedStyles.add(inheritedRule.style);
516
516
  }
517
+ const node = parentNode;
517
518
  parentNode = await traverseParentInFlatTree(parentNode);
518
- nodeCascades.push(new NodeCascade(this, inheritedStyles, true /* #isInherited */));
519
+ nodeCascades.push(new NodeCascade(this, inheritedStyles, node, true /* #isInherited */));
519
520
  }
520
521
 
521
522
  return new DOMInheritanceCascade(this, nodeCascades, this.#registeredProperties);
@@ -556,7 +557,8 @@ export class CSSMatchedStyles {
556
557
  }
557
558
 
558
559
  for (const [highlightName, highlightStyles] of splitHighlightRules) {
559
- const nodeCascade = new NodeCascade(this, highlightStyles, isInherited, true /* #isHighlightPseudoCascade*/);
560
+ const nodeCascade =
561
+ new NodeCascade(this, highlightStyles, node, isInherited, true /* #isHighlightPseudoCascade*/);
560
562
  const cascadeListForHighlightName = pseudoCascades.get(highlightName);
561
563
  if (cascadeListForHighlightName) {
562
564
  cascadeListForHighlightName.push(nodeCascade);
@@ -601,7 +603,8 @@ export class CSSMatchedStyles {
601
603
  }
602
604
  const isHighlightPseudoCascade = cssMetadata().isHighlightPseudoType(entryPayload.pseudoType);
603
605
  const nodeCascade = new NodeCascade(
604
- this, pseudoStyles, false /* #isInherited */, isHighlightPseudoCascade /* #isHighlightPseudoCascade*/);
606
+ this, pseudoStyles, this.#node, false /* #isInherited */,
607
+ isHighlightPseudoCascade /* #isHighlightPseudoCascade*/);
605
608
  pseudoCascades.set(entryPayload.pseudoType, [nodeCascade]);
606
609
  }
607
610
  }
@@ -629,7 +632,8 @@ export class CSSMatchedStyles {
629
632
 
630
633
  const isHighlightPseudoCascade = cssMetadata().isHighlightPseudoType(inheritedEntryPayload.pseudoType);
631
634
  const nodeCascade = new NodeCascade(
632
- this, pseudoStyles, true /* #isInherited */, isHighlightPseudoCascade /* #isHighlightPseudoCascade*/);
635
+ this, pseudoStyles, parentNode, true /* #isInherited */,
636
+ isHighlightPseudoCascade /* #isHighlightPseudoCascade*/);
633
637
  const cascadeListForPseudoType = pseudoCascades.get(inheritedEntryPayload.pseudoType);
634
638
  if (cascadeListForPseudoType) {
635
639
  cascadeListForPseudoType.push(nodeCascade);
@@ -960,13 +964,15 @@ class NodeCascade {
960
964
  readonly #isHighlightPseudoCascade: boolean;
961
965
  readonly propertiesState = new Map<CSSProperty, PropertyState>();
962
966
  readonly activeProperties = new Map<string, CSSProperty>();
967
+ readonly #node: DOMNode;
963
968
  constructor(
964
- matchedStyles: CSSMatchedStyles, styles: CSSStyleDeclaration[], isInherited: boolean,
969
+ matchedStyles: CSSMatchedStyles, styles: CSSStyleDeclaration[], node: DOMNode, isInherited: boolean,
965
970
  isHighlightPseudoCascade = false) {
966
971
  this.#matchedStyles = matchedStyles;
967
972
  this.styles = styles;
968
973
  this.#isInherited = isInherited;
969
974
  this.#isHighlightPseudoCascade = isHighlightPseudoCascade;
975
+ this.#node = node;
970
976
  }
971
977
 
972
978
  computeActiveProperties(): void {
@@ -1026,9 +1032,46 @@ class NodeCascade {
1026
1032
  }
1027
1033
  }
1028
1034
 
1035
+ #treeScopeDistance(property: CSSProperty): number {
1036
+ if (!property.ownerStyle.parentRule && property.ownerStyle.type !== Type.Inline) {
1037
+ return -1;
1038
+ }
1039
+ const root = this.#node.getTreeRoot();
1040
+ const nodeId = property.ownerStyle.parentRule?.treeScope ?? root?.backendNodeId();
1041
+ if (nodeId === undefined) {
1042
+ return -1;
1043
+ }
1044
+
1045
+ let distance = 0;
1046
+ for (let ancestor: DOMNode|null = this.#node; ancestor; ancestor = ancestor.parentNode) {
1047
+ if (ancestor.backendNodeId() === nodeId) {
1048
+ return distance;
1049
+ }
1050
+ distance++;
1051
+ }
1052
+ return -1;
1053
+ }
1054
+
1055
+ #needsCascadeContextStep(): boolean {
1056
+ if (!this.#node.isInShadowTree()) {
1057
+ return false;
1058
+ }
1059
+
1060
+ if (this.#node.ancestorShadowRoot()?.shadowRootType() === 'user-agent') {
1061
+ // In UA shadow dom, only standards-track pseudo elements override style attributes. -webkit-* and -internal-*
1062
+ // pseudos are still exempt from that to retain legacy behavior.
1063
+ const pseudoElement = this.#node.getAttribute('pseudo');
1064
+ return !pseudoElement?.startsWith('-webkit-') && !pseudoElement?.startsWith('-internal-');
1065
+ }
1066
+
1067
+ return true;
1068
+ }
1069
+
1029
1070
  private updatePropertyState(propertyWithHigherSpecificity: CSSProperty, canonicalName: string): void {
1030
1071
  const activeProperty = this.activeProperties.get(canonicalName);
1031
- if (activeProperty?.important && !propertyWithHigherSpecificity.important) {
1072
+ if (activeProperty?.important && !propertyWithHigherSpecificity.important ||
1073
+ activeProperty && this.#needsCascadeContextStep() &&
1074
+ this.#treeScopeDistance(activeProperty) > this.#treeScopeDistance(propertyWithHigherSpecificity)) {
1032
1075
  this.propertiesState.set(propertyWithHigherSpecificity, PropertyState.OVERLOADED);
1033
1076
  return;
1034
1077
  }
@@ -26,15 +26,18 @@ export class CSSRule {
26
26
  readonly origin: Protocol.CSS.StyleSheetOrigin;
27
27
  readonly style: CSSStyleDeclaration;
28
28
  readonly header: CSSStyleSheetHeader|null;
29
+ readonly treeScope: Protocol.DOM.BackendNodeId|undefined;
29
30
 
30
31
  constructor(cssModel: CSSModel, payload: {
31
32
  style: Protocol.CSS.CSSStyle,
32
33
  origin: Protocol.CSS.StyleSheetOrigin,
34
+ originTreeScopeNodeId: Protocol.DOM.BackendNodeId|undefined,
33
35
  header: CSSStyleSheetHeader|null,
34
36
  }) {
35
37
  this.header = payload.header;
36
38
  this.cssModelInternal = cssModel;
37
39
  this.origin = payload.origin;
40
+ this.treeScope = payload.originTreeScopeNodeId;
38
41
  this.style = new CSSStyleDeclaration(this.cssModelInternal, this, payload.style, Type.Regular);
39
42
  }
40
43
 
@@ -112,7 +115,12 @@ export class CSSStyleRule extends CSSRule {
112
115
  startingStyles: CSSStartingStyle[];
113
116
  wasUsed: boolean;
114
117
  constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSRule, wasUsed?: boolean) {
115
- super(cssModel, {origin: payload.origin, style: payload.style, header: styleSheetHeaderForRule(cssModel, payload)});
118
+ super(cssModel, {
119
+ origin: payload.origin,
120
+ style: payload.style,
121
+ header: styleSheetHeaderForRule(cssModel, payload),
122
+ originTreeScopeNodeId: payload.originTreeScopeNodeId
123
+ });
116
124
  this.reinitializeSelectors(payload.selectorList);
117
125
  this.nestingSelectors = payload.nestingSelectors;
118
126
  this.media = payload.media ? CSSMedia.parseMediaArrayPayload(cssModel, payload.media) : [];
@@ -224,7 +232,12 @@ export class CSSStyleRule extends CSSRule {
224
232
  export class CSSPropertyRule extends CSSRule {
225
233
  #name: CSSValue;
226
234
  constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSPropertyRule) {
227
- super(cssModel, {origin: payload.origin, style: payload.style, header: styleSheetHeaderForRule(cssModel, payload)});
235
+ super(cssModel, {
236
+ origin: payload.origin,
237
+ style: payload.style,
238
+ header: styleSheetHeaderForRule(cssModel, payload),
239
+ originTreeScopeNodeId: undefined,
240
+ });
228
241
  this.#name = new CSSValue(payload.propertyName);
229
242
  }
230
243
 
@@ -258,7 +271,12 @@ export class CSSPropertyRule extends CSSRule {
258
271
  export class CSSFontPaletteValuesRule extends CSSRule {
259
272
  readonly #paletteName: CSSValue;
260
273
  constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSFontPaletteValuesRule) {
261
- super(cssModel, {origin: payload.origin, style: payload.style, header: styleSheetHeaderForRule(cssModel, payload)});
274
+ super(cssModel, {
275
+ origin: payload.origin,
276
+ style: payload.style,
277
+ header: styleSheetHeaderForRule(cssModel, payload),
278
+ originTreeScopeNodeId: undefined
279
+ });
262
280
  this.#paletteName = new CSSValue(payload.fontPaletteName);
263
281
  }
264
282
 
@@ -289,7 +307,12 @@ export class CSSKeyframeRule extends CSSRule {
289
307
  #keyText!: CSSValue;
290
308
  #parentRuleName: string;
291
309
  constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSKeyframeRule, parentRuleName: string) {
292
- super(cssModel, {origin: payload.origin, style: payload.style, header: styleSheetHeaderForRule(cssModel, payload)});
310
+ super(cssModel, {
311
+ origin: payload.origin,
312
+ style: payload.style,
313
+ header: styleSheetHeaderForRule(cssModel, payload),
314
+ originTreeScopeNodeId: undefined
315
+ });
293
316
  this.reinitializeKey(payload.keyText);
294
317
  this.#parentRuleName = parentRuleName;
295
318
  }
@@ -340,7 +363,12 @@ export class CSSPositionTryRule extends CSSRule {
340
363
  readonly #name: CSSValue;
341
364
  readonly #active: boolean;
342
365
  constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSPositionTryRule) {
343
- super(cssModel, {origin: payload.origin, style: payload.style, header: styleSheetHeaderForRule(cssModel, payload)});
366
+ super(cssModel, {
367
+ origin: payload.origin,
368
+ style: payload.style,
369
+ header: styleSheetHeaderForRule(cssModel, payload),
370
+ originTreeScopeNodeId: undefined
371
+ });
344
372
  this.#name = new CSSValue(payload.name);
345
373
  this.#active = payload.active;
346
374
  }
@@ -372,7 +400,8 @@ export class CSSFunctionRule extends CSSRule {
372
400
  super(cssModel, {
373
401
  origin: payload.origin,
374
402
  style: {cssProperties: [], shorthandEntries: []},
375
- header: styleSheetHeaderForRule(cssModel, payload)
403
+ header: styleSheetHeaderForRule(cssModel, payload),
404
+ originTreeScopeNodeId: undefined
376
405
  });
377
406
  this.#name = new CSSValue(payload.name);
378
407
  this.#parameters = payload.parameters.map(({name}) => name);
@@ -272,9 +272,10 @@ export async function initMainConnection(
272
272
 
273
273
  function createMainConnection(onConnectionLost: (message: Platform.UIString.LocalizedString) => void):
274
274
  ProtocolClient.InspectorBackend.Connection {
275
- if (Root.Runtime.getPathName().includes('rehydrated_devtools_app')) {
275
+ if (Root.Runtime.Runtime.isTraceApp()) {
276
276
  return new RehydratingConnection(onConnectionLost);
277
277
  }
278
+
278
279
  const wsParam = Root.Runtime.Runtime.queryParam('ws');
279
280
  const wssParam = Root.Runtime.Runtime.queryParam('wss');
280
281
  if (wsParam || wssParam) {
@@ -480,6 +480,10 @@ export class DOMNode {
480
480
  return this.#isInShadowTree;
481
481
  }
482
482
 
483
+ getTreeRoot(): DOMNode {
484
+ return this.isShadowRoot() ? this : (this.ancestorShadowRoot() ?? this.ownerDocument ?? this);
485
+ }
486
+
483
487
  ancestorShadowHost(): DOMNode|null {
484
488
  const ancestorShadowRoot = this.ancestorShadowRoot();
485
489
  return ancestorShadowRoot ? ancestorShadowRoot.parentNode : null;
@@ -16,6 +16,7 @@ import {Events as ResourceTreeModelEvents, ResourceTreeModel} from './ResourceTr
16
16
  import {type EvaluationOptions, type EvaluationResult, type ExecutionContext, RuntimeModel} from './RuntimeModel.js';
17
17
  import {Script} from './Script.js';
18
18
  import {SDKModel} from './SDKModel.js';
19
+ import {SourceMap} from './SourceMap.js';
19
20
  import {SourceMapManager} from './SourceMapManager.js';
20
21
  import {Capability, type Target, Type} from './Target.js';
21
22
 
@@ -169,7 +170,10 @@ export class DebuggerModel extends SDKModel<EventTypes> {
169
170
  this.agent = target.debuggerAgent();
170
171
  this.#runtimeModel = (target.model(RuntimeModel) as RuntimeModel);
171
172
 
172
- this.#sourceMapManager = new SourceMapManager(target);
173
+ this.#sourceMapManager = new SourceMapManager(
174
+ target,
175
+ (compiledURL, sourceMappingURL, payload, script) =>
176
+ new SourceMap(compiledURL, sourceMappingURL, payload, script));
173
177
 
174
178
  Common.Settings.Settings.instance()
175
179
  .moduleSetting('pause-on-exception-enabled')