chrome-devtools-frontend 1.0.943182 → 1.0.944903

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 (382) hide show
  1. package/config/gni/devtools_grd_files.gni +3 -0
  2. package/front_end/core/common/ParsedURL.ts +1 -1
  3. package/front_end/core/host/InspectorFrontendHostAPI.ts +5 -5
  4. package/front_end/core/host/UserMetrics.ts +0 -1
  5. package/front_end/core/i18n/locales/af.json +455 -44
  6. package/front_end/core/i18n/locales/am.json +455 -44
  7. package/front_end/core/i18n/locales/ar.json +455 -44
  8. package/front_end/core/i18n/locales/as.json +455 -44
  9. package/front_end/core/i18n/locales/az.json +455 -44
  10. package/front_end/core/i18n/locales/be.json +456 -45
  11. package/front_end/core/i18n/locales/bg.json +455 -44
  12. package/front_end/core/i18n/locales/bn.json +455 -44
  13. package/front_end/core/i18n/locales/bs.json +455 -44
  14. package/front_end/core/i18n/locales/ca.json +457 -46
  15. package/front_end/core/i18n/locales/cs.json +458 -47
  16. package/front_end/core/i18n/locales/cy.json +455 -44
  17. package/front_end/core/i18n/locales/da.json +455 -44
  18. package/front_end/core/i18n/locales/de.json +455 -44
  19. package/front_end/core/i18n/locales/el.json +455 -44
  20. package/front_end/core/i18n/locales/en-GB.json +449 -38
  21. package/front_end/core/i18n/locales/en-US.json +10 -34
  22. package/front_end/core/i18n/locales/en-XL.json +22 -46
  23. package/front_end/core/i18n/locales/es-419.json +455 -44
  24. package/front_end/core/i18n/locales/es.json +455 -44
  25. package/front_end/core/i18n/locales/et.json +455 -44
  26. package/front_end/core/i18n/locales/eu.json +462 -51
  27. package/front_end/core/i18n/locales/fa.json +455 -44
  28. package/front_end/core/i18n/locales/fi.json +455 -44
  29. package/front_end/core/i18n/locales/fil.json +454 -43
  30. package/front_end/core/i18n/locales/fr-CA.json +455 -44
  31. package/front_end/core/i18n/locales/fr.json +456 -45
  32. package/front_end/core/i18n/locales/gl.json +455 -44
  33. package/front_end/core/i18n/locales/gu.json +456 -45
  34. package/front_end/core/i18n/locales/he.json +455 -44
  35. package/front_end/core/i18n/locales/hi.json +455 -44
  36. package/front_end/core/i18n/locales/hr.json +455 -44
  37. package/front_end/core/i18n/locales/hu.json +455 -44
  38. package/front_end/core/i18n/locales/hy.json +455 -44
  39. package/front_end/core/i18n/locales/id.json +455 -44
  40. package/front_end/core/i18n/locales/is.json +455 -44
  41. package/front_end/core/i18n/locales/it.json +502 -91
  42. package/front_end/core/i18n/locales/ja.json +456 -45
  43. package/front_end/core/i18n/locales/ka.json +455 -44
  44. package/front_end/core/i18n/locales/kk.json +456 -45
  45. package/front_end/core/i18n/locales/km.json +455 -44
  46. package/front_end/core/i18n/locales/kn.json +455 -44
  47. package/front_end/core/i18n/locales/ko.json +455 -44
  48. package/front_end/core/i18n/locales/ky.json +456 -45
  49. package/front_end/core/i18n/locales/lo.json +454 -43
  50. package/front_end/core/i18n/locales/lt.json +455 -44
  51. package/front_end/core/i18n/locales/lv.json +458 -47
  52. package/front_end/core/i18n/locales/mk.json +455 -44
  53. package/front_end/core/i18n/locales/ml.json +461 -50
  54. package/front_end/core/i18n/locales/mn.json +455 -44
  55. package/front_end/core/i18n/locales/mr.json +455 -44
  56. package/front_end/core/i18n/locales/ms.json +455 -44
  57. package/front_end/core/i18n/locales/my.json +456 -45
  58. package/front_end/core/i18n/locales/ne.json +456 -45
  59. package/front_end/core/i18n/locales/nl.json +532 -121
  60. package/front_end/core/i18n/locales/no.json +455 -44
  61. package/front_end/core/i18n/locales/or.json +455 -44
  62. package/front_end/core/i18n/locales/pa.json +455 -44
  63. package/front_end/core/i18n/locales/pl.json +455 -44
  64. package/front_end/core/i18n/locales/pt-PT.json +504 -93
  65. package/front_end/core/i18n/locales/pt.json +454 -43
  66. package/front_end/core/i18n/locales/ro.json +455 -44
  67. package/front_end/core/i18n/locales/ru.json +455 -44
  68. package/front_end/core/i18n/locales/si.json +455 -44
  69. package/front_end/core/i18n/locales/sk.json +456 -45
  70. package/front_end/core/i18n/locales/sl.json +455 -44
  71. package/front_end/core/i18n/locales/sq.json +455 -44
  72. package/front_end/core/i18n/locales/sr-Latn.json +455 -44
  73. package/front_end/core/i18n/locales/sr.json +455 -44
  74. package/front_end/core/i18n/locales/sv.json +456 -45
  75. package/front_end/core/i18n/locales/sw.json +455 -44
  76. package/front_end/core/i18n/locales/ta.json +456 -45
  77. package/front_end/core/i18n/locales/te.json +454 -43
  78. package/front_end/core/i18n/locales/th.json +455 -44
  79. package/front_end/core/i18n/locales/tr.json +455 -44
  80. package/front_end/core/i18n/locales/uk.json +455 -44
  81. package/front_end/core/i18n/locales/ur.json +455 -44
  82. package/front_end/core/i18n/locales/uz.json +455 -44
  83. package/front_end/core/i18n/locales/vi.json +455 -44
  84. package/front_end/core/i18n/locales/zh-HK.json +459 -48
  85. package/front_end/core/i18n/locales/zh-TW.json +457 -46
  86. package/front_end/core/i18n/locales/zh.json +460 -49
  87. package/front_end/core/i18n/locales/zu.json +455 -44
  88. package/front_end/core/protocol_client/InspectorBackend.ts +4 -0
  89. package/front_end/core/protocol_client/NodeURL.ts +1 -0
  90. package/front_end/core/sdk/AccessibilityModel.ts +99 -78
  91. package/front_end/core/sdk/CSSStyleDeclaration.ts +4 -0
  92. package/front_end/core/sdk/CSSStyleSheetHeader.ts +2 -3
  93. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +2 -3
  94. package/front_end/core/sdk/Cookie.ts +17 -0
  95. package/front_end/core/sdk/CookieModel.ts +1 -0
  96. package/front_end/core/sdk/DebuggerModel.ts +5 -4
  97. package/front_end/core/sdk/NetworkManager.ts +6 -0
  98. package/front_end/core/sdk/NetworkRequest.ts +2 -2
  99. package/front_end/core/sdk/OverlayModel.ts +0 -9
  100. package/front_end/core/sdk/Resource.ts +2 -2
  101. package/front_end/core/sdk/Script.ts +2 -7
  102. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +13 -12
  103. package/front_end/core/sdk/sdk-meta.ts +0 -26
  104. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +0 -13
  105. package/front_end/entrypoints/main/MainImpl.ts +2 -4
  106. package/front_end/generated/InspectorBackendCommands.js +3 -1
  107. package/front_end/generated/protocol-mapping.d.ts +1 -0
  108. package/front_end/generated/protocol-proxy-api.d.ts +2 -0
  109. package/front_end/generated/protocol.d.ts +40 -0
  110. package/front_end/models/bindings/BreakpointManager.ts +3 -4
  111. package/front_end/models/bindings/DefaultScriptMapping.ts +1 -9
  112. package/front_end/models/bindings/ResourceMapping.ts +1 -2
  113. package/front_end/models/bindings/ResourceScriptMapping.ts +3 -11
  114. package/front_end/models/bindings/StylesSourceMapping.ts +1 -2
  115. package/front_end/models/formatter/SourceFormatter.ts +0 -15
  116. package/front_end/models/persistence/IsolatedFileSystem.ts +7 -6
  117. package/front_end/models/persistence/IsolatedFileSystemManager.ts +10 -6
  118. package/front_end/models/persistence/PersistenceActions.ts +4 -1
  119. package/front_end/models/persistence/PlatformFileSystem.ts +3 -4
  120. package/front_end/models/text_utils/ContentProvider.ts +1 -2
  121. package/front_end/models/text_utils/StaticContentProvider.ts +2 -3
  122. package/front_end/models/timeline_model/TimelineJSProfile.ts +3 -16
  123. package/front_end/models/timeline_model/TimelineModel.ts +0 -1
  124. package/front_end/models/workspace/UISourceCode.ts +2 -2
  125. package/front_end/panels/animation/animationTimeline.css +2 -0
  126. package/front_end/panels/application/ApplicationPanelCacheSection.ts +1 -1
  127. package/front_end/panels/application/BackForwardCacheView.ts +26 -26
  128. package/front_end/panels/application/ReportingApiView.ts +15 -1
  129. package/front_end/panels/application/components/EndpointsGrid.ts +63 -4
  130. package/front_end/panels/application/components/FrameDetailsView.ts +21 -34
  131. package/front_end/panels/console/ConsolePinPane.ts +1 -0
  132. package/front_end/panels/console/ConsolePrompt.ts +121 -171
  133. package/front_end/panels/console/ConsoleView.ts +1 -1
  134. package/front_end/panels/console/consoleView.css +1 -1
  135. package/front_end/panels/css_overview/cssOverviewCompletedView.css +2 -2
  136. package/front_end/panels/elements/AccessibilityTreeUtils.ts +98 -67
  137. package/front_end/panels/elements/AccessibilityTreeView.ts +76 -125
  138. package/front_end/panels/elements/ElementsPanel.ts +6 -7
  139. package/front_end/panels/elements/ElementsTreeElement.ts +1 -0
  140. package/front_end/panels/elements/StyleEditorWidget.ts +13 -2
  141. package/front_end/panels/elements/StylePropertyHighlighter.ts +29 -19
  142. package/front_end/panels/elements/StylePropertyTreeElement.ts +7 -4
  143. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  144. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +27 -3
  145. package/front_end/panels/network/NetworkDataGridNode.ts +5 -1
  146. package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
  147. package/front_end/panels/sources/BreakpointEditDialog.ts +1 -0
  148. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  149. package/front_end/panels/sources/NavigatorView.ts +1 -1
  150. package/front_end/panels/sources/Plugin.ts +0 -3
  151. package/front_end/panels/sources/UISourceCodeFrame.ts +23 -50
  152. package/front_end/panels/timeline/TimelineController.ts +0 -3
  153. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -34
  154. package/front_end/panels/timeline/TimelineUIUtils.ts +51 -3
  155. package/front_end/services/window_bounds/WindowBoundsService.ts +27 -0
  156. package/front_end/services/window_bounds/window_bounds.ts +9 -0
  157. package/front_end/third_party/codemirror.next/bundle.ts +4 -3
  158. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  159. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +39 -1
  160. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
  161. package/front_end/third_party/codemirror.next/package.json +3 -3
  162. package/front_end/third_party/lit-html/README.chromium +2 -2
  163. package/front_end/third_party/lit-html/package/CHANGELOG.md +216 -28
  164. package/front_end/third_party/lit-html/package/LICENSE +9 -9
  165. package/front_end/third_party/lit-html/package/README.md +12 -162
  166. package/front_end/third_party/lit-html/package/async-directive.d.ts +23 -54
  167. package/front_end/third_party/lit-html/package/async-directive.d.ts.map +1 -1
  168. package/front_end/third_party/lit-html/package/async-directive.js +2 -7
  169. package/front_end/third_party/lit-html/package/async-directive.js.map +1 -1
  170. package/front_end/third_party/lit-html/package/development/async-directive.d.ts +23 -54
  171. package/front_end/third_party/lit-html/package/development/async-directive.d.ts.map +1 -1
  172. package/front_end/third_party/lit-html/package/development/async-directive.js +44 -194
  173. package/front_end/third_party/lit-html/package/development/async-directive.js.map +1 -1
  174. package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts +6 -5
  175. package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts.map +1 -1
  176. package/front_end/third_party/lit-html/package/development/directive-helpers.js +25 -9
  177. package/front_end/third_party/lit-html/package/development/directive-helpers.js.map +1 -1
  178. package/front_end/third_party/lit-html/package/development/directive.d.ts +3 -16
  179. package/front_end/third_party/lit-html/package/development/directive.d.ts.map +1 -1
  180. package/front_end/third_party/lit-html/package/development/directive.js +6 -1
  181. package/front_end/third_party/lit-html/package/development/directive.js.map +1 -1
  182. package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts +7 -14
  183. package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts.map +1 -1
  184. package/front_end/third_party/lit-html/package/development/directives/async-append.js +17 -58
  185. package/front_end/third_party/lit-html/package/development/directives/async-append.js.map +1 -1
  186. package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts +9 -14
  187. package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts.map +1 -1
  188. package/front_end/third_party/lit-html/package/development/directives/async-replace.js +57 -37
  189. package/front_end/third_party/lit-html/package/development/directives/async-replace.js.map +1 -1
  190. package/front_end/third_party/lit-html/package/development/directives/cache.d.ts +2 -3
  191. package/front_end/third_party/lit-html/package/development/directives/cache.d.ts.map +1 -1
  192. package/front_end/third_party/lit-html/package/development/directives/cache.js +4 -6
  193. package/front_end/third_party/lit-html/package/development/directives/cache.js.map +1 -1
  194. package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts +2 -2
  195. package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts.map +1 -1
  196. package/front_end/third_party/lit-html/package/development/directives/class-map.js +17 -7
  197. package/front_end/third_party/lit-html/package/development/directives/class-map.js.map +1 -1
  198. package/front_end/third_party/lit-html/package/development/directives/guard.d.ts +3 -2
  199. package/front_end/third_party/lit-html/package/development/directives/guard.d.ts.map +1 -1
  200. package/front_end/third_party/lit-html/package/development/directives/guard.js +3 -2
  201. package/front_end/third_party/lit-html/package/development/directives/guard.js.map +1 -1
  202. package/front_end/third_party/lit-html/package/development/directives/live.d.ts +4 -3
  203. package/front_end/third_party/lit-html/package/development/directives/live.d.ts.map +1 -1
  204. package/front_end/third_party/lit-html/package/development/directives/live.js +5 -7
  205. package/front_end/third_party/lit-html/package/development/directives/live.js.map +1 -1
  206. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts +58 -0
  207. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts.map +1 -0
  208. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js +85 -0
  209. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js.map +1 -0
  210. package/front_end/third_party/lit-html/package/development/directives/ref.d.ts +14 -11
  211. package/front_end/third_party/lit-html/package/development/directives/ref.d.ts.map +1 -1
  212. package/front_end/third_party/lit-html/package/development/directives/ref.js +13 -11
  213. package/front_end/third_party/lit-html/package/development/directives/ref.js.map +1 -1
  214. package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts +8 -4
  215. package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts.map +1 -1
  216. package/front_end/third_party/lit-html/package/development/directives/repeat.js +23 -9
  217. package/front_end/third_party/lit-html/package/development/directives/repeat.js.map +1 -1
  218. package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts +1 -2
  219. package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts.map +1 -1
  220. package/front_end/third_party/lit-html/package/development/directives/style-map.js +1 -2
  221. package/front_end/third_party/lit-html/package/development/directives/style-map.js.map +1 -1
  222. package/front_end/third_party/lit-html/package/development/directives/template-content.d.ts +1 -2
  223. package/front_end/third_party/lit-html/package/development/directives/template-content.js +1 -2
  224. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts +6 -4
  225. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts.map +1 -1
  226. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js +7 -5
  227. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js.map +1 -1
  228. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts +4 -1
  229. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts.map +1 -1
  230. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js +3 -0
  231. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js.map +1 -1
  232. package/front_end/third_party/lit-html/package/development/directives/until.d.ts +12 -8
  233. package/front_end/third_party/lit-html/package/development/directives/until.d.ts.map +1 -1
  234. package/front_end/third_party/lit-html/package/development/directives/until.js +63 -23
  235. package/front_end/third_party/lit-html/package/development/directives/until.js.map +1 -1
  236. package/front_end/third_party/lit-html/package/development/experimental-hydrate.d.ts.map +1 -1
  237. package/front_end/third_party/lit-html/package/development/experimental-hydrate.js +9 -8
  238. package/front_end/third_party/lit-html/package/development/experimental-hydrate.js.map +1 -1
  239. package/front_end/third_party/lit-html/package/development/lit-html.d.ts +81 -136
  240. package/front_end/third_party/lit-html/package/development/lit-html.d.ts.map +1 -1
  241. package/front_end/third_party/lit-html/package/development/lit-html.js +249 -76
  242. package/front_end/third_party/lit-html/package/development/lit-html.js.map +1 -1
  243. package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts +1 -41
  244. package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts.map +1 -1
  245. package/front_end/third_party/lit-html/package/development/polyfill-support.js +40 -21
  246. package/front_end/third_party/lit-html/package/development/polyfill-support.js.map +1 -1
  247. package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts +12 -10
  248. package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts.map +1 -1
  249. package/front_end/third_party/lit-html/package/development/private-ssr-support.js +11 -3
  250. package/front_end/third_party/lit-html/package/development/private-ssr-support.js.map +1 -1
  251. package/front_end/third_party/lit-html/package/development/static.d.ts.map +1 -1
  252. package/front_end/third_party/lit-html/package/development/static.js +6 -5
  253. package/front_end/third_party/lit-html/package/development/static.js.map +1 -1
  254. package/front_end/third_party/lit-html/package/directive-helpers.d.ts +6 -5
  255. package/front_end/third_party/lit-html/package/directive-helpers.d.ts.map +1 -1
  256. package/front_end/third_party/lit-html/package/directive-helpers.js +2 -2
  257. package/front_end/third_party/lit-html/package/directive-helpers.js.map +1 -1
  258. package/front_end/third_party/lit-html/package/directive.d.ts +3 -16
  259. package/front_end/third_party/lit-html/package/directive.d.ts.map +1 -1
  260. package/front_end/third_party/lit-html/package/directive.js +1 -1
  261. package/front_end/third_party/lit-html/package/directive.js.map +1 -1
  262. package/front_end/third_party/lit-html/package/directives/async-append.d.ts +7 -14
  263. package/front_end/third_party/lit-html/package/directives/async-append.d.ts.map +1 -1
  264. package/front_end/third_party/lit-html/package/directives/async-append.js +2 -6
  265. package/front_end/third_party/lit-html/package/directives/async-append.js.map +1 -1
  266. package/front_end/third_party/lit-html/package/directives/async-replace.d.ts +9 -14
  267. package/front_end/third_party/lit-html/package/directives/async-replace.d.ts.map +1 -1
  268. package/front_end/third_party/lit-html/package/directives/async-replace.js +2 -5
  269. package/front_end/third_party/lit-html/package/directives/async-replace.js.map +1 -1
  270. package/front_end/third_party/lit-html/package/directives/cache.d.ts +2 -3
  271. package/front_end/third_party/lit-html/package/directives/cache.d.ts.map +1 -1
  272. package/front_end/third_party/lit-html/package/directives/cache.js +2 -5
  273. package/front_end/third_party/lit-html/package/directives/cache.js.map +1 -1
  274. package/front_end/third_party/lit-html/package/directives/class-map.d.ts +2 -2
  275. package/front_end/third_party/lit-html/package/directives/class-map.d.ts.map +1 -1
  276. package/front_end/third_party/lit-html/package/directives/class-map.js +2 -4
  277. package/front_end/third_party/lit-html/package/directives/class-map.js.map +1 -1
  278. package/front_end/third_party/lit-html/package/directives/guard.d.ts +3 -2
  279. package/front_end/third_party/lit-html/package/directives/guard.d.ts.map +1 -1
  280. package/front_end/third_party/lit-html/package/directives/guard.js +2 -4
  281. package/front_end/third_party/lit-html/package/directives/guard.js.map +1 -1
  282. package/front_end/third_party/lit-html/package/directives/live.d.ts +4 -3
  283. package/front_end/third_party/lit-html/package/directives/live.d.ts.map +1 -1
  284. package/front_end/third_party/lit-html/package/directives/live.js +1 -4
  285. package/front_end/third_party/lit-html/package/directives/live.js.map +1 -1
  286. package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts +58 -0
  287. package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts.map +1 -0
  288. package/front_end/third_party/lit-html/package/directives/private-async-helpers.js +7 -0
  289. package/front_end/third_party/lit-html/package/directives/private-async-helpers.js.map +1 -0
  290. package/front_end/third_party/lit-html/package/directives/ref.d.ts +14 -11
  291. package/front_end/third_party/lit-html/package/directives/ref.d.ts.map +1 -1
  292. package/front_end/third_party/lit-html/package/directives/ref.js +2 -5
  293. package/front_end/third_party/lit-html/package/directives/ref.js.map +1 -1
  294. package/front_end/third_party/lit-html/package/directives/repeat.d.ts +8 -4
  295. package/front_end/third_party/lit-html/package/directives/repeat.d.ts.map +1 -1
  296. package/front_end/third_party/lit-html/package/directives/repeat.js +2 -5
  297. package/front_end/third_party/lit-html/package/directives/repeat.js.map +1 -1
  298. package/front_end/third_party/lit-html/package/directives/style-map.d.ts +1 -2
  299. package/front_end/third_party/lit-html/package/directives/style-map.d.ts.map +1 -1
  300. package/front_end/third_party/lit-html/package/directives/style-map.js +2 -4
  301. package/front_end/third_party/lit-html/package/directives/style-map.js.map +1 -1
  302. package/front_end/third_party/lit-html/package/directives/template-content.d.ts +1 -2
  303. package/front_end/third_party/lit-html/package/directives/template-content.js +2 -4
  304. package/front_end/third_party/lit-html/package/directives/template-content.js.map +1 -1
  305. package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts +6 -4
  306. package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts.map +1 -1
  307. package/front_end/third_party/lit-html/package/directives/unsafe-html.js +2 -4
  308. package/front_end/third_party/lit-html/package/directives/unsafe-html.js.map +1 -1
  309. package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts +4 -1
  310. package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts.map +1 -1
  311. package/front_end/third_party/lit-html/package/directives/unsafe-svg.js.map +1 -1
  312. package/front_end/third_party/lit-html/package/directives/until.d.ts +12 -8
  313. package/front_end/third_party/lit-html/package/directives/until.d.ts.map +1 -1
  314. package/front_end/third_party/lit-html/package/directives/until.js +2 -6
  315. package/front_end/third_party/lit-html/package/directives/until.js.map +1 -1
  316. package/front_end/third_party/lit-html/package/experimental-hydrate.d.ts.map +1 -1
  317. package/front_end/third_party/lit-html/package/experimental-hydrate.js +2 -5
  318. package/front_end/third_party/lit-html/package/experimental-hydrate.js.map +1 -1
  319. package/front_end/third_party/lit-html/package/lit-html.d.ts +81 -136
  320. package/front_end/third_party/lit-html/package/lit-html.d.ts.map +1 -1
  321. package/front_end/third_party/lit-html/package/lit-html.js +1 -1
  322. package/front_end/third_party/lit-html/package/lit-html.js.map +1 -1
  323. package/front_end/third_party/lit-html/package/package.json +75 -24
  324. package/front_end/third_party/lit-html/package/polyfill-support.d.ts +1 -41
  325. package/front_end/third_party/lit-html/package/polyfill-support.d.ts.map +1 -1
  326. package/front_end/third_party/lit-html/package/polyfill-support.js +1 -1
  327. package/front_end/third_party/lit-html/package/polyfill-support.js.map +1 -1
  328. package/front_end/third_party/lit-html/package/private-ssr-support.d.ts +12 -10
  329. package/front_end/third_party/lit-html/package/private-ssr-support.d.ts.map +1 -1
  330. package/front_end/third_party/lit-html/package/private-ssr-support.js +2 -2
  331. package/front_end/third_party/lit-html/package/private-ssr-support.js.map +1 -1
  332. package/front_end/third_party/lit-html/package/static.d.ts.map +1 -1
  333. package/front_end/third_party/lit-html/package/static.js +1 -1
  334. package/front_end/third_party/lit-html/package/static.js.map +1 -1
  335. package/front_end/third_party/marked/README.chromium +2 -2
  336. package/front_end/third_party/marked/marked.ts +2 -2
  337. package/front_end/third_party/marked/package/README.md +7 -1
  338. package/front_end/third_party/marked/package/bin/marked.js +214 -0
  339. package/front_end/third_party/marked/package/lib/marked.cjs +2907 -0
  340. package/front_end/third_party/marked/package/lib/marked.esm.d.ts +1 -3
  341. package/front_end/third_party/marked/package/lib/marked.esm.js +627 -586
  342. package/front_end/third_party/marked/package/lib/marked.umd.js +2913 -0
  343. package/front_end/third_party/marked/package/man/marked.1 +5 -24
  344. package/front_end/third_party/marked/package/man/marked.1.txt +21 -31
  345. package/front_end/third_party/marked/package/marked.min.js +1 -1
  346. package/front_end/third_party/marked/package/package.json +41 -32
  347. package/front_end/third_party/marked/package/src/Lexer.js +109 -108
  348. package/front_end/third_party/marked/package/src/Parser.js +38 -15
  349. package/front_end/third_party/marked/package/src/Renderer.js +5 -5
  350. package/front_end/third_party/marked/package/src/Slugger.js +2 -2
  351. package/front_end/third_party/marked/package/src/TextRenderer.js +2 -2
  352. package/front_end/third_party/marked/package/src/Tokenizer.js +215 -190
  353. package/front_end/third_party/marked/package/src/defaults.js +6 -9
  354. package/front_end/third_party/marked/package/src/helpers.js +16 -27
  355. package/front_end/third_party/marked/package/src/marked.js +146 -63
  356. package/front_end/third_party/marked/package/src/rules.js +20 -45
  357. package/front_end/third_party/wasmparser/README.chromium +2 -2
  358. package/front_end/third_party/wasmparser/package/.github/workflows/main.yml +47 -0
  359. package/front_end/third_party/wasmparser/package/CHANGELOG.md +12 -0
  360. package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js +53 -53
  361. package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js.map +1 -1
  362. package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js +53 -53
  363. package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js.map +1 -1
  364. package/front_end/third_party/wasmparser/package/package.json +1 -1
  365. package/front_end/third_party/wasmparser/package/src/WasmParser.ts +53 -53
  366. package/front_end/ui/components/text_editor/TextEditor.ts +29 -0
  367. package/front_end/ui/components/text_editor/config.ts +36 -14
  368. package/front_end/ui/components/text_editor/javascript.ts +14 -9
  369. package/front_end/ui/components/text_editor/theme.ts +29 -4
  370. package/front_end/ui/components/tree_outline/TreeOutline.ts +8 -0
  371. package/front_end/ui/legacy/Dialog.ts +8 -3
  372. package/front_end/ui/legacy/ViewManager.ts +6 -0
  373. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +20 -0
  374. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +6 -4
  375. package/front_end/ui/legacy/components/utils/Linkifier.ts +49 -79
  376. package/front_end/ui/legacy/themeColors.css +2 -0
  377. package/inspector_overlay/css_grid_label_helpers.ts +1 -1
  378. package/inspector_overlay/highlight_common.ts +1 -1
  379. package/inspector_overlay/tool_highlight.ts +1 -1
  380. package/package.json +1 -1
  381. package/scripts/eslint_rules/lib/es_modules_import.js +0 -16
  382. package/scripts/eslint_rules/tests/es_modules_import_test.js +0 -16
@@ -6,9 +6,9 @@ import * as Common from '../../core/common/common.js';
6
6
  import * as Host from '../../core/host/host.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
8
  import * as SDK from '../../core/sdk/sdk.js';
9
- import * as TextUtils from '../../models/text_utils/text_utils.js';
9
+ import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
10
+ import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
10
11
  import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
11
- import * as TextEditor from '../../ui/legacy/components/text_editor/text_editor.js';
12
12
  import * as UI from '../../ui/legacy/legacy.js';
13
13
 
14
14
  import {ConsolePanel} from './ConsolePanel.js';
@@ -27,17 +27,17 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
27
27
  private addCompletionsFromHistory: boolean;
28
28
  private historyInternal: ConsoleHistoryManager;
29
29
  private initialText: string;
30
- private editor: UI.TextEditor.TextEditor|null;
30
+ private editor: TextEditor.TextEditor.TextEditor;
31
31
  private readonly eagerPreviewElement: HTMLDivElement;
32
32
  private textChangeThrottler: Common.Throttler.Throttler;
33
33
  private readonly formatter: ObjectUI.RemoteObjectPreviewFormatter.RemoteObjectPreviewFormatter;
34
34
  private requestPreviewBound: () => Promise<void>;
35
+ private requestPreviewCurrent = 0;
35
36
  private readonly innerPreviewElement: HTMLElement;
36
37
  private readonly promptIcon: UI.Icon.Icon;
37
38
  private readonly iconThrottler: Common.Throttler.Throttler;
38
39
  private readonly eagerEvalSetting: Common.Settings.Setting<boolean>;
39
40
  private previewRequestForTest: Promise<void>|null;
40
- private defaultAutocompleteConfig: UI.TextEditor.AutocompleteConfig|null;
41
41
  private highlightingNode: boolean;
42
42
 
43
43
  constructor() {
@@ -46,7 +46,6 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
46
46
  this.historyInternal = new ConsoleHistoryManager();
47
47
 
48
48
  this.initialText = '';
49
- this.editor = null;
50
49
  this.eagerPreviewElement = document.createElement('div');
51
50
  this.eagerPreviewElement.classList.add('console-eager-preview');
52
51
  this.textChangeThrottler = new Common.Throttler.Throttler(150);
@@ -68,41 +67,41 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
68
67
 
69
68
  this.element.tabIndex = 0;
70
69
  this.previewRequestForTest = null;
70
+ this.highlightingNode = false;
71
71
 
72
- this.defaultAutocompleteConfig = null;
72
+ const editorState = CodeMirror.EditorState.create({
73
+ doc: this.initialText,
74
+ extensions: [
75
+ CodeMirror.keymap.of(this.editorKeymap()),
76
+ CodeMirror.EditorView.updateListener.of(update => this.editorUpdate(update)),
77
+ TextEditor.JavaScript.argumentHints(),
78
+ TextEditor.JavaScript.completion(),
79
+ TextEditor.Config.showCompletionHint,
80
+ CodeMirror.javascript.javascript(),
81
+ TextEditor.Config.baseConfiguration(this.initialText),
82
+ TextEditor.Config.autocompletion,
83
+ CodeMirror.javascript.javascriptLanguage.data.of({
84
+ autocomplete: (context: CodeMirror.CompletionContext): CodeMirror.CompletionResult | null =>
85
+ this.historyCompletions(context),
86
+ }),
87
+ CodeMirror.EditorView.contentAttributes.of({'aria-label': i18nString(UIStrings.consolePrompt)}),
88
+ CodeMirror.EditorView.lineWrapping,
89
+ CodeMirror.autocompletion({aboveCursor: true}),
90
+ ],
91
+ });
73
92
 
74
- this.highlightingNode = false;
93
+ this.editor = new TextEditor.TextEditor.TextEditor(editorState);
94
+ this.editor.addEventListener('keydown', (event): void => {
95
+ if (event.defaultPrevented) {
96
+ event.stopPropagation();
97
+ }
98
+ });
99
+ editorContainerElement.appendChild(this.editor);
75
100
 
76
- const factory = TextEditor.CodeMirrorTextEditor.CodeMirrorTextEditorFactory.instance();
77
-
78
- const options = {
79
- devtoolsAccessibleName: (i18nString(UIStrings.consolePrompt) as string),
80
- lineNumbers: false,
81
- lineWrapping: true,
82
- mimeType: 'javascript',
83
- autoHeight: true,
84
- };
85
- this.editor = factory.createEditor((options as UI.TextEditor.Options));
86
-
87
- this.defaultAutocompleteConfig =
88
- ObjectUI.JavaScriptAutocomplete.JavaScriptAutocompleteConfig.createConfigForEditor(this.editor);
89
- this.editor.configureAutocomplete(Object.assign({}, this.defaultAutocompleteConfig, {
90
- suggestionsCallback: this.wordsWithQuery.bind(this),
91
- anchorBehavior: UI.GlassPane.AnchorBehavior.PreferTop,
92
- }));
93
- this.editor.widget().element.addEventListener('keydown', this.editorKeyDown.bind(this), true);
94
- this.editor.widget().show(editorContainerElement);
95
- this.editor.addEventListener(UI.TextEditor.Events.CursorChanged, this.updatePromptIcon, this);
96
- this.editor.addEventListener(UI.TextEditor.Events.TextChanged, this.onTextChanged, this);
97
- this.editor.addEventListener(UI.TextEditor.Events.SuggestionChanged, this.onTextChanged, this);
98
-
99
- this.setText(this.initialText);
100
- this.initialText = '';
101
101
  if (this.hasFocus()) {
102
102
  this.focus();
103
103
  }
104
104
  this.element.removeAttribute('tabindex');
105
- this.editor.widget().element.tabIndex = -1;
106
105
 
107
106
  this.editorSetForTest();
108
107
 
@@ -126,7 +125,7 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
126
125
  // ConsoleView and prompt both use a throttler, so we clear the preview
127
126
  // ASAP to avoid inconsistency between a fresh viewport and stale preview.
128
127
  if (this.eagerEvalSetting.get()) {
129
- const asSoonAsPossible = !this.editor || !this.editor.textWithCurrentSuggestion();
128
+ const asSoonAsPossible = !TextEditor.Config.contentIncludingHint(this.editor.editor);
130
129
  this.previewRequestForTest = this.textChangeThrottler.schedule(this.requestPreviewBound, asSoonAsPossible);
131
130
  }
132
131
  this.updatePromptIcon();
@@ -134,15 +133,16 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
134
133
  }
135
134
 
136
135
  private async requestPreview(): Promise<void> {
137
- if (!this.editor) {
138
- return;
139
- }
140
- const text = this.editor.textWithCurrentSuggestion().trim();
136
+ const id = ++this.requestPreviewCurrent;
137
+ const text = TextEditor.Config.contentIncludingHint(this.editor.editor).trim();
141
138
  const executionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
142
139
  const {preview, result} = await ObjectUI.JavaScriptREPL.JavaScriptREPL.evaluateAndBuildPreview(
143
140
  text, true /* throwOnSideEffect */, true /* replMode */, 500 /* timeout */);
141
+ if (this.requestPreviewCurrent !== id) {
142
+ return;
143
+ }
144
144
  this.innerPreviewElement.removeChildren();
145
- if (preview.deepTextContent() !== this.editor.textWithCurrentSuggestion().trim()) {
145
+ if (preview.deepTextContent() !== TextEditor.Config.contentIncludingHint(this.editor.editor).trim()) {
146
146
  this.innerPreviewElement.appendChild(preview);
147
147
  }
148
148
  if (result && 'object' in result && result.object && result.object.subtype === 'node') {
@@ -174,149 +174,102 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
174
174
  }
175
175
 
176
176
  clearAutocomplete(): void {
177
- if (this.editor) {
178
- this.editor.clearAutocomplete();
179
- }
177
+ CodeMirror.closeCompletion(this.editor.editor);
180
178
  }
181
179
 
182
180
  private isCaretAtEndOfPrompt(): boolean {
183
- return this.editor !== null &&
184
- this.editor.selection().collapseToEnd().equal(this.editor.fullRange().collapseToEnd());
181
+ return this.editor.state.selection.main.head === this.editor.state.doc.length;
185
182
  }
186
183
 
187
184
  moveCaretToEndOfPrompt(): void {
188
- if (this.editor) {
189
- this.editor.setSelection(TextUtils.TextRange.TextRange.createFromLocation(Infinity, Infinity));
190
- }
185
+ this.editor.dispatch({
186
+ selection: CodeMirror.EditorSelection.cursor(this.editor.state.doc.length),
187
+ });
191
188
  }
192
189
 
193
- setText(text: string): void {
194
- if (this.editor) {
195
- this.editor.setText(text);
196
- } else {
197
- this.initialText = text;
198
- }
199
- this.dispatchEventToListeners(Events.TextChanged);
190
+ clear(): void {
191
+ this.editor.dispatch({
192
+ changes: {from: 0, to: this.editor.state.doc.length},
193
+ });
200
194
  }
201
195
 
202
196
  text(): string {
203
- return this.editor ? this.editor.text() : this.initialText;
197
+ return this.editor.state.doc.toString();
204
198
  }
205
199
 
206
200
  setAddCompletionsFromHistory(value: boolean): void {
207
201
  this.addCompletionsFromHistory = value;
208
202
  }
209
203
 
210
- private editorKeyDown(event: Event): void {
211
- if (!this.editor) {
212
- return;
213
- }
214
- const keyboardEvent = (event as KeyboardEvent);
215
- let newText;
216
- let isPrevious;
217
- // Check against visual coordinates in case lines wrap.
218
- const selection = this.editor.selection();
219
- const cursorY = this.editor.visualCoordinates(selection.endLine, selection.endColumn).y;
220
-
221
- switch (keyboardEvent.keyCode) {
222
- case UI.KeyboardShortcut.Keys.Up.code: {
223
- const startY = this.editor.visualCoordinates(0, 0).y;
224
- if (keyboardEvent.shiftKey || !selection.isEmpty() || cursorY !== startY) {
225
- break;
226
- }
227
- newText = this.historyInternal.previous(this.text());
228
- isPrevious = true;
229
- break;
230
- }
231
- case UI.KeyboardShortcut.Keys.Down.code: {
232
- const fullRange = this.editor.fullRange();
233
- const endY = this.editor.visualCoordinates(fullRange.endLine, fullRange.endColumn).y;
234
- if (keyboardEvent.shiftKey || !selection.isEmpty() || cursorY !== endY) {
235
- break;
236
- }
237
- newText = this.historyInternal.next();
238
- break;
239
- }
240
- case UI.KeyboardShortcut.Keys.P.code: { // Ctrl+P = Previous
241
- if (Host.Platform.isMac() && keyboardEvent.ctrlKey && !keyboardEvent.metaKey && !keyboardEvent.altKey &&
242
- !keyboardEvent.shiftKey) {
243
- newText = this.historyInternal.previous(this.text());
244
- isPrevious = true;
245
- }
246
- break;
247
- }
248
- case UI.KeyboardShortcut.Keys.N.code: { // Ctrl+N = Next
249
- if (Host.Platform.isMac() && keyboardEvent.ctrlKey && !keyboardEvent.metaKey && !keyboardEvent.altKey &&
250
- !keyboardEvent.shiftKey) {
251
- newText = this.historyInternal.next();
252
- }
253
- break;
254
- }
255
- case UI.KeyboardShortcut.Keys.Enter.code: {
256
- this.enterKeyPressed(keyboardEvent);
257
- break;
204
+ private editorKeymap(): readonly CodeMirror.KeyBinding[] {
205
+ return [
206
+ {key: 'ArrowUp', run: (): boolean => this.moveHistory(-1)},
207
+ {key: 'ArrowDown', run: (): boolean => this.moveHistory(1)},
208
+ {mac: 'Ctrl-p', run: (): boolean => this.moveHistory(-1, true)},
209
+ {mac: 'Ctrl-n', run: (): boolean => this.moveHistory(1, true)},
210
+ {key: 'Enter', run: (): boolean => this.evaluate(), shift: CodeMirror.insertNewlineAndIndent},
211
+ ];
212
+ }
213
+
214
+ private moveHistory(dir: -1|1, force = false): boolean {
215
+ const {editor} = this.editor, {main} = editor.state.selection;
216
+ if (!force) {
217
+ if (!main.empty) {
218
+ return false;
258
219
  }
259
- case UI.KeyboardShortcut.Keys.Tab.code: {
260
- if (!this.text()) {
261
- keyboardEvent.consume();
262
- }
263
- break;
220
+ const cursorCoords = editor.coordsAtPos(main.head);
221
+ const endCoords = editor.coordsAtPos(dir < 0 ? 0 : editor.state.doc.length);
222
+ // Check if there are wrapped lines in this direction, and let
223
+ // the cursor move normally if there are.
224
+ if (cursorCoords && endCoords &&
225
+ (dir < 0 ? cursorCoords.top > endCoords.top + 5 : cursorCoords.bottom < endCoords.bottom - 5)) {
226
+ return false;
264
227
  }
265
228
  }
266
229
 
230
+ const history = this.historyInternal;
231
+ const newText = dir < 0 ? history.previous(this.text()) : history.next();
267
232
  if (newText === undefined) {
268
- return;
233
+ return false;
269
234
  }
270
- keyboardEvent.consume(true);
271
- this.setText(newText);
272
235
 
273
- if (isPrevious) {
274
- this.editor.setSelection(TextUtils.TextRange.TextRange.createFromLocation(0, Infinity));
275
- } else {
276
- this.moveCaretToEndOfPrompt();
277
- }
236
+ const cursorPos = dir < 0 ? newText.search(/\n|$/) : newText.length;
237
+ this.editor.dispatch({
238
+ changes: {from: 0, to: this.editor.state.doc.length, insert: newText},
239
+ selection: CodeMirror.EditorSelection.cursor(cursorPos),
240
+ scrollIntoView: true,
241
+ });
242
+ return true;
243
+ }
244
+
245
+ private enterWillEvaluate(): boolean {
246
+ const {state} = this.editor;
247
+ return state.doc.length > 0 && TextEditor.JavaScript.isExpressionComplete(state);
278
248
  }
279
249
 
280
- private async enterWillEvaluate(): Promise<boolean> {
281
- if (!this.isCaretAtEndOfPrompt()) {
282
- return true;
250
+ private evaluate(): boolean {
251
+ if (this.enterWillEvaluate()) {
252
+ this.appendCommand(this.text(), true);
253
+ this.editor.dispatch({
254
+ changes: {from: 0, to: this.editor.state.doc.length},
255
+ scrollIntoView: true,
256
+ });
257
+ } else if (this.editor.state.doc.length) {
258
+ return CodeMirror.insertNewlineAndIndent(this.editor.editor);
259
+ } else {
260
+ this.editor.dispatch({scrollIntoView: true});
283
261
  }
284
- return await ObjectUI.JavaScriptAutocomplete.JavaScriptAutocomplete.isExpressionComplete(this.text());
262
+ this.enterProcessedForTest();
263
+ return true;
285
264
  }
286
265
 
287
266
  private updatePromptIcon(): void {
288
267
  this.iconThrottler.schedule(async () => {
289
- const canComplete = await this.enterWillEvaluate();
290
- this.promptIcon.classList.toggle('console-prompt-incomplete', !canComplete);
268
+ this.promptIcon.classList.toggle('console-prompt-incomplete', !this.enterWillEvaluate());
291
269
  });
292
270
  }
293
271
 
294
- private async enterKeyPressed(event: KeyboardEvent): Promise<void> {
295
- if (event.altKey || event.ctrlKey || event.shiftKey) {
296
- return;
297
- }
298
-
299
- event.consume(true);
300
-
301
- // Since we prevent default, manually emulate the native "scroll on key input" behavior.
302
- this.element.scrollIntoView();
303
- this.clearAutocomplete();
304
-
305
- const str = this.text();
306
- if (!str.length) {
307
- return;
308
- }
309
-
310
- if (await this.enterWillEvaluate()) {
311
- await this.appendCommand(str, true);
312
- } else if (this.editor) {
313
- this.editor.newlineAndIndent();
314
- }
315
- this.enterProcessedForTest();
316
- }
317
-
318
- private async appendCommand(text: string, useCommandLineAPI: boolean): Promise<void> {
319
- this.setText('');
272
+ private appendCommand(text: string, useCommandLineAPI: boolean): void {
320
273
  const currentExecutionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
321
274
  if (currentExecutionContext) {
322
275
  const executionContext = currentExecutionContext;
@@ -333,10 +286,19 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
333
286
  private enterProcessedForTest(): void {
334
287
  }
335
288
 
336
- private historyCompletions(prefix: string, force?: boolean): UI.SuggestBox.Suggestions {
289
+ private editorUpdate(update: CodeMirror.ViewUpdate): void {
290
+ if (update.docChanged ||
291
+ CodeMirror.selectedCompletion(update.state) !== CodeMirror.selectedCompletion(update.startState)) {
292
+ this.onTextChanged();
293
+ } else if (update.selectionSet) {
294
+ this.updatePromptIcon();
295
+ }
296
+ }
297
+
298
+ private historyCompletions(context: CodeMirror.CompletionContext): CodeMirror.CompletionResult|null {
337
299
  const text = this.text();
338
- if (!this.addCompletionsFromHistory || !this.isCaretAtEndOfPrompt() || (!text && !force)) {
339
- return [];
300
+ if (!this.addCompletionsFromHistory || !this.isCaretAtEndOfPrompt() || (!text.length && !context.explicit)) {
301
+ return null;
340
302
  }
341
303
  const result = [];
342
304
  const set = new Set<string>();
@@ -350,30 +312,18 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
350
312
  continue;
351
313
  }
352
314
  set.add(item);
353
- result.push(
354
- {text: item.substring(text.length - prefix.length), iconType: 'smallicon-text-prompt', isSecondary: true});
315
+ result.push({label: item, type: 'secondary', boost: -1e5});
355
316
  }
356
- return result as UI.SuggestBox.Suggestions;
317
+ return result.length ? {
318
+ from: 0,
319
+ to: text.length,
320
+ options: result,
321
+ } :
322
+ null;
357
323
  }
358
324
 
359
325
  focus(): void {
360
- if (this.editor) {
361
- this.editor.widget().focus();
362
- } else {
363
- this.element.focus();
364
- }
365
- }
366
-
367
- private async wordsWithQuery(
368
- queryRange: TextUtils.TextRange.TextRange, substituteRange: TextUtils.TextRange.TextRange,
369
- force?: boolean): Promise<UI.SuggestBox.Suggestions> {
370
- if (!this.editor || !this.defaultAutocompleteConfig || !this.defaultAutocompleteConfig.suggestionsCallback) {
371
- return [];
372
- }
373
- const query = this.editor.text(queryRange);
374
- const words = await this.defaultAutocompleteConfig.suggestionsCallback(queryRange, substituteRange, force);
375
- const historyWords = this.historyCompletions(query, force);
376
- return words ? words.concat(historyWords) : historyWords;
326
+ this.editor.focus();
377
327
  }
378
328
 
379
329
  private editorSetForTest(): void {
@@ -1218,7 +1218,7 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
1218
1218
  }
1219
1219
 
1220
1220
  private clearPromptBackwards(): void {
1221
- this.prompt.setText('');
1221
+ this.prompt.clear();
1222
1222
  }
1223
1223
 
1224
1224
  private promptKeyDown(event: Event): void {
@@ -345,13 +345,13 @@
345
345
  }
346
346
 
347
347
  #console-messages .link {
348
+ cursor: pointer;
348
349
  text-decoration: underline;
349
350
  }
350
351
 
351
352
  #console-messages .link,
352
353
  #console-messages .devtools-link {
353
354
  color: var(--color-text-secondary);
354
- cursor: pointer;
355
355
  word-break: break-all;
356
356
  }
357
357
 
@@ -338,7 +338,7 @@
338
338
  background: none;
339
339
  border: none;
340
340
  -webkit-mask-image: var(--image-file-ic_show_node_16x16);
341
- background-color: var(--color-background-elevation-1);
341
+ background-color: var(--color-text-secondary);
342
342
  width: 16px;
343
343
  height: 16px;
344
344
  display: none;
@@ -348,7 +348,7 @@
348
348
 
349
349
  .show-element:focus,
350
350
  .show-element:hover {
351
- background-color: var(--color-syntax-1);
351
+ background-color: var(--color-primary);
352
352
  }
353
353
 
354
354
  .nodeId-column:focus-within .show-element,
@@ -6,87 +6,113 @@ import * as SDK from '../../core/sdk/sdk.js';
6
6
  import type * as TreeOutline from '../../ui/components/tree_outline/tree_outline.js';
7
7
  import * as ElementsComponents from './components/components.js';
8
8
  import * as LitHtml from '../../ui/lit-html/lit-html.js';
9
+ import type * as Protocol from '../../generated/protocol.js';
9
10
 
10
11
  export type AXTreeNodeData = SDK.AccessibilityModel.AccessibilityNode;
11
12
  export type AXTreeNode = TreeOutline.TreeOutlineUtils.TreeNode<AXTreeNodeData>;
12
13
 
13
- export function sdkNodeToAXTreeNode(sdkNode: SDK.AccessibilityModel.AccessibilityNode): AXTreeNode {
14
- const treeNodeData = sdkNode;
15
- const role = sdkNode.role()?.value;
16
-
17
- if (role === 'Iframe') {
18
- return {
19
- treeNodeData,
20
- children: async(): Promise<AXTreeNode[]> => {
21
- const domNode = await sdkNode.deferredDOMNode()?.resolvePromise();
22
- if (!domNode) {
23
- throw new Error('Could not find corresponding DOMNode');
24
- }
25
- const frameId = domNode.frameOwnerFrameId();
14
+ function isLeafNode(node: SDK.AccessibilityModel.AccessibilityNode): boolean {
15
+ return node.numChildren() === 0 && node.role()?.value !== 'Iframe';
16
+ }
26
17
 
27
- let document = domNode.contentDocument();
28
- if (!document && frameId) {
29
- const frame = SDK.FrameManager.FrameManager.instance().getFrame(frameId);
30
- if (!frame) {
31
- return [];
32
- }
33
- document = await frame.resourceTreeModel().domModel().requestDocument();
34
- }
35
- if (!document) {
36
- return [];
37
- }
18
+ function getModel(frameId: Protocol.Page.FrameId): SDK.AccessibilityModel.AccessibilityModel {
19
+ const frame = SDK.FrameManager.FrameManager.instance().getFrame(frameId);
20
+ const model = frame?.resourceTreeModel().target().model(SDK.AccessibilityModel.AccessibilityModel);
21
+ if (!model) {
22
+ throw Error('Could not instantiate model for frameId');
23
+ }
24
+ return model;
25
+ }
38
26
 
39
- const axmodel = document.domModel().target().model(SDK.AccessibilityModel.AccessibilityModel);
40
- if (!axmodel) {
41
- throw new Error('Could not find AccessibilityModel for child document');
42
- }
43
- // Check if we have requested the node before:
44
- let localRoot = axmodel.axNodeForDOMNode(document);
45
- if (!localRoot && frameId) {
46
- // Request the root node of the iframe document:
47
- localRoot = await axmodel.requestRootNode(1, frameId) || null;
48
- }
49
- if (!localRoot) {
50
- throw new Error('Could not find root node');
51
- }
52
- return [sdkNodeToAXTreeNode(localRoot)];
53
- },
54
- id: sdkNode.id(),
55
- };
27
+ export async function getRootNode(frameId: Protocol.Page.FrameId): Promise<SDK.AccessibilityModel.AccessibilityNode> {
28
+ const model = getModel(frameId);
29
+ const root = await model.requestRootNode(frameId);
30
+ if (!root) {
31
+ throw Error('No accessibility root for frame');
56
32
  }
33
+ return root;
34
+ }
57
35
 
58
- if (!sdkNode.numChildren()) {
59
- return {
60
- treeNodeData,
61
- id: sdkNode.id(),
62
- };
36
+ function getFrameIdForNodeOrDocument(node: SDK.DOMModel.DOMNode): Protocol.Page.FrameId {
37
+ let frameId;
38
+ if (node instanceof SDK.DOMModel.DOMDocument) {
39
+ frameId = node.body?.frameId();
40
+ } else {
41
+ frameId = node.frameId();
42
+ }
43
+ if (!frameId) {
44
+ throw Error('No frameId for DOM node');
63
45
  }
46
+ return frameId;
47
+ }
64
48
 
65
- return {
66
- treeNodeData,
67
- children: async(): Promise<AXTreeNode[]> => {
68
- if (sdkNode.numChildren() === sdkNode.children().length) {
69
- return sdkNode.children().map(child => sdkNodeToAXTreeNode(child));
70
- }
71
- // numChildren returns the number of children that this node has, whereas node.children()
72
- // returns only children that have been loaded. If these two don't match, that means that
73
- // there are backend children that need to be loaded into the model, so request them now.
74
- await sdkNode.accessibilityModel().requestAXChildren(sdkNode.id(), sdkNode.getFrameId() || undefined);
49
+ export async function getNodeAndAncestorsFromDOMNode(domNode: SDK.DOMModel.DOMNode):
50
+ Promise<SDK.AccessibilityModel.AccessibilityNode[]> {
51
+ let frameId = getFrameIdForNodeOrDocument(domNode);
52
+ const model = getModel(frameId);
53
+ const result = await model.requestAndLoadSubTreeToNode(domNode);
54
+ if (!result) {
55
+ throw Error('Could not retrieve accessibility node for inspected DOM node');
56
+ }
75
57
 
76
- if (sdkNode.numChildren() !== sdkNode.children().length) {
77
- throw new Error('Once loaded, number of children and length of children must match.');
78
- }
58
+ const topFrameId = SDK.FrameManager.FrameManager.instance().getTopFrame()?.id;
59
+ if (!topFrameId) {
60
+ return result;
61
+ }
62
+ while (frameId !== topFrameId) {
63
+ const node = await SDK.FrameManager.FrameManager.instance().getFrame(frameId)?.getOwnerDOMNodeOrDocument();
64
+ if (!node) {
65
+ break;
66
+ }
67
+ frameId = getFrameIdForNodeOrDocument(node);
68
+ const model = getModel(frameId);
69
+ const ancestors = await model.requestAndLoadSubTreeToNode(node);
70
+ result.push(...ancestors || []);
71
+ }
72
+ return result;
73
+ }
79
74
 
80
- const treeNodeChildren: AXTreeNode[] = [];
75
+ async function getChildren(node: SDK.AccessibilityModel.AccessibilityNode):
76
+ Promise<SDK.AccessibilityModel.AccessibilityNode[]> {
77
+ if (node.role()?.value === 'Iframe') {
78
+ const domNode = await node.deferredDOMNode()?.resolvePromise();
79
+ if (!domNode) {
80
+ throw new Error('Could not find corresponding DOMNode');
81
+ }
82
+ const frameId = domNode.frameOwnerFrameId();
83
+ if (!frameId) {
84
+ throw Error('No owner frameId on iframe node');
85
+ }
86
+ const localRoot = await getRootNode(frameId);
87
+ return [localRoot];
88
+ }
89
+ if (node.hasUnloadedChildren()) {
90
+ await node.accessibilityModel().requestAXChildren(node.id(), node.getFrameId() || undefined);
91
+ if (node.numChildren() !== node.children().length) {
92
+ throw new Error('Once loaded, number of children and length of children must match.');
93
+ }
94
+ }
95
+ return node.children();
96
+ }
81
97
 
82
- for (const child of sdkNode.children()) {
83
- treeNodeChildren.push(sdkNodeToAXTreeNode(child));
84
- }
98
+ export async function sdkNodeToAXTreeNodes(sdkNode: SDK.AccessibilityModel.AccessibilityNode): Promise<AXTreeNode[]> {
99
+ const treeNodeData = sdkNode;
100
+ if (isLeafNode(sdkNode)) {
101
+ return [{
102
+ treeNodeData,
103
+ id: getNodeId(sdkNode),
104
+ }];
105
+ }
85
106
 
86
- return treeNodeChildren;
107
+ return [{
108
+ treeNodeData,
109
+ children: async(): Promise<AXTreeNode[]> => {
110
+ const childNodes = await getChildren(sdkNode);
111
+ const childTreeNodes = await Promise.all(childNodes.map(childNode => sdkNodeToAXTreeNodes(childNode)));
112
+ return childTreeNodes.flat(1);
87
113
  },
88
- id: sdkNode.id(),
89
- };
114
+ id: getNodeId(sdkNode),
115
+ }];
90
116
  }
91
117
 
92
118
  type Data = ElementsComponents.AccessibilityTreeNode.AccessibilityTreeNodeData;
@@ -96,6 +122,11 @@ export function accessibilityNodeRenderer(node: AXTreeNode): LitHtml.TemplateRes
96
122
  const sdkNode = node.treeNodeData;
97
123
  const name = sdkNode.name()?.value || '';
98
124
  const role = sdkNode.role()?.value || '';
125
+ const properties = sdkNode.properties() || [];
99
126
  const ignored = sdkNode.ignored();
100
- return LitHtml.html`<${tag} .data=${{name, role, ignored} as Data}></${tag}>`;
127
+ return LitHtml.html`<${tag} .data=${{name, role, ignored, properties} as Data}></${tag}>`;
128
+ }
129
+
130
+ export function getNodeId(node: SDK.AccessibilityModel.AccessibilityNode): string {
131
+ return node.getFrameId() + '#' + node.id();
101
132
  }