chrome-devtools-frontend 1.0.1538310 → 1.0.1539728

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 (245) hide show
  1. package/eslint.config.mjs +1 -1
  2. package/front_end/core/protocol_client/CDPConnection.ts +12 -10
  3. package/front_end/core/protocol_client/InspectorBackend.ts +74 -101
  4. package/front_end/core/protocol_client/NodeURL.ts +1 -3
  5. package/front_end/core/sdk/ChildTargetManager.ts +5 -41
  6. package/front_end/core/sdk/Connections.ts +9 -58
  7. package/front_end/core/sdk/DOMModel.ts +1 -0
  8. package/front_end/core/sdk/RehydratingConnection.ts +1 -1
  9. package/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +15 -26
  10. package/front_end/entrypoints/node_app/{NodeConnectionsPanel.ts → app/NodeConnectionsPanel.ts} +8 -8
  11. package/front_end/entrypoints/node_app/{NodeMain.ts → app/NodeMain.ts} +11 -11
  12. package/front_end/entrypoints/node_app/app/app.ts +6 -0
  13. package/front_end/entrypoints/node_app/node_app.ts +4 -2
  14. package/front_end/generated/{InspectorBackendCommands.js → InspectorBackendCommands.ts} +16 -34
  15. package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +18 -3
  16. package/front_end/models/trace/types/TraceEvents.ts +19 -0
  17. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +49 -26
  18. package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -1
  19. package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
  20. package/front_end/panels/ai_assistance/components/ChatView.ts +1 -134
  21. package/front_end/panels/ai_assistance/components/DisabledWidget.ts +170 -0
  22. package/front_end/panels/ai_assistance/components/ExploreWidget.ts +4 -4
  23. package/front_end/panels/ai_assistance/components/chatView.css +0 -31
  24. package/front_end/panels/ai_assistance/components/disabledWidget.css +45 -0
  25. package/front_end/panels/animation/AnimationTimeline.ts +1 -1
  26. package/front_end/panels/application/components/FrameDetailsView.ts +1 -1
  27. package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
  28. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -3
  29. package/front_end/panels/elements/ElementsTreeElement.ts +123 -95
  30. package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
  31. package/front_end/panels/elements/NodeStackTraceWidget.ts +8 -2
  32. package/front_end/panels/explain/components/ConsoleInsight.ts +0 -1
  33. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +57 -33
  34. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +1 -1
  35. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +12 -5
  36. package/front_end/panels/network/RequestInitiatorView.ts +1 -1
  37. package/front_end/panels/network/components/EditableSpan.ts +1 -1
  38. package/front_end/panels/recorder/components/StepView.ts +1 -1
  39. package/front_end/panels/recorder/models/RecordingPlayer.ts +8 -7
  40. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +4 -4
  41. package/front_end/panels/timeline/TimelineFlameChartView.ts +10 -10
  42. package/front_end/panels/timeline/TimelinePanel.ts +3 -3
  43. package/front_end/panels/timeline/TimelineUIUtils.ts +21 -24
  44. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +3 -2
  45. package/front_end/panels/utils/utils.ts +4 -2
  46. package/front_end/services/puppeteer/PuppeteerConnection.ts +56 -53
  47. package/front_end/third_party/puppeteer/README.chromium +2 -2
  48. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +3 -1
  49. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
  50. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js +4 -2
  51. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
  52. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts +3 -1
  53. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
  54. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
  55. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
  56. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.js +1 -1
  57. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.js.map +1 -1
  58. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
  59. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.js +4 -3
  60. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.js.map +1 -1
  61. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +1 -1
  62. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  63. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +1 -1
  64. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
  65. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.d.ts +2 -1
  66. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.d.ts.map +1 -1
  67. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.js +3 -2
  68. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.js.map +1 -1
  69. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  70. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +26 -9
  71. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
  73. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +11 -0
  75. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  76. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +9 -2
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js +4 -2
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +2 -2
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.d.ts.map +1 -1
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.js +2 -1
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.js.map +1 -1
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.d.ts +6 -1
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.d.ts.map +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.js +11 -2
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.js.map +1 -1
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts +2 -0
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js +4 -3
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js.map +1 -1
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +7 -0
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  99. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  100. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts +4 -0
  101. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +10 -4
  103. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
  104. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  105. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  106. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  107. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +9 -3
  108. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +37 -18
  109. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +3 -1
  110. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js +4 -2
  112. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts +3 -1
  114. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.js +1 -1
  118. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.js.map +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.js +4 -3
  121. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.js.map +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.d.ts +2 -1
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.d.ts.map +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.js +3 -2
  129. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.js.map +1 -1
  130. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +26 -9
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  133. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
  134. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  135. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +11 -0
  136. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  137. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  138. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +9 -2
  139. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
  140. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
  141. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js +4 -2
  142. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
  143. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +1 -1
  144. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +2 -2
  146. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.d.ts.map +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.js +2 -1
  149. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.js.map +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.d.ts +6 -1
  151. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.d.ts.map +1 -1
  152. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.js +11 -2
  153. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.js.map +1 -1
  154. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts +2 -0
  155. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
  156. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js +4 -3
  157. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js.map +1 -1
  158. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +7 -0
  159. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +4 -0
  161. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  162. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +10 -4
  163. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  166. package/front_end/third_party/puppeteer/package/lib/types.d.ts +9 -3
  167. package/front_end/third_party/puppeteer/package/package.json +3 -3
  168. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +4 -2
  169. package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +3 -1
  170. package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +1 -0
  171. package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +8 -1
  172. package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +1 -1
  173. package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +4 -1
  174. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +34 -10
  175. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +13 -0
  176. package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +8 -2
  177. package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +4 -0
  178. package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +2 -2
  179. package/front_end/third_party/puppeteer/package/src/cdp/CdpSession.ts +2 -1
  180. package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +15 -1
  181. package/front_end/third_party/puppeteer/package/src/common/CallbackRegistry.ts +7 -5
  182. package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +8 -0
  183. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +22 -1
  184. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  185. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
  186. package/front_end/ui/components/switch/Switch.docs.ts +38 -0
  187. package/front_end/ui/components/tooltips/Tooltip.ts +69 -45
  188. package/front_end/ui/legacy/Slider.docs.ts +49 -0
  189. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +77 -5
  190. package/front_end/ui/legacy/components/utils/Linkifier.ts +62 -3
  191. package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
  192. package/package.json +1 -1
  193. package/front_end/third_party/puppeteer/package/src/templates/version.ts.tmpl +0 -4
  194. package/front_end/ui/components/docs/color_swatch/basic.html +0 -32
  195. package/front_end/ui/components/docs/color_swatch/basic.ts +0 -38
  196. package/front_end/ui/components/docs/color_swatch/change-color.html +0 -24
  197. package/front_end/ui/components/docs/color_swatch/change-color.ts +0 -28
  198. package/front_end/ui/components/docs/computed_style_property/basic.html +0 -25
  199. package/front_end/ui/components/docs/computed_style_property/basic.ts +0 -19
  200. package/front_end/ui/components/docs/computed_style_property/traceable.html +0 -25
  201. package/front_end/ui/components/docs/computed_style_property/traceable.ts +0 -16
  202. package/front_end/ui/components/docs/computed_style_trace/basic.html +0 -25
  203. package/front_end/ui/components/docs/computed_style_trace/basic.ts +0 -24
  204. package/front_end/ui/components/docs/console_insight/basic.html +0 -28
  205. package/front_end/ui/components/docs/console_insight/basic.ts +0 -103
  206. package/front_end/ui/components/docs/console_insight/error.html +0 -28
  207. package/front_end/ui/components/docs/console_insight/error.ts +0 -33
  208. package/front_end/ui/components/docs/console_insight/loading.html +0 -28
  209. package/front_end/ui/components/docs/console_insight/loading.ts +0 -47
  210. package/front_end/ui/components/docs/elements_breadcrumbs/basic.html +0 -43
  211. package/front_end/ui/components/docs/elements_breadcrumbs/basic.ts +0 -54
  212. package/front_end/ui/components/docs/elements_breadcrumbs/helpers.ts +0 -29
  213. package/front_end/ui/components/docs/elements_breadcrumbs/scroll-to-active-element.html +0 -38
  214. package/front_end/ui/components/docs/elements_breadcrumbs/scroll-to-active-element.ts +0 -90
  215. package/front_end/ui/components/docs/elements_breadcrumbs/scroll.html +0 -29
  216. package/front_end/ui/components/docs/elements_breadcrumbs/scroll.ts +0 -62
  217. package/front_end/ui/components/docs/icon_button/basic.html +0 -34
  218. package/front_end/ui/components/docs/icon_button/basic.ts +0 -67
  219. package/front_end/ui/components/docs/issue_counter/basic.html +0 -35
  220. package/front_end/ui/components/docs/issue_counter/basic.ts +0 -34
  221. package/front_end/ui/components/docs/issue_link_icon/basic.html +0 -31
  222. package/front_end/ui/components/docs/issue_link_icon/basic.ts +0 -26
  223. package/front_end/ui/components/docs/linear_memory_inspector/basic.html +0 -26
  224. package/front_end/ui/components/docs/linear_memory_inspector/basic.ts +0 -44
  225. package/front_end/ui/components/docs/menu/basic.html +0 -28
  226. package/front_end/ui/components/docs/menu/basic.ts +0 -66
  227. package/front_end/ui/components/docs/recorder_control_button/basic.html +0 -20
  228. package/front_end/ui/components/docs/recorder_control_button/basic.ts +0 -15
  229. package/front_end/ui/components/docs/recorder_recording_list_view/basic.html +0 -20
  230. package/front_end/ui/components/docs/recorder_recording_list_view/basic.ts +0 -26
  231. package/front_end/ui/components/docs/recorder_select_button/basic.html +0 -20
  232. package/front_end/ui/components/docs/recorder_select_button/basic.ts +0 -81
  233. package/front_end/ui/components/docs/recorder_split_view/basic.html +0 -17
  234. package/front_end/ui/components/docs/recorder_split_view/basic.ts +0 -22
  235. package/front_end/ui/components/docs/request_link_icon/basic.html +0 -31
  236. package/front_end/ui/components/docs/request_link_icon/basic.ts +0 -21
  237. package/front_end/ui/components/docs/slider/basic.ts +0 -62
  238. package/front_end/ui/components/docs/style_property_editor/flex.html +0 -21
  239. package/front_end/ui/components/docs/style_property_editor/flex.ts +0 -52
  240. package/front_end/ui/components/docs/style_property_editor/grid.html +0 -22
  241. package/front_end/ui/components/docs/style_property_editor/grid.ts +0 -50
  242. package/front_end/ui/components/docs/style_property_editor/masonry.html +0 -21
  243. package/front_end/ui/components/docs/style_property_editor/masonry.ts +0 -50
  244. package/front_end/ui/components/docs/switch/basic.ts +0 -51
  245. /package/front_end/entrypoints/node_app/{nodeConnectionsPanel.css → app/nodeConnectionsPanel.css} +0 -0
@@ -30,6 +30,10 @@ import {TimeoutError} from '../common/Errors.js';
30
30
  import type {SupportedBrowser} from '../common/SupportedBrowser.js';
31
31
  import {debugError, DEFAULT_VIEWPORT} from '../common/util.js';
32
32
  import type {Viewport} from '../common/Viewport.js';
33
+ import {
34
+ createIncrementalIdGenerator,
35
+ type GetIdFn,
36
+ } from '../util/incremental-id-generator.js';
33
37
 
34
38
  import type {ChromeReleaseChannel, LaunchOptions} from './LaunchOptions.js';
35
39
  import {NodeWebSocketTransport as WebSocketTransport} from './NodeWebSocketTransport.js';
@@ -88,6 +92,7 @@ export abstract class BrowserLauncher {
88
92
  waitForInitialPage = true,
89
93
  protocolTimeout,
90
94
  handleDevToolsAsPage,
95
+ idGenerator = createIncrementalIdGenerator(),
91
96
  } = options;
92
97
 
93
98
  let {protocol} = options;
@@ -166,6 +171,7 @@ export abstract class BrowserLauncher {
166
171
  defaultViewport,
167
172
  acceptInsecureCerts,
168
173
  networkEnabled,
174
+ idGenerator,
169
175
  },
170
176
  );
171
177
  } else {
@@ -174,12 +180,14 @@ export abstract class BrowserLauncher {
174
180
  timeout,
175
181
  protocolTimeout,
176
182
  slowMo,
183
+ idGenerator,
177
184
  });
178
185
  } else {
179
186
  cdpConnection = await this.createCdpSocketConnection(browserProcess, {
180
187
  timeout,
181
188
  protocolTimeout,
182
189
  slowMo,
190
+ idGenerator,
183
191
  });
184
192
  }
185
193
 
@@ -342,6 +350,7 @@ export abstract class BrowserLauncher {
342
350
  timeout: number;
343
351
  protocolTimeout: number | undefined;
344
352
  slowMo: number;
353
+ idGenerator: GetIdFn;
345
354
  },
346
355
  ): Promise<Connection> {
347
356
  const browserWSEndpoint = await browserProcess.waitForLineOutput(
@@ -354,6 +363,8 @@ export abstract class BrowserLauncher {
354
363
  transport,
355
364
  opts.slowMo,
356
365
  opts.protocolTimeout,
366
+ /* rawErrors */ false,
367
+ opts.idGenerator,
357
368
  );
358
369
  }
359
370
 
@@ -366,6 +377,7 @@ export abstract class BrowserLauncher {
366
377
  timeout: number;
367
378
  protocolTimeout: number | undefined;
368
379
  slowMo: number;
380
+ idGenerator: GetIdFn;
369
381
  },
370
382
  ): Promise<Connection> {
371
383
  // stdio was assigned during start(), and the 'pipe' option there adds the
@@ -375,7 +387,14 @@ export abstract class BrowserLauncher {
375
387
  pipeWrite as NodeJS.WritableStream,
376
388
  pipeRead as NodeJS.ReadableStream,
377
389
  );
378
- return new Connection('', transport, opts.slowMo, opts.protocolTimeout);
390
+ return new Connection(
391
+ '',
392
+ transport,
393
+ opts.slowMo,
394
+ opts.protocolTimeout,
395
+ /* rawErrors */ false,
396
+ opts.idGenerator,
397
+ );
379
398
  }
380
399
 
381
400
  /**
@@ -417,6 +436,7 @@ export abstract class BrowserLauncher {
417
436
  timeout: number;
418
437
  protocolTimeout: number | undefined;
419
438
  slowMo: number;
439
+ idGenerator: GetIdFn;
420
440
  defaultViewport: Viewport | null;
421
441
  acceptInsecureCerts?: boolean;
422
442
  networkEnabled?: boolean;
@@ -432,6 +452,7 @@ export abstract class BrowserLauncher {
432
452
  const bidiConnection = new BiDi.BidiConnection(
433
453
  browserWSEndpoint,
434
454
  transport,
455
+ opts.idGenerator,
435
456
  opts.slowMo,
436
457
  opts.protocolTimeout,
437
458
  );
@@ -6,5 +6,5 @@
6
6
 
7
7
  // If moved update release-please config
8
8
  // x-release-please-start-version
9
- export const packageVersion = '24.27.0';
9
+ export const packageVersion = '24.28.0';
10
10
  // x-release-please-end
@@ -69,7 +69,7 @@ export class PreviewToggle extends HTMLElement {
69
69
  <devtools-checkbox
70
70
  ?checked=${checked}
71
71
  @change=${this.#checkboxChanged}
72
- aria-label=${this.#name} />
72
+ aria-label=${this.#name} >
73
73
  <devtools-icon name="experiment" class="medium">
74
74
  </devtools-icon>${this.#name}
75
75
  </devtools-checkbox>
@@ -0,0 +1,38 @@
1
+ // Copyright 2024 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import {Switch} from './switch.js';
6
+
7
+ export async function render(container: HTMLElement) {
8
+ function switchExample({checked, disabled}: {checked: boolean, disabled: boolean}): HTMLElement {
9
+ const example = document.createElement('div');
10
+ example.style.marginTop = '20px';
11
+ const explanation = document.createElement('div');
12
+ const disabledExplanation = document.createElement('div');
13
+ const component = new Switch.Switch();
14
+ component.checked = checked;
15
+ component.disabled = disabled;
16
+ explanation.textContent = `is checked? ${component.checked}`;
17
+ disabledExplanation.textContent = `is disabled? ${component.disabled}`;
18
+ component.addEventListener(Switch.SwitchChangeEvent.eventName, ev => {
19
+ explanation.textContent = `is checked? ${ev.checked}`;
20
+ });
21
+ example.appendChild(component);
22
+ example.appendChild(explanation);
23
+ example.appendChild(disabledExplanation);
24
+ return example;
25
+ }
26
+
27
+ // Basic
28
+ container.appendChild(switchExample({checked: false, disabled: false}));
29
+
30
+ // Already checked
31
+ container.appendChild(switchExample({checked: true, disabled: false}));
32
+
33
+ // Disabled
34
+ container.appendChild(switchExample({checked: false, disabled: true}));
35
+
36
+ // Disabled & checked
37
+ container.appendChild(switchExample({checked: true, disabled: true}));
38
+ }
@@ -21,7 +21,7 @@ interface PositioningParams {
21
21
  currentPopoverRect: DOMRect;
22
22
  }
23
23
 
24
- enum PositionOption {
24
+ export enum PositionOption {
25
25
  BOTTOM_SPAN_RIGHT = 'bottom-span-right',
26
26
  BOTTOM_SPAN_LEFT = 'bottom-span-left',
27
27
  TOP_SPAN_RIGHT = 'top-span-right',
@@ -66,29 +66,32 @@ const positioningUtils = {
66
66
  };
67
67
  },
68
68
  // Adjusts proposed rect so that the resulting popover is always inside the inspector view bounds.
69
- insetAdjustedRect:
70
- ({inspectorViewRect, anchorRect, currentPopoverRect, proposedRect}:
71
- {inspectorViewRect: DOMRect, anchorRect: DOMRect, currentPopoverRect: DOMRect, proposedRect: ProposedRect}):
72
- ProposedRect => {
73
- if (inspectorViewRect.left > proposedRect.left) {
74
- proposedRect.left = inspectorViewRect.left;
75
- }
76
-
77
- if (inspectorViewRect.right < proposedRect.left + currentPopoverRect.width) {
78
- proposedRect.left = inspectorViewRect.right - currentPopoverRect.width;
79
- }
80
-
81
- if (proposedRect.top + currentPopoverRect.height > inspectorViewRect.bottom) {
82
- proposedRect.top = anchorRect.top - currentPopoverRect.height;
83
- }
84
- return proposedRect;
85
- },
69
+ insetAdjustedRect: ({inspectorViewRect, currentPopoverRect, proposedRect}:
70
+ {inspectorViewRect: DOMRect, currentPopoverRect: DOMRect, proposedRect: ProposedRect}):
71
+ ProposedRect => {
72
+ if (inspectorViewRect.left > proposedRect.left) {
73
+ proposedRect.left = inspectorViewRect.left;
74
+ }
75
+
76
+ if (inspectorViewRect.right < proposedRect.left + currentPopoverRect.width) {
77
+ proposedRect.left = inspectorViewRect.right - currentPopoverRect.width;
78
+ }
79
+
80
+ if (proposedRect.top < inspectorViewRect.top) {
81
+ proposedRect.top = inspectorViewRect.top;
82
+ }
83
+
84
+ if (proposedRect.top + currentPopoverRect.height > inspectorViewRect.bottom) {
85
+ proposedRect.top = inspectorViewRect.bottom - currentPopoverRect.height;
86
+ }
87
+ return proposedRect;
88
+ },
86
89
  isInBounds: ({inspectorViewRect, currentPopoverRect, proposedRect}:
87
90
  {inspectorViewRect: DOMRect, currentPopoverRect: DOMRect, proposedRect: ProposedRect}): boolean => {
88
- return inspectorViewRect.left < proposedRect.left &&
89
- proposedRect.left + currentPopoverRect.width < inspectorViewRect.right &&
90
- inspectorViewRect.top < proposedRect.top &&
91
- proposedRect.top + currentPopoverRect.height < inspectorViewRect.bottom;
91
+ return inspectorViewRect.left <= proposedRect.left &&
92
+ proposedRect.left + currentPopoverRect.width <= inspectorViewRect.right &&
93
+ inspectorViewRect.top <= proposedRect.top &&
94
+ proposedRect.top + currentPopoverRect.height <= inspectorViewRect.bottom;
92
95
  },
93
96
  isSameRect: (rect1: DOMRect|null, rect2: DOMRect|null): boolean => {
94
97
  if (!rect1 || !rect2) {
@@ -100,7 +103,7 @@ const positioningUtils = {
100
103
  }
101
104
  };
102
105
 
103
- const proposedRectForRichTooltip = ({inspectorViewRect, anchorRect, currentPopoverRect, preferredPositions}: {
106
+ export const proposedRectForRichTooltip = ({inspectorViewRect, anchorRect, currentPopoverRect, preferredPositions}: {
104
107
  inspectorViewRect: DOMRect,
105
108
  anchorRect: DOMRect,
106
109
  currentPopoverRect: DOMRect,
@@ -116,36 +119,49 @@ const proposedRectForRichTooltip = ({inspectorViewRect, anchorRect, currentPopov
116
119
  ]),
117
120
  ];
118
121
 
119
- // Tries the positioning options in the order given by `uniqueOrder`.
120
- // If none of them work out, we default to showing the tooltip in the bottom right and adjust
121
- // its insets so that the tooltip is inside the inspector view bounds.
122
- for (const positionOption of uniqueOrder) {
123
- let proposedRect;
122
+ const getProposedRectForPositionOption = (positionOption: PositionOption): ProposedRect => {
124
123
  switch (positionOption) {
125
124
  case PositionOption.BOTTOM_SPAN_RIGHT:
126
- proposedRect = positioningUtils.bottomSpanRight({anchorRect, currentPopoverRect});
127
- break;
125
+ return positioningUtils.bottomSpanRight({anchorRect, currentPopoverRect});
128
126
  case PositionOption.BOTTOM_SPAN_LEFT:
129
- proposedRect = positioningUtils.bottomSpanLeft({anchorRect, currentPopoverRect});
130
- break;
127
+ return positioningUtils.bottomSpanLeft({anchorRect, currentPopoverRect});
131
128
  case PositionOption.TOP_SPAN_RIGHT:
132
- proposedRect = positioningUtils.topSpanRight({anchorRect, currentPopoverRect});
133
- break;
129
+ return positioningUtils.topSpanRight({anchorRect, currentPopoverRect});
134
130
  case PositionOption.TOP_SPAN_LEFT:
135
- proposedRect = positioningUtils.topSpanLeft({anchorRect, currentPopoverRect});
131
+ return positioningUtils.topSpanLeft({anchorRect, currentPopoverRect});
136
132
  }
133
+ };
134
+
135
+ // Tries the positioning options in the order given by `uniqueOrder`.
136
+ for (const positionOption of uniqueOrder) {
137
+ const proposedRect = getProposedRectForPositionOption(positionOption);
137
138
  if (positioningUtils.isInBounds({inspectorViewRect, currentPopoverRect, proposedRect})) {
138
139
  return proposedRect;
139
140
  }
140
141
  }
141
142
 
142
- // If none of the options work above, we position to bottom right
143
- // and adjust the insets so that it does not go out of bounds.
144
- const proposedRect = positioningUtils.bottomSpanRight({anchorRect, currentPopoverRect});
145
- return positioningUtils.insetAdjustedRect({anchorRect, currentPopoverRect, inspectorViewRect, proposedRect});
143
+ // If none of the options above work, we decide between top or bottom by which
144
+ // option is fewer vertical pixels out of the viewport. We pick left/right
145
+ // according to `uniqueOrder`. And finally we adjust the insets so that the
146
+ // tooltip is not out of bounds.
147
+ const bottomProposed = positioningUtils.bottomSpanRight({anchorRect, currentPopoverRect});
148
+ const bottomVerticalOutOfBounds =
149
+ Math.max(0, bottomProposed.top + currentPopoverRect.height - inspectorViewRect.bottom);
150
+ const topProposed = positioningUtils.topSpanRight({anchorRect, currentPopoverRect});
151
+ const topVerticalOutOfBounds = Math.max(0, inspectorViewRect.top - topProposed.top);
152
+ const prefersBottom = bottomVerticalOutOfBounds <= topVerticalOutOfBounds;
153
+ const fallbackOption = uniqueOrder.find(option => {
154
+ if (prefersBottom) {
155
+ return option === PositionOption.BOTTOM_SPAN_LEFT || option === PositionOption.BOTTOM_SPAN_RIGHT;
156
+ }
157
+ return option === PositionOption.TOP_SPAN_LEFT || option === PositionOption.TOP_SPAN_RIGHT;
158
+ }) ??
159
+ PositionOption.TOP_SPAN_RIGHT;
160
+ const fallbackRect = getProposedRectForPositionOption(fallbackOption);
161
+ return positioningUtils.insetAdjustedRect({currentPopoverRect, inspectorViewRect, proposedRect: fallbackRect});
146
162
  };
147
163
 
148
- const proposedRectForSimpleTooltip =
164
+ export const proposedRectForSimpleTooltip =
149
165
  ({inspectorViewRect, anchorRect, currentPopoverRect}:
150
166
  {inspectorViewRect: DOMRect, anchorRect: DOMRect, currentPopoverRect: DOMRect}): ProposedRect => {
151
167
  // Default options are bottom centered & top centered.
@@ -153,16 +169,24 @@ const proposedRectForSimpleTooltip =
153
169
  if (positioningUtils.isInBounds({inspectorViewRect, currentPopoverRect, proposedRect})) {
154
170
  return proposedRect;
155
171
  }
172
+ const bottomVerticalOutOfBoundsAmount =
173
+ Math.max(0, proposedRect.top + currentPopoverRect.height - inspectorViewRect.bottom);
156
174
 
157
175
  proposedRect = positioningUtils.topCentered({anchorRect, currentPopoverRect});
158
176
  if (positioningUtils.isInBounds({inspectorViewRect, currentPopoverRect, proposedRect})) {
159
177
  return proposedRect;
160
178
  }
161
-
162
- // The default options did not work out, so position it to bottom center
163
- // and adjust the insets to make sure that it does not go out of bounds.
164
- proposedRect = positioningUtils.bottomCentered({anchorRect, currentPopoverRect});
165
- return positioningUtils.insetAdjustedRect({anchorRect, currentPopoverRect, inspectorViewRect, proposedRect});
179
+ const topVerticalOutOfBoundsAmount = Math.max(0, inspectorViewRect.top - proposedRect.top);
180
+
181
+ // The default options did not work out, so compare which option is fewer
182
+ // pixels out of the viewport vertically. Pick the better option and
183
+ // adjust the insets to make sure that the tooltip is not out of bounds.
184
+ if (bottomVerticalOutOfBoundsAmount <= topVerticalOutOfBoundsAmount) {
185
+ proposedRect = positioningUtils.bottomCentered({anchorRect, currentPopoverRect});
186
+ } else {
187
+ proposedRect = positioningUtils.topCentered({anchorRect, currentPopoverRect});
188
+ }
189
+ return positioningUtils.insetAdjustedRect({currentPopoverRect, inspectorViewRect, proposedRect});
166
190
  };
167
191
 
168
192
  export type TooltipVariant = 'simple'|'rich';
@@ -0,0 +1,49 @@
1
+ // Copyright 2024 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import {UIUtils} from './legacy.js';
6
+
7
+ export async function render(container: HTMLElement) {
8
+ function sliderExample({min, max, tabIndex, disabled}: {
9
+ min: number,
10
+ max: number,
11
+ tabIndex: number,
12
+ disabled: boolean,
13
+ }): HTMLElement {
14
+ const example = document.createElement('div');
15
+ example.style.marginTop = '20px';
16
+ const minExplanation = document.createElement('div');
17
+ const maxExplanation = document.createElement('div');
18
+ const valueExplanation = document.createElement('div');
19
+ const disabledExplanation = document.createElement('div');
20
+ const tabbableExplanation = document.createElement('div');
21
+ const component = UIUtils.createSlider(min, max, tabIndex);
22
+ component.disabled = disabled;
23
+ minExplanation.textContent = `min: ${min}`;
24
+ maxExplanation.textContent = `max: ${max}`;
25
+ valueExplanation.textContent = `value: ${component.value}`;
26
+ disabledExplanation.textContent = `is disabled? ${component.disabled}`;
27
+ tabbableExplanation.textContent = `is tabbable? ${component.tabIndex >= 0}`;
28
+
29
+ component.addEventListener('change', () => {
30
+ valueExplanation.textContent = `value: ${component.value}`;
31
+ });
32
+ example.appendChild(component);
33
+ example.appendChild(minExplanation);
34
+ example.appendChild(maxExplanation);
35
+ example.appendChild(valueExplanation);
36
+ example.appendChild(disabledExplanation);
37
+ example.appendChild(tabbableExplanation);
38
+ return example;
39
+ }
40
+
41
+ // Basic
42
+ container.appendChild(sliderExample({min: 0, max: 100, tabIndex: 0, disabled: false}));
43
+
44
+ // Not tab reachable
45
+ container.appendChild(sliderExample({min: 0, max: 100, tabIndex: -1, disabled: false}));
46
+
47
+ // Disabled
48
+ container.appendChild(sliderExample({min: 0, max: 100, tabIndex: 0, disabled: true}));
49
+ }
@@ -39,6 +39,7 @@ import * as i18n from '../../../../core/i18n/i18n.js';
39
39
  import * as Platform from '../../../../core/platform/platform.js';
40
40
  import * as SDK from '../../../../core/sdk/sdk.js';
41
41
  import type * as Protocol from '../../../../generated/protocol.js';
42
+ import * as StackTrace from '../../../../models/stack_trace/stack_trace.js';
42
43
  import * as Workspace from '../../../../models/workspace/workspace.js';
43
44
  import * as VisualLogging from '../../../visual_logging/visual_logging.js';
44
45
  import * as UI from '../../legacy.js';
@@ -95,7 +96,8 @@ function populateContextMenu(link: Element, event: Event): void {
95
96
  void contextMenu.show();
96
97
  }
97
98
 
98
- export function buildStackTraceRows(
99
+ // TODO(crbug.com/456517732): remove when all usages of runtimeStackTrace are migrated.
100
+ export function buildStackTraceRowsForLegacyRuntimeStackTrace(
99
101
  stackTrace: Protocol.Runtime.StackTrace,
100
102
  target: SDK.Target.Target|null,
101
103
  linkifier: Linkifier,
@@ -158,6 +160,63 @@ export function buildStackTraceRows(
158
160
  return stackTraceRows;
159
161
  }
160
162
 
163
+ export function buildStackTraceRows(
164
+ stackTrace: StackTrace.StackTrace.StackTrace,
165
+ target: SDK.Target.Target|null,
166
+ linkifier: Linkifier,
167
+ tabStops: boolean|undefined,
168
+ showColumnNumber?: boolean,
169
+ ): Array<StackTraceRegularRow|StackTraceAsyncRow> {
170
+ const stackTraceRows: Array<StackTraceRegularRow|StackTraceAsyncRow> = [];
171
+
172
+ function buildStackTraceRowsHelper(
173
+ fragment: StackTrace.StackTrace.Fragment|StackTrace.StackTrace.AsyncFragment,
174
+ previousFragment: StackTrace.StackTrace.Fragment|undefined = undefined): void {
175
+ let asyncRow: StackTraceAsyncRow|null = null;
176
+ const isAsync = 'description' in fragment;
177
+ if (previousFragment && isAsync) {
178
+ asyncRow = {
179
+ asyncDescription: UI.UIUtils.asyncStackTraceLabel(
180
+ fragment.description, previousFragment.frames.map(f => ({functionName: f.name ?? ''}))),
181
+ };
182
+ stackTraceRows.push(asyncRow);
183
+ }
184
+ let previousStackFrameWasBreakpointCondition = false;
185
+ for (const frame of fragment.frames) {
186
+ const functionName = UI.UIUtils.beautifyFunctionName(frame.name ?? '');
187
+ const link = linkifier.maybeLinkifyStackTraceFrame(target, frame, {
188
+ showColumnNumber,
189
+ tabStop: Boolean(tabStops),
190
+ inlineFrameIndex: 0,
191
+ revealBreakpoint: previousStackFrameWasBreakpointCondition,
192
+ });
193
+ if (link) {
194
+ link.setAttribute('jslog', `${VisualLogging.link('stack-trace').track({click: true})}`);
195
+ link.addEventListener('contextmenu', populateContextMenu.bind(null, link));
196
+
197
+ if (!link.textContent) {
198
+ link.textContent = i18nString(UIStrings.unknownSource);
199
+ }
200
+ }
201
+ stackTraceRows.push({functionName, link});
202
+ previousStackFrameWasBreakpointCondition = [
203
+ SDK.DebuggerModel.COND_BREAKPOINT_SOURCE_URL,
204
+ SDK.DebuggerModel.LOGPOINT_SOURCE_URL,
205
+ ].includes(frame.url ?? '');
206
+ }
207
+ }
208
+
209
+ buildStackTraceRowsHelper(stackTrace.syncFragment);
210
+ let previousFragment = stackTrace.syncFragment;
211
+ for (const asyncFragment of stackTrace.asyncFragments) {
212
+ if (asyncFragment.frames.length) {
213
+ buildStackTraceRowsHelper(asyncFragment, previousFragment);
214
+ }
215
+ previousFragment = asyncFragment;
216
+ }
217
+ return stackTraceRows;
218
+ }
219
+
161
220
  function renderStackTraceTable(
162
221
  container: Element, parent: Element,
163
222
  stackTraceRows: Array<StackTraceRegularRow|StackTraceAsyncRow>): HTMLElement[] {
@@ -224,7 +283,9 @@ function renderStackTraceTable(
224
283
  }
225
284
 
226
285
  export interface Options {
227
- stackTrace?: Protocol.Runtime.StackTrace;
286
+ // TODO(crbug.com/456517732): remove when all usages of runtimeStackTrace are migrated.
287
+ runtimeStackTrace?: Protocol.Runtime.StackTrace;
288
+ stackTrace?: StackTrace.StackTrace.StackTrace;
228
289
  tabStops?: boolean;
229
290
  // Whether the width of stack trace preview
230
291
  // is constrained to its container or whether
@@ -269,6 +330,8 @@ export class StackTracePreviewContent extends UI.Widget.Widget {
269
330
  this.#table = this.contentElement.createChild('table', 'stack-preview-container');
270
331
  this.#table.classList.toggle('width-constrained', this.#options.widthConstrained ?? false);
271
332
 
333
+ this.#options.stackTrace?.addEventListener(StackTrace.StackTrace.Events.UPDATED, this.performUpdate.bind(this));
334
+
272
335
  this.performUpdate();
273
336
  }
274
337
 
@@ -277,10 +340,19 @@ export class StackTracePreviewContent extends UI.Widget.Widget {
277
340
  return;
278
341
  }
279
342
 
280
- const {stackTrace, tabStops} = this.#options;
343
+ const {runtimeStackTrace, stackTrace, tabStops} = this.#options;
344
+
345
+ if (stackTrace) {
346
+ const stackTraceRows = buildStackTraceRows(
347
+ stackTrace, this.#target ?? null, this.#linkifier, tabStops, this.#options.showColumnNumber);
348
+ this.#links = renderStackTraceTable(this.#table, this.element, stackTraceRows);
349
+ return;
350
+ }
351
+
352
+ // TODO(crbug.com/456517732): remove when all usages of runtimeStackTrace are migrated.
281
353
  const updateCallback = renderStackTraceTable.bind(null, this.#table, this.element);
282
- const stackTraceRows = buildStackTraceRows(
283
- stackTrace ?? {callFrames: []}, this.#target ?? null, this.#linkifier, tabStops, updateCallback,
354
+ const stackTraceRows = buildStackTraceRowsForLegacyRuntimeStackTrace(
355
+ runtimeStackTrace ?? {callFrames: []}, this.#target ?? null, this.#linkifier, tabStops, updateCallback,
284
356
  this.#options.showColumnNumber);
285
357
  this.#links = renderStackTraceTable(this.#table, this.element, stackTraceRows);
286
358
  }
@@ -12,6 +12,7 @@ import * as SDK from '../../../../core/sdk/sdk.js';
12
12
  import type * as Protocol from '../../../../generated/protocol.js';
13
13
  import * as Bindings from '../../../../models/bindings/bindings.js';
14
14
  import * as Breakpoints from '../../../../models/breakpoints/breakpoints.js';
15
+ import type * as StackTrace from '../../../../models/stack_trace/stack_trace.js';
15
16
  import * as TextUtils from '../../../../models/text_utils/text_utils.js';
16
17
  import type * as Trace from '../../../../models/trace/trace.js';
17
18
  import * as Workspace from '../../../../models/workspace/workspace.js';
@@ -341,6 +342,53 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
341
342
  callFrame.url as Platform.DevToolsPath.UrlString, callFrame.lineNumber, linkifyOptions);
342
343
  }
343
344
 
345
+ maybeLinkifyStackTraceFrame(
346
+ target: SDK.Target.Target|null, frame: StackTrace.StackTrace.Frame, options?: LinkifyOptions): HTMLElement|null {
347
+ let fallbackAnchor: HTMLElement|null = null;
348
+ const linkifyURLOptions: LinkifyURLOptions = {
349
+ ...options,
350
+ lineNumber: frame.line,
351
+ maxLength: this.maxLength,
352
+ columnNumber: frame.column,
353
+ showColumnNumber: Boolean(options?.showColumnNumber),
354
+ className: options?.className,
355
+ tabStop: options?.tabStop,
356
+ inlineFrameIndex: options?.inlineFrameIndex ?? 0,
357
+ userMetric: options?.userMetric,
358
+ jslogContext: options?.jslogContext || 'script-location',
359
+ omitOrigin: options?.omitOrigin,
360
+ };
361
+ const {className = ''} = linkifyURLOptions;
362
+ if (frame.url) {
363
+ fallbackAnchor = Linkifier.linkifyURL(frame.url as Platform.DevToolsPath.UrlString, linkifyURLOptions);
364
+ }
365
+ if (!target || target.isDisposed()) {
366
+ return fallbackAnchor;
367
+ }
368
+
369
+ const createLinkOptions: CreateLinkOptions = {
370
+ tabStop: options?.tabStop,
371
+ jslogContext: 'script-location',
372
+ };
373
+ const {link, linkInfo} = Linkifier.createLink(
374
+ fallbackAnchor?.textContent ? fallbackAnchor.textContent : '', className, createLinkOptions);
375
+ linkInfo.enableDecorator = this.useLinkDecorator;
376
+ linkInfo.fallback = fallbackAnchor;
377
+ linkInfo.userMetric = options?.userMetric;
378
+
379
+ const linkDisplayOptions: LinkDisplayOptions = {
380
+ showColumnNumber: linkifyURLOptions.showColumnNumber ?? false,
381
+ revealBreakpoint: options?.revealBreakpoint,
382
+ };
383
+
384
+ const uiLocation = frame.uiSourceCode?.uiLocation(frame.line, frame.column) ?? null;
385
+ this.updateAnchorFromUILocation(link, linkDisplayOptions, uiLocation);
386
+
387
+ const anchors = (this.anchorsByTarget.get(target) as Element[]);
388
+ anchors.push(link);
389
+ return link;
390
+ }
391
+
344
392
  linkifyStackTraceTopFrame(target: SDK.Target.Target|null, stackTrace: Protocol.Runtime.StackTrace): HTMLElement {
345
393
  console.assert(stackTrace.callFrames.length > 0);
346
394
 
@@ -459,6 +507,20 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
459
507
  return;
460
508
  }
461
509
 
510
+ this.#anchorUpdaters.set(anchor, function(this: Linkifier, anchor: HTMLElement) {
511
+ void this.updateAnchor(anchor, options, liveLocation);
512
+ });
513
+ this.updateAnchorFromUILocation(anchor, options, uiLocation);
514
+ }
515
+
516
+ private updateAnchorFromUILocation(
517
+ anchor: HTMLElement, options: LinkDisplayOptions, uiLocation: Workspace.UISourceCode.UILocation|null): void {
518
+ if (!uiLocation) {
519
+ anchor.classList.add('invalid-link');
520
+ anchor.removeAttribute('role');
521
+ return;
522
+ }
523
+
462
524
  Linkifier.bindUILocation(anchor, uiLocation);
463
525
  if (options.revealBreakpoint) {
464
526
  Linkifier.bindBreakpoint(anchor, uiLocation);
@@ -466,9 +528,6 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
466
528
 
467
529
  const text = uiLocation.linkText(true /* skipTrim */, options.showColumnNumber);
468
530
  Linkifier.setTrimmedText(anchor, text, this.maxLength);
469
- this.#anchorUpdaters.set(anchor, function(this: Linkifier, anchor: HTMLElement) {
470
- void this.updateAnchor(anchor, options, liveLocation);
471
- });
472
531
 
473
532
  let titleText: string = uiLocation.uiSourceCode.url();
474
533
  if (uiLocation.uiSourceCode.mimeType() === 'application/wasm') {
@@ -809,6 +809,10 @@ export const knownContextValues = new Set([
809
809
  'column-rule',
810
810
  'column-rule-break',
811
811
  'column-rule-color',
812
+ 'column-rule-edge-end-outset',
813
+ 'column-rule-edge-start-outset',
814
+ 'column-rule-interior-end-outset',
815
+ 'column-rule-interior-start-outset',
812
816
  'column-rule-outset',
813
817
  'column-rule-style',
814
818
  'column-rule-visibility-items',
@@ -3163,6 +3167,10 @@ export const knownContextValues = new Set([
3163
3167
  'row-rule',
3164
3168
  'row-rule-break',
3165
3169
  'row-rule-color',
3170
+ 'row-rule-edge-end-outset',
3171
+ 'row-rule-edge-start-outset',
3172
+ 'row-rule-interior-end-outset',
3173
+ 'row-rule-interior-start-outset',
3166
3174
  'row-rule-outset',
3167
3175
  'row-rule-style',
3168
3176
  'row-rule-visibility-items',
package/package.json CHANGED
@@ -102,5 +102,5 @@
102
102
  "flat-cache": "6.1.12"
103
103
  }
104
104
  },
105
- "version": "1.0.1538310"
105
+ "version": "1.0.1539728"
106
106
  }
@@ -1,4 +0,0 @@
1
- /**
2
- * @internal
3
- */
4
- export const packageVersion = 'PACKAGE_VERSION';
@@ -1,32 +0,0 @@
1
- <!--
2
- Copyright 2020 The Chromium Authors
3
- Use of this source code is governed by a BSD-style license that can be
4
- found in the LICENSE file.
5
- -->
6
- <!DOCTYPE html>
7
- <html>
8
- <head>
9
- <meta charset="UTF-8" />
10
- <meta name="viewport" content="width=device-width" />
11
- <title>Color Swatch example</title>
12
- <style>
13
- #container {
14
- display: flex;
15
- flex-wrap: wrap;
16
- margin: 0;
17
- padding: 0;
18
- }
19
- #container > li {
20
- padding: .5rem;
21
- border: 1px solid;
22
- margin: 0 .5rem;
23
- list-style: none;
24
- }
25
- </style>
26
- </head>
27
- <body>
28
- <ul id="container">
29
- </ul>
30
- <script type="module" src="./basic.js"></script>
31
- </body>
32
- </html>