chrome-devtools-frontend 1.0.1579812 → 1.0.1581708

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 (351) hide show
  1. package/agents/prompts/creating-a-model.md +51 -0
  2. package/agents/prompts/merging-devtools-module.md +144 -0
  3. package/agents/prompts/ui-widgets.md +351 -0
  4. package/agents/prompts/verification.md +2 -1
  5. package/docs/contributing/README.md +5 -6
  6. package/docs/contributing/changes.md +1 -2
  7. package/docs/feature-specs/elements-tree-edit-html.md +14 -0
  8. package/docs/feature-specs/elements-tree-node-title.md +46 -0
  9. package/docs/styleguide/ux/README.md +1 -1
  10. package/front_end/core/host/UserMetrics.ts +3 -7
  11. package/front_end/core/root/Runtime.ts +0 -1
  12. package/front_end/core/sdk/NetworkManager.ts +0 -35
  13. package/front_end/core/sdk/OverlayModel.ts +12 -0
  14. package/front_end/core/sdk/StorageKeyManager.ts +6 -1
  15. package/front_end/core/sdk/Target.ts +4 -2
  16. package/front_end/devtools_compatibility.js +4 -0
  17. package/front_end/entrypoints/devtools_app/devtools_app.ts +1 -0
  18. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +536 -0
  19. package/front_end/entrypoints/greendev_floaty/floaty.css +298 -0
  20. package/front_end/entrypoints/greendev_floaty/floaty.html +38 -0
  21. package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +422 -0
  22. package/front_end/entrypoints/inspector_main/InspectorMain.ts +0 -38
  23. package/front_end/entrypoints/node_app/app/NodeMain.ts +19 -1
  24. package/front_end/entrypoints/node_app/node_app.ts +34 -0
  25. package/front_end/generated/InspectorBackendCommands.ts +9 -3
  26. package/front_end/generated/SupportedCSSProperties.js +39 -31
  27. package/front_end/generated/protocol-mapping.d.ts +12 -0
  28. package/front_end/generated/protocol-proxy-api.d.ts +12 -0
  29. package/front_end/generated/protocol.ts +56 -2
  30. package/front_end/models/ai_assistance/AiConversation.ts +10 -0
  31. package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -0
  32. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +24 -2
  33. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +104 -9
  34. package/front_end/{panels/elements → models/computed_style}/ComputedStyleModel.ts +26 -0
  35. package/front_end/models/computed_style/computed_style.ts +9 -0
  36. package/front_end/models/issues_manager/CookieIssue.ts +0 -28
  37. package/front_end/models/issues_manager/CorsIssue.ts +11 -14
  38. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +3 -5
  39. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +102 -6
  40. package/front_end/panels/ai_assistance/components/ChatInput.ts +15 -2
  41. package/front_end/panels/ai_assistance/components/ChatView.ts +2 -0
  42. package/front_end/panels/animation/AnimationGroupPreviewUI.ts +1 -1
  43. package/front_end/panels/application/ApplicationPanelSidebar.ts +13 -11
  44. package/front_end/panels/application/DOMStorageModel.ts +1 -1
  45. package/front_end/panels/application/ResourcesPanel.ts +10 -5
  46. package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +0 -1
  47. package/front_end/panels/application/components/BackForwardCacheView.ts +2 -4
  48. package/front_end/panels/autofill/AutofillView.ts +1 -1
  49. package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +0 -1
  50. package/front_end/panels/changes/changesSidebar.css +5 -0
  51. package/front_end/panels/common/AiCodeCompletionTeaser.ts +13 -3
  52. package/front_end/panels/common/ExtensionPanel.ts +4 -0
  53. package/front_end/panels/common/FreDialog.ts +4 -0
  54. package/front_end/panels/common/aiCodeCompletionTeaser.css +6 -0
  55. package/front_end/panels/console/ConsoleViewMessage.ts +0 -1
  56. package/front_end/panels/console_counters/WarningErrorCounter.ts +16 -10
  57. package/front_end/panels/coverage/CoverageListView.ts +18 -3
  58. package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +11 -0
  59. package/front_end/panels/elements/ComputedStyleWidget.ts +67 -45
  60. package/front_end/panels/elements/ElementsPanel.ts +4 -3
  61. package/front_end/panels/elements/ElementsSidebarPane.ts +11 -8
  62. package/front_end/panels/elements/ElementsTreeElement.ts +0 -1
  63. package/front_end/panels/elements/ElementsTreeOutline.ts +25 -15
  64. package/front_end/panels/elements/LayoutPane.ts +7 -8
  65. package/front_end/panels/elements/MetricsSidebarPane.ts +2 -2
  66. package/front_end/panels/elements/PlatformFontsWidget.ts +24 -9
  67. package/front_end/panels/elements/PropertiesWidget.ts +3 -6
  68. package/front_end/panels/elements/StylesSidebarPane.ts +4 -3
  69. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
  70. package/front_end/panels/elements/components/StylePropertyEditor.ts +1 -2
  71. package/front_end/panels/elements/elements.ts +1 -3
  72. package/front_end/panels/greendev/GreenDevPanel.css +282 -0
  73. package/front_end/panels/greendev/GreenDevPanel.ts +337 -0
  74. package/front_end/panels/greendev/GreenDevShared.ts +13 -0
  75. package/front_end/panels/greendev/greendev-meta.ts +52 -0
  76. package/front_end/panels/greendev/greendev.ts +9 -0
  77. package/front_end/panels/issues/CorsIssueDetailsView.ts +4 -4
  78. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -1
  79. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +1 -1
  80. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +1 -1
  81. package/front_end/panels/media/PlayerListView.ts +1 -1
  82. package/front_end/panels/network/NetworkLogViewColumns.ts +1 -2
  83. package/front_end/panels/network/RequestInitiatorView.ts +8 -11
  84. package/front_end/panels/network/RequestTimingView.ts +1 -1
  85. package/front_end/panels/network/components/RequestHeaderSection.ts +1 -1
  86. package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
  87. package/front_end/panels/recorder/components/RecordingListView.ts +1 -1
  88. package/front_end/panels/recorder/components/StepEditor.ts +3 -3
  89. package/front_end/panels/security/SecurityPanel.ts +0 -4
  90. package/front_end/panels/security/SecurityPanelSidebar.ts +2 -42
  91. package/front_end/panels/security/security-meta.ts +2 -14
  92. package/front_end/panels/security/security.ts +0 -4
  93. package/front_end/panels/settings/KeybindsSettingsTab.ts +5 -5
  94. package/front_end/panels/sources/OutlineQuickOpen.ts +19 -0
  95. package/front_end/panels/sources/SourcesSearchScope.ts +2 -1
  96. package/front_end/panels/sources/components/HeadersView.ts +2 -2
  97. package/front_end/panels/timeline/TimelinePanel.ts +25 -0
  98. package/front_end/panels/timeline/components/BreadcrumbsUI.ts +1 -1
  99. package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +1 -1
  100. package/front_end/third_party/chromium/README.chromium +1 -1
  101. package/front_end/third_party/lighthouse/README.chromium +2 -2
  102. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +145 -144
  103. package/front_end/third_party/lighthouse/report/bundle.js +12 -5
  104. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -2
  105. package/front_end/third_party/puppeteer/README.chromium +2 -2
  106. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +35 -0
  107. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js +19 -0
  109. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
  110. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts +16 -1
  111. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +1 -1
  114. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +21 -0
  116. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +6 -0
  118. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.d.ts +13 -1
  120. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.d.ts.map +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.js +56 -36
  122. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.js.map +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +2 -2
  124. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +32 -8
  126. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +5 -1
  128. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  129. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +32 -2
  130. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
  131. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts +3 -2
  132. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
  133. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +20 -0
  134. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
  135. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +2 -1
  136. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  137. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +25 -8
  138. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  139. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.d.ts +2 -0
  140. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  141. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js +23 -0
  142. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js.map +1 -1
  143. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +3 -2
  144. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +10 -6
  146. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js +1 -1
  149. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js.map +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +29 -0
  151. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  152. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +46 -6
  153. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
  154. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +5 -1
  155. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  156. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +18 -0
  157. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
  158. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.js +2 -2
  159. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.js.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  161. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js +13 -1
  162. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/JSHandle.js +2 -2
  164. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/JSHandle.js.map +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +7 -2
  166. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  167. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +43 -7
  168. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  169. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.d.ts +10 -1
  170. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.d.ts.map +1 -1
  171. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.js +34 -4
  172. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.js.map +1 -1
  173. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Cookie.d.ts +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Cookie.d.ts.map +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +1 -1
  176. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js.map +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/XPathQuerySelector.js +1 -1
  180. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/XPathQuerySelector.js.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  182. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +1 -0
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -0
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +4 -0
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js +2 -2
  192. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js.map +1 -1
  193. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  194. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  195. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  196. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  197. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +129 -3
  199. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +233 -65
  200. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +35 -0
  201. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
  202. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js +19 -0
  203. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
  204. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts +16 -1
  205. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
  206. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
  207. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +1 -1
  208. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js +1 -1
  209. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +21 -0
  210. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  211. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +6 -0
  212. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  213. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.d.ts +13 -1
  214. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.d.ts.map +1 -1
  215. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.js +56 -36
  216. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.js.map +1 -1
  217. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +2 -2
  218. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
  219. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +30 -6
  220. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
  221. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +5 -1
  222. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  223. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +32 -2
  224. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
  225. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts +3 -2
  226. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
  227. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +20 -0
  228. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
  229. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +2 -1
  230. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  231. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +25 -8
  232. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  233. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.d.ts +2 -0
  234. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  235. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js +23 -0
  236. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js.map +1 -1
  237. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +3 -2
  238. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  239. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +10 -6
  240. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  241. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
  242. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js +1 -1
  243. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js.map +1 -1
  244. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts +29 -0
  245. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  246. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +46 -6
  247. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
  248. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +5 -1
  249. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  250. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +19 -1
  251. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
  252. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.js +3 -3
  253. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.js.map +1 -1
  254. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  255. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js +14 -2
  256. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
  257. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/JSHandle.js +3 -3
  258. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/JSHandle.js.map +1 -1
  259. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +7 -2
  260. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  261. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +43 -8
  262. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  263. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.d.ts +10 -1
  264. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.d.ts.map +1 -1
  265. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.js +31 -3
  266. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.js.map +1 -1
  267. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Cookie.d.ts +1 -1
  268. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Cookie.d.ts.map +1 -1
  269. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +1 -1
  270. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts.map +1 -1
  271. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +1 -1
  272. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js.map +1 -1
  273. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/XPathQuerySelector.js +1 -1
  274. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/XPathQuerySelector.js.map +1 -1
  275. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  276. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +1 -0
  277. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
  278. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  279. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -0
  280. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
  281. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +4 -0
  282. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  283. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
  284. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js +2 -2
  285. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js.map +1 -1
  286. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  287. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  288. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  289. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  290. package/front_end/third_party/puppeteer/package/lib/types.d.ts +129 -3
  291. package/front_end/third_party/puppeteer/package/package.json +4 -4
  292. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +46 -0
  293. package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +21 -0
  294. package/front_end/third_party/puppeteer/package/src/api/Frame.ts +1 -1
  295. package/front_end/third_party/puppeteer/package/src/api/Page.ts +23 -0
  296. package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +88 -56
  297. package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +33 -8
  298. package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +61 -3
  299. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +23 -2
  300. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +29 -8
  301. package/front_end/third_party/puppeteer/package/src/bidi/core/Browser.ts +30 -0
  302. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +13 -2
  303. package/front_end/third_party/puppeteer/package/src/bidi/core/UserContext.ts +1 -0
  304. package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +85 -8
  305. package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +36 -1
  306. package/front_end/third_party/puppeteer/package/src/cdp/ExecutionContext.ts +5 -5
  307. package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +23 -2
  308. package/front_end/third_party/puppeteer/package/src/cdp/JSHandle.ts +3 -3
  309. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +60 -8
  310. package/front_end/third_party/puppeteer/package/src/cdp/utils.ts +36 -3
  311. package/front_end/third_party/puppeteer/package/src/common/Cookie.ts +1 -1
  312. package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
  313. package/front_end/third_party/puppeteer/package/src/injected/XPathQuerySelector.ts +1 -1
  314. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +1 -0
  315. package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +2 -0
  316. package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +4 -0
  317. package/front_end/third_party/puppeteer/package/src/node/PuppeteerNode.ts +8 -6
  318. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  319. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  320. package/front_end/ui/components/suggestion_input/SuggestionInput.ts +12 -7
  321. package/front_end/ui/components/text_editor/AutocompleteHistory.ts +2 -1
  322. package/front_end/ui/components/text_editor/TextEditorHistory.ts +1 -1
  323. package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -1
  324. package/front_end/ui/legacy/ListControl.ts +27 -1
  325. package/front_end/ui/legacy/ListWidget.ts +1 -1
  326. package/front_end/ui/legacy/SearchableView.ts +5 -2
  327. package/front_end/ui/legacy/SoftContextMenu.ts +1 -2
  328. package/front_end/ui/legacy/Treeoutline.ts +1 -2
  329. package/front_end/ui/legacy/UIUtils.ts +17 -7
  330. package/front_end/ui/legacy/Widget.ts +15 -0
  331. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +8 -4
  332. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +50 -1
  333. package/front_end/ui/legacy/components/data_grid/ViewportDataGrid.ts +2 -1
  334. package/front_end/ui/legacy/components/data_grid/data_grid.ts +1 -0
  335. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -1
  336. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +4 -2
  337. package/front_end/ui/visual_logging/KnownContextValues.ts +15 -0
  338. package/inspector_overlay/main.ts +18 -3
  339. package/inspector_overlay/tool_green_dev_anchors.css +54 -0
  340. package/inspector_overlay/tool_green_dev_anchors.ts +164 -0
  341. package/inspector_overlay/tool_persistent.ts +14 -0
  342. package/mcp/mcp.ts +1 -0
  343. package/package.json +1 -1
  344. package/docs/contributing/design.md +0 -166
  345. package/docs/design_guidelines.md +0 -1
  346. package/front_end/panels/security/CookieControlsTreeElement.ts +0 -21
  347. package/front_end/panels/security/CookieControlsView.ts +0 -447
  348. package/front_end/panels/security/CookieReportTreeElement.ts +0 -21
  349. package/front_end/panels/security/CookieReportView.ts +0 -549
  350. package/front_end/panels/security/cookieControlsView.css +0 -139
  351. package/front_end/panels/security/cookieReportView.css +0 -90
@@ -0,0 +1,51 @@
1
+ # Creating or Migrating a Model in DevTools
2
+
3
+ This guide outlines the standard procedure for creating a new model or migrating an existing one to `front_end/models/`.
4
+
5
+ ## 0. Preparation (Before you start)
6
+ * **Baseline:** Run existing tests for the code you are moving to ensure they pass *before* you touch anything.
7
+ * `npm run test -- front_end/<old_location>`
8
+ * **Impact Analysis:** Search for usages of the class/file to understand the scope of refactoring.
9
+ * `grep -r "ClassName" front_end/`
10
+
11
+ ## 1. File Structure
12
+ * **Location:** `front_end/models/<model_name>/` (must be lowercase).
13
+ * **Entrypoint:** Create a barrel file `front_end/models/<model_name>/<model_name>.ts` that exports the model's public API.
14
+ * **Implementation:** The actual logic goes in `<ClassName>.ts`.
15
+ * **Tests:** Unit tests go in `<ClassName>.test.ts` alongside the implementation.
16
+
17
+ ## 2. Build Configuration (`BUILD.gn`)
18
+ Every model requires a `BUILD.gn` file in its directory with three specific targets:
19
+
20
+ 1. **`devtools_module("<model_name>")`**: Lists implementation source files (`sources`) and dependencies (`deps`).
21
+ * **Crucial:** Do NOT include the barrel file (`<model_name>.ts`) in `sources`.
22
+ 2. **`devtools_entrypoint("bundle")`**: Defines the barrel file (`entrypoint = "<model_name>.ts"`).
23
+ * **Crucial:** Must depend on the module target: `deps = [ ":<model_name>" ]`.
24
+ 3. **`ts_library("unittests")`**: Lists test files and test-only dependencies.
25
+ * **Crucial:** Must depend on the bundle: `deps = [ ":bundle" ]`.
26
+
27
+ ## 3. Global Registration (Crucial)
28
+ The build system does not auto-detect new modules. You must manually register them in **`config/gni/devtools_grd_files.gni`**:
29
+
30
+ * **Bundled (Release) Build:** Add the new barrel file path (e.g., `front_end/models/<model_name>/<model_name>.js`) to the `grd_files_bundled_sources` list.
31
+ * **Unbundled (Debug) Build:** Add all other implementation files (e.g., `front_end/models/<model_name>/<ClassName>.js`) to the `grd_files_unbundled_sources` list.
32
+ * **Test Runner:** Add the new model's unittest target (e.g., `models/<model_name>:unittests`) to the `deps` list in **`front_end/BUILD.gn`**.
33
+
34
+ ## 4. Refactoring Imports & Exports
35
+ * **Consumers:** Update all files importing the model to use the new entrypoint:
36
+ `import * as ModelName from '../../models/<model_name>/<model_name>.js';`
37
+ * **Old Barrel File (Migration only):** If moving a file, **remove** its export from the original directory's barrel file (e.g., `front_end/panels/elements/elements.ts`).
38
+ * **Internal Imports:** Files *within* the model directory must import each other via relative paths (e.g., `./OtherClass.js`), **never** via the model's own barrel file.
39
+
40
+ ## 5. Verification Checklist
41
+ 1. **Build:** `autoninja -C out/Default` (Ensures BUILD.gn and GRD files are correct).
42
+ 2. **Lint:** `npm run lint` (Checks style and formatting).
43
+ 3. **Test:**
44
+ * `npm run test -- front_end/models/<model_name>` (New tests).
45
+ * `npm run test -- front_end/<old_location>` (Regression check for previous owner).
46
+
47
+ ## Common Pitfalls
48
+ * **Circular Dependencies:** Occur when internal files import from the directory's own barrel file.
49
+ * **Missing Tests:** Failing to add the target to `front_end/BUILD.gn` means tests exist but never run.
50
+ * **Legacy Exports:** Forgetting to remove the class from the old location's `files` or `exports` allows old patterns to persist.
51
+ * **Build Errors:** Including the barrel file in `devtools_module` sources causes duplicate definition errors.
@@ -0,0 +1,144 @@
1
+ # Workflow: Merging a DevTools Submodule into its Parent
2
+
3
+ This document outlines the process for merging a submodule (e.g., `panels/timeline/extensions`) into its parent module (e.g., `panels/timeline`) within the DevTools build system. The goal is to simplify the build configuration by consolidating `BUILD.gn` files while keeping the original source file directory structure.
4
+
5
+ ## Prerequisites
6
+
7
+ You will need the following information:
8
+ - **Parent Module Path:** The path to the directory containing the primary module.
9
+ - **Child Module Path:** The path to the directory of the submodule to be merged.
10
+
11
+ ## Workflow Steps
12
+
13
+ ### 1. Analyze Build Configurations
14
+
15
+ Read the contents of the `BUILD.gn` file from both the child module and the parent module. Identify the following from the child's `BUILD.gn`:
16
+ - The list of `sources` in the `devtools_module`.
17
+ - The list of `deps` (dependencies) in the `devtools_module`.
18
+ - The `entrypoint` for the `devtools_entrypoint("bundle")`.
19
+
20
+ ### 2. Modify the Parent `BUILD.gn`
21
+
22
+ Edit the `BUILD.gn` file in the parent module's directory to incorporate the child module's configuration.
23
+
24
+ 1. **Add Child's Sources:** Append the list of `sources` from the child's `devtools_module` to the parent's `sources` list. Remember to maintain the relative path from the parent's directory (e.g., `extensions/ExtensionUI.ts`).
25
+ 2. **Merge Dependencies:** Add the `deps` from the child's `devtools_module` to the parent's `deps` list. Remove any duplicate entries.
26
+ 3. **Remove Child Bundle Dependency:** Delete the dependency on the child's bundle from the parent's `deps` list (e.g., remove `./extensions:bundle`).
27
+
28
+ ### 3. Delete the Child `BUILD.gn`
29
+
30
+ Once the parent `BUILD.gn` is updated and contains all the necessary information, the child's `BUILD.gn` is no longer needed. Delete it.
31
+
32
+ ```bash
33
+ rm <child_module_path>/BUILD.gn
34
+ ```
35
+
36
+ ### 4. Update `devtools_grd_files.gni`
37
+
38
+ The global `.gni` file that lists all resources needs to be updated to reflect that the child module is no longer a separate, bundled entrypoint.
39
+
40
+ 1. **Locate and Read the File:** Open `config/gni/devtools_grd_files.gni`.
41
+ 2. **Remove Bundled Source:** Find and remove the line for the child's bundled JavaScript file from the `grd_files_bundled_sources` list. This path usually corresponds to the child's `entrypoint`.
42
+ 3. **Add Unbundled Sources:** Add the paths to all of the child's original TypeScript source files (`.ts`) to the `grd_files_unbundled_sources` list.
43
+
44
+ ---
45
+
46
+ ## Example: Merging `panels/timeline/extensions` into `panels/timeline`
47
+
48
+ - **Parent Module:** `panels/timeline`
49
+ - **Child Module:** `panels/timeline/extensions`
50
+
51
+ ### 1. `panels/timeline/BUILD.gn` Modification
52
+
53
+ **Before:**
54
+ ```gni
55
+ devtools_module("timeline") {
56
+ sources = [
57
+ ...
58
+ "UIDevtoolsUtils.ts",
59
+ ]
60
+
61
+ deps = [
62
+ ...
63
+ "./components:bundle",
64
+ "./extensions:bundle",
65
+ "./overlays:bundle",
66
+ ...
67
+ ]
68
+ }
69
+ ```
70
+
71
+ **After:**
72
+ ```gni
73
+ devtools_module("timeline") {
74
+ sources = [
75
+ ...
76
+ "UIDevtoolsUtils.ts",
77
+ "extensions/ExtensionUI.ts", # Added from child
78
+ ]
79
+
80
+ deps = [
81
+ ...
82
+ "./components:bundle",
83
+ # "./extensions:bundle", # Removed
84
+ "./overlays:bundle",
85
+ ...
86
+ # Dependencies from extensions/BUILD.gn are merged here
87
+ "../../../ui/components/helpers:bundle",
88
+ "../../../ui/components/render_coordinator:bundle",
89
+ "../../../ui/legacy:bundle",
90
+ ]
91
+ }
92
+ ```
93
+
94
+ ### 2. `panels/timeline/extensions/BUILD.gn` Deletion
95
+
96
+ ```bash
97
+ rm front_end/panels/timeline/extensions/BUILD.gn
98
+ ```
99
+
100
+ ### 3. `config/gni/devtools_grd_files.gni` Modification
101
+
102
+ **Before:**
103
+ ```gni
104
+ grd_files_bundled_sources = [
105
+ ...
106
+ "front_end/panels/timeline/components/components.js",
107
+ "front_end/panels/timeline/extensions/extensions.js",
108
+ "front_end/panels/timeline/overlays/overlays.js",
109
+ ...
110
+ ]
111
+
112
+ grd_files_unbundled_sources = [
113
+ ...
114
+ "front_end/panels/timeline/extensions/ExtensionUI.ts", # This might not have been present before
115
+ ...
116
+ ]
117
+ ```
118
+
119
+ **After:**
120
+ ```gni
121
+ grd_files_bundled_sources = [
122
+ ...
123
+ "front_end/panels/timeline/components/components.js",
124
+ # "front_end/panels/timeline/extensions/extensions.js", # Removed
125
+ "front_end/panels/timeline/overlays/overlays.js",
126
+ ...
127
+ ]
128
+
129
+ grd_files_unbundled_sources = [
130
+ ...
131
+ "front_end/panels/timeline/extensions/extensions.ts", # Added
132
+ "front_end/panels/timeline/extensions/ExtensionUI.ts", # Added
133
+ ...
134
+ ]
135
+ ```
136
+
137
+ ## Removing Barrel Files
138
+
139
+ After merging modules, you may still have remaining barrel files (e.g. `index.ts` or `extensions.ts` that just re-export other files). These should be removed to simplify the module structure.
140
+
141
+ Manually updating all imports that rely on these barrels can be tedious and error-prone. The tool [unbarrelify](https://github.com/webpro/unbarrelify) can automate this process. It analyzes your codebase and replaces imports from barrel files with direct imports from the source files.
142
+
143
+ **Usage:**
144
+ Follow the instructions in the [unbarrelify repository](https://github.com/webpro/unbarrelify) to install and run the tool on your project. This is highly recommended to complete the refactoring process efficiently.
@@ -0,0 +1,351 @@
1
+ ## UI Widget Framework Guide (MVP Architecture)
2
+
3
+ Adhere strictly to the Model-View-Presenter (MVP) architecture.
4
+
5
+ * **Models** (`front_end/models/`): Handle business logic and application state. MUST NOT have knowledge of the UI.
6
+ * **Presenters (`Widget`)**: Orchestrate data flow, manage UI-specific state, and handle interactions.
7
+ * **Views (`function`)**: Purely presentational. Stateless functions that receive data/callbacks and render using `lit-html`.
8
+
9
+ **Refactoring Note:** When refactoring legacy widgets to this framework, the widget's class name MUST NOT be changed. If you're refactoring a UI piece that uses shadow root (e.g. custom HTMLElements) to a Widget, make sure to update its styles to wrap the rules with a `@scope to (devtools-widget > *)` rule.
10
+
11
+ ### Presenter (`Widget`) Rules
12
+
13
+ * Location: Co-located in the same file as its View.
14
+ * MUST extend a base `UI.Widget` class (e.g., `UI.Widget.Widget`). Note that `UI.Widget.Widget` is not an `HTMLElement` and must be appended via `.show()` or `<devtools-widget>`.
15
+ * Constructor MUST assign the injected view function to a private `#view` field.
16
+ * Constructor MUST call `super()`. If taking `element?: HTMLElement`, pass it to `super(element)`. `super(true)` is forbidden.
17
+ * Styling MUST be handled within the View. `this.registerCSSFiles()` is forbidden.
18
+ * Initial render MUST be triggered in `override wasShown(): void` by calling `this.requestUpdate()`.
19
+ * MUST hold all UI state as private class fields (e.g., `#counter`).
20
+ * To schedule a UI update, MUST call `this.requestUpdate()`. `performUpdate()` MUST NOT be called directly.
21
+
22
+ ### View (`function`) Rules
23
+
24
+ * MUST be a pure function, typically named `DEFAULT_VIEW`, in the same file as the Presenter.
25
+ * MUST use the signature: `(input: ViewInput, output: ViewOutput, target: HTMLElement)`.
26
+ * `input`: Data and event handlers from the Presenter.
27
+ * `output`: Callbacks for imperative actions (e.g., focus) provided to the Presenter. If unused, the `output` parameter should be typed as `undefined` in the view's signature, and `undefined` should be passed from the presenter.
28
+ * `target`: The HTML element to render into.
29
+ * The `input` parameter MUST NOT be destructured. Always use `input.propertyName`.
30
+ * Responsibility: Render a `lit-html` template into `target`.
31
+ * MUST NOT hold state, fetch data, or perform business logic.
32
+
33
+ #### Helper Functions in Views
34
+
35
+ Complex views can be broken down using helper functions defined inside `DEFAULT_VIEW` to access `input` and `output`.
36
+
37
+ ```ts
38
+ // clang-format off
39
+ const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLElement): void => {
40
+ const renderHeader = (): Lit.LitTemplate => {
41
+ return html`<h1>${input.title}</h1>`;
42
+ };
43
+ // ...
44
+ render(html`
45
+ <div class="child-widget">
46
+ ${renderHeader()}
47
+ </div>
48
+ `, target);
49
+ };
50
+ // clang-format on
51
+ ```
52
+
53
+ ### Composition (`<devtools-widget>`)
54
+
55
+ * To render a child widget, the parent's View MUST use `<devtools-widget>`.
56
+ * Configuration is passed via the `.widgetConfig` property using `UI.Widget.widgetConfig()`.
57
+ * Properties passed from a parent MUST be declared as public fields on the child presenter class.
58
+ * The framework automatically updates these properties and calls `requestUpdate()` on the child when the parent re-renders.
59
+
60
+ ## Refactoring Legacy Components
61
+
62
+ When migrating imperative components (extending `UI.VBox`, `UI.Panel`, or `HTMLElement`) to the MVP architecture:
63
+
64
+ 1. **Analyze Rendering Logic:** Identify where DOM is created (constructor, `wasShown`, imperative methods). This logic moves to the `DEFAULT_VIEW`.
65
+ 2. **Convert Base Class:**
66
+ * Prefer extending `UI.Widget.Widget`.
67
+ * **Special Case:** If the component *must* extend `UI.Panel.Panel` or `UI.Dialog.Dialog` (to retain specific functionality), you cannot use `requestUpdate()`. Instead, call `this.performUpdate()` directly on state changes.
68
+ 3. **State Migration:** Move DOM-stored state to private class fields.
69
+ 4. **Update Usage:** Replace `new MyComponent()` instantiations with declarative `<devtools-widget .widgetConfig=...>` in parent templates.
70
+ 5. **Scoping Styles:** Ensure your CSS file uses the `@scope` block to prevent style leaks:
71
+ ```css
72
+ @scope to (devtools-widget > *) {
73
+ ...
74
+ }
75
+ ```
76
+
77
+ ## Key Implementation Details (Gotchas)
78
+
79
+ ### Styling Strategy
80
+ DevTools widgets typically render into Light DOM (the default for `UI.Widget`). To ensure styles are scoped to the component and do not leak into child widgets, wrap your CSS in an `@scope` block:
81
+
82
+ ```css
83
+ /* myWidget.css */
84
+ @scope to (devtools-widget > *) {
85
+ .my-class { ... }
86
+ }
87
+ ```
88
+
89
+ Then, include the styles in your `DEFAULT_VIEW`:
90
+
91
+ ```ts
92
+ import myWidgetStyles from './myWidget.css.js';
93
+ // ...
94
+ render(html`
95
+ <style>${myWidgetStyles}</style>
96
+ <div class="my-widget">...</div>
97
+ `, target);
98
+ ```
99
+
100
+ **Note:** The `{host: input}` option in `render()` is generally **not required** unless you are using specific Shadow DOM patterns that necessitate it. The `@scope` strategy is the preferred method for style isolation in DevTools widgets.
101
+
102
+ ### Legacy Interop & Refs
103
+ * **Raw Elements:** Use `Lit.Directives.ref` to obtain a reference to a raw `HTMLElement` if needed for imperative APIs (e.g., `splitWidget.installResizer(element)`).
104
+ * **Child Widgets:** Use `UI.Widget.widgetRef` to obtain the class instance of a child `<devtools-widget>` if you need to call methods on it directly (though declarative data flow is preferred).
105
+
106
+ ### Dependencies
107
+ The `DEFAULT_VIEW` is typically a module-level function. Ensure all dependencies (enums, constants, other components) are imported at the top of the file so they are available in the function scope.
108
+
109
+ ## Step-by-Step Implementation Example
110
+
111
+ ### 1\. Create the Widget File and Styles
112
+
113
+ Example: `front_end/panels/my_example/MyExampleWidget.ts`.
114
+
115
+ ```css
116
+ /* front_end/panels/my_example/myExampleWidget.css */
117
+ @scope to (devtools-widget > *) {
118
+ p {
119
+ color: blue;
120
+ }
121
+ }
122
+ ```
123
+
124
+ ```ts
125
+ // front_end/panels/my_example/MyExampleWidget.ts
126
+
127
+ import * as Lit from '../../ui/lit/lit.js';
128
+ import * as UI from '../../ui/legacy/legacy.js';
129
+
130
+ import myExampleWidgetStyles from './myExampleWidget.css.js';
131
+
132
+ const {html, render, ref} = Lit;
133
+
134
+ // 1. Define Input data shape. (Assuming Child Widget configuration for completeness)
135
+ export interface ViewInput {
136
+ title: string;
137
+ counter: number;
138
+ onButtonClick: () => void;
139
+ }
140
+
141
+ // 2. Define Output imperative API shape.
142
+ export interface ViewOutput {
143
+ focusButton?: () => void;
144
+ }
145
+
146
+ // 3. Define the View function.
147
+ // clang-format off
148
+ const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLElement): void => {
149
+ render(html`
150
+ <style>${myExampleWidgetStyles}</style>
151
+ <div class="child-widget">
152
+ <h3>${input.title}</h3>
153
+ <p>Counter: ${input.counter}</p>
154
+ <button @click=${input.onButtonClick} ${ref(el => {
155
+ if (el) {
156
+ output.focusButton = () => el.focus();
157
+ }
158
+ })}>Increment</button>
159
+ </div>
160
+ `, target);
161
+ };
162
+ // clang-format on
163
+
164
+ // 4. Type alias for the view.
165
+ type View = typeof DEFAULT_VIEW;
166
+
167
+ // 5. Define the Presenter.
168
+ export class MyExampleWidget extends UI.Widget.Widget {
169
+ #counter: number = 0;
170
+
171
+ // Public field REQUIRED to receive data from a parent.
172
+ title: string = 'Default Title';
173
+
174
+ #view: View;
175
+ #viewOutput: ViewOutput = {};
176
+
177
+ constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
178
+ super(element);
179
+ this.#view = view;
180
+ }
181
+
182
+ override wasShown(): void {
183
+ super.wasShown();
184
+ // Initial render trigger.
185
+ this.requestUpdate();
186
+ }
187
+
188
+ focus(): void {
189
+ this.#viewOutput.focusButton?.();
190
+ }
191
+
192
+ #handleButtonClick = (): void => {
193
+ this.#counter++;
194
+ this.requestUpdate();
195
+ }
196
+
197
+ override performUpdate(): void {
198
+ const viewInput = {
199
+ title: this.title,
200
+ counter: this.#counter,
201
+ onButtonClick: this.#handleButtonClick,
202
+ };
203
+ this.#view(viewInput, this.#viewOutput, this.contentElement);
204
+ }
205
+ }
206
+ ```
207
+
208
+ ### 2\. Compose Widgets (Parent Widget)
209
+
210
+ Example: `front_end/panels/parent/ParentWidget.ts`. Demonstrates passing state via `widgetConfig` and a view with no `output`.
211
+
212
+ ```ts
213
+ // front_end/panels/parent/ParentWidget.ts
214
+
215
+ import * as Lit from '../../ui/lit/lit.js';
216
+ import * as UI from '../../ui/legacy/legacy.js';
217
+ import {MyExampleWidget} from '../my_example/MyExampleWidget.ts';
218
+
219
+ import parentWidgetStyles from './parentWidgetStyles.css';
220
+
221
+ const {html, render} = Lit;
222
+ const {widgetConfig} = UI.Widget;
223
+
224
+ interface ViewInput {
225
+ title: string;
226
+ onTitleChange: () => void;
227
+ }
228
+
229
+ // Parent View
230
+ // clang-format off
231
+ const DEFAULT_VIEW = (input: ViewInput, output: undefined, target: HTMLElement): void => {
232
+ render(html`
233
+ <style>${parentWidgetStyles}</style>
234
+ <div class="parent-container">
235
+ <h1>Parent Widget</h1>
236
+ <button @click=${input.onTitleChange}>Change Child Title</button>
237
+
238
+ <!-- Pass properties to the child widget. -->
239
+ <devtools-widget .widgetConfig=${widgetConfig(MyExampleWidget, {title: input.title})}>
240
+ </devtools-widget>
241
+ </div>
242
+ `, target);
243
+ };
244
+ // clang-format on
245
+
246
+ type View = typeof DEFAULT_VIEW;
247
+
248
+ // Parent Presenter
249
+ export class ParentWidget extends UI.Widget.Widget {
250
+ #childTitle: string = 'Initial Title';
251
+ #view: View;
252
+
253
+ constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
254
+ super(element);
255
+ this.#view = view;
256
+ }
257
+
258
+ override wasShown(): void {
259
+ super.wasShown();
260
+ this.requestUpdate();
261
+ }
262
+
263
+ #handleChangeTitleClick = () => {
264
+ this.#childTitle = `Title set at ${new Date().toLocaleTimeString()}`;
265
+ this.requestUpdate();
266
+ }
267
+
268
+ override performUpdate(): void {
269
+ this.#view({
270
+ title: this.#childTitle,
271
+ onTitleChange: this.#handleChangeTitleClick,
272
+ }, undefined, this.contentElement);
273
+ }
274
+ }
275
+ ```
276
+
277
+ ### 3\. Testing Widgets
278
+
279
+ Testing focuses on the Presenter's logic. The View MUST be replaced by a stub using `createViewFunctionStub`.
280
+
281
+ * **`describeWithEnvironment`**: Sets up the testing environment.
282
+ * **`createViewFunctionStub`**: Stubs the view to capture `input` data.
283
+ * **`renderElementIntoDOM`**: Attaches the widget to the DOM to trigger lifecycle methods (like `wasShown`).
284
+ * **`view.nextInput`**: A promise that resolves with the next `input` when the widget re-renders.
285
+ * **Simulating Events**: Invoke callbacks directly (e.g., `view.input.onButtonClick()`), do not interact with the DOM.
286
+
287
+ ```ts
288
+ // front_end/panels/my_example/MyExampleWidget.test.ts
289
+
290
+ import {
291
+ renderElementIntoDOM,
292
+ } from '../../testing/DOMHelpers.js';
293
+ import {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';
294
+ import {createViewFunctionStub} from '../../testing/ViewFunctionHelpers.js';
295
+ import * as UI from '../../ui/legacy/legacy.js';
296
+
297
+ import * as MyExampleWidget from './MyExampleWidget.js';
298
+
299
+ const {MyExampleWidget} = MyExampleWidget;
300
+
301
+ describeWithEnvironment('MyExampleWidget', () => {
302
+ // Helper to set up the widget with a stubbed view.
303
+ async function createWidget() {
304
+ // 1. Stub the view function.
305
+ const view = createViewFunctionStub(MyExampleWidget);
306
+
307
+ // 2. Instantiate the widget, injecting the stub.
308
+ const widget = new MyExampleWidget(undefined, view);
309
+
310
+ // 3. Render the widget into the DOM (triggers `wasShown`).
311
+ widget.markAsRoot();
312
+ renderElementIntoDOM(widget);
313
+
314
+ // 4. Wait for the initial render.
315
+ await view.nextInput;
316
+
317
+ return {view, widget};
318
+ }
319
+
320
+ it('renders with initial state', async () => {
321
+ const {view} = await createWidget();
322
+ assert.strictEqual(view.input.counter, 0);
323
+ });
324
+
325
+ it('increments counter on button click', async () => {
326
+ const {view} = await createWidget();
327
+
328
+ // Simulate the click by invoking the callback.
329
+ view.input.onButtonClick();
330
+
331
+ // Wait for the re-render.
332
+ const finalInput = await view.nextInput;
333
+
334
+ assert.strictEqual(finalInput.counter, 1);
335
+ });
336
+
337
+ it('updates its title when a new one is passed in', async () => {
338
+ const {view, widget} = await createWidget();
339
+
340
+ widget.title = 'New Test Title';
341
+ widget.requestUpdate();
342
+
343
+ const finalInput = await view.nextInput;
344
+ assert.strictEqual(finalInput.title, 'New Test Title');
345
+ });
346
+ });
347
+ ```
348
+
349
+ ## Improving this Guide
350
+
351
+ This document is a living guide. If you find that the instructions are incomplete, lead to errors, or could be improved, please suggest updates. Your goal is to make this guide as helpful as possible for both human developers and your future AI counterparts.
@@ -17,7 +17,8 @@
17
17
 
18
18
  ## Linting
19
19
 
20
- - `npm run lint` will execute ESLint and StyleLint and report any violations that must be fixed.
20
+ - `npm run lint` will execute ESLint and StyleLint. It will report any violations and automatically fix them where possible.
21
+ - To run the linter on a specific file or directory, you can run `npm run lint -- <PATH>` where `PATH` is a path to a file or directory. This will also automatically fix violations where possible.
21
22
 
22
23
  ## Best practices
23
24
 
@@ -6,12 +6,11 @@ This page assumes a working Chromium DevTools [checkout and build](../get_the_co
6
6
 
7
7
  1. [Quick Start](#Quick-Start)
8
8
  2. [IDE Setup](#IDE-Setup)
9
- 3. [Design Documents](./design.md)
10
- 4. [Contributing changes](./changes.md)
11
- 5. [Issues Guidelines](./issues.md)
12
- 6. [Settings, Experiments, and Features](./settings-experiments-features.md)
13
- 7. [Infrastructure](./infrastructure.md)
14
- 8. [Legal Stuff](#Legal-Stuff)
9
+ 3. [Contributing changes](./changes.md)
10
+ 4. [Issues Guidelines](./issues.md)
11
+ 5. [Settings, Experiments, and Features](./settings-experiments-features.md)
12
+ 6. [Infrastructure](./infrastructure.md)
13
+ 7. [Legal Stuff](#Legal-Stuff)
15
14
 
16
15
 
17
16
  ## Quick Start
@@ -1,8 +1,7 @@
1
1
  # Contributing changes to Chromium DevTools
2
2
 
3
3
  See [Get the Code](../get_the_code.md) for details on how to checkout the code,
4
- and [Design Documents](design.md) for information regarding our design process.
5
- Also check out [Contributing to
4
+ and check out [Contributing to
6
5
  Chromium](https://chromium.googlesource.com/chromium/src/+/main/docs/contributing.md)
7
6
  for general information how to contribute to any Chromium project (including
8
7
  its developer tools).
@@ -0,0 +1,14 @@
1
+ # HTML Edit View in Elements Tree
2
+
3
+ ## Overview
4
+ The HTML Edit View allows developers to freely edit the HTML of a DOM node directly in the Elements panel. When active, it replaces the standard tree item representation with a fully functional CodeMirror editor instance.
5
+
6
+ ## Requirements
7
+ 1. **Triggering**: Users can trigger the HTML edit view via keyboard shortcuts (`F2` on a selected node), or via the Context Menu ("Edit as HTML").
8
+ 2. **Editor UI**: When activated, the tree element's inline attributes, tags, and descendant nodes are hidden. A CodeMirror editor instance is shown in place of the node.
9
+ 3. **Behavior**:
10
+ - The editor is populated with the node's `outerHTML` (or relevant subset).
11
+ - It supports syntax highlighting, auto-completion of tags, and proper indentation.
12
+ - If the user clicks outside the editor or presses `Cmd+Enter` / `Ctrl+Enter`, the edit is committed.
13
+ - If the user presses `Escape`, the edit is aborted.
14
+ 4. **State Management**: Upon committing or aborting, the tree element restores its standard view, and any updated DOM state is reflected.
@@ -0,0 +1,46 @@
1
+ # Requirements Specification: Elements Panel Tree Node Title
2
+
3
+ ## 1. Overview
4
+ The Elements panel represents the DOM tree as a collection of nodes. Each node's primary visual representation—its "title"—is a dynamic string of text, interactive links, and syntax-highlighted code. This specification documents the expected user-facing behaviors of the node title rendering across various DOM node types, ensuring a rich, interactive, and accurate representation of the document structure.
5
+
6
+ ## 2. Node Types and Rendering Rules
7
+
8
+ ### 2.1 Element Nodes (`Node.ELEMENT_NODE`)
9
+ Element nodes are the most common nodes in the tree. Their rendering depends on their state:
10
+ * **Standard Tags**: Rendered as `<tagName attribute="value">` for opening tags and `</tagName>` for closing tags. The tag names are syntax-highlighted.
11
+ * **Pseudo-Elements**: Rendered as `::pseudo-element-name(identifier)`.
12
+ * **Inline Text Nodes**: If an element contains only a text node and no other children (e.g., `<div>Hello</div>`), it is rendered entirely on one line: `<tagName>Hello</tagName>`. The text content has its whitespace collapsed, and HTML entities are syntax-highlighted.
13
+ * **Collapsed Expandable Elements**: When an element with children is collapsed, the title renders the opening tag, a clickable expand button (`▶`), a visually hidden `…` (for accessibility and layout tests), and the closing tag, all on one line.
14
+
15
+ ### 2.2 Attributes
16
+ Attributes within Element nodes have complex interactive behaviors:
17
+ * **Formatting**: Rendered natively as `name="value"`. If an attribute has no value, the `="value"` part is omitted unless explicitly forced.
18
+ * **HTML Entities**: Unicode sequences and entities within attribute values are syntax-highlighted.
19
+ * **Linkification (URLs)**: Values of `src` and `href` attributes, as well as complex `srcset` definitions in `<img>`, `<source>`, and `<image>` tags, are automatically detected. They are rendered as clickable links that open the resource or show an image preview popover on hover.
20
+ * **Linkification (DOM Relations)**: Attributes that establish DOM relationships (`popovertarget`, `interesttarget`, `commandfor`) are parsed. Their values are rendered as clickable links that, when clicked, reveal the target DOM node in the Elements panel. Tooltips will read: "Reveal Popover Target", "Reveal Interest Target", or "Reveal Command For Target" respectively.
21
+
22
+ ### 2.3 Text Nodes (`Node.TEXT_NODE`)
23
+ * **Standard Text**: Rendered surrounded by double quotes (`"text"`). HTML entities within the text are highlighted.
24
+ * **JavaScript inside `<script>`**: If the parent is a `<script>` tag, the text is treated as code. Quotes are omitted, whitespace is trimmed, and the content is passed through the JavaScript syntax highlighter.
25
+ * **CSS inside `<style>`**: If the parent is a `<style>` tag, the text is treated as code. Quotes are omitted, whitespace is trimmed, and the content is passed through the CSS syntax highlighter.
26
+
27
+ ### 2.4 Other Node Types
28
+ * **Comment Nodes (`Node.COMMENT_NODE`)**: Rendered exactly as `<!-- comment text -->`.
29
+ * **Doctype Nodes (`Node.DOCUMENT_TYPE_NODE`)**: Rendered in the format `<!DOCTYPE name PUBLIC "publicId" "systemId" [internalSubset]>`. Only the applicable parts of the doctype are displayed.
30
+ * **CDATA Sections (`Node.CDATA_SECTION_NODE`)**: Rendered as `<![CDATA[text]]>`.
31
+ * **Document Nodes (`Node.DOCUMENT_NODE`)**: Rendered as `#document (url)` where the URL is a clickable link.
32
+ * **Document Fragments (`Node.DOCUMENT_FRAGMENT_NODE`)**: Rendered as the fragment name, with whitespace collapsed (e.g., `#document-fragment`). Shadow roots also receive specific CSS classes to indent them appropriately (`shadow-root`, `shadow-root-deep`, etc.).
33
+
34
+ ## 3. Dynamic Highlighting and Interactions
35
+
36
+ ### 3.1 DOM Update Flash (Animations)
37
+ When the DevTools backend reports a change to a node (via an `ElementUpdateRecord`), the specific portion of the title that changed must briefly flash with a purple highlight (`dom-update-highlight` CSS animation):
38
+ * If an attribute was added/modified, the attribute value flashes.
39
+ * If children were added/removed (and the element is not expanded), the tag name flashes.
40
+ * If text content changed, the text node itself flashes.
41
+
42
+ ### 3.2 Search Result Highlighting
43
+ When a user executes a search within the Elements panel (Ctrl/Cmd + F), matches found within the text representation of the node title are highlighted with a distinct yellow background span. This highlight spans across Tag names, attributes, and text values.
44
+
45
+ ### 3.3 Adorners
46
+ Specific semantic markers like `slot`, `grid`, `flex`, and `popover` markers are appended to the title but managed via a separate layout/adorner system, overlaying on the line.
@@ -16,6 +16,6 @@ user interface.
16
16
 
17
17
  ## UI reviews
18
18
  If you make changes to DevTools UI, make sure to involve us **early**, i.e. already in the
19
- UI design stage. See also the [Chrome DevTools Design Review Guidelines](../../contributing/design.md#Review-Guidelines)
19
+ UI design stage.
20
20
 
21
21
  Back to the [Chromium DevTools Documentation](../../README.md).