chrome-devtools-frontend 1.0.1736236 → 1.0.1739869

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 (388) hide show
  1. package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +1 -1
  2. package/.agents/skills/version-control/SKILL.md +63 -11
  3. package/.stylelintrc.json +3 -1
  4. package/docs/devtools-protocol.md +3 -1
  5. package/eslint.config.mjs +127 -6
  6. package/front_end/application_tokens.css +0 -30
  7. package/front_end/core/host/AidaClient.ts +14 -36
  8. package/front_end/core/host/AidaGcaTranslation.ts +8 -5
  9. package/front_end/core/root/Runtime.ts +0 -5
  10. package/front_end/core/sdk/SourceMap.ts +30 -3
  11. package/front_end/core/sdk/SourceMapRangeMappings.ts +57 -0
  12. package/front_end/design_system_tokens.css +1 -0
  13. package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +5 -9
  14. package/front_end/entrypoints/main/GlobalAiButton.ts +2 -9
  15. package/front_end/entrypoints/main/MainImpl.ts +0 -4
  16. package/front_end/generated/SupportedCSSProperties.ts +24 -23
  17. package/front_end/models/ai-utils/AiUtils.ts +1 -5
  18. package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -18
  19. package/front_end/models/ai_assistance/contexts/FileContext.ts +1 -2
  20. package/front_end/models/ai_assistance/tools/ListSources.ts +3 -1
  21. package/front_end/models/ai_code_generation/AiCodeGeneration.ts +0 -6
  22. package/front_end/models/javascript_metadata/NativeFunctions.ts +9 -5
  23. package/front_end/models/trace/EventsSerializer.ts +0 -8
  24. package/front_end/models/trace/extras/TraceFilter.ts +16 -8
  25. package/front_end/models/trace/extras/TraceTree.ts +104 -67
  26. package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +0 -5
  27. package/front_end/models/trace/handlers/RendererHandler.ts +7 -6
  28. package/front_end/models/trace/handlers/SamplesHandler.ts +1 -1
  29. package/front_end/models/trace/helpers/Extensions.ts +1 -3
  30. package/front_end/models/trace/helpers/SamplesIntegrator.ts +155 -87
  31. package/front_end/models/trace/helpers/Trace.ts +15 -12
  32. package/front_end/models/trace/helpers/TreeHelpers.ts +38 -10
  33. package/front_end/models/trace/insights/SlowCSSSelector.ts +3 -3
  34. package/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +19 -4
  35. package/front_end/models/workspace/UISourceCode.ts +30 -8
  36. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -7
  37. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +15 -34
  38. package/front_end/panels/ai_assistance/components/ChatView.ts +2 -16
  39. package/front_end/panels/ai_assistance/components/chatView.css +0 -212
  40. package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
  41. package/front_end/panels/animation/AnimationTimeline.ts +1 -1
  42. package/front_end/panels/animation/animationTimeline.css +5 -3
  43. package/front_end/panels/application/ApplicationPanelTreeElement.ts +66 -3
  44. package/front_end/panels/application/PrivateVerificationTokensView.ts +114 -26
  45. package/front_end/panels/application/ResourcesPanel.ts +1 -0
  46. package/front_end/panels/application/backgroundServiceView.css +2 -2
  47. package/front_end/panels/application/components/backForwardCacheView.css +1 -1
  48. package/front_end/panels/application/components/permissionsPolicySection.css +0 -4
  49. package/front_end/panels/application/frameDetailsReportView.css +0 -7
  50. package/front_end/panels/application/indexedDBViews.css +3 -3
  51. package/front_end/panels/application/privateVerificationTokensView.css +6 -0
  52. package/front_end/panels/application/resourcesPanel.css +0 -48
  53. package/front_end/panels/application/serviceWorkerUpdateCycleView.css +1 -1
  54. package/front_end/panels/application/serviceWorkersView.css +2 -2
  55. package/front_end/panels/comments/CommentsPane.ts +1 -1
  56. package/front_end/panels/comments/commentsPane.css +1 -1
  57. package/front_end/panels/common/common.ts +0 -1
  58. package/front_end/panels/console/ConsoleView.ts +11 -1
  59. package/front_end/panels/console/ConsoleViewMessage.ts +5 -1
  60. package/front_end/panels/console/consolePinPane.css +1 -1
  61. package/front_end/panels/console/consoleView.css +6 -5
  62. package/front_end/panels/elements/DOMTreeWidget.ts +47 -5
  63. package/front_end/panels/elements/StylePropertiesSection.ts +4 -9
  64. package/front_end/panels/elements/StylePropertyTreeElement.ts +52 -34
  65. package/front_end/panels/elements/classesPaneWidget.css +3 -7
  66. package/front_end/panels/elements/components/CSSQuery.ts +6 -5
  67. package/front_end/panels/elements/layoutPane.css +0 -1
  68. package/front_end/panels/elements/metricsSidebarPane.css +2 -2
  69. package/front_end/panels/elements/stylePropertiesTreeOutline.css +0 -6
  70. package/front_end/panels/elements/stylesSidebarPane.css +0 -1
  71. package/front_end/panels/emulation/InspectedPagePlaceholder.ts +1 -0
  72. package/front_end/panels/emulation/deviceModeView.css +0 -1
  73. package/front_end/panels/explain/components/consoleInsight.css +1 -6
  74. package/front_end/panels/issues/AffectedBlockedByResponseView.ts +88 -46
  75. package/front_end/panels/issues/AffectedHeavyAdView.ts +72 -43
  76. package/front_end/panels/issues/AffectedResourcesView.ts +81 -13
  77. package/front_end/panels/issues/GenericIssueDetailsView.ts +112 -32
  78. package/front_end/panels/issues/issues.ts +2 -0
  79. package/front_end/panels/issues/issuesTree.css +9 -2
  80. package/front_end/panels/layer_viewer/LayerDetailsView.ts +34 -17
  81. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +39 -17
  82. package/front_end/panels/layer_viewer/Layers3DView.ts +34 -13
  83. package/front_end/panels/layer_viewer/layerDetailsView.css +2 -2
  84. package/front_end/panels/layer_viewer/layers3DView.css +0 -4
  85. package/front_end/panels/lighthouse/lighthousePanel.css +0 -9
  86. package/front_end/panels/linear_memory_inspector/components/linearMemoryValueInterpreter.css +2 -2
  87. package/front_end/panels/media/playerListView.css +0 -18
  88. package/front_end/panels/media/playerPropertiesView.css +1 -1
  89. package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +2 -2
  90. package/front_end/panels/network/NetworkLogView.ts +9 -2
  91. package/front_end/panels/network/NetworkWaterfallColumn.ts +22 -10
  92. package/front_end/panels/network/RequestPreviewView.ts +182 -63
  93. package/front_end/panels/network/RequestTimingView.ts +16 -2
  94. package/front_end/panels/network/SignedExchangeInfoView.ts +242 -158
  95. package/front_end/panels/network/networkConfigView.css +3 -3
  96. package/front_end/panels/network/networkLogView.css +4 -16
  97. package/front_end/panels/network/networkPanel.css +0 -7
  98. package/front_end/panels/network/networkTimingTable.css +12 -27
  99. package/front_end/panels/network/signedExchangeInfoView.css +12 -8
  100. package/front_end/panels/performance_monitor/performanceMonitor.css +2 -2
  101. package/front_end/panels/profiler/IsolateSelector.ts +31 -10
  102. package/front_end/panels/profiler/profilesPanel.css +0 -19
  103. package/front_end/panels/protocol_monitor/JSONEditor.css +1 -1
  104. package/front_end/panels/recorder/ControlButton.ts +1 -1
  105. package/front_end/panels/recorder/RecordingView.ts +22 -1
  106. package/front_end/panels/recorder/StepView.ts +26 -1
  107. package/front_end/panels/recorder/TimelineSection.ts +22 -6
  108. package/front_end/panels/recorder/controlButton.css +2 -9
  109. package/front_end/panels/recorder/recorderPanel.css +0 -1
  110. package/front_end/panels/recorder/recordingView.css +32 -32
  111. package/front_end/panels/recorder/replaySection.css +2 -0
  112. package/front_end/panels/recorder/stepView.css +18 -14
  113. package/front_end/panels/recorder/timelineSection.css +60 -84
  114. package/front_end/panels/screencast/screencastView.css +2 -2
  115. package/front_end/panels/search/searchView.css +1 -1
  116. package/front_end/panels/security/SecurityPanel.ts +474 -418
  117. package/front_end/panels/security/SecurityPanelSidebar.ts +68 -48
  118. package/front_end/panels/security/lockIcon.css +52 -50
  119. package/front_end/panels/security/mainView.css +149 -145
  120. package/front_end/panels/security/originView.css +117 -115
  121. package/front_end/panels/sensors/LocationsSettingsTab.ts +2 -50
  122. package/front_end/panels/sensors/SensorsView.ts +6 -21
  123. package/front_end/panels/sensors/locationsSettingsTab.css +1 -21
  124. package/front_end/panels/settings/AISettingsTab.ts +1 -2
  125. package/front_end/panels/settings/SettingsScreen.ts +1 -1
  126. package/front_end/panels/sources/CallStackSidebarPane.ts +31 -6
  127. package/front_end/panels/sources/NavigatorView.ts +105 -31
  128. package/front_end/panels/sources/breakpointsView.css +5 -3
  129. package/front_end/panels/sources/scopeChainSidebarPane.css +1 -1
  130. package/front_end/panels/sources/sourcesView.css +2 -1
  131. package/front_end/panels/timeline/EventsTimelineTreeView.ts +18 -5
  132. package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -0
  133. package/front_end/panels/timeline/TimelineController.ts +30 -26
  134. package/front_end/panels/timeline/TimelineDetailsView.ts +10 -9
  135. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +4 -16
  136. package/front_end/panels/timeline/TimelineLayersView.ts +108 -46
  137. package/front_end/panels/timeline/TimelineMiniMap.ts +132 -54
  138. package/front_end/panels/timeline/TimelinePanel.ts +4 -2
  139. package/front_end/panels/timeline/TimelineTreeView.ts +25 -9
  140. package/front_end/panels/timeline/components/DetailsView.ts +7 -14
  141. package/front_end/panels/timeline/components/NetworkTrackWidget.ts +5 -1
  142. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
  143. package/front_end/panels/timeline/components/interactionBreakdown.css +1 -0
  144. package/front_end/panels/timeline/components/networkRequestDetails.css +2 -1
  145. package/front_end/panels/timeline/components/networkTrackWidget.css +1 -1
  146. package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -0
  147. package/front_end/panels/timeline/docs/profile_calls.md +7 -9
  148. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +0 -7
  149. package/front_end/panels/timeline/timelineDetailsView.css +2 -2
  150. package/front_end/panels/web_audio/webAudio.css +1 -2
  151. package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
  152. package/front_end/panels/webauthn/webauthnPane.css +1 -1
  153. package/front_end/panels/whats_new/ReleaseNoteText.ts +6 -6
  154. package/front_end/panels/whats_new/resources/WNDT.md +6 -6
  155. package/front_end/third_party/axe-core/README.chromium +2 -3
  156. package/front_end/third_party/chromium/README.chromium +1 -1
  157. package/front_end/third_party/puppeteer/README.chromium +2 -2
  158. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +328 -11
  159. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +907 -588
  160. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +119 -1
  161. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
  162. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts +120 -1
  164. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
  166. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.d.ts +16 -1
  167. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.d.ts.map +1 -1
  168. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js +5 -1
  169. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js.map +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts +26 -0
  171. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
  173. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +23 -3
  174. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +21 -14
  176. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts +5 -5
  178. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js +4 -4
  180. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts +6 -1
  182. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts.map +1 -1
  183. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js +158 -67
  184. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js +1 -0
  187. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js.map +1 -1
  188. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts.map +1 -1
  189. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js +3 -1
  190. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js.map +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.d.ts.map +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js +28 -5
  193. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js.map +1 -1
  194. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.d.ts +4 -0
  195. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  196. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.js +19 -11
  197. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.js.map +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts +2 -0
  199. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
  200. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +17 -5
  201. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
  202. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.d.ts.map +1 -1
  203. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.js +62 -4
  204. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.js.map +1 -1
  205. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.d.ts +29 -0
  206. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.d.ts.map +1 -0
  207. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.js +60 -0
  208. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.js.map +1 -0
  209. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts +9 -1
  210. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts.map +1 -1
  211. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js +24 -9
  212. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js.map +1 -1
  213. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.d.ts.map +1 -1
  214. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js +16 -7
  215. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js.map +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.d.ts +6 -0
  217. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  218. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.js +37 -20
  219. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.js.map +1 -1
  220. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
  221. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  222. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js +10 -5
  223. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Navigation.d.ts.map +1 -1
  225. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Navigation.js +18 -1
  226. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Navigation.js.map +1 -1
  227. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.d.ts.map +1 -1
  228. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.js +24 -5
  229. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.js.map +1 -1
  230. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.d.ts.map +1 -1
  231. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js +6 -4
  232. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js.map +1 -1
  233. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExtensionTransport.js +30 -6
  235. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExtensionTransport.js.map +1 -1
  236. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts +2 -0
  237. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
  238. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +3 -0
  239. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
  240. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.d.ts +5 -1
  241. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  242. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js +12 -2
  243. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js.map +1 -1
  244. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts +3 -0
  245. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
  246. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +40 -0
  247. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
  248. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.d.ts +23 -1
  249. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
  250. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.js +37 -0
  251. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.js.map +1 -1
  252. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts +2 -0
  253. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  254. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js +74 -16
  255. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
  256. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts +3 -2
  257. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts.map +1 -1
  258. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js +34 -23
  259. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js.map +1 -1
  260. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.d.ts +10 -0
  261. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.d.ts.map +1 -0
  262. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.js +94 -0
  263. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.js.map +1 -0
  264. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts +2 -2
  265. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
  266. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js +29 -1
  267. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
  268. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.d.ts +1 -0
  269. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.d.ts.map +1 -1
  270. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.js +1 -0
  271. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.js.map +1 -1
  272. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/utils.d.ts.map +1 -1
  273. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/utils.js +6 -5
  274. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/utils.js.map +1 -1
  275. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConsoleMessage.d.ts +4 -0
  276. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  277. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConsoleMessage.js.map +1 -1
  278. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts +4 -4
  279. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts.map +1 -1
  280. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js +2 -2
  281. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js.map +1 -1
  282. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts.map +1 -1
  283. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js +34 -15
  284. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
  285. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts +3 -0
  286. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  287. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +11 -7
  288. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
  289. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js +10 -7
  290. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js.map +1 -1
  291. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
  292. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
  293. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/decorators.js.map +1 -1
  294. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
  295. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
  296. package/front_end/third_party/puppeteer/package/lib/types.d.ts +328 -11
  297. package/front_end/third_party/puppeteer/package/package.json +10 -8
  298. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +118 -0
  299. package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +119 -0
  300. package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +25 -2
  301. package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +28 -0
  302. package/front_end/third_party/puppeteer/package/src/api/Page.ts +65 -38
  303. package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +27 -7
  304. package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +43 -7
  305. package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +1 -0
  306. package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +5 -1
  307. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +38 -8
  308. package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +27 -12
  309. package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +19 -6
  310. package/front_end/third_party/puppeteer/package/src/bidi/Input.ts +72 -5
  311. package/front_end/third_party/puppeteer/package/src/bidi/NetworkEvents.ts +82 -0
  312. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +37 -13
  313. package/front_end/third_party/puppeteer/package/src/bidi/Realm.ts +26 -14
  314. package/front_end/third_party/puppeteer/package/src/bidi/core/Browser.ts +43 -22
  315. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +13 -5
  316. package/front_end/third_party/puppeteer/package/src/bidi/core/Navigation.ts +21 -1
  317. package/front_end/third_party/puppeteer/package/src/bidi/core/Request.ts +27 -5
  318. package/front_end/third_party/puppeteer/package/src/cdp/Binding.ts +6 -4
  319. package/front_end/third_party/puppeteer/package/src/cdp/ExtensionTransport.ts +31 -6
  320. package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +5 -0
  321. package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +18 -1
  322. package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +48 -0
  323. package/front_end/third_party/puppeteer/package/src/cdp/NetworkEventManager.ts +58 -5
  324. package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +94 -14
  325. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +50 -28
  326. package/front_end/third_party/puppeteer/package/src/cdp/ResponseBodyStream.ts +106 -0
  327. package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +38 -3
  328. package/front_end/third_party/puppeteer/package/src/cdp/cdp.ts +1 -0
  329. package/front_end/third_party/puppeteer/package/src/cdp/utils.ts +6 -5
  330. package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +5 -0
  331. package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +17 -8
  332. package/front_end/third_party/puppeteer/package/src/common/util.ts +32 -15
  333. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +21 -13
  334. package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +10 -10
  335. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  336. package/front_end/third_party/puppeteer/package/src/util/decorators.ts +1 -1
  337. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  338. package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +2 -0
  339. package/front_end/ui/comments/CommentAnchorResolver.ts +45 -4
  340. package/front_end/ui/comments/CommentOverlayManager.ts +45 -12
  341. package/front_end/ui/components/buttons/FloatingButton.ts +2 -6
  342. package/front_end/ui/components/buttons/button.css +2 -2
  343. package/front_end/ui/components/buttons/floatingButton.css +0 -44
  344. package/front_end/ui/components/diff_view/diffView.css +0 -2
  345. package/front_end/ui/components/icon_button/iconButton.css +1 -1
  346. package/front_end/ui/components/markdown_view/markdownView.css +1 -1
  347. package/front_end/ui/components/tooltips/Tooltip.ts +29 -0
  348. package/front_end/ui/components/tree_outline/treeOutline.css +1 -1
  349. package/front_end/ui/legacy/ContextMenu.ts +7 -5
  350. package/front_end/ui/legacy/InspectorDrawerView.ts +1 -0
  351. package/front_end/ui/legacy/InspectorView.ts +5 -1
  352. package/front_end/ui/legacy/PopoverHelper.ts +1 -0
  353. package/front_end/ui/legacy/RootView.ts +9 -3
  354. package/front_end/ui/legacy/SplitWidget.ts +1 -0
  355. package/front_end/ui/legacy/Treeoutline.ts +9 -0
  356. package/front_end/ui/legacy/UIUtils.ts +1 -1
  357. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +130 -137
  358. package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
  359. package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +1 -0
  360. package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +1 -1
  361. package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +3 -1
  362. package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +7 -6
  363. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +34 -20
  364. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +43 -14
  365. package/front_end/ui/legacy/components/perf_ui/pieChart.css +2 -2
  366. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -10
  367. package/front_end/ui/legacy/components/source_frame/imageView.css +2 -2
  368. package/front_end/ui/legacy/filter.css +7 -3
  369. package/front_end/ui/legacy/infobar.css +1 -1
  370. package/front_end/ui/legacy/inspectorCommon.css +3 -55
  371. package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +3 -3
  372. package/front_end/ui/legacy/listWidget.css +3 -8
  373. package/front_end/ui/legacy/softDropDownButton.css +1 -1
  374. package/front_end/ui/legacy/tabbedPane.css +2 -9
  375. package/front_end/ui/legacy/treeoutline.css +3 -2
  376. package/front_end/ui/visual_logging/KnownContextValues.ts +134 -0
  377. package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
  378. package/inspector_overlay/tool_highlight.css +0 -7
  379. package/inspector_overlay/tool_highlight.ts +0 -1
  380. package/package.json +1 -1
  381. package/front_end/Images/geminiInDevTools.png +0 -0
  382. package/front_end/Images/geminiInDevTools_2x.png +0 -0
  383. package/front_end/generated/InspectorBackendCommands.ts +0 -1690
  384. package/front_end/generated/protocol-mapping.d.ts +0 -5986
  385. package/front_end/generated/protocol-proxy-api.d.ts +0 -5452
  386. package/front_end/generated/protocol.ts +0 -23364
  387. package/front_end/panels/common/GeminiRebrandPromoDialog.ts +0 -193
  388. package/front_end/panels/common/geminiRebrandPromoDialog.css +0 -47
@@ -5,7 +5,7 @@ severity: nit
5
5
  ---
6
6
 
7
7
  **Rule.** Scope light-DOM stylesheets and align elements using flexbox or grid rather than competing margin and position offsets
8
- - **Look for**: Unscoped generic selectors in light-DOM `.css` files (or `:host` inside `@scope` blocks instead of `:scope`), redundant `@scope to (devtools-widget > *)` wrappers on shadow-DOM (`useShadowDom: 'pure'` or `useShadowDom: true`) widgets that have no child `<devtools-widget>` elements, or CSS rules combining `vertical-align`, negative `margin-top`, and pixel offsets to center icons and buttons.
8
+ - **Look for**: Unscoped generic selectors in light-DOM `.css` files (or `:host` inside `@scope` blocks instead of `:scope`), redundant `@scope to (devtools-widget > *)` wrappers on shadow-DOM (`useShadowDom: 'pure'` or `useShadowDom: true`) widgets that have no child `<devtools-widget>` elements, CSS rules combining `vertical-align`, negative `margin-top`, and pixel offsets to center icons and buttons, or `this.registerRequiredCSS(...)` or `widget.registerRequiredCSS(...)` calls in widgets migrated to Lit view functions instead of rendering `<style>${styles}</style>` inside the view template.
9
9
  - **Do not flag**: Shadow DOM component stylesheets where `:host` scoping is native. `<style>${styles}</style>` interpolations of `*.css.js` default imports in Lit templates (generated `.css.js` files export plain CSS strings, not `CSSStyleSheet` objects, and `<style>${...}</style>` is the standard replacement for deprecated `registerRequiredCSS`).
10
10
 
11
11
  **Why.** Unscoped class or tag selectors in light-DOM widget stylesheets leak across the DevTools document, while combining `vertical-align`, negative margins, and `position: relative` offsets creates brittle layouts that break under font scaling or zoom.
@@ -61,22 +61,71 @@ git rebase-update && gclient sync -Df
61
61
  * **Clean up old branches first:** Before running `git rebase-update`, archive landed/closed branches (`git cl archive -f`) or mark dormant (`git config branch.<branch>.dormant true`) any obsolete branches so they do not trigger unnecessary rebase conflicts.
62
62
  * **Always sync dependencies after rebase:** Always run `gclient sync -Df` after a `git rebase-update`. CIPD dependency updates do not show up in `git status`, so skipping `gclient sync -Df` risks leaving your checkout out of sync.
63
63
 
64
- ### Initial upload
65
- When a CL is ready, upload it with:
64
+ ### Uploading & Requesting Review
65
+ Always run `ChromiumCodeReviewAgent` on a Work-in-Progress (WIP) CL and resolve any `ERROR` or `WARNING` findings **before** marking the CL Ready for Review or adding human reviewers.
66
+
67
+ #### Step 1 — Upload as WIP and trigger AI review
68
+ Upload without `--send-mail` (`-s`) (and without `-c` / `--use-commit-queue`, which implies `--send-mail`) so the CL stays in Work-in-Progress, and trigger a CQ dry run (`--cq-dry-run` / `-d`) before adding human reviewers to the attention set:
69
+ ```bash
70
+ git cl upload -f --cq-dry-run --commit-description="<description>"
71
+ ```
72
+ Or, if the WIP patchset is already uploaded, vote `Commit-Queue+1` via `/google/bin/releases/gemini-agents-gerrit/gerrit`:
66
73
  ```bash
67
- git cl upload -f -d --commit-description="<description>"
74
+ /google/bin/releases/gemini-agents-gerrit/gerrit vote Commit-Queue 1 \
75
+ --change=<CL_NUMBER> \
76
+ --host=https://chromium-review.googlesource.com
68
77
  ```
69
78
  * Always include `-f` (`--force`) so that `git cl upload` runs non-interactively without opening a text editor or prompting.
70
- * Use the same writing style as the current committer
71
- * Keep line length below 72
72
- * Add a "Bug: <issue number>" or "Bug: None" trailer on a separate line.
73
- * Amend formatter/linter changes and fix linter issues.
74
- * For a brand new stack of CLs, perform the initial upload on each branch individually in parent-to-child order so each CL receives its own commit description.
79
+ * Use the same writing style as the current committer.
80
+ * Keep line length below 72.
81
+ * Add a `Bug: <issue number>` (or `Fixed: <issue number>` / `Bug: None`) trailer on a separate line.
82
+ * Amend formatter/linter changes and fix linter issues before uploading.
83
+ * For a brand new stack of CLs, perform the initial WIP upload on each branch individually in parent-to-child order so each CL receives its own commit description.
84
+
85
+ #### Step 2 — Poll for `ChromiumCodeReviewAgent` findings
86
+ Poll every ~60 seconds (up to ~5 minutes) until the `ChromiumCodeReviewAgent` run completes:
87
+ 1. Check whether the `ChromiumCodeReviewAgent` run has reached `"status": "COMPLETED"`:
88
+ ```bash
89
+ gerrit_client.py checks \
90
+ --host https://chromium-review.googlesource.com \
91
+ --change <CL_NUMBER> \
92
+ --revision <PS> \
93
+ --json_file <TMP_CHECKS_JSON>
94
+ ```
95
+ 2. Fetch the findings with `/google/bin/releases/gemini-agents-gerrit/gerrit findings` (include `--all` because `ChromiumCodeReviewAgent` marks `WARNING` findings `actionable: false`, which `gerrit findings` omits by default; if the internal binary is unavailable, read `results` on the `ChromiumCodeReviewAgent` entry in `<TMP_CHECKS_JSON>`):
96
+ ```bash
97
+ /google/bin/releases/gemini-agents-gerrit/gerrit findings \
98
+ --change=<CL_NUMBER> \
99
+ --patchset=<PS> \
100
+ --all \
101
+ --json \
102
+ --host=https://chromium-review.googlesource.com
103
+ ```
104
+
105
+ #### Step 3 — Address findings before starting human review
106
+ Inspect all `ChromiumCodeReviewAgent` findings with `ERROR` or `WARNING` severity (consulting `.agents/skills/code-review/SKILL.md`, including its Shared False-Positive Guards):
107
+ * **Real issue:** Fix the issue locally, re-verify (`devtools-verification`), `git commit --amend`, upload a new WIP patchset with `--cq-dry-run` (`git cl upload -f --cq-dry-run -t "<one sentence patch set description>"`), and repeat Step 2 on the new patchset.
108
+ * **Confirmed false positive:** While the CL is still in WIP (before adding human reviewers), reply on the CL explaining why the finding does not apply (citing `ref: f/...` if present):
109
+ ```bash
110
+ /google/bin/releases/gemini-agents-gerrit/gerrit messages post \
111
+ --change=<CL_NUMBER> \
112
+ --message="<explanation citing ref: f/...>" \
113
+ --host=https://chromium-review.googlesource.com
114
+ ```
115
+ * **Start human review:** Once `ChromiumCodeReviewAgent` completes with all `ERROR` and `WARNING` findings addressed, mark the CL Ready for Review and add human reviewers:
116
+ ```bash
117
+ /google/bin/releases/gemini-agents-gerrit/gerrit reviewers add \
118
+ --change=<CL_NUMBER> \
119
+ --ready \
120
+ --reviewer=<reviewer1@chromium.org>,<reviewer2@chromium.org> \
121
+ --host=https://chromium-review.googlesource.com
122
+ ```
123
+ (Or run `git cl upload -f --send-mail -r <reviewer1@chromium.org> -r <reviewer2@chromium.org>`.)
75
124
 
76
125
  ### Subsequent upload & Updating Stacks
77
126
  To upload an updated CL:
78
127
  ```bash
79
- git cl upload -f -d -t "<one sentence patch set description>"
128
+ git cl upload -f --cq-dry-run -t "<one sentence patch set description>"
80
129
  ```
81
130
  * **Updating an existing stack of CLs:** Once all CLs in a stack have been initially created, **only run `git cl upload` from the leaf (latest) branch in the chain** for subsequent updates. Uploading from the leaf branch automatically runs presubmit checks and uploads new patchsets for all parent CLs in the stack simultaneously. Never upload intermediate CLs one by one when updating a stack.
82
131
 
@@ -93,8 +142,10 @@ To check whether a DevTools commit (`devtools/devtools-frontend`) has rolled int
93
142
  | Create new CL from main | `git new-branch <name>` |
94
143
  | Create stacked CL | `git new-branch --upstream_current <name>` |
95
144
  | Update current CL | `git commit --amend` |
96
- | Initial CL upload | `git cl upload -f -d --commit-description="<description>"` |
97
- | Subsequent CL upload (or update stack from leaf) | `git cl upload -f -d -t "<message>"` |
145
+ | Initial WIP CL upload + CQ dry run | `git cl upload -f --cq-dry-run --commit-description="<description>"` |
146
+ | Poll `ChromiumCodeReviewAgent` findings | `/google/bin/releases/gemini-agents-gerrit/gerrit findings --change=<CL> --patchset=<PS> --all --json --host=https://chromium-review.googlesource.com` |
147
+ | Mark Ready for Review & add reviewers | `/google/bin/releases/gemini-agents-gerrit/gerrit reviewers add --change=<CL> --ready --reviewer=<emails> --host=https://chromium-review.googlesource.com` |
148
+ | Subsequent CL upload (or update stack from leaf) | `git cl upload -f --cq-dry-run -t "<message>"` |
98
149
  | Reparent branch to root (`origin/main`) | `git reparent-branch --root` |
99
150
  | Change branch parent | `git reparent-branch <new-parent>` |
100
151
  | Archive landed/closed branches | `git cl archive -f` |
@@ -103,6 +154,7 @@ To check whether a DevTools commit (`devtools/devtools-frontend`) has rolled int
103
154
  | Check release & roll status | Query `https://chromiumdash.appspot.com/fetch_commit?commit=<sha>` |
104
155
 
105
156
  ## Common Mistakes
157
+ - **Starting human review before resolving `ChromiumCodeReviewAgent` findings:** Never pass `--send-mail` (`-s`) or `-c` (`--use-commit-queue`) on the initial upload, or add human reviewers to the attention set before AI review finishes. Upload in WIP with `--cq-dry-run`, wait for `ChromiumCodeReviewAgent` to complete, and address all `ERROR` and `WARNING` findings first.
106
158
  - **Multiple commits on one branch:** Gerrit expects one commit per CL. Always `commit --amend`.
107
159
  - **Using `git checkout -b`:** Does not set up tracking information correctly for `depot_tools`. Use `git new-branch`.
108
160
  - **Manual rebasing of stacked branches:** Never use manual `git rebase` loops. Always use `git rebase-update` or `git reparent-branch` to let `depot_tools` handle tracking updates.
package/.stylelintrc.json CHANGED
@@ -3,12 +3,14 @@
3
3
  "plugins": [
4
4
  "./scripts/stylelint_rules/lib/use_theme_colors.mjs",
5
5
  "./scripts/stylelint_rules/lib/check_highlight_scope.mjs",
6
- "./scripts/stylelint_rules/lib/use_monospace_font.mjs"
6
+ "./scripts/stylelint_rules/lib/use_monospace_font.mjs",
7
+ "./scripts/stylelint_rules/lib/check_scope_selectors.mjs"
7
8
  ],
8
9
  "rules": {
9
10
  "plugin/use_theme_colors": true,
10
11
  "plugin/check_highlight_scope": true,
11
12
  "plugin/use_monospace_font": true,
13
+ "plugin/check_scope_selectors": true,
12
14
  "alpha-value-notation": "percentage",
13
15
  "color-function-notation": "modern",
14
16
  "hue-degree-notation": "angle",
@@ -33,7 +33,9 @@ handlers spanning several layers and processes, e.g. have instances in
33
33
  ### browser_protocol.pdl
34
34
 
35
35
  The `browser_protocol.pdl` file is the source of truth that is used to generate
36
- the `browser_protocol.json` file and the `.ts`, `.h` and `.cc` files.
36
+ the `.ts`, `.h` and `.cc` files. DevTools generates its TypeScript types from
37
+ it at build time (see `front_end/generated/BUILD.gn`); they end up under
38
+ `out/Default/gen/front_end/generated/`.
37
39
 
38
40
  However, there are multiple `browser_protocol.pdl` files across the codebase.
39
41
  The main one is located at (in your chromium repo):
package/eslint.config.mjs CHANGED
@@ -28,11 +28,6 @@ export default defineConfig([
28
28
 
29
29
  'front_end/diff/diff_match_patch.js',
30
30
  'front_end/models/javascript_metadata/NativeFunctions.ts',
31
- // All of these scripts are auto-generated so don't lint them.
32
- 'front_end/generated/InspectorBackendCommands.ts',
33
- 'front_end/generated/protocol-mapping.d.ts',
34
- 'front_end/generated/protocol-proxy-api.d.ts',
35
- 'front_end/generated/protocol.ts',
36
31
  // Any third_party addition has its source code checked out into
37
32
  // third_party/X/package, so we ignore that code as it's not code we author or
38
33
  // own.
@@ -740,6 +735,7 @@ export default defineConfig([
740
735
  'front_end/**/*.docs.ts',
741
736
  'test/**/*.ts',
742
737
  '**/testing/*.ts',
738
+ 'scripts/build/tests/**/*.ts',
743
739
  'scripts/eslint_rules/tests/**/*',
744
740
  'scripts/gn_deps_verifier/tests/**/*',
745
741
  'extensions/cxx_debugging/e2e/**/*.ts',
@@ -815,6 +811,19 @@ export default defineConfig([
815
811
  ],
816
812
  },
817
813
  },
814
+ {
815
+ name: 'JavaScript script test files',
816
+ // The 'TypeScript test files' rules need type information, so JS tests
817
+ // only get the mocha rules. Missing mocha imports fail at runtime (see
818
+ // test/scripts/run_mocha.ts).
819
+ files: ['scripts/build/tests/**/*.js'],
820
+ rules: {
821
+ 'mocha/no-exclusive-tests': 'error',
822
+ 'mocha/no-async-describe': 'error',
823
+ 'mocha/no-global-tests': 'error',
824
+ 'mocha/no-nested-tests': 'error',
825
+ },
826
+ },
818
827
  {
819
828
  name: 'API test files',
820
829
  files: ['**/*.test.api.ts'],
@@ -838,6 +847,119 @@ export default defineConfig([
838
847
  '@devtools/prefer-private-class-members': 'error',
839
848
  },
840
849
  },
850
+ {
851
+ name: 'Enforce scoped light DOM styles rule',
852
+ files: [
853
+ 'front_end/**/*.ts',
854
+ ],
855
+ ignores: [
856
+ 'front_end/**/*.test.ts',
857
+ 'front_end/**/*.test.api.ts',
858
+ 'front_end/**/*.docs.ts',
859
+ 'front_end/testing/**',
860
+ 'front_end/third_party/**',
861
+ ],
862
+
863
+ rules: {
864
+ '@devtools/no-unscoped-light-dom-styles': [
865
+ 'error',
866
+ {
867
+ // Burndown list of Light DOM widgets with unscoped styles. Do NOT add files to this list.
868
+ // New Light DOM widgets must wrap their styles in '@scope' (see docs/ui_engineering.md#styling).
869
+ burndown: [
870
+ 'front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts',
871
+ 'front_end/panels/accessibility/AccessibilityNodeView.ts',
872
+ 'front_end/panels/ai_assistance/AiAssistancePanel.ts',
873
+ 'front_end/panels/ai_assistance/components/ChatInput.ts',
874
+ 'front_end/panels/ai_assistance/components/ChatMessage.ts',
875
+ 'front_end/panels/ai_assistance/components/RelevantDataDisclaimer.ts',
876
+ 'front_end/panels/ai_assistance/components/WalkthroughView.ts',
877
+ 'front_end/panels/application/BackgroundServiceView.ts',
878
+ 'front_end/panels/application/CrashReportContextView.ts',
879
+ 'front_end/panels/application/DeviceBoundSessionsView.ts',
880
+ 'front_end/panels/application/IndexedDBViews.ts',
881
+ 'front_end/panels/application/KeyValueStorageItemsView.ts',
882
+ 'front_end/panels/application/ReportingApiView.ts',
883
+ 'front_end/panels/application/ResourcesPanel.ts',
884
+ 'front_end/panels/application/ServiceWorkerCacheViews.ts',
885
+ 'front_end/panels/application/ServiceWorkersView.ts',
886
+ 'front_end/panels/application/SubAppsView.ts',
887
+ 'front_end/panels/application/WebMCPView.ts',
888
+ 'front_end/panels/application/components/EndpointsGrid.ts',
889
+ 'front_end/panels/application/components/ProtocolHandlersView.ts',
890
+ 'front_end/panels/application/components/ReportsGrid.ts',
891
+ 'front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts',
892
+ 'front_end/panels/changes/CombinedDiffView.ts',
893
+ 'front_end/panels/common/CommentThreadWidget.ts',
894
+ 'front_end/panels/console/ConsolePinPane.ts',
895
+ 'front_end/panels/console/ConsolePrompt.ts',
896
+ 'front_end/panels/console/ConsoleView.ts',
897
+ 'front_end/panels/css_overview/CSSOverviewProcessingView.ts',
898
+ 'front_end/panels/elements/AccessibilityTreeView.ts',
899
+ 'front_end/panels/elements/ElementsPanel.ts',
900
+ 'front_end/panels/elements/LayersWidget.ts',
901
+ 'front_end/panels/event_listeners/EventListenersView.ts',
902
+ 'front_end/panels/explain/components/ConsoleInsight.ts',
903
+ 'front_end/panels/layer_viewer/Layers3DView.ts',
904
+ 'front_end/panels/lighthouse/LighthousePanel.ts',
905
+ 'front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts',
906
+ 'front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts',
907
+ 'front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts',
908
+ 'front_end/panels/media/EventDisplayTable.ts',
909
+ 'front_end/panels/media/PlayerMessagesView.ts',
910
+ 'front_end/panels/media/PlayerPropertiesView.ts',
911
+ 'front_end/panels/network/NetworkLogView.ts',
912
+ 'front_end/panels/network/NetworkPanel.ts',
913
+ 'front_end/panels/network/NetworkWaterfallColumn.ts',
914
+ 'front_end/panels/network/RequestCookiesView.ts',
915
+ 'front_end/panels/network/RequestDeviceBoundSessionsView.ts',
916
+ 'front_end/panels/network/RequestHeadersView.ts',
917
+ 'front_end/panels/network/RequestPayloadView.ts',
918
+ 'front_end/panels/network/RequestTimingView.ts',
919
+ 'front_end/panels/profiler/HeapProfileView.ts',
920
+ 'front_end/panels/profiler/ProfileLauncherView.ts',
921
+ 'front_end/panels/profiler/ProfilesPanel.ts',
922
+ 'front_end/panels/screencast/ScreencastApp.ts',
923
+ 'front_end/panels/settings/AISettingsTab.ts',
924
+ 'front_end/panels/settings/BackendLinkingSettingsTab.ts',
925
+ 'front_end/panels/settings/emulation/DevicesSettingsTab.ts',
926
+ 'front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts',
927
+ 'front_end/panels/sources/FilteredUISourceCodeListProvider.ts',
928
+ 'front_end/panels/sources/SourcesNavigator.ts',
929
+ 'front_end/panels/sources/SourcesPanel.ts',
930
+ 'front_end/panels/sources/ThreadsSidebarPane.ts',
931
+ 'front_end/panels/sources/UISourceCodeFrame.ts',
932
+ 'front_end/panels/timeline/ThirdPartyTreeView.ts',
933
+ 'front_end/panels/timeline/TimelineFlameChartDataProvider.ts',
934
+ 'front_end/panels/timeline/TimelineFlameChartView.ts',
935
+ 'front_end/panels/timeline/TimelineMiniMap.ts',
936
+ 'front_end/panels/timeline/TimelinePaintProfilerView.ts',
937
+ 'front_end/panels/timeline/TimelinePanel.ts',
938
+ 'front_end/panels/timeline/TimelineSelectorStatsView.ts',
939
+ 'front_end/panels/timeline/TimelineTreeView.ts',
940
+ 'front_end/panels/timeline/components/LayoutShiftDetails.ts',
941
+ 'front_end/panels/webauthn/WebauthnPane.ts',
942
+ 'front_end/ui/components/dialogs/FreDialog.ts',
943
+ 'front_end/ui/components/text_editor/AiCodeGenerationUpgradeDialog.ts',
944
+ 'front_end/ui/legacy/FilterBar.ts',
945
+ 'front_end/ui/legacy/RootView.ts',
946
+ 'front_end/ui/legacy/components/cookie_table/CookiesTable.ts',
947
+ 'front_end/ui/legacy/components/data_grid/DataGrid.ts',
948
+ 'front_end/ui/legacy/components/inline_editor/CSSAngle.ts',
949
+ 'front_end/ui/legacy/components/inline_editor/LinkSwatch.ts',
950
+ 'front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts',
951
+ 'front_end/ui/legacy/components/perf_ui/ChartViewport.ts',
952
+ 'front_end/ui/legacy/components/perf_ui/OverviewGrid.ts',
953
+ 'front_end/ui/legacy/components/perf_ui/TimelineGrid.ts',
954
+ 'front_end/ui/legacy/components/source_frame/FontView.ts',
955
+ 'front_end/ui/legacy/components/source_frame/JSONView.ts',
956
+ 'front_end/ui/legacy/components/source_frame/XMLView.ts',
957
+ ],
958
+ },
959
+ ],
960
+ },
961
+ },
962
+
841
963
  {
842
964
  name: 'Ignore private class members rule',
843
965
  // The list below is an explicit burndown list of legacy files that have not
@@ -1020,7 +1142,6 @@ export default defineConfig([
1020
1142
  'front_end/panels/screencast/InputModel.ts',
1021
1143
  'front_end/panels/screencast/ScreencastView.ts',
1022
1144
  'front_end/panels/security/SecurityModel.ts',
1023
- 'front_end/panels/security/SecurityPanel.ts',
1024
1145
  'front_end/panels/sensors/LocationsSettingsTab.ts',
1025
1146
  'front_end/panels/sensors/SensorsView.ts',
1026
1147
  'front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts',
@@ -59,14 +59,10 @@
59
59
  --color-grid-selected: var(--sys-color-surface-variant);
60
60
  --color-grid-hovered: var(--sys-color-state-hover-on-subtle);
61
61
  --color-primary-old: rgb(26 115 232);
62
- --color-primary-variant: rgb(66 133 244);
63
62
  --color-background: rgb(255 255 255);
64
- --color-background-inverted: rgb(0 0 0);
65
63
  --color-background-inverted-opacity-0: rgb(0 0 0 / 0%);
66
64
  --color-background-inverted-opacity-2: rgb(0 0 0 / 2%);
67
- --color-background-inverted-opacity-30: rgb(0 0 0 / 30%);
68
65
  --color-background-inverted-opacity-50: rgb(0 0 0 / 50%);
69
- --color-background-opacity-50: rgb(255 255 255 / 50%);
70
66
  --color-background-opacity-80: rgb(255 255 255 / 80%);
71
67
  --color-background-elevation-1: rgb(241 243 244);
72
68
  --color-background-elevation-2: rgb(222 225 230);
@@ -82,9 +78,6 @@
82
78
  0 0 0 1px rgb(0 0 0 / 5%),
83
79
  0 2px 4px rgb(0 0 0 / 20%),
84
80
  0 2px 6px rgb(0 0 0 / 10%);
85
- --drop-shadow-depth-1:
86
- 0 1px 2px rgb(60 64 67 / 30%),
87
- 0 1px 3px 1px rgb(60 64 67 / 15%);
88
81
  --drop-shadow-depth-3:
89
82
  0 4px 8px 3px rgb(60 64 67 / 15%),
90
83
  0 1px 3px rgb(60 64 67 / 30%);
@@ -102,9 +95,6 @@
102
95
  /** Used to indicate an input box */
103
96
  --input-outline: rgb(202 205 209);
104
97
 
105
- /** These colors are used to show errors */
106
- --color-error-text: #f00;
107
-
108
98
  /* Colors used by the code editor */
109
99
  --color-continue-to-location: var(--ref-palette-blue90);
110
100
  --color-continue-to-location-hover: var(--ref-palette-blue80);
@@ -121,7 +111,6 @@
121
111
  --legacy-accent-color: #1a73e8;
122
112
  --legacy-focus-ring-inactive-shadow-color: #e0e0e0;
123
113
  --legacy-input-validation-error: #db1600;
124
- --legacy-selection-bg-color: var(--legacy-accent-color);
125
114
  --legacy-focus-ring-inactive-shadow: 0 0 0 1px var(--legacy-focus-ring-inactive-shadow-color);
126
115
  --legacy-focus-ring-active-shadow: 0 0 0 1px var(--sys-color-state-focus-ring);
127
116
 
@@ -145,7 +134,6 @@
145
134
  --app-color-painting: var(--ref-palette-green70);
146
135
  --app-color-painting-children: var(--ref-palette-green80);
147
136
  --app-color-messaging: var(--ref-palette-cyan70);
148
- --app-color-messaging-children: var(--ref-palette-cyan80);
149
137
  --app-color-task: var(--ref-palette-neutral80);
150
138
  --app-color-task-children: var(--ref-palette-neutral90);
151
139
  --app-color-system: var(--ref-palette-neutral80);
@@ -223,11 +211,6 @@
223
211
  */
224
212
  --app-color-element-sidebar-subtitle: var(--ref-palette-neutral50);
225
213
 
226
- /**
227
- * Color for input driver for AI assistance chat
228
- */
229
- --app-color-ai-assistance-input-divider: rgb(0 0 0 / 10%);
230
-
231
214
  /**
232
215
  * Gradient colors for Google AI, used in the Global AI button in promotion enabled state
233
216
  */
@@ -261,13 +244,9 @@
261
244
 
262
245
  &.theme-with-dark-background {
263
246
  --color-primary-old: rgb(138 180 248);
264
- --color-primary-variant: rgb(102 157 246);
265
247
  --color-background: rgb(32 33 36);
266
- --color-background-inverted: rgb(255 255 255);
267
248
  --color-background-inverted-opacity-2: rgb(255 255 255 / 2%);
268
- --color-background-inverted-opacity-30: rgb(255 255 255 / 30%);
269
249
  --color-background-inverted-opacity-50: rgb(255 255 255 / 50%);
270
- --color-background-opacity-50: rgb(32 33 36 / 50%);
271
250
  --color-background-opacity-80: rgb(32 33 36 / 80%);
272
251
  --color-background-elevation-1: rgb(41 42 45);
273
252
  --color-background-elevation-2: rgb(53 54 58);
@@ -281,9 +260,6 @@
281
260
  0 0 0 1px rgb(255 255 255 / 20%),
282
261
  0 2px 4px 2px rgb(0 0 0 / 20%),
283
262
  0 2px 6px 2px rgb(0 0 0 / 10%);
284
- --drop-shadow-depth-1:
285
- 0 1px 2px rgb(0 0 0 / 30%),
286
- 0 1px 3px 1px rgb(0 0 0 / 15%);
287
263
  --drop-shadow-depth-3:
288
264
  0 4px 8px 3px rgb(0 0 0 / 15%),
289
265
  0 1px 3px rgb(0 0 0 / 30%);
@@ -292,7 +268,6 @@
292
268
  --color-scrollbar-mac-hover: rgb(75 76 79);
293
269
  --color-scrollbar-other: rgb(51 51 51);
294
270
  --color-scrollbar-other-hover: rgb(75 76 79);
295
- --color-error-text: hsl(0deg 100% 75%);
296
271
 
297
272
  /* Colors used by the code editor */
298
273
  --color-continue-to-location: var(--ref-palette-yellow30);
@@ -403,11 +378,6 @@
403
378
  */
404
379
  --app-color-element-sidebar-subtitle: var(--sys-color-token-subtle);
405
380
 
406
- /**
407
- * Color for input driver for AI assistance chat
408
- */
409
- --app-color-ai-assistance-input-divider: rgb(255 255 255 / 15%);
410
-
411
381
  /**
412
382
  * Combobox image.
413
383
  */
@@ -106,7 +106,7 @@ function conversationSurfaceHistogram(feature: ClientFeature): UserMetrics.AiCli
106
106
 
107
107
  /**
108
108
  * Returns a closure that records the request outcome histogram once per call.
109
- * One-shot recording prevents early generator returns or nested catch/finally blocks from double-counting outcomes.
109
+ * One-shot recording prevents inner validation branches and outer catch blocks from double-counting outcomes.
110
110
  */
111
111
  function createOutcomeRecorder(surfaceHistogram?: UserMetrics.AiClientSurfaceHistogram):
112
112
  (result: UserMetrics.AiClientRequestResult) => void {
@@ -190,7 +190,8 @@ export class AidaClient {
190
190
  throw new Error('dispatchHttpRequest is not available');
191
191
  }
192
192
 
193
- const recordOutcome = createOutcomeRecorder(conversationSurfaceHistogram(request.client_feature));
193
+ // Defaults to ABORTED so early caller exits (`break` / `return`) before `completed: true` record as aborted.
194
+ let outcome = UserMetrics.AiClientRequestResult.ABORTED;
194
195
  let abortListener: (() => void)|undefined;
195
196
  let streamId: number|undefined;
196
197
  try {
@@ -198,13 +199,6 @@ export class AidaClient {
198
199
  throw new AidaAbortError();
199
200
  }
200
201
 
201
- // Disable logging for now.
202
- // For context, see b/454563259#comment35.
203
- // We should be able to remove this ~end of April.
204
- if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
205
- request.metadata.disable_user_content_logging = true;
206
- }
207
-
208
202
  const stream = (() => {
209
203
  let {promise, resolve, reject} = Promise.withResolvers<string|null>();
210
204
  // Prevent unhandled promise rejections if stream.fail() is called after
@@ -254,14 +248,17 @@ export class AidaClient {
254
248
  debugLog('doConversation failed with error:', JSON.stringify(err));
255
249
  stream.fail(mapError(err));
256
250
  });
257
- yield* this.#handleResponseStream(stream);
258
- recordOutcome(UserMetrics.AiClientRequestResult.SUCCESS);
251
+ for await (const chunk of this.#handleResponseStream(stream)) {
252
+ if (chunk.completed) {
253
+ outcome = UserMetrics.AiClientRequestResult.SUCCESS;
254
+ }
255
+ yield chunk;
256
+ }
259
257
  } catch (err) {
260
- recordOutcome(classifyRequestError(err));
258
+ outcome = classifyRequestError(err);
261
259
  throw err;
262
260
  } finally {
263
- // Fallback when a caller exits the generator early (such as breaking out of a for-await loop) before stream completion.
264
- recordOutcome(UserMetrics.AiClientRequestResult.ABORTED);
261
+ UserMetrics.userMetrics.aiClientRequestResult(outcome, conversationSurfaceHistogram(request.client_feature));
265
262
  if (options?.signal && abortListener) {
266
263
  options.signal.removeEventListener('abort', abortListener);
267
264
  }
@@ -317,7 +314,9 @@ export class AidaClient {
317
314
  });
318
315
  } else if ('error' in result) {
319
316
  throw mapError(result.error);
320
- } else {
317
+ } else if (!result.metadata) {
318
+ // Chunks from thought-only parts or trailing metadata-only chunks lack text or function calls
319
+ // and carry only metadata.
321
320
  throw new Error(`Unknown chunk result ${JSON.stringify(result)}`);
322
321
  }
323
322
  }
@@ -372,13 +371,6 @@ export class AidaClient {
372
371
  }
373
372
 
374
373
  registerClientEvent(clientEvent: AidaRegisterClientEvent): Promise<AidaClientResult> {
375
- // Disable logging for now.
376
- // For context, see b/454563259#comment35.
377
- // We should be able to remove this ~end of April.
378
- if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
379
- clientEvent.disable_user_content_logging = true;
380
- }
381
-
382
374
  if (this.#gcaClient.enabled()) {
383
375
  return this.#gcaClient.registerClientEvent(clientEvent);
384
376
  }
@@ -401,13 +393,6 @@ export class AidaClient {
401
393
  throw new Error('aidaCodeComplete is not available');
402
394
  }
403
395
 
404
- // Disable logging for now.
405
- // For context, see b/454563259#comment35.
406
- // We should be able to remove this ~end of April.
407
- if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
408
- request.metadata.disable_user_content_logging = true;
409
- }
410
-
411
396
  const recordOutcome = createOutcomeRecorder(EnumeratedHistogram.AiClientRequestResultCodeComplete);
412
397
  try {
413
398
  if (this.#gcaClient.enabled()) {
@@ -473,13 +458,6 @@ export class AidaClient {
473
458
  }
474
459
 
475
460
  async generateCode(request: GenerateCodeRequest, options?: {signal?: AbortSignal}): Promise<GenerateCodeResponse> {
476
- // Disable logging for now.
477
- // For context, see b/454563259#comment35.
478
- // We should be able to remove this ~end of April.
479
- if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
480
- request.metadata.disable_user_content_logging = true;
481
- }
482
-
483
461
  const surfaceHistogram = EnumeratedHistogram.AiClientRequestResultCodeGenerate;
484
462
  try {
485
463
  const response = this.#gcaClient.enabled() ?
@@ -130,7 +130,8 @@ function extractTextFromGcaParts(parts: GCA.Part[]|undefined): string {
130
130
  if (!parts) {
131
131
  return '';
132
132
  }
133
- return parts.map(p => p.text || '').join('');
133
+ // Exclude internal chain-of-thought parts from the visible explanation text.
134
+ return parts.map(p => (p.thought ? '' : p.text || '')).join('');
134
135
  }
135
136
 
136
137
  export function aidaEventToGcaTelemetryRequest(clientEvent: AIDA.AidaRegisterClientEvent): GCA.SendTelemetryRequest {
@@ -532,12 +533,14 @@ export function gcaChunkResponseToAidaChunkResponse(response: GCA.GenerateConten
532
533
  })),
533
534
  };
534
535
  }
535
-
536
- const chunks: AIDA.AidaChunkResponse[] = parts.map(part => {
536
+ // Trailing chunks without parts still yield metadata so the client receives the final
537
+ // rpcGlobalId, modelVersion, usageMetadata, and citationMetadata.
538
+ const chunks: AIDA.AidaChunkResponse[] = parts.length === 0 ? [{metadata}] : parts.map(part => {
537
539
  const aidaChunkResponse: AIDA.AidaChunkResponse = {metadata};
538
- if (part.text !== undefined) {
540
+ // Exclude empty text parts and internal model chain-of-thought from rendering in the UI.
541
+ if (part.text && !part.thought) {
539
542
  aidaChunkResponse.textChunk = {
540
- text: extractTextFromGcaParts(parts),
543
+ text: part.text,
541
544
  };
542
545
  }
543
546
  if (part.functionCall) {
@@ -389,10 +389,6 @@ export interface HostConfigGreenDevUi {
389
389
  enabled: boolean;
390
390
  }
391
391
 
392
- export interface HostConfigGeminiRebranding {
393
- enabled: boolean;
394
- }
395
-
396
392
  export interface HostConfigVeLogging {
397
393
  enabled: boolean;
398
394
  testing: boolean;
@@ -578,7 +574,6 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
578
574
  devToolsEnableDurableMessages: DevToolsEnableDurableMessages,
579
575
  devToolsAiAssistanceContextSelectionAgent: HostConfigAiAssistanceContextSelectionAgent,
580
576
  devToolsConsoleInsightsTeasers: ConsoleInsightsTeasers,
581
- devToolsGeminiRebranding: HostConfigGeminiRebranding,
582
577
  devToolsProtocolMonitor: DevToolsProtocolMonitor,
583
578
  devToolsAdsPanel: DevToolsAdsPanel,
584
579
  devToolsUseGcaApi: UseGcaApi,
@@ -11,7 +11,7 @@ import type {CallFrame, Location, ScopeChainEntry} from './DebuggerModel.js';
11
11
  import {scopeTreeForScript} from './ScopeTreeCache.js';
12
12
  import type {Script} from './Script.js';
13
13
  import {buildOriginalScopes, decodePastaRanges, type NamedFunctionRange} from './SourceMapFunctionRanges.js';
14
- import {decodeRangeMappings} from './SourceMapRangeMappings.js';
14
+ import {decodeRangeMappings, interpolateOriginalPosition} from './SourceMapRangeMappings.js';
15
15
  import {
16
16
  type PositionRange,
17
17
  type RawFrameTranslation,
@@ -275,10 +275,25 @@ export class SourceMap {
275
275
  const mappings = this.mappings();
276
276
  const index = Platform.ArrayUtilities.upperBound(
277
277
  mappings, undefined, (_, entry) => lineNumber - entry.lineNumber || columnNumber - entry.columnNumber);
278
- return index ? mappings[index - 1] : null;
278
+ if (!index) {
279
+ return null;
280
+ }
281
+ const entry = mappings[index - 1];
282
+ if (!entry.isRangeMapping || (entry.lineNumber === lineNumber && entry.columnNumber === columnNumber)) {
283
+ return entry;
284
+ }
285
+ // A range mapping covers the generated code character by character, so report the
286
+ // position the queried character maps to rather than the start of the range. The name,
287
+ // if any, describes the token at the start and does not carry over.
288
+ const sourcePosition = interpolateOriginalPosition(entry, lineNumber, columnNumber);
289
+ return new SourceMapEntry(lineNumber, columnNumber, entry.sourceIndex, entry.sourceURL, sourcePosition.lineNumber,
290
+ sourcePosition.columnNumber, undefined, true);
279
291
  }
280
292
 
281
- /** Returns the entry at the given position but only if an entry exists for that exact position */
293
+ /**
294
+ * Returns the entry at the given position but only if an entry exists for that exact position.
295
+ * A range mapping maps every position it covers exactly, so those positions count as exact too.
296
+ */
282
297
  findEntryExact(lineNumber: number, columnNumber: number): SourceMapEntry|null {
283
298
  const entry = this.findEntry(lineNumber, columnNumber);
284
299
  if (entry?.lineNumber === lineNumber && entry.columnNumber === columnNumber) {
@@ -312,6 +327,18 @@ export class SourceMap {
312
327
  const range = new TextUtils.TextRange.TextRange(
313
328
  mappings[startIndex].lineNumber, mappings[startIndex].columnNumber, endLine, endColumn);
314
329
 
330
+ if (mappings[startIndex].isRangeMapping) {
331
+ // A range mapping covers the original code character by character, so the original
332
+ // range has the exact same shape as the generated one and there's nothing to look up.
333
+ const sourceEnd = endIndex < mappings.length ?
334
+ interpolateOriginalPosition(mappings[startIndex], endLine, endColumn) :
335
+ {lineNumber: endLine, columnNumber: endColumn};
336
+ const sourceRange = new TextUtils.TextRange.TextRange(mappings[startIndex].sourceLineNumber,
337
+ mappings[startIndex].sourceColumnNumber,
338
+ sourceEnd.lineNumber, sourceEnd.columnNumber);
339
+ return {range, sourceRange, sourceURL};
340
+ }
341
+
315
342
  // Now try to find the corresponding token in the original code.
316
343
  const reverseMappings = this.#reversedMappings(sourceURL);
317
344
  const startSourceLine = mappings[startIndex].sourceLineNumber;