chrome-devtools-frontend 1.0.1578729 → 1.0.1581449

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 (314) hide show
  1. package/agents/prompts/creating-a-model.md +51 -0
  2. package/docs/cookbook/devtools_on_devtools.md +2 -2
  3. package/docs/feature-specs/elements-gutter-decorators.md +40 -0
  4. package/docs/feature-specs/elements-tree-edit-html.md +14 -0
  5. package/docs/feature-specs/elements-tree-node-title.md +46 -0
  6. package/docs/feature-specs/elements-tree-selection-and-hover.md +31 -0
  7. package/docs/feature-specs/images/elements-gutter-decorators-multiple.png +0 -0
  8. package/docs/get_the_code.md +3 -3
  9. package/front_end/core/host/UserMetrics.ts +3 -7
  10. package/front_end/core/root/Runtime.ts +0 -1
  11. package/front_end/core/sdk/NetworkManager.ts +0 -35
  12. package/front_end/core/sdk/OverlayModel.ts +10 -0
  13. package/front_end/devtools_compatibility.js +4 -0
  14. package/front_end/entrypoints/devtools_app/devtools_app.ts +1 -0
  15. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +530 -0
  16. package/front_end/entrypoints/greendev_floaty/floaty.css +258 -0
  17. package/front_end/entrypoints/greendev_floaty/floaty.html +31 -0
  18. package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +422 -0
  19. package/front_end/entrypoints/inspector_main/InspectorMain.ts +0 -38
  20. package/front_end/generated/ARIAProperties.js +0 -6
  21. package/front_end/generated/InspectorBackendCommands.ts +10 -4
  22. package/front_end/generated/SupportedCSSProperties.js +39 -31
  23. package/front_end/generated/protocol-mapping.d.ts +12 -0
  24. package/front_end/generated/protocol-proxy-api.d.ts +12 -0
  25. package/front_end/generated/protocol.ts +57 -2
  26. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +32 -2
  27. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +110 -6
  28. package/front_end/models/computed_style/computed_style.ts +9 -0
  29. package/front_end/models/issues_manager/CorsIssue.ts +11 -14
  30. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
  31. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +33 -4
  32. package/front_end/panels/ai_assistance/components/ChatInput.ts +52 -19
  33. package/front_end/panels/ai_assistance/components/ChatMessage.ts +7 -4
  34. package/front_end/panels/ai_assistance/components/ChatView.ts +4 -0
  35. package/front_end/panels/ai_assistance/components/chatInput.css +10 -3
  36. package/front_end/panels/application/DeviceBoundSessionsView.ts +51 -76
  37. package/front_end/panels/changes/changesSidebar.css +5 -0
  38. package/front_end/panels/common/AiCodeGenerationTeaser.ts +2 -2
  39. package/front_end/panels/common/AiCodeGenerationUpgradeDialog.ts +4 -4
  40. package/front_end/panels/common/ExtensionPanel.ts +4 -0
  41. package/front_end/panels/common/FreDialog.ts +4 -0
  42. package/front_end/panels/coverage/CoverageListView.ts +18 -3
  43. package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +89 -0
  44. package/front_end/panels/elements/ComputedStyleWidget.ts +12 -8
  45. package/front_end/panels/elements/ElementsPanel.ts +4 -3
  46. package/front_end/panels/elements/ElementsSidebarPane.ts +11 -8
  47. package/front_end/panels/elements/ElementsTreeElement.ts +92 -121
  48. package/front_end/panels/elements/ElementsTreeOutline.ts +26 -15
  49. package/front_end/panels/elements/MetricsSidebarPane.ts +2 -2
  50. package/front_end/panels/elements/PlatformFontsWidget.ts +7 -5
  51. package/front_end/panels/elements/PropertiesWidget.ts +3 -6
  52. package/front_end/panels/elements/StylesSidebarPane.ts +4 -3
  53. package/front_end/panels/elements/elements.ts +4 -3
  54. package/front_end/panels/elements/elementsTreeOutline.css +16 -5
  55. package/front_end/panels/greendev/GreenDevPanel.css +241 -0
  56. package/front_end/panels/greendev/GreenDevPanel.ts +308 -0
  57. package/front_end/panels/greendev/GreenDevShared.ts +13 -0
  58. package/front_end/panels/greendev/greendev-meta.ts +52 -0
  59. package/front_end/panels/greendev/greendev.ts +9 -0
  60. package/front_end/panels/issues/CorsIssueDetailsView.ts +4 -4
  61. package/front_end/panels/lighthouse/LighthouseStartView.ts +1 -1
  62. package/front_end/panels/lighthouse/lighthouseStartView.css +6 -0
  63. package/front_end/panels/network/NetworkLogView.ts +2 -5
  64. package/front_end/panels/security/SecurityPanel.ts +0 -4
  65. package/front_end/panels/security/SecurityPanelSidebar.ts +2 -42
  66. package/front_end/panels/security/security-meta.ts +2 -14
  67. package/front_end/panels/security/security.ts +0 -4
  68. package/front_end/panels/settings/EditFileSystemView.ts +8 -8
  69. package/front_end/panels/settings/SettingsScreen.ts +4 -4
  70. package/front_end/panels/sources/SourcesSearchScope.ts +2 -1
  71. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +47 -26
  72. package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +121 -39
  73. package/front_end/panels/timeline/overlays/components/timespanBreakdownOverlay.css +106 -101
  74. package/front_end/third_party/chromium/README.chromium +1 -1
  75. package/front_end/third_party/puppeteer/README.chromium +2 -2
  76. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +35 -0
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js +19 -0
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts +16 -1
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js +1 -1
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +21 -0
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +6 -0
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.d.ts +13 -1
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.d.ts.map +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.js +56 -36
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.js.map +1 -1
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +2 -2
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +32 -8
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +5 -1
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  99. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +32 -2
  100. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
  101. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts +3 -2
  102. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
  103. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +20 -0
  104. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +2 -1
  106. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  107. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +25 -8
  108. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.d.ts +2 -0
  110. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js +23 -0
  112. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js.map +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +3 -2
  114. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +10 -6
  116. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
  118. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +29 -0
  121. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +46 -6
  123. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
  124. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +5 -1
  125. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +18 -0
  127. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.js +2 -2
  129. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.js.map +1 -1
  130. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  131. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js +13 -1
  132. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
  133. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/JSHandle.js +2 -2
  134. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/JSHandle.js.map +1 -1
  135. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +7 -2
  136. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  137. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +43 -7
  138. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  139. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.d.ts +10 -1
  140. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.d.ts.map +1 -1
  141. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.js +34 -4
  142. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.js.map +1 -1
  143. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Cookie.d.ts +1 -1
  144. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Cookie.d.ts.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +1 -1
  146. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts.map +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js.map +1 -1
  149. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/XPathQuerySelector.js +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/XPathQuerySelector.js.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  152. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  153. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +1 -0
  154. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  156. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -0
  157. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
  158. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +4 -0
  159. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
  161. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js +2 -2
  162. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js.map +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  164. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  165. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  166. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  167. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  168. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +129 -3
  169. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +233 -65
  170. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +35 -0
  171. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js +19 -0
  173. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts +16 -1
  175. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
  176. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +21 -0
  180. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +6 -0
  182. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  183. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.d.ts +13 -1
  184. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.d.ts.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.js +56 -36
  186. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.js.map +1 -1
  187. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +2 -2
  188. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
  189. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +30 -6
  190. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +5 -1
  192. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  193. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +32 -2
  194. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
  195. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts +3 -2
  196. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
  197. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +20 -0
  198. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
  199. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +2 -1
  200. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  201. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +25 -8
  202. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  203. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.d.ts +2 -0
  204. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  205. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js +23 -0
  206. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js.map +1 -1
  207. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +3 -2
  208. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  209. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +10 -6
  210. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  211. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
  212. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js +1 -1
  213. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js.map +1 -1
  214. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts +29 -0
  215. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +46 -6
  217. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
  218. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +5 -1
  219. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  220. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +19 -1
  221. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
  222. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.js +3 -3
  223. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.js.map +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  225. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js +14 -2
  226. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
  227. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/JSHandle.js +3 -3
  228. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/JSHandle.js.map +1 -1
  229. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +7 -2
  230. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  231. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +43 -8
  232. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  233. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.d.ts +10 -1
  234. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.d.ts.map +1 -1
  235. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.js +31 -3
  236. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.js.map +1 -1
  237. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Cookie.d.ts +1 -1
  238. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Cookie.d.ts.map +1 -1
  239. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +1 -1
  240. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts.map +1 -1
  241. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +1 -1
  242. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js.map +1 -1
  243. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/XPathQuerySelector.js +1 -1
  244. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/XPathQuerySelector.js.map +1 -1
  245. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  246. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +1 -0
  247. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
  248. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  249. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -0
  250. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
  251. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +4 -0
  252. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  253. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
  254. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js +2 -2
  255. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js.map +1 -1
  256. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  257. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  258. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  259. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  260. package/front_end/third_party/puppeteer/package/lib/types.d.ts +129 -3
  261. package/front_end/third_party/puppeteer/package/package.json +4 -4
  262. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +46 -0
  263. package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +21 -0
  264. package/front_end/third_party/puppeteer/package/src/api/Frame.ts +1 -1
  265. package/front_end/third_party/puppeteer/package/src/api/Page.ts +23 -0
  266. package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +88 -56
  267. package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +33 -8
  268. package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +61 -3
  269. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +23 -2
  270. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +29 -8
  271. package/front_end/third_party/puppeteer/package/src/bidi/core/Browser.ts +30 -0
  272. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +13 -2
  273. package/front_end/third_party/puppeteer/package/src/bidi/core/UserContext.ts +1 -0
  274. package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +85 -8
  275. package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +36 -1
  276. package/front_end/third_party/puppeteer/package/src/cdp/ExecutionContext.ts +5 -5
  277. package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +23 -2
  278. package/front_end/third_party/puppeteer/package/src/cdp/JSHandle.ts +3 -3
  279. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +60 -8
  280. package/front_end/third_party/puppeteer/package/src/cdp/utils.ts +36 -3
  281. package/front_end/third_party/puppeteer/package/src/common/Cookie.ts +1 -1
  282. package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
  283. package/front_end/third_party/puppeteer/package/src/injected/XPathQuerySelector.ts +1 -1
  284. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +1 -0
  285. package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +2 -0
  286. package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +4 -0
  287. package/front_end/third_party/puppeteer/package/src/node/PuppeteerNode.ts +8 -6
  288. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  289. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  290. package/front_end/ui/components/text_editor/AutocompleteHistory.ts +2 -1
  291. package/front_end/ui/components/text_editor/TextEditorHistory.ts +1 -1
  292. package/front_end/ui/legacy/InplaceEditor.ts +1 -1
  293. package/front_end/ui/legacy/SearchableView.ts +5 -2
  294. package/front_end/ui/legacy/Widget.ts +15 -0
  295. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +6 -0
  296. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +50 -1
  297. package/front_end/ui/legacy/components/data_grid/SortableDataGrid.ts +59 -9
  298. package/front_end/ui/legacy/components/data_grid/ViewportDataGrid.ts +2 -1
  299. package/front_end/ui/legacy/components/data_grid/data_grid.ts +1 -0
  300. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +28 -15
  301. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +2 -2
  302. package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +3 -3
  303. package/front_end/ui/legacy/components/source_frame/JSONView.ts +2 -3
  304. package/front_end/ui/visual_logging/Debugging.ts +1 -1
  305. package/front_end/ui/visual_logging/KnownContextValues.ts +13 -0
  306. package/mcp/mcp.ts +1 -0
  307. package/package.json +1 -1
  308. package/front_end/panels/security/CookieControlsTreeElement.ts +0 -21
  309. package/front_end/panels/security/CookieControlsView.ts +0 -447
  310. package/front_end/panels/security/CookieReportTreeElement.ts +0 -21
  311. package/front_end/panels/security/CookieReportView.ts +0 -549
  312. package/front_end/panels/security/cookieControlsView.css +0 -139
  313. package/front_end/panels/security/cookieReportView.css +0 -90
  314. /package/front_end/{panels/elements → models/computed_style}/ComputedStyleModel.ts +0 -0
@@ -1451,17 +1451,14 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
1451
1451
  }
1452
1452
 
1453
1453
  private removeNodeAndMaybeAncestors(node: NetworkRequestNode): void {
1454
- let parent: NetworkNode|
1455
- (DataGrid.DataGrid.DataGridNode<DataGrid.ViewportDataGrid.ViewportDataGridNode<
1456
- DataGrid.SortableDataGrid.SortableDataGridNode<NetworkNode>>>|
1457
- null) = node.parent;
1454
+ let parent = node.parent;
1458
1455
  if (!parent) {
1459
1456
  return;
1460
1457
  }
1461
1458
  parent.removeChild(node);
1462
1459
  while (parent && !parent.hasChildren() && parent.dataGrid && parent.dataGrid.rootNode() !== parent) {
1463
1460
  const grandparent = (parent.parent as NetworkNode);
1464
- grandparent.removeChild(parent);
1461
+ grandparent.removeChild(parent as NetworkNode);
1465
1462
  parent = grandparent;
1466
1463
  }
1467
1464
  }
@@ -15,8 +15,6 @@ import * as UI from '../../ui/legacy/legacy.js';
15
15
  import {html, render} from '../../ui/lit/lit.js';
16
16
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
17
17
 
18
- import {CookieControlsView} from './CookieControlsView.js';
19
- import {CookieReportView} from './CookieReportView.js';
20
18
  import lockIconStyles from './lockIcon.css.js';
21
19
  import mainViewStyles from './mainView.css.js';
22
20
  import {ShowOriginEvent} from './OriginTreeElement.js';
@@ -555,8 +553,6 @@ const DEFAULT_VIEW: View = (input: ViewInput, output: ViewOutput, target: HTMLEl
555
553
  <devtools-widget
556
554
  slot="sidebar"
557
555
  .widgetConfig=${widgetConfig(SecurityPanelSidebar)}
558
- @showCookieReport=${()=>output.setVisibleView(new CookieReportView())}
559
- @showFlagControls=${() => output.setVisibleView(new CookieControlsView())}
560
556
  ${UI.Widget.widgetRef(SecurityPanelSidebar, e => {output.sidebar = e;})}>
561
557
  </devtools-widget>
562
558
  </devtools-split-view>`,
@@ -6,13 +6,10 @@
6
6
  import * as Common from '../../core/common/common.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
8
  import * as Platform from '../../core/platform/platform.js';
9
- import * as Root from '../../core/root/root.js';
10
9
  import * as Protocol from '../../generated/protocol.js';
11
10
  import type {Icon} from '../../ui/kit/kit.js';
12
11
  import * as UI from '../../ui/legacy/legacy.js';
13
12
 
14
- import {CookieControlsTreeElement} from './CookieControlsTreeElement.js';
15
- import {CookieReportTreeElement} from './CookieReportTreeElement.js';
16
13
  import lockIconStyles from './lockIcon.css.js';
17
14
  import {OriginTreeElement} from './OriginTreeElement.js';
18
15
  import {
@@ -29,18 +26,6 @@ const UIStrings = {
29
26
  * @description Section title for the the Security Panel's sidebar
30
27
  */
31
28
  security: 'Security',
32
- /**
33
- * @description Section title for the the Security Panel's sidebar
34
- */
35
- privacy: 'Privacy',
36
- /**
37
- * @description Sidebar element text in the Security panel
38
- */
39
- cookieReport: 'Third-party cookies',
40
- /**
41
- * @description Sidebar element text in the Security panel
42
- */
43
- flagControls: 'Controls',
44
29
  /**
45
30
  * @description Text in Security Panel of the Security panel
46
31
  */
@@ -76,8 +61,6 @@ export class SecurityPanelSidebar extends UI.Widget.VBox {
76
61
  readonly #originGroupTitles: Map<OriginGroup, {title: string, icon?: Icon}>;
77
62
  #originGroups: Map<OriginGroup, UI.TreeOutline.TreeElement>;
78
63
  securityOverviewElement: OriginTreeElement;
79
- readonly #cookieControlsTreeElement: CookieControlsTreeElement|undefined;
80
- readonly cookieReportTreeElement: CookieReportTreeElement|undefined;
81
64
  readonly #elementsByOrigin: Map<string, OriginTreeElement>;
82
65
  readonly #mainViewReloadMessage: UI.TreeOutline.TreeElement;
83
66
  #mainOrigin: string|null;
@@ -94,20 +77,6 @@ export class SecurityPanelSidebar extends UI.Widget.VBox {
94
77
  this.sidebarTree.element.classList.add('security-sidebar');
95
78
  this.contentElement.appendChild(this.sidebarTree.element);
96
79
 
97
- if (Root.Runtime.hostConfig.devToolsPrivacyUI?.enabled) {
98
- const privacyTreeSection = this.#addSidebarSection(i18nString(UIStrings.privacy), 'privacy');
99
- this.#cookieControlsTreeElement =
100
- new CookieControlsTreeElement(i18nString(UIStrings.flagControls), 'cookie-flag-controls');
101
- privacyTreeSection.appendChild(this.#cookieControlsTreeElement);
102
- this.cookieReportTreeElement = new CookieReportTreeElement(i18nString(UIStrings.cookieReport), 'cookie-report');
103
- privacyTreeSection.appendChild(this.cookieReportTreeElement);
104
-
105
- // If this if the first time this setting is set, go to the controls tool
106
- if (this.#securitySidebarLastItemSetting.get() === '') {
107
- this.#securitySidebarLastItemSetting.set(this.#cookieControlsTreeElement.elemId);
108
- }
109
- }
110
-
111
80
  const securitySectionTitle = i18nString(UIStrings.security);
112
81
  const securityTreeSection = this.#addSidebarSection(securitySectionTitle, 'security');
113
82
 
@@ -177,17 +146,8 @@ export class SecurityPanelSidebar extends UI.Widget.VBox {
177
146
  }
178
147
 
179
148
  showLastSelectedElement(): void {
180
- if (this.#cookieControlsTreeElement &&
181
- this.#securitySidebarLastItemSetting.get() === this.#cookieControlsTreeElement.elemId) {
182
- this.#cookieControlsTreeElement.select();
183
- this.#cookieControlsTreeElement.showElement();
184
- } else if (this.#securitySidebarLastItemSetting.get() === this.cookieReportTreeElement?.elemId) {
185
- this.cookieReportTreeElement.select();
186
- this.cookieReportTreeElement.showElement();
187
- } else {
188
- this.securityOverviewElement.select();
189
- this.securityOverviewElement.showElement();
190
- }
149
+ this.securityOverviewElement.select();
150
+ this.securityOverviewElement.showElement();
191
151
  }
192
152
 
193
153
  #addSidebarSection(title: string, jslogContext: string): UI.TreeOutline.TreeElement {
@@ -3,7 +3,6 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as i18n from '../../core/i18n/i18n.js';
6
- import * as Root from '../../core/root/root.js';
7
6
  import * as UI from '../../ui/legacy/legacy.js';
8
7
 
9
8
  import type * as Security from './security.js';
@@ -13,18 +12,10 @@ const UIStrings = {
13
12
  * @description Default Title of the security panel
14
13
  */
15
14
  security: 'Security',
16
- /**
17
- * @description Title of privacy and security panel. This is used when the kDevToolsPrivacyUI feature flag is enabled.
18
- */
19
- PrivacyAndSecurity: 'Privacy and security',
20
15
  /**
21
16
  * @description Default command to open the security panel
22
17
  */
23
18
  showSecurity: 'Show Security',
24
- /**
25
- * @description Command to open the privacy and security panel. This is used when the kDevToolPrivacyUI feature flag is enabled
26
- */
27
- showPrivacyAndSecurity: 'Show Privacy and security',
28
19
  } as const;
29
20
 
30
21
  const str_ = i18n.i18n.registerUIStrings('panels/security/security-meta.ts', UIStrings);
@@ -42,11 +33,8 @@ async function loadSecurityModule(): Promise<typeof Security> {
42
33
  UI.ViewManager.registerViewExtension({
43
34
  location: UI.ViewManager.ViewLocationValues.PANEL,
44
35
  id: 'security',
45
- title: () => Root.Runtime.hostConfig.devToolsPrivacyUI?.enabled ? i18nLazyString(UIStrings.PrivacyAndSecurity)() :
46
- i18nLazyString(UIStrings.security)(),
47
- commandPrompt: () => Root.Runtime.hostConfig.devToolsPrivacyUI?.enabled ?
48
- i18nLazyString(UIStrings.showPrivacyAndSecurity)() :
49
- i18nLazyString(UIStrings.showSecurity)(),
36
+ title: () => i18nLazyString(UIStrings.security)(),
37
+ commandPrompt: () => i18nLazyString(UIStrings.showSecurity)(),
50
38
  order: 80,
51
39
  persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
52
40
  async loadView() {
@@ -2,14 +2,10 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- import * as CookieControlsView from './CookieControlsView.js';
6
- import * as CookieReportView from './CookieReportView.js';
7
5
  import * as SecurityModel from './SecurityModel.js';
8
6
  import * as SecurityPanel from './SecurityPanel.js';
9
7
 
10
8
  export {
11
- CookieControlsView,
12
- CookieReportView,
13
9
  SecurityModel,
14
10
  SecurityPanel,
15
11
  };
@@ -61,9 +61,8 @@ export interface EditFileSystemViewInput {
61
61
  fileSystemPath: Platform.DevToolsPath.UrlString;
62
62
  excludedFolderPaths: PathWithStatus[];
63
63
  onCreate: (event: CustomEvent<{url?: string}>) => void;
64
- onEdit:
65
- (event: CustomEvent<{node: HTMLElement, columnId: string, valueBeforeEditing: string, newText: string}>) => void;
66
- onDelete: (event: CustomEvent<HTMLElement>) => void;
64
+ onEdit: (event: CustomEvent<{columnId: string, valueBeforeEditing: string, newText: string}>) => void;
65
+ onDelete: (event: CustomEvent) => void;
67
66
  }
68
67
 
69
68
  export type View = (input: EditFileSystemViewInput, output: object, target: HTMLElement) => void;
@@ -77,8 +76,6 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
77
76
  <span class="excluded-folder-url">${input.fileSystemPath}</span>
78
77
  <devtools-data-grid
79
78
  @create=${input.onCreate}
80
- @edit=${input.onEdit}
81
- @delete=${input.onDelete}
82
79
  class="exclude-subfolders-table"
83
80
  parts="excluded-folder-row-with-error"
84
81
  inline striped>
@@ -90,7 +87,9 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
90
87
  </thead>
91
88
  <tbody>
92
89
  ${input.excludedFolderPaths.map((path, index) => html`
93
- <tr data-url=${path.path} data-index=${index}>
90
+ <tr data-url=${path.path} data-index=${index}
91
+ @edit=${input.onEdit}
92
+ @delete=${input.onDelete}>
94
93
  <td style=${styleMap({backgroundColor: path.status !== ExcludedFolderStatus.VALID ? 'var(--sys-color-error-container)' : undefined})}>${path.path}</td>
95
94
  </tr>
96
95
  `)}
@@ -139,8 +138,9 @@ export class EditFileSystemView extends UI.Widget.VBox {
139
138
  fileSystemPath: this.#fileSystem?.path() ?? Platform.DevToolsPath.urlString``,
140
139
  excludedFolderPaths: this.#excludedFolderPaths,
141
140
  onCreate: e => this.#onCreate(e.detail.url),
142
- onEdit: e => this.#onEdit(e.detail.node.dataset.index ?? '-1', e.detail.valueBeforeEditing, e.detail.newText),
143
- onDelete: e => this.#onDelete(e.detail.dataset.index ?? '-1'),
141
+ onEdit: e => this.#onEdit(
142
+ (e.currentTarget as HTMLElement).dataset.index ?? '-1', e.detail.valueBeforeEditing, e.detail.newText),
143
+ onDelete: e => this.#onDelete((e.currentTarget as HTMLElement).dataset.index ?? '-1'),
144
144
  };
145
145
  this.#view(input, {}, this.contentElement);
146
146
  }
@@ -59,7 +59,7 @@ const UIStrings = {
59
59
  /**
60
60
  * @description Message to display if a setting change requires a reload of DevTools
61
61
  */
62
- oneOrMoreSettingsHaveChanged: 'One or more settings have changed which requires a reload to take effect',
62
+ settingsChangedReloadDevTools: 'Settings changed. To apply, reload DevTools.',
63
63
  /**
64
64
  * @description Warning text shown when the user has entered text to filter the
65
65
  * list of experiments, but no experiments match the filter.
@@ -465,7 +465,7 @@ export class ExperimentsSettingsTab extends UI.Widget.VBox implements SettingsTa
465
465
  experiment.setEnabled(checkbox.checked);
466
466
  Host.userMetrics.experimentChanged(experiment.name, experiment.isEnabled());
467
467
  UI.InspectorView.InspectorView.instance().displayReloadRequiredWarning(
468
- i18nString(UIStrings.oneOrMoreSettingsHaveChanged));
468
+ i18nString(UIStrings.settingsChangedReloadDevTools));
469
469
  }
470
470
  checkbox.addEventListener('click', listener, false);
471
471
 
@@ -675,7 +675,7 @@ function renderWidgetOptions(settings: GreenDev.GreenDevSettings): TemplateResul
675
675
  }
676
676
 
677
677
  UI.InspectorView.InspectorView.instance().displayReloadRequiredWarning(
678
- i18nString(UIStrings.oneOrMoreSettingsHaveChanged));
678
+ i18nString(UIStrings.settingsChangedReloadDevTools));
679
679
  };
680
680
  }
681
681
  // clang-format off
@@ -701,7 +701,7 @@ function renderPrototypeCheckboxes(
701
701
 
702
702
  function showChangeWarning(): void {
703
703
  UI.InspectorView.InspectorView.instance().displayReloadRequiredWarning(
704
- i18nString(UIStrings.oneOrMoreSettingsHaveChanged));
704
+ i18nString(UIStrings.settingsChangedReloadDevTools));
705
705
  }
706
706
  // clang-format off
707
707
  const checkboxes = Object.keys(settings).map(name => {
@@ -86,7 +86,8 @@ export class SourcesSearchScope implements Search.SearchScope.SearchScope {
86
86
  if (!searchInAnonymousAndContentScripts && project.type() === Workspace.Workspace.projectTypes.ContentScripts) {
87
87
  return false;
88
88
  }
89
- if (!localOverridesEnabled && project.type() === Workspace.Workspace.projectTypes.FileSystem) {
89
+ if (!localOverridesEnabled && project.type() === Workspace.Workspace.projectTypes.FileSystem &&
90
+ Persistence.FileSystemWorkspaceBinding.FileSystemWorkspaceBinding.fileSystemType(project) === 'overrides') {
90
91
  return false;
91
92
  }
92
93
  return true;
@@ -9,9 +9,11 @@ import * as Platform from '../../../core/platform/platform.js';
9
9
  import * as AIAssistance from '../../../models/ai_assistance/ai_assistance.js';
10
10
  import * as Trace from '../../../models/trace/trace.js';
11
11
  import type * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';
12
+ import * as UI from '../../../ui/legacy/legacy.js';
12
13
  import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
13
14
 
14
15
  import * as Components from './components/components.js';
16
+ import type {SectionPosition} from './components/TimespanBreakdownOverlay.js';
15
17
 
16
18
  const UIStrings = {
17
19
  /**
@@ -909,8 +911,13 @@ export class Overlays extends EventTarget {
909
911
  return;
910
912
  }
911
913
 
912
- const component = element.querySelector('devtools-timespan-breakdown-overlay');
913
- const elementSections = component?.renderedSections() ?? [];
914
+ const component = element.querySelector('.devtools-timespan-breakdown-overlay');
915
+
916
+ if (!component) {
917
+ return;
918
+ }
919
+
920
+ const widget = UI.Widget.Widget.get(component) as Components.TimespanBreakdownOverlay.TimespanBreakdownOverlay;
914
921
 
915
922
  // Handle horizontal positioning.
916
923
  const leftEdgePixel = this.#xPixelForMicroSeconds('main', overlay.sections[0].bounds.min);
@@ -921,14 +928,11 @@ export class Overlays extends EventTarget {
921
928
  }
922
929
 
923
930
  const rangeWidth = rightEdgePixel - leftEdgePixel;
924
- element.style.left = `${leftEdgePixel}px`;
925
- element.style.width = `${rangeWidth}px`;
926
931
 
927
- if (elementSections.length === 0) {
928
- return;
929
- }
932
+ widget.left = leftEdgePixel;
933
+ widget.width = rangeWidth;
930
934
 
931
- let count = 0;
935
+ const widths: SectionPosition[] = [];
932
936
  for (const section of overlay.sections) {
933
937
  const leftPixel = this.#xPixelForMicroSeconds('main', section.bounds.min);
934
938
  const rightPixel = this.#xPixelForMicroSeconds('main', section.bounds.max);
@@ -936,18 +940,17 @@ export class Overlays extends EventTarget {
936
940
  return;
937
941
  }
938
942
  const rangeWidth = rightPixel - leftPixel;
939
- const sectionElement = elementSections[count];
940
943
 
941
- sectionElement.style.left = `${leftPixel}px`;
942
- sectionElement.style.width = `${rangeWidth}px`;
943
- count++;
944
+ widths.push({left: leftPixel, width: rangeWidth});
944
945
  }
945
946
 
947
+ widget.widths = widths;
948
+
946
949
  // Handle vertical positioning based on the entry's vertical position.
947
950
  if (overlay.entry && (overlay.renderLocation === 'BELOW_EVENT' || overlay.renderLocation === 'ABOVE_EVENT')) {
948
951
  // Max height for the overlay box when attached to an entry.
949
952
  const MAX_BOX_HEIGHT = 50;
950
- element.style.maxHeight = `${MAX_BOX_HEIGHT}px`;
953
+ widget.maxHeight = MAX_BOX_HEIGHT;
951
954
 
952
955
  const y = this.yPixelForEventOnChart(overlay.entry);
953
956
  if (y === null) {
@@ -960,7 +963,7 @@ export class Overlays extends EventTarget {
960
963
 
961
964
  if (overlay.renderLocation === 'BELOW_EVENT') {
962
965
  const top = y + eventHeight;
963
- element.style.top = `${top}px`;
966
+ widget.top = top;
964
967
  } else {
965
968
  // Some padding so the box hovers just on top.
966
969
  const PADDING = 7;
@@ -974,7 +977,7 @@ export class Overlays extends EventTarget {
974
977
  const height = Math.min(MAX_BOX_HEIGHT, minSpace);
975
978
 
976
979
  const top = bottom - height;
977
- element.style.top = `${top}px`;
980
+ widget.top = top;
978
981
  }
979
982
  }
980
983
  }
@@ -1558,11 +1561,17 @@ export class Overlays extends EventTarget {
1558
1561
  return overlayElement;
1559
1562
  }
1560
1563
  case 'TIMESPAN_BREAKDOWN': {
1561
- const component = new Components.TimespanBreakdownOverlay.TimespanBreakdownOverlay();
1562
- component.sections = overlay.sections;
1563
- component.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();
1564
- component.isBelowEntry = overlay.renderLocation === 'BELOW_EVENT';
1565
- overlayElement.appendChild(component);
1564
+ const widget = document.createElement('devtools-widget') as
1565
+ UI.Widget.WidgetElement<Components.TimespanBreakdownOverlay.TimespanBreakdownOverlay>;
1566
+
1567
+ widget.widgetConfig = UI.Widget.widgetConfig(Components.TimespanBreakdownOverlay.TimespanBreakdownOverlay, {
1568
+ isBelowEntry: overlay.renderLocation === 'BELOW_EVENT',
1569
+ canvasRect: this.#charts.mainChart.canvasBoundingClientRect(),
1570
+ sections: overlay.sections,
1571
+ });
1572
+
1573
+ overlayElement.appendChild(widget);
1574
+
1566
1575
  return overlayElement;
1567
1576
  }
1568
1577
  case 'TIMINGS_MARKER': {
@@ -1685,10 +1694,16 @@ export class Overlays extends EventTarget {
1685
1694
  break;
1686
1695
  }
1687
1696
  case 'TIMESPAN_BREAKDOWN': {
1688
- const component = element.querySelector('devtools-timespan-breakdown-overlay');
1689
- if (component) {
1690
- component.sections = overlay.sections;
1691
- component.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();
1697
+ const component = element.querySelector('.devtools-timespan-breakdown-overlay');
1698
+ if (!component) {
1699
+ return;
1700
+ }
1701
+
1702
+ const widget = UI.Widget.Widget.get(component) as Components.TimespanBreakdownOverlay.TimespanBreakdownOverlay;
1703
+
1704
+ if (widget) {
1705
+ widget.sections = overlay.sections;
1706
+ widget.canvasRect = this.#charts.mainChart.canvasBoundingClientRect();
1692
1707
  }
1693
1708
  break;
1694
1709
  }
@@ -1737,8 +1752,14 @@ export class Overlays extends EventTarget {
1737
1752
  case 'ENTRIES_LINK':
1738
1753
  break;
1739
1754
  case 'TIMESPAN_BREAKDOWN': {
1740
- const component = element.querySelector('devtools-timespan-breakdown-overlay');
1741
- component?.checkSectionLabelPositioning();
1755
+ const component = element.querySelector('.devtools-timespan-breakdown-overlay');
1756
+
1757
+ if (!component) {
1758
+ return;
1759
+ }
1760
+
1761
+ const widget = UI.Widget.Widget.get(component) as Components.TimespanBreakdownOverlay.TimespanBreakdownOverlay;
1762
+ widget?.checkSectionLabelPositioning();
1742
1763
  break;
1743
1764
  }
1744
1765
  case 'TIMESTAMP_MARKER':
@@ -1,23 +1,110 @@
1
1
  // Copyright 2024 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
- /* eslint-disable @devtools/no-lit-render-outside-of-view */
5
4
 
6
5
  import * as i18n from '../../../../core/i18n/i18n.js';
7
6
  import type * as Trace from '../../../../models/trace/trace.js';
8
- import * as Lit from '../../../../ui/lit/lit.js';
7
+ import * as UI from '../../../../ui/legacy/legacy.js';
8
+ import {Directives, html, nothing, render, type TemplateResult} from '../../../../ui/lit/lit.js';
9
9
 
10
10
  import timespanBreakdownOverlayStyles from './timespanBreakdownOverlay.css.js';
11
11
 
12
- const {html} = Lit;
12
+ export interface Input {
13
+ sections: Trace.Types.Overlays.TimespanBreakdownEntryBreakdown[]|null;
14
+ positions: SectionPosition[];
15
+ left: number|null;
16
+ width: number|null;
17
+ maxHeight: number|null;
18
+ top: number|null;
19
+ className: string;
20
+ }
21
+ export interface SectionPosition {
22
+ left: number|null;
23
+ width: number|null;
24
+ }
25
+
26
+ type View = (input: Input, _output: undefined, target: HTMLElement) => void;
27
+
28
+ const renderSection =
29
+ (section: Trace.Types.Overlays.TimespanBreakdownEntryBreakdown, position: SectionPosition): TemplateResult => {
30
+ const style = Directives.styleMap(
31
+ {left: position ? `${position.left}px` : undefined, width: position ? `${position.width}px` : undefined});
32
+
33
+ // clang-format off
34
+ return html`
35
+ <div class="timespan-breakdown-overlay-section" style=${style}>
36
+ <div class="timespan-breakdown-overlay-label">
37
+ ${
38
+ section.showDuration ?
39
+ html`<span class="duration-text">${i18n.TimeUtilities.formatMicroSecondsAsMillisFixed(section.bounds.range)}</span> ` :
40
+ nothing
41
+ }
42
+ <span class="section-label-text">${section.label}</span>
43
+ </div>
44
+ </div>`;
45
+ // clang-format on
46
+ };
47
+
48
+ export const DEFAULT_VIEW = (input: Input, _output: undefined, target: HTMLElement): void => {
49
+ const style = Directives.styleMap({
50
+ left: input.left ? `${input.left}px` : undefined,
51
+ width: input.width ? `${input.width}px` : undefined,
52
+ top: input.top ? `${input.top}px` : undefined,
53
+ maxHeight: input.maxHeight ? `${input.maxHeight}px` : undefined,
54
+ position: 'relative'
55
+ });
56
+ // clang-format off
57
+ render(
58
+ html`
59
+ <style>${timespanBreakdownOverlayStyles}</style>
60
+ <div style=${style} class=${input.className}>
61
+ ${input.sections?.map((curr, index) => {
62
+ return renderSection(curr, input.positions[index]);
63
+ })}
64
+ </div>`,
65
+ target);
66
+ // clang-format off
67
+ };
13
68
 
14
- export class TimespanBreakdownOverlay extends HTMLElement {
15
- readonly #shadow = this.attachShadow({mode: 'open'});
69
+ export class TimespanBreakdownOverlay extends UI.Widget.Widget {
16
70
  #canvasRect: DOMRect|null = null;
17
71
  #sections: Trace.Types.Overlays.TimespanBreakdownEntryBreakdown[]|null = null;
72
+ #sectionsPositions: SectionPosition[] = [];
73
+ #left: number|null = null;
74
+ #width: number|null = null;
75
+ #maxHeight: number|null = null;
76
+ #top: number|null = null;
77
+
78
+ #view: View;
79
+
80
+ constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
81
+ super(element, {classes: ['devtools-timespan-breakdown-overlay']});
82
+ this.#view = view;
83
+ this.requestUpdate();
84
+ }
85
+
86
+ set top(top: number) {
87
+ this.#top = top;
88
+ this.requestUpdate();
89
+ }
90
+
91
+ set maxHeight(maxHeight: number) {
92
+ this.#maxHeight = maxHeight;
93
+ this.requestUpdate();
94
+ }
95
+
96
+ set width(width: number) {
97
+ this.#width = width;
98
+ this.requestUpdate();
99
+ }
100
+
101
+ set left(left: number) {
102
+ this.#left = left;
103
+ this.requestUpdate();
104
+ }
18
105
 
19
106
  set isBelowEntry(isBelow: boolean) {
20
- this.classList.toggle('is-below', isBelow);
107
+ this.element.classList.toggle('is-below', isBelow);
21
108
  }
22
109
 
23
110
  set canvasRect(rect: DOMRect|null) {
@@ -25,7 +112,16 @@ export class TimespanBreakdownOverlay extends HTMLElement {
25
112
  return;
26
113
  }
27
114
  this.#canvasRect = rect;
28
- this.#render();
115
+ this.requestUpdate();
116
+ }
117
+
118
+ set widths(widths: SectionPosition[]) {
119
+ if (widths === this.#sectionsPositions) {
120
+ return;
121
+ }
122
+
123
+ this.#sectionsPositions = widths;
124
+ this.requestUpdate();
29
125
  }
30
126
 
31
127
  set sections(sections: Trace.Types.Overlays.TimespanBreakdownEntryBreakdown[]|null) {
@@ -33,7 +129,7 @@ export class TimespanBreakdownOverlay extends HTMLElement {
33
129
  return;
34
130
  }
35
131
  this.#sections = sections;
36
- this.#render();
132
+ this.requestUpdate();
37
133
  }
38
134
 
39
135
  /**
@@ -43,7 +139,7 @@ export class TimespanBreakdownOverlay extends HTMLElement {
43
139
  * align the text so the label is visible as long as possible.
44
140
  */
45
141
  checkSectionLabelPositioning(): void {
46
- const sections = this.#shadow.querySelectorAll<HTMLElement>('.timespan-breakdown-overlay-section');
142
+ const sections = this.element.querySelectorAll<HTMLElement>('.timespan-breakdown-overlay-section');
47
143
  if (!sections) {
48
144
  return;
49
145
  }
@@ -139,40 +235,26 @@ export class TimespanBreakdownOverlay extends HTMLElement {
139
235
  }
140
236
  }
141
237
 
142
- renderedSections(): HTMLElement[] {
143
- return Array.from(this.#shadow.querySelectorAll('.timespan-breakdown-overlay-section'));
144
- }
145
-
146
- #renderSection(section: Trace.Types.Overlays.TimespanBreakdownEntryBreakdown): Lit.TemplateResult {
147
- // clang-format off
148
- return html`
149
- <div class="timespan-breakdown-overlay-section">
150
- <div class="timespan-breakdown-overlay-label">
151
- ${section.showDuration ?
152
- html`<span class="duration-text">${i18n.TimeUtilities.formatMicroSecondsAsMillisFixed(section.bounds.range)}</span> ` : Lit.nothing}
153
- <span class="section-label-text">${section.label}</span>
154
- </div>
155
- </div>`;
156
- // clang-format on
157
- }
238
+ override performUpdate(): void {
239
+ let className = 'timeline-segment-container';
158
240
 
159
- #render(): void {
160
241
  if (this.#sections) {
161
- this.classList.toggle('odd-number-of-sections', this.#sections.length % 2 === 1);
162
- this.classList.toggle('even-number-of-sections', this.#sections.length % 2 === 0);
242
+ if(this.#sections.length % 2 === 0) {
243
+ className += ' even-number-of-sections';
244
+ } else {
245
+ className += ' odd-number-of-sections';
246
+ }
163
247
  }
164
- Lit.render(
165
- html`<style>${timespanBreakdownOverlayStyles}</style>
166
- ${this.#sections?.map(this.#renderSection)}`,
167
- this.#shadow, {host: this});
168
- this.checkSectionLabelPositioning();
169
- }
170
- }
171
248
 
172
- customElements.define('devtools-timespan-breakdown-overlay', TimespanBreakdownOverlay);
249
+ this.#view({sections: this.#sections,
250
+ positions: this.#sectionsPositions,
251
+ left: this.#left,
252
+ width: this.#width,
253
+ top: this.#top,
254
+ maxHeight: this.#maxHeight,
255
+ className
256
+ }, undefined, this.contentElement);
173
257
 
174
- declare global {
175
- interface HTMLElementTagNameMap {
176
- 'devtools-timespan-breakdown-overlay': TimespanBreakdownOverlay;
258
+ this.checkSectionLabelPositioning();
177
259
  }
178
260
  }