chrome-devtools-frontend 1.0.945884 → 1.0.948295

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 (259) hide show
  1. package/.eslintrc.js +1 -0
  2. package/config/gni/all_devtools_files.gni +1 -20
  3. package/config/gni/devtools_grd_files.gni +9 -48
  4. package/config/gni/devtools_image_files.gni +1 -0
  5. package/front_end/.eslintrc.js +6 -1
  6. package/front_end/Images/src/circled_backslash_icon.svg +3 -0
  7. package/front_end/core/host/InspectorFrontendHost.ts +0 -3
  8. package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
  9. package/front_end/core/host/UserMetrics.ts +1 -23
  10. package/front_end/core/i18n/locales/en-US.json +41 -41
  11. package/front_end/core/i18n/locales/en-XL.json +41 -41
  12. package/front_end/core/platform/platform.ts +0 -2
  13. package/front_end/core/platform/string-utilities.ts +14 -1
  14. package/front_end/core/platform/utilities.ts +0 -29
  15. package/front_end/core/root/Runtime.ts +4 -212
  16. package/front_end/core/sdk/AccessibilityModel.ts +0 -2
  17. package/front_end/core/sdk/CSSProperty.ts +16 -11
  18. package/front_end/core/sdk/CSSRule.ts +0 -2
  19. package/front_end/core/sdk/Cookie.ts +0 -25
  20. package/front_end/core/sdk/EmulationModel.ts +0 -2
  21. package/front_end/core/sdk/HeapProfilerModel.ts +0 -2
  22. package/front_end/core/sdk/NetworkManager.ts +0 -3
  23. package/front_end/core/sdk/Resource.ts +0 -3
  24. package/front_end/core/sdk/ResourceTreeModel.ts +0 -3
  25. package/front_end/core/sdk/ServiceWorkerManager.ts +0 -2
  26. package/front_end/core/sdk/sdk-legacy.ts +0 -3
  27. package/front_end/devtools_compatibility.js +1 -8
  28. package/front_end/entrypoints/devtools_app/{devtools_app-meta-files.ts → devtools_app.ts} +9 -2
  29. package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +1 -3
  30. package/front_end/entrypoints/formatter_worker/FormatterActions.ts +0 -2
  31. package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +0 -120
  32. package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -11
  33. package/front_end/entrypoints/formatter_worker/formatter_worker.ts +5 -0
  34. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +2 -1
  35. package/front_end/entrypoints/inspector/{inspector.js → inspector.ts} +0 -3
  36. package/front_end/entrypoints/js_app/{JsMain.ts → js_app.ts} +5 -1
  37. package/front_end/entrypoints/main/MainImpl.ts +0 -7
  38. package/front_end/entrypoints/ndb_app/{ndb_app.js → ndb_app.ts} +3 -2
  39. package/front_end/entrypoints/{node_main → node_app}/NodeConnectionsPanel.ts +1 -1
  40. package/front_end/entrypoints/{node_main → node_app}/NodeMain.ts +2 -4
  41. package/front_end/entrypoints/{node_main → node_app}/nodeConnectionsPanel.css +0 -0
  42. package/front_end/entrypoints/node_app/node_app.ts +79 -0
  43. package/front_end/entrypoints/shell/{shell-meta-files.ts → shell.ts} +7 -1
  44. package/front_end/entrypoints/worker_app/{worker_app.js → worker_app.ts} +6 -2
  45. package/front_end/generated/InspectorBackendCommands.js +5 -1
  46. package/front_end/generated/protocol.d.ts +12 -0
  47. package/front_end/legacy/legacy-defs.d.ts +0 -4
  48. package/front_end/legacy_test_runner/sources_test_runner/sources_test_runner.js +0 -1
  49. package/front_end/legacy_test_runner/test_runner/TestRunner.js +35 -59
  50. package/front_end/models/bindings/CompilerScriptMapping.ts +0 -1
  51. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +4 -11
  52. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -1
  53. package/front_end/models/bindings/ResourceMapping.ts +1 -1
  54. package/front_end/models/bindings/SASSSourceMapping.ts +0 -1
  55. package/front_end/models/emulation/DeviceModeModel.ts +0 -2
  56. package/front_end/models/formatter/FormatterWorkerPool.ts +0 -18
  57. package/front_end/models/issues_manager/CorsIssue.ts +17 -9
  58. package/front_end/models/issues_manager/descriptions/{corsInsecurePrivateNetworkPreflight.md → corsPreflightAllowPrivateNetworkError.md} +1 -1
  59. package/front_end/models/text_utils/CodeMirrorUtils.ts +6 -51
  60. package/front_end/models/text_utils/TextUtils.ts +1 -2
  61. package/front_end/models/text_utils/text_utils-legacy.ts +0 -5
  62. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +3 -1
  63. package/front_end/panels/animation/AnimationTimeline.ts +0 -2
  64. package/front_end/panels/animation/AnimationUI.ts +0 -2
  65. package/front_end/panels/application/ApplicationPanelSidebar.ts +2 -4
  66. package/front_end/panels/application/BackForwardCacheStrings.ts +2 -5
  67. package/front_end/panels/application/BackForwardCacheView.ts +150 -58
  68. package/front_end/panels/application/ResourcesPanel.ts +0 -42
  69. package/front_end/panels/application/application-legacy.ts +0 -3
  70. package/front_end/panels/application/application-meta.ts +0 -13
  71. package/front_end/panels/application/backForwardCacheView.css +44 -6
  72. package/front_end/panels/application/components/FrameDetailsView.ts +3 -3
  73. package/front_end/panels/application/components/OriginTrialTreeView.ts +3 -3
  74. package/front_end/panels/application/components/StackTrace.ts +1 -1
  75. package/front_end/panels/coverage/CoverageView.ts +1 -1
  76. package/front_end/panels/css_overview/CSSOverviewModel.ts +0 -2
  77. package/front_end/panels/css_overview/CSSOverviewPanel.ts +0 -7
  78. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +0 -2
  79. package/front_end/panels/css_overview/components/cssOverviewStartView.css +1 -0
  80. package/front_end/panels/css_overview/cssOverviewCompletedView.css +1 -1
  81. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +2 -1
  82. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +0 -11
  83. package/front_end/panels/elements/ElementsPanel.ts +9 -1
  84. package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
  85. package/front_end/panels/elements/StylesSidebarPane.ts +0 -1
  86. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
  87. package/front_end/panels/elements/elementsTreeOutline.css +0 -13
  88. package/front_end/panels/emulation/DeviceModeToolbar.ts +0 -16
  89. package/front_end/panels/issues/CorsIssueDetailsView.ts +18 -2
  90. package/front_end/panels/lighthouse/lighthouse-meta.ts +0 -3
  91. package/front_end/panels/network/NetworkConfigView.ts +10 -0
  92. package/front_end/panels/network/NetworkItemView.ts +3 -0
  93. package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -0
  94. package/front_end/panels/network/networkConfigView.css +5 -0
  95. package/front_end/panels/profiler/CPUProfileFlameChart.ts +3 -1
  96. package/front_end/panels/profiler/ProfileDataGrid.ts +2 -1
  97. package/front_end/panels/profiler/profilesPanel.css +1 -1
  98. package/front_end/panels/search/SearchView.ts +24 -4
  99. package/front_end/panels/settings/components/SyncSection.ts +2 -2
  100. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +52 -50
  101. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +0 -12
  102. package/front_end/panels/sources/CSSPlugin.ts +3 -0
  103. package/front_end/panels/sources/CoveragePlugin.ts +2 -0
  104. package/front_end/panels/sources/DebuggerPlugin.ts +35 -7
  105. package/front_end/panels/sources/JavaScriptCompilerPlugin.ts +3 -0
  106. package/front_end/panels/sources/ProfilePlugin.ts +3 -0
  107. package/front_end/panels/sources/UISourceCodeFrame.ts +11 -2
  108. package/front_end/panels/sources/sourcesView.css +0 -130
  109. package/front_end/panels/timeline/TimelineTreeView.ts +3 -1
  110. package/front_end/third_party/codemirror/codemirror-tsconfig.json +1 -25
  111. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  112. package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -2
  113. package/front_end/third_party/codemirror.next/chunk/java.js +1 -2
  114. package/front_end/third_party/codemirror.next/chunk/json.js +1 -2
  115. package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -2
  116. package/front_end/third_party/codemirror.next/chunk/php.js +1 -2
  117. package/front_end/third_party/codemirror.next/chunk/python.js +1 -2
  118. package/front_end/third_party/codemirror.next/chunk/wast.js +1 -2
  119. package/front_end/third_party/codemirror.next/chunk/xml.js +1 -2
  120. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1486 -1423
  121. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -2
  122. package/front_end/third_party/codemirror.next/package.json +10 -9
  123. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +168 -164
  124. package/front_end/third_party/lighthouse/locales/ar-XB.json +0 -3
  125. package/front_end/third_party/lighthouse/locales/ar.json +0 -3
  126. package/front_end/third_party/lighthouse/locales/bg.json +17 -20
  127. package/front_end/third_party/lighthouse/locales/ca.json +0 -3
  128. package/front_end/third_party/lighthouse/locales/cs.json +0 -3
  129. package/front_end/third_party/lighthouse/locales/da.json +16 -19
  130. package/front_end/third_party/lighthouse/locales/de.json +0 -3
  131. package/front_end/third_party/lighthouse/locales/el.json +0 -3
  132. package/front_end/third_party/lighthouse/locales/en-GB.json +19 -22
  133. package/front_end/third_party/lighthouse/locales/en-US.json +33 -3
  134. package/front_end/third_party/lighthouse/locales/en-XA.json +0 -3
  135. package/front_end/third_party/lighthouse/locales/en-XL.json +33 -3
  136. package/front_end/third_party/lighthouse/locales/es-419.json +17 -20
  137. package/front_end/third_party/lighthouse/locales/es.json +0 -3
  138. package/front_end/third_party/lighthouse/locales/fi.json +16 -19
  139. package/front_end/third_party/lighthouse/locales/fil.json +33 -36
  140. package/front_end/third_party/lighthouse/locales/fr.json +16 -19
  141. package/front_end/third_party/lighthouse/locales/he.json +16 -19
  142. package/front_end/third_party/lighthouse/locales/hi.json +0 -3
  143. package/front_end/third_party/lighthouse/locales/hr.json +16 -19
  144. package/front_end/third_party/lighthouse/locales/hu.json +16 -19
  145. package/front_end/third_party/lighthouse/locales/id.json +16 -19
  146. package/front_end/third_party/lighthouse/locales/it.json +37 -40
  147. package/front_end/third_party/lighthouse/locales/ja.json +16 -19
  148. package/front_end/third_party/lighthouse/locales/ko.json +16 -19
  149. package/front_end/third_party/lighthouse/locales/lt.json +17 -20
  150. package/front_end/third_party/lighthouse/locales/lv.json +0 -3
  151. package/front_end/third_party/lighthouse/locales/nl.json +16 -19
  152. package/front_end/third_party/lighthouse/locales/no.json +17 -20
  153. package/front_end/third_party/lighthouse/locales/pl.json +16 -19
  154. package/front_end/third_party/lighthouse/locales/pt-PT.json +37 -40
  155. package/front_end/third_party/lighthouse/locales/pt.json +16 -19
  156. package/front_end/third_party/lighthouse/locales/ro.json +0 -3
  157. package/front_end/third_party/lighthouse/locales/ru.json +16 -19
  158. package/front_end/third_party/lighthouse/locales/sk.json +0 -3
  159. package/front_end/third_party/lighthouse/locales/sl.json +0 -3
  160. package/front_end/third_party/lighthouse/locales/sr-Latn.json +16 -19
  161. package/front_end/third_party/lighthouse/locales/sr.json +16 -19
  162. package/front_end/third_party/lighthouse/locales/sv.json +17 -20
  163. package/front_end/third_party/lighthouse/locales/ta.json +0 -3
  164. package/front_end/third_party/lighthouse/locales/te.json +0 -3
  165. package/front_end/third_party/lighthouse/locales/th.json +0 -3
  166. package/front_end/third_party/lighthouse/locales/tr.json +0 -3
  167. package/front_end/third_party/lighthouse/locales/uk.json +17 -20
  168. package/front_end/third_party/lighthouse/locales/vi.json +0 -3
  169. package/front_end/third_party/lighthouse/locales/zh-HK.json +0 -3
  170. package/front_end/third_party/lighthouse/locales/zh-TW.json +0 -3
  171. package/front_end/third_party/lighthouse/locales/zh.json +0 -3
  172. package/front_end/third_party/lighthouse/report/bundle.d.ts +63 -61
  173. package/front_end/third_party/lighthouse/report/bundle.js +36 -7
  174. package/front_end/third_party/lighthouse/report-assets/report-generator.js +205 -192
  175. package/front_end/ui/components/diff_view/DiffView.ts +4 -4
  176. package/front_end/ui/components/helpers/component-server-setup.ts +1 -12
  177. package/front_end/ui/components/helpers/helpers.ts +0 -2
  178. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  179. package/front_end/ui/components/issue_counter/IssueCounter.ts +2 -2
  180. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +3 -3
  181. package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
  182. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +98 -0
  183. package/front_end/ui/components/panel_feedback/panel_feedback.ts +1 -0
  184. package/front_end/ui/components/panel_feedback/previewToggle.css +24 -0
  185. package/front_end/ui/components/report_view/ReportView.ts +22 -0
  186. package/front_end/ui/components/report_view/reportSection.css +20 -0
  187. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
  188. package/front_end/ui/components/settings/SettingCheckbox.ts +2 -2
  189. package/front_end/ui/components/text_editor/config.ts +11 -9
  190. package/front_end/ui/components/text_editor/javascript.ts +34 -12
  191. package/front_end/ui/components/text_editor/theme.ts +1 -0
  192. package/front_end/ui/components/text_prompt/TextPrompt.ts +2 -2
  193. package/front_end/ui/legacy/GlassPane.ts +1 -1
  194. package/front_end/ui/legacy/InspectorView.ts +10 -0
  195. package/front_end/ui/legacy/SearchableView.ts +2 -1
  196. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  197. package/front_end/ui/legacy/Widget.ts +1 -1
  198. package/front_end/ui/legacy/XWidget.ts +0 -5
  199. package/front_end/ui/legacy/components/inline_editor/CSSVarSwatch.ts +2 -2
  200. package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +1 -1
  201. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +2 -3
  202. package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +0 -1
  203. package/front_end/ui/legacy/components/object_ui/object_ui-legacy.ts +0 -8
  204. package/front_end/ui/legacy/components/object_ui/object_ui.ts +0 -4
  205. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +40 -29
  206. package/front_end/ui/legacy/inspectorSyntaxHighlight.css +0 -211
  207. package/front_end/ui/legacy/legacy-legacy.ts +0 -6
  208. package/front_end/ui/legacy/legacy.ts +0 -2
  209. package/front_end/ui/legacy/tabbedPane.css +1 -1
  210. package/front_end/ui/legacy/themeColors.css +1 -1
  211. package/front_end/ui/legacy/utils/append-style.ts +2 -13
  212. package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +7 -5
  213. package/package.json +2 -4
  214. package/scripts/build/build_inspector_overlay.py +15 -1
  215. package/scripts/build/rjsmin.py +84 -115
  216. package/scripts/eslint_rules/lib/l10n_filename_matches.js +4 -4
  217. package/scripts/eslint_rules/lib/lit_html_no_attribute_quotes.js +101 -0
  218. package/scripts/eslint_rules/lib/no_only_eslint_tests.js +53 -0
  219. package/scripts/eslint_rules/tests/.eslintrc.js +14 -0
  220. package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +4 -0
  221. package/scripts/eslint_rules/tests/lit_html_no_attribute_quotes_test.js +45 -0
  222. package/scripts/eslint_rules/tests/no_only_eslint_tests_test.js +94 -0
  223. package/scripts/hosted_mode/server.js +17 -2
  224. package/front_end/entrypoints/devtools_app/devtools_app.js +0 -8
  225. package/front_end/entrypoints/devtools_app/devtools_app.json +0 -6
  226. package/front_end/entrypoints/inspector/inspector.json +0 -4
  227. package/front_end/entrypoints/js_app/js_app.js +0 -9
  228. package/front_end/entrypoints/js_app/js_app.json +0 -4
  229. package/front_end/entrypoints/ndb_app/ndb_app.json +0 -5
  230. package/front_end/entrypoints/node_app/node_app-meta.ts +0 -43
  231. package/front_end/entrypoints/node_app/node_app.js +0 -13
  232. package/front_end/entrypoints/node_app/node_app.json +0 -4
  233. package/front_end/entrypoints/node_main/node_main-meta.ts +0 -48
  234. package/front_end/entrypoints/node_main/node_main.ts +0 -11
  235. package/front_end/entrypoints/shell/shell.js +0 -13
  236. package/front_end/entrypoints/shell/shell.json +0 -5
  237. package/front_end/entrypoints/startup/RuntimeInstantiator.ts +0 -95
  238. package/front_end/entrypoints/startup/startup.ts +0 -9
  239. package/front_end/entrypoints/worker_app/worker_app.json +0 -4
  240. package/front_end/panels/lighthouse/module.json +0 -6
  241. package/front_end/third_party/lighthouse/report-assets/report.d.ts +0 -1
  242. package/front_end/third_party/lighthouse/report-assets/report.js +0 -233
  243. package/front_end/third_party/lighthouse/report-assets/standalone-template.html +0 -38
  244. package/front_end/ui/components/helpers/get-stylesheet.ts +0 -45
  245. package/front_end/ui/legacy/TextEditor.ts +0 -82
  246. package/front_end/ui/legacy/components/object_ui/JavaScriptAutocomplete.ts +0 -836
  247. package/front_end/ui/legacy/components/text_editor/CodeMirrorTextEditor.ts +0 -1676
  248. package/front_end/ui/legacy/components/text_editor/TextEditorAutocompleteController.ts +0 -586
  249. package/front_end/ui/legacy/components/text_editor/autocompleteTooltip.css +0 -20
  250. package/front_end/ui/legacy/components/text_editor/cm_modes.ts +0 -23
  251. package/front_end/ui/legacy/components/text_editor/cmdevtools.css +0 -995
  252. package/front_end/ui/legacy/components/text_editor/module.json +0 -7
  253. package/front_end/ui/legacy/components/text_editor/text_editor-legacy.ts +0 -33
  254. package/front_end/ui/legacy/components/text_editor/text_editor.ts +0 -13
  255. package/scripts/build/build_release_applications.py +0 -216
  256. package/scripts/build/modular_build.py +0 -184
  257. package/scripts/check_gn.js +0 -119
  258. package/scripts/json_validator/module.schema.json +0 -19
  259. package/scripts/json_validator/validate_module_json.js +0 -44
@@ -1542,6 +1542,8 @@ export function registerCommands(inspectorBackend) {
1542
1542
  PreflightInvalidAllowCredentials: 'PreflightInvalidAllowCredentials',
1543
1543
  PreflightMissingAllowExternal: 'PreflightMissingAllowExternal',
1544
1544
  PreflightInvalidAllowExternal: 'PreflightInvalidAllowExternal',
1545
+ PreflightMissingAllowPrivateNetwork: 'PreflightMissingAllowPrivateNetwork',
1546
+ PreflightInvalidAllowPrivateNetwork: 'PreflightInvalidAllowPrivateNetwork',
1545
1547
  InvalidAllowMethodsPreflightResponse: 'InvalidAllowMethodsPreflightResponse',
1546
1548
  InvalidAllowHeadersPreflightResponse: 'InvalidAllowHeadersPreflightResponse',
1547
1549
  MethodDisallowedByPreflightResponse: 'MethodDisallowedByPreflightResponse',
@@ -2203,6 +2205,7 @@ export function registerCommands(inspectorBackend) {
2203
2205
  ContentWebUSB: 'ContentWebUSB',
2204
2206
  ContentMediaSession: 'ContentMediaSession',
2205
2207
  ContentMediaSessionService: 'ContentMediaSessionService',
2208
+ ContentScreenReader: 'ContentScreenReader',
2206
2209
  EmbedderPopupBlockerTabHelper: 'EmbedderPopupBlockerTabHelper',
2207
2210
  EmbedderSafeBrowsingTriggeredPopupBlocker: 'EmbedderSafeBrowsingTriggeredPopupBlocker',
2208
2211
  EmbedderSafeBrowsingThreatDetails: 'EmbedderSafeBrowsingThreatDetails',
@@ -2686,7 +2689,8 @@ export function registerCommands(inspectorBackend) {
2686
2689
  [
2687
2690
  {'name': 'disposeOnDetach', 'type': 'boolean', 'optional': true},
2688
2691
  {'name': 'proxyServer', 'type': 'string', 'optional': true},
2689
- {'name': 'proxyBypassList', 'type': 'string', 'optional': true}
2692
+ {'name': 'proxyBypassList', 'type': 'string', 'optional': true},
2693
+ {'name': 'originsWithUniversalNetworkAccess', 'type': 'object', 'optional': true}
2690
2694
  ],
2691
2695
  ['browserContextId']);
2692
2696
  inspectorBackend.registerCommand('Target.getBrowserContexts', [], ['browserContextIds']);
@@ -7174,6 +7174,8 @@ declare namespace Protocol {
7174
7174
  PreflightInvalidAllowCredentials = 'PreflightInvalidAllowCredentials',
7175
7175
  PreflightMissingAllowExternal = 'PreflightMissingAllowExternal',
7176
7176
  PreflightInvalidAllowExternal = 'PreflightInvalidAllowExternal',
7177
+ PreflightMissingAllowPrivateNetwork = 'PreflightMissingAllowPrivateNetwork',
7178
+ PreflightInvalidAllowPrivateNetwork = 'PreflightInvalidAllowPrivateNetwork',
7177
7179
  InvalidAllowMethodsPreflightResponse = 'InvalidAllowMethodsPreflightResponse',
7178
7180
  InvalidAllowHeadersPreflightResponse = 'InvalidAllowHeadersPreflightResponse',
7179
7181
  MethodDisallowedByPreflightResponse = 'MethodDisallowedByPreflightResponse',
@@ -10442,6 +10444,10 @@ declare namespace Protocol {
10442
10444
  * The fantasy font-family.
10443
10445
  */
10444
10446
  fantasy?: string;
10447
+ /**
10448
+ * The pictograph font-family.
10449
+ */
10450
+ pictograph?: string;
10445
10451
  }
10446
10452
 
10447
10453
  /**
@@ -10649,6 +10655,7 @@ declare namespace Protocol {
10649
10655
  ContentWebUSB = 'ContentWebUSB',
10650
10656
  ContentMediaSession = 'ContentMediaSession',
10651
10657
  ContentMediaSessionService = 'ContentMediaSessionService',
10658
+ ContentScreenReader = 'ContentScreenReader',
10652
10659
  EmbedderPopupBlockerTabHelper = 'EmbedderPopupBlockerTabHelper',
10653
10660
  EmbedderSafeBrowsingTriggeredPopupBlocker = 'EmbedderSafeBrowsingTriggeredPopupBlocker',
10654
10661
  EmbedderSafeBrowsingThreatDetails = 'EmbedderSafeBrowsingThreatDetails',
@@ -12892,6 +12899,11 @@ declare namespace Protocol {
12892
12899
  * Proxy bypass list, similar to the one passed to --proxy-bypass-list
12893
12900
  */
12894
12901
  proxyBypassList?: string;
12902
+ /**
12903
+ * An optional list of origins to grant unlimited cross-origin access to.
12904
+ * Parts of the URL other than those constituting origin are ignored.
12905
+ */
12906
+ originsWithUniversalNetworkAccess?: string[];
12895
12907
  }
12896
12908
 
12897
12909
  export interface CreateBrowserContextResponse extends ProtocolResponseWithError {
@@ -1,9 +1,6 @@
1
1
  // Copyright 2020 The Chromium Authors. All rights reserved.
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
- interface StringConstructor {
5
- sprintf(format: string, ...var_arg: any): string;
6
- }
7
4
 
8
5
  interface Window {
9
6
  UI: {themeSupport: unknown}
@@ -124,7 +121,6 @@ interface Node {
124
121
 
125
122
  declare function isEnterOrSpaceKey(event: Event): boolean;
126
123
  declare function isEscKey(event: Event): boolean;
127
- declare function createPlainTextSearchRegex(query: string, flags?: string): RegExp;
128
124
  declare function onInvokeElement(element: Element, callback: (event: Event) => void): void;
129
125
 
130
126
  interface ServicePort {
@@ -8,7 +8,6 @@ import '../../models/workspace/workspace-legacy.js';
8
8
  import '../../ui/legacy/components/source_frame/source_frame-legacy.js';
9
9
  import '../../models/text_utils/text_utils-legacy.js';
10
10
  import '../../ui/legacy/components/object_ui/object_ui-legacy.js';
11
- import '../../ui/legacy/components/text_editor/text_editor-legacy.js';
12
11
  import '../../panels/browser_debugger/browser_debugger-legacy.js';
13
12
 
14
13
  import './SourcesTestRunner.js';
@@ -23,6 +23,10 @@ self.Platform = self.Platform || {};
23
23
  self.Platform.StringUtilities = Platform.StringUtilities;
24
24
  self.Platform.MapUtilities = Platform.MapUtilities;
25
25
  self.Platform.ArrayUtilities = Platform.ArrayUtilities;
26
+ self.createPlainTextSearchRegex = Platform.StringUtilities.createPlainTextSearchRegex;
27
+ String.sprintf = Platform.StringUtilities.sprintf;
28
+ String.regexSpecialCharacters = Platform.StringUtilities.regexSpecialCharacters;
29
+ String.caseInsensetiveComparator = Platform.StringUtilities.caseInsensetiveComparator;
26
30
 
27
31
  /**
28
32
  * @return {boolean}
@@ -229,23 +233,36 @@ export function addSnifferPromise(receiver, methodName) {
229
233
  });
230
234
  }
231
235
 
232
- /** @type {function():void} */
233
- let _resolveOnFinishInits;
234
-
235
- /**
236
- * @param {string} module
237
- * @return {!Promise<undefined>}
238
- */
239
- export async function loadModule(module) {
240
- const promise = new Promise(resolve => {
241
- _resolveOnFinishInits = resolve;
242
- });
243
- await self.runtime.loadModulePromise(module);
244
- if (!_pendingInits) {
245
- return;
246
- }
247
- return promise;
248
- }
236
+ const mappingForLayoutTests = new Map([
237
+ ['panels/animation', 'animation'],
238
+ ['panels/browser_debugger', 'browser_debugger'],
239
+ ['panels/changes', 'changes'],
240
+ ['panels/console', 'console'],
241
+ ['panels/elements', 'elements'],
242
+ ['panels/emulation', 'emulation'],
243
+ ['panels/mobile_throttling', 'mobile_throttling'],
244
+ ['panels/network', 'network'],
245
+ ['panels/profiler', 'profiler'],
246
+ ['panels/application', 'resources'],
247
+ ['panels/search', 'search'],
248
+ ['panels/sources', 'sources'],
249
+ ['panels/snippets', 'snippets'],
250
+ ['panels/settings', 'settings'],
251
+ ['panels/timeline', 'timeline'],
252
+ ['panels/web_audio', 'web_audio'],
253
+ ['models/persistence', 'persistence'],
254
+ ['models/workspace_diff', 'workspace_diff'],
255
+ ['entrypoints/main', 'main'],
256
+ ['third_party/diff', 'diff'],
257
+ ['ui/legacy/components/inline_editor', 'inline_editor'],
258
+ ['ui/legacy/components/data_grid', 'data_grid'],
259
+ ['ui/legacy/components/perf_ui', 'perf_ui'],
260
+ ['ui/legacy/components/source_frame', 'source_frame'],
261
+ ['ui/legacy/components/color_picker', 'color_picker'],
262
+ ['ui/legacy/components/cookie_table', 'cookie_table'],
263
+ ['ui/legacy/components/quick_open', 'quick_open'],
264
+ ['ui/legacy/components/utils', 'components'],
265
+ ]);
249
266
 
250
267
  /**
251
268
  * @param {string} module
@@ -253,7 +270,7 @@ export async function loadModule(module) {
253
270
  */
254
271
  export async function loadLegacyModule(module) {
255
272
  let containingFolder = module;
256
- for (const [remappedFolder, originalFolder] of Root.Runtime.mappingForLayoutTests.entries()) {
273
+ for (const [remappedFolder, originalFolder] of mappingForLayoutTests.entries()) {
257
274
  if (originalFolder === module) {
258
275
  containingFolder = remappedFolder;
259
276
  }
@@ -667,9 +684,6 @@ export function addIframe(path, options = {}) {
667
684
  `);
668
685
  }
669
686
 
670
- /** @type {number} */
671
- let _pendingInits = 0;
672
-
673
687
  /**
674
688
  * The old test framework executed certain snippets in the inspected page
675
689
  * context as part of loading a test helper file.
@@ -685,12 +699,7 @@ let _pendingInits = 0;
685
699
  * @param {string} code
686
700
  */
687
701
  export async function deprecatedInitAsync(code) {
688
- _pendingInits++;
689
702
  await TestRunner.RuntimeAgent.invoke_evaluate({expression: code, objectGroup: 'console'});
690
- _pendingInits--;
691
- if (!_pendingInits && _resolveOnFinishInits !== undefined) {
692
- _resolveOnFinishInits();
693
- }
694
703
  }
695
704
 
696
705
  /**
@@ -1290,36 +1299,6 @@ export class MockSetting {
1290
1299
  }
1291
1300
  }
1292
1301
 
1293
- /**
1294
- * @return {!Array<!Root.Runtime.Module>}
1295
- */
1296
- export function loadedModules() {
1297
- return self.runtime.modules.filter(module => module.loadedForTest)
1298
- .filter(module => module.name() !== 'help')
1299
- .filter(module => module.name().indexOf('test_runner') === -1);
1300
- }
1301
-
1302
- /**
1303
- * @param {!Array<!Root.Runtime.Module>} relativeTo
1304
- * @return {!Array<!Root.Runtime.Module>}
1305
- */
1306
- export function dumpLoadedModules(relativeTo) {
1307
- const previous = new Set(relativeTo || []);
1308
- function moduleSorter(left, right) {
1309
- return Platform.StringUtilities.naturalOrderComparator(left.descriptor.name, right.descriptor.name);
1310
- }
1311
-
1312
- addResult('Loaded modules:');
1313
- const sortedLoadedModules = loadedModules().sort(moduleSorter);
1314
- for (const module of sortedLoadedModules) {
1315
- if (previous.has(module)) {
1316
- continue;
1317
- }
1318
- addResult(' ' + module.descriptor.name);
1319
- }
1320
- return sortedLoadedModules;
1321
- }
1322
-
1323
1302
  /**
1324
1303
  * @param {string} urlSuffix
1325
1304
  * @param {!Workspace.Workspace.projectTypes=} projectType
@@ -1511,13 +1490,10 @@ TestRunner.override = override;
1511
1490
  TestRunner.clearSpecificInfoFromStackFrames = clearSpecificInfoFromStackFrames;
1512
1491
  TestRunner.hideInspectorView = hideInspectorView;
1513
1492
  TestRunner.mainFrame = mainFrame;
1514
- TestRunner.loadedModules = loadedModules;
1515
- TestRunner.dumpLoadedModules = dumpLoadedModules;
1516
1493
  TestRunner.waitForUISourceCode = waitForUISourceCode;
1517
1494
  TestRunner.waitForUISourceCodeRemoved = waitForUISourceCodeRemoved;
1518
1495
  TestRunner.url = url;
1519
1496
  TestRunner.dumpSyntaxHighlight = dumpSyntaxHighlight;
1520
- TestRunner.loadModule = loadModule;
1521
1497
  TestRunner.loadLegacyModule = loadLegacyModule;
1522
1498
  TestRunner.loadTestModule = loadTestModule;
1523
1499
  TestRunner.evaluateInPageRemoteObject = evaluateInPageRemoteObject;
@@ -329,7 +329,6 @@ class Binding {
329
329
  readonly #project: ContentProviderBasedProject;
330
330
  readonly #url: string;
331
331
  referringSourceMaps: SDK.SourceMap.SourceMap[];
332
- readonly #activeSourceMap?: SDK.SourceMap.SourceMap|null;
333
332
  uiSourceCode: Workspace.UISourceCode.UISourceCode|null;
334
333
 
335
334
  constructor(project: ContentProviderBasedProject, url: string) {
@@ -614,15 +614,12 @@ class SourceScopeRemoteObject extends SDK.RemoteObject.RemoteObjectImpl {
614
614
  variables: Chrome.DevTools.Variable[];
615
615
  #callFrame: SDK.DebuggerModel.CallFrame;
616
616
  #plugin: DebuggerLanguagePlugin;
617
- readonly #location: Chrome.DevTools.RawLocation;
618
617
 
619
- constructor(
620
- callFrame: SDK.DebuggerModel.CallFrame, plugin: DebuggerLanguagePlugin, location: Chrome.DevTools.RawLocation) {
618
+ constructor(callFrame: SDK.DebuggerModel.CallFrame, plugin: DebuggerLanguagePlugin) {
621
619
  super(callFrame.debuggerModel.runtimeModel(), undefined, 'object', undefined, null);
622
620
  this.variables = [];
623
621
  this.#callFrame = callFrame;
624
622
  this.#plugin = plugin;
625
- this.#location = location;
626
623
  }
627
624
 
628
625
  async doGetProperties(ownProperties: boolean, accessorPropertiesOnly: boolean, _generatePreview: boolean):
@@ -691,18 +688,16 @@ export class SourceScope implements SDK.DebuggerModel.ScopeChainEntry {
691
688
  readonly #typeNameInternal: string;
692
689
  readonly #iconInternal: string|undefined;
693
690
  readonly #objectInternal: SourceScopeRemoteObject;
694
- readonly #nameInternal: string;
695
691
  readonly #startLocationInternal: SDK.DebuggerModel.Location|null;
696
692
  readonly #endLocationInternal: SDK.DebuggerModel.Location|null;
697
693
  constructor(
698
694
  callFrame: SDK.DebuggerModel.CallFrame, type: string, typeName: string, icon: string|undefined,
699
- plugin: DebuggerLanguagePlugin, location: Chrome.DevTools.RawLocation) {
695
+ plugin: DebuggerLanguagePlugin) {
700
696
  this.#callFrameInternal = callFrame;
701
697
  this.#typeInternal = type;
702
698
  this.#typeNameInternal = typeName;
703
699
  this.#iconInternal = icon;
704
- this.#objectInternal = new SourceScopeRemoteObject(callFrame, plugin, location);
705
- this.#nameInternal = type;
700
+ this.#objectInternal = new SourceScopeRemoteObject(callFrame, plugin);
706
701
  this.#startLocationInternal = null;
707
702
  this.#endLocationInternal = null;
708
703
  }
@@ -1154,7 +1149,7 @@ export class DebuggerLanguagePluginManager implements
1154
1149
  let scope = scopes.get(variable.scope);
1155
1150
  if (!scope) {
1156
1151
  const {type, typeName, icon} = await plugin.getScopeInfo(variable.scope);
1157
- scope = new SourceScope(callFrame, type, typeName, icon, plugin, location);
1152
+ scope = new SourceScope(callFrame, type, typeName, icon, plugin);
1158
1153
  scopes.set(variable.scope, scope);
1159
1154
  }
1160
1155
  scope.object().variables.push(variable);
@@ -1292,11 +1287,9 @@ export class DebuggerLanguagePluginManager implements
1292
1287
  }
1293
1288
 
1294
1289
  class ModelData {
1295
- readonly #debuggerModel: SDK.DebuggerModel.DebuggerModel;
1296
1290
  project: ContentProviderBasedProject;
1297
1291
  readonly uiSourceCodeToScripts: Map<Workspace.UISourceCode.UISourceCode, SDK.Script.Script[]>;
1298
1292
  constructor(debuggerModel: SDK.DebuggerModel.DebuggerModel, workspace: Workspace.Workspace.WorkspaceImpl) {
1299
- this.#debuggerModel = debuggerModel;
1300
1293
  this.project = new ContentProviderBasedProject(
1301
1294
  workspace, 'language_plugins::' + debuggerModel.target().id(), Workspace.Workspace.projectTypes.Network, '',
1302
1295
  false /* isServiceProject */);
@@ -341,7 +341,7 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
341
341
  modelData.callFrameLocations.clear();
342
342
  }
343
343
 
344
- private resetForTest(target: SDK.Target.Target): void {
344
+ resetForTest(target: SDK.Target.Target): void {
345
345
  const debuggerModel = (target.model(SDK.DebuggerModel.DebuggerModel) as SDK.DebuggerModel.DebuggerModel);
346
346
  const modelData = this.#debuggerModelToData.get(debuggerModel);
347
347
  if (modelData) {
@@ -149,7 +149,7 @@ export class ResourceMapping implements SDK.TargetManager.SDKModelObserver<SDK.R
149
149
  uiLocation.uiSourceCode.url(), uiLocation.lineNumber, uiLocation.columnNumber);
150
150
  }
151
151
 
152
- private resetForTest(target: SDK.Target.Target): void {
152
+ resetForTest(target: SDK.Target.Target): void {
153
153
  const resourceTreeModel = target.model(SDK.ResourceTreeModel.ResourceTreeModel);
154
154
  const info = resourceTreeModel ? this.#modelToInfo.get(resourceTreeModel) : null;
155
155
  if (info) {
@@ -165,7 +165,6 @@ class Binding {
165
165
  readonly #project: ContentProviderBasedProject;
166
166
  readonly #url: string;
167
167
  referringSourceMaps: SDK.SourceMap.TextSourceMap[];
168
- readonly #activeSourceMap?: SDK.SourceMap.TextSourceMap|null;
169
168
  uiSourceCode: Workspace.UISourceCode.UISourceCode|null;
170
169
 
171
170
  constructor(project: ContentProviderBasedProject, url: string) {
@@ -99,7 +99,6 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
99
99
  #touchMobile: boolean;
100
100
  #emulationModel: SDK.EmulationModel.EmulationModel|null;
101
101
  #onModelAvailable: (() => void)|null;
102
- #emulatedPageSize?: UI.Geometry.Size;
103
102
  #outlineRectInternal?: Rect;
104
103
 
105
104
  private constructor() {
@@ -622,7 +621,6 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
622
621
 
623
622
  let pageWidth: 0|number = screenSize.width - insets.left - insets.right;
624
623
  let pageHeight: 0|number = screenSize.height - insets.top - insets.bottom;
625
- this.#emulatedPageSize = new UI.Geometry.Size(pageWidth, pageHeight);
626
624
 
627
625
  const positionX = insets.left;
628
626
  const positionY = insets.top;
@@ -171,24 +171,6 @@ export class FormatterWorkerPool {
171
171
  }
172
172
  }
173
173
 
174
- findLastExpression(content: string): Promise<string|null> {
175
- return this.runTask(FormatterActions.FormatterActions.FIND_LAST_EXPRESSION, {content}) as Promise<string|null>;
176
- }
177
-
178
- findLastFunctionCall(content: string): Promise<{
179
- baseExpression: string,
180
- receiver: string,
181
- argumentIndex: number,
182
- functionName: string,
183
- }|null> {
184
- return this.runTask(FormatterActions.FormatterActions.FIND_LAST_FUNCTION_CALL, {content}) as Promise<{
185
- baseExpression: string,
186
- receiver: string,
187
- argumentIndex: number,
188
- functionName: string,
189
- }|null>;
190
- }
191
-
192
174
  argumentsList(content: string): Promise<string[]> {
193
175
  return this.runTask(FormatterActions.FormatterActions.ARGUMENTS_LIST, {content}) as Promise<string[]>;
194
176
  }
@@ -13,7 +13,7 @@ const UIStrings = {
13
13
  /**
14
14
  *@description Label for the link for CORS private network issues
15
15
  */
16
- corsForPrivateNetworksRfc: 'CORS for private networks (RFC1918)',
16
+ corsPrivateNetworkAccess: 'Private Network Access',
17
17
  /**
18
18
  *@description Label for the link for CORS network issues
19
19
  */
@@ -26,7 +26,6 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
26
26
  // eslint-disable-next-line rulesdir/const_enum
27
27
  export enum IssueCode {
28
28
  InsecurePrivateNetwork = 'CorsIssue::InsecurePrivateNetwork',
29
- InsecurePrivateNetworkPreflight = 'CorsIssue::InsecurePrivateNetworkPreflight',
30
29
  InvalidHeaderValues = 'CorsIssue::InvalidHeaders',
31
30
  WildcardOriginNotAllowed = 'CorsIssue::WildcardOriginWithCredentials',
32
31
  PreflightResponseInvalid = 'CorsIssue::PreflightResponseInvalid',
@@ -37,12 +36,15 @@ export enum IssueCode {
37
36
  RedirectContainsCredentials = 'CorsIssue::RedirectContainsCredentials',
38
37
  DisallowedByMode = 'CorsIssue::DisallowedByMode',
39
38
  CorsDisabledScheme = 'CorsIssue::CorsDisabledScheme',
39
+ // TODO(https://crbug.com/1263483): Remove this once it's removed from CDP.
40
40
  PreflightMissingAllowExternal = 'CorsIssue::PreflightMissingAllowExternal',
41
+ // TODO(https://crbug.com/1263483): Remove this once it's removed from CDP.
41
42
  PreflightInvalidAllowExternal = 'CorsIssue::PreflightInvalidAllowExternal',
42
43
  InvalidResponse = 'CorsIssue::InvalidResponse',
43
44
  NoCorsRedirectModeNotFollow = 'CorsIssue::NoCorsRedirectModeNotFollow',
44
45
  InvalidPrivateNetworkAccess = 'CorsIssue::InvalidPrivateNetworkAccess',
45
46
  UnexpectedPrivateNetworkAccess = 'CorsIssue::UnexpectedPrivateNetworkAccess',
47
+ PreflightAllowPrivateNetworkError = 'CorsIssue::PreflightAllowPrivateNetworkError',
46
48
  }
47
49
 
48
50
  function getIssueCode(details: Protocol.Audits.CorsIssueDetails): IssueCode {
@@ -85,14 +87,16 @@ function getIssueCode(details: Protocol.Audits.CorsIssueDetails): IssueCode {
85
87
  case Protocol.Network.CorsError.InvalidResponse:
86
88
  return IssueCode.InvalidResponse;
87
89
  case Protocol.Network.CorsError.InsecurePrivateNetwork:
88
- return details.clientSecurityState?.initiatorIsSecureContext ? IssueCode.InsecurePrivateNetworkPreflight :
89
- IssueCode.InsecurePrivateNetwork;
90
+ return IssueCode.InsecurePrivateNetwork;
90
91
  case Protocol.Network.CorsError.NoCorsRedirectModeNotFollow:
91
92
  return IssueCode.NoCorsRedirectModeNotFollow;
92
93
  case Protocol.Network.CorsError.InvalidPrivateNetworkAccess:
93
94
  return IssueCode.InvalidPrivateNetworkAccess;
94
95
  case Protocol.Network.CorsError.UnexpectedPrivateNetworkAccess:
95
96
  return IssueCode.UnexpectedPrivateNetworkAccess;
97
+ case Protocol.Network.CorsError.PreflightMissingAllowPrivateNetwork:
98
+ case Protocol.Network.CorsError.PreflightInvalidAllowPrivateNetwork:
99
+ return IssueCode.PreflightAllowPrivateNetworkError;
96
100
  }
97
101
  }
98
102
 
@@ -121,15 +125,15 @@ export class CorsIssue extends Issue<IssueCode> {
121
125
  file: 'corsInsecurePrivateNetwork.md',
122
126
  links: [{
123
127
  link: 'https://developer.chrome.com/blog/private-network-access-update',
124
- linkTitle: i18nString(UIStrings.corsForPrivateNetworksRfc),
128
+ linkTitle: i18nString(UIStrings.corsPrivateNetworkAccess),
125
129
  }],
126
130
  };
127
- case IssueCode.InsecurePrivateNetworkPreflight:
131
+ case IssueCode.PreflightAllowPrivateNetworkError:
128
132
  return {
129
- file: 'corsInsecurePrivateNetworkPreflight.md',
133
+ file: 'corsPreflightAllowPrivateNetworkError.md',
130
134
  links: [{
131
135
  link: 'https://developer.chrome.com/blog/private-network-access-update',
132
- linkTitle: i18nString(UIStrings.corsForPrivateNetworksRfc),
136
+ linkTitle: i18nString(UIStrings.corsPrivateNetworkAccess),
133
137
  }],
134
138
  };
135
139
  case IssueCode.InvalidHeaderValues:
@@ -235,7 +239,11 @@ export class CorsIssue extends Issue<IssueCode> {
235
239
 
236
240
  getKind(): IssueKind {
237
241
  if (this.issueDetails.isWarning &&
238
- this.issueDetails.corsErrorStatus.corsError === Protocol.Network.CorsError.InsecurePrivateNetwork) {
242
+ (this.issueDetails.corsErrorStatus.corsError === Protocol.Network.CorsError.InsecurePrivateNetwork ||
243
+ this.issueDetails.corsErrorStatus.corsError ===
244
+ Protocol.Network.CorsError.PreflightMissingAllowPrivateNetwork ||
245
+ this.issueDetails.corsErrorStatus.corsError ===
246
+ Protocol.Network.CorsError.PreflightInvalidAllowPrivateNetwork)) {
239
247
  return IssueKind.BreakingChange;
240
248
  }
241
249
  return IssueKind.PageError;
@@ -3,7 +3,7 @@
3
3
  A site requested a resource from a network that it could only access because of its users' privileged network position.
4
4
  These requests expose devices and servers to the internet, increasing the risk of a cross-site request forgery (CSRF) attack, and/or information leakage.
5
5
 
6
- To mitigate these risks, a future version of Chrome will require non-public subresources to opt-into being accessed with a preflight request.
6
+ To mitigate these risks, Chrome will require non-public subresources to opt-into being accessed with a preflight request and will start blocking them in Chrome 101 (April 2022).
7
7
 
8
8
  To fix this issue, ensure that response to the [preflight request](issueCorsPreflightRequest) for the private network resource has the `Access-Control-Allow-Private-Network` header set to `true`.
9
9
 
@@ -31,57 +31,11 @@
31
31
  /* eslint-disable @typescript-eslint/no-explicit-any */
32
32
 
33
33
  import type * as CodeMirrorModule from '../../third_party/codemirror/codemirror-legacy.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
34
+ import '../../third_party/codemirror/package/addon/runmode/runmode-standalone.js';
35
+ import '../../third_party/codemirror/package/mode/css/css.js';
34
36
 
35
- import * as TextRange from './TextRange.js';
36
37
  import type * as TextUtils from './TextUtils.js';
37
38
 
38
- export function toPos(range: TextRange.TextRange): {
39
- start: any,
40
- end: any,
41
- } {
42
- return {
43
- start: new CodeMirror.Pos(range.startLine, range.startColumn),
44
- end: new CodeMirror.Pos(range.endLine, range.endColumn),
45
- };
46
- }
47
-
48
- export function toRange(start: any, end: any): TextRange.TextRange {
49
- return new TextRange.TextRange(start.line, start.ch, end.line, end.ch);
50
- }
51
-
52
- export function changeObjectToEditOperation(changeObject: any): {
53
- oldRange: TextRange.TextRange,
54
- newRange: TextRange.TextRange,
55
- } {
56
- const oldRange = toRange(changeObject.from, changeObject.to);
57
- const newRange = oldRange.clone();
58
- const linesAdded = changeObject.text.length;
59
- if (linesAdded === 0) {
60
- newRange.endLine = newRange.startLine;
61
- newRange.endColumn = newRange.startColumn;
62
- } else if (linesAdded === 1) {
63
- newRange.endLine = newRange.startLine;
64
- newRange.endColumn = newRange.startColumn + changeObject.text[0].length;
65
- } else {
66
- newRange.endLine = newRange.startLine + linesAdded - 1;
67
- newRange.endColumn = changeObject.text[linesAdded - 1].length;
68
- }
69
- return {oldRange: oldRange, newRange: newRange};
70
- }
71
-
72
- export function pullLines(codeMirror: typeof CodeMirror, linesCount: number): string[] {
73
- const lines: string[] = [];
74
- // @ts-expect-error CodeMirror types do not specify eachLine.
75
- codeMirror.eachLine(0, linesCount, onLineHandle);
76
- return lines;
77
-
78
- function onLineHandle(lineHandle: {
79
- text: string,
80
- }): void {
81
- lines.push(lineHandle.text);
82
- }
83
- }
84
-
85
39
  let tokenizerFactoryInstance: TokenizerFactory;
86
40
 
87
41
  export type Tokenizer =
@@ -103,15 +57,16 @@ export class TokenizerFactory implements TextUtils.TokenizerFactory {
103
57
  }
104
58
 
105
59
  // https://crbug.com/1151919 * = CodeMirror.Mode
106
- createTokenizer(mimeType: string, mode?: any): Tokenizer {
107
- const cmMode = mode || CodeMirror.getMode({indentUnit: 2}, mimeType);
60
+ createTokenizer(mimeType: string): Tokenizer {
61
+ const cmMode = CodeMirror.getMode({indentUnit: 2}, mimeType);
108
62
  const state = CodeMirror.startState(cmMode);
109
63
 
110
64
  function tokenize(
111
65
  line: string, callback: (value: string, style: string|null, start: number, end: number) => void): void {
112
66
  const stream = new CodeMirror.StringStream(line);
113
67
  while (!stream.eol()) {
114
- const style = cmMode.token(stream, state);
68
+ const style =
69
+ (cmMode.token as (stream: CodeMirror.StringStream, state: unknown) => string | null)(stream, state);
115
70
  const value = stream.current();
116
71
  callback(value, style, stream.start, stream.start + value.length);
117
72
  stream.start = stream.pos;
@@ -29,7 +29,6 @@
29
29
  */
30
30
 
31
31
  import * as Platform from '../../core/platform/platform.js';
32
- import type * as CodeMirrorModule from '../../third_party/codemirror/codemirror-legacy.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
33
32
 
34
33
  import {SearchMatch} from './ContentProvider.js';
35
34
  import {Text} from './Text.js';
@@ -330,7 +329,7 @@ export class BalancedJSONTokenizer {
330
329
  export interface TokenizerFactory {
331
330
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
332
331
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
333
- createTokenizer(mimeType: string, mode?: CodeMirror.Mode<any>):
332
+ createTokenizer(mimeType: string):
334
333
  (arg0: string, arg1: (arg0: string, arg1: string|null, arg2: number, arg3: number) => void) => void;
335
334
  }
336
335
 
@@ -48,10 +48,5 @@ TextUtils.isMinified = TextUtilsModule.TextUtils.isMinified;
48
48
 
49
49
  TextUtils.CodeMirrorUtils = {};
50
50
 
51
- TextUtils.CodeMirrorUtils.toPos = TextUtilsModule.CodeMirrorUtils.toPos;
52
- TextUtils.CodeMirrorUtils.toRange = TextUtilsModule.CodeMirrorUtils.toRange;
53
- TextUtils.CodeMirrorUtils.changeObjectToEditOperation = TextUtilsModule.CodeMirrorUtils.changeObjectToEditOperation;
54
- TextUtils.CodeMirrorUtils.pullLines = TextUtilsModule.CodeMirrorUtils.pullLines;
55
-
56
51
  /** @constructor */
57
52
  TextUtils.CodeMirrorUtils.TokenizerFactory = TextUtilsModule.CodeMirrorUtils.TokenizerFactory;
@@ -107,7 +107,9 @@ export class AccessibilitySidebarView extends UI.ThrottledWidget.ThrottledWidget
107
107
  if (!accessibilityModel) {
108
108
  return;
109
109
  }
110
- accessibilityModel.clear();
110
+ if (!Root.Runtime.experiments.isEnabled('fullAccessibilityTree')) {
111
+ accessibilityModel.clear();
112
+ }
111
113
  await accessibilityModel.requestPartialAXTree(node);
112
114
  this.accessibilityNodeCallback(accessibilityModel.axNodeForDOMNode(node));
113
115
  }
@@ -107,7 +107,6 @@ export class AnimationTimeline extends UI.Widget.VBox implements SDK.TargetManag
107
107
  #uiAnimations: AnimationUI[];
108
108
  #groupBuffer: AnimationGroup[];
109
109
  readonly #previewMap: Map<AnimationGroup, AnimationGroupPreviewUI>;
110
- readonly #symbol: symbol;
111
110
  readonly #animationsMap: Map<string, AnimationImpl>;
112
111
  #timelineScrubberLine?: HTMLElement;
113
112
  #pauseButton?: UI.Toolbar.ToolbarToggle;
@@ -143,7 +142,6 @@ export class AnimationTimeline extends UI.Widget.VBox implements SDK.TargetManag
143
142
  this.#uiAnimations = [];
144
143
  this.#groupBuffer = [];
145
144
  this.#previewMap = new Map();
146
- this.#symbol = Symbol('animationTimeline');
147
145
  this.#animationsMap = new Map();
148
146
  SDK.TargetManager.TargetManager.instance().addModelListener(
149
147
  SDK.DOMModel.DOMModel, SDK.DOMModel.Events.NodeRemoved, this.nodeRemoved, this);
@@ -42,7 +42,6 @@ type CachedElement = {
42
42
  export class AnimationUI {
43
43
  #animationInternal: AnimationImpl;
44
44
  #timeline: AnimationTimeline;
45
- readonly #parentElement: Element;
46
45
  #keyframes?: KeyframeStyle[];
47
46
  #nameElement: HTMLElement;
48
47
  readonly #svg: Element;
@@ -62,7 +61,6 @@ export class AnimationUI {
62
61
  constructor(animation: AnimationImpl, timeline: AnimationTimeline, parentElement: Element) {
63
62
  this.#animationInternal = animation;
64
63
  this.#timeline = timeline;
65
- this.#parentElement = parentElement;
66
64
 
67
65
  const keyframesRule = this.#animationInternal.source().keyframesRule();
68
66
  if (keyframesRule) {
@@ -281,10 +281,8 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
281
281
  this.cacheStorageListTreeElement = new ServiceWorkerCacheTreeElement(panel);
282
282
  cacheTreeElement.appendChild(this.cacheStorageListTreeElement);
283
283
 
284
- if (Root.Runtime.experiments.isEnabled('bfcacheDebugging')) {
285
- this.backForwardCacheListTreeElement = new BackForwardCacheTreeElement(panel);
286
- cacheTreeElement.appendChild(this.backForwardCacheListTreeElement);
287
- }
284
+ this.backForwardCacheListTreeElement = new BackForwardCacheTreeElement(panel);
285
+ cacheTreeElement.appendChild(this.backForwardCacheListTreeElement);
288
286
 
289
287
  if (Root.Runtime.experiments.isEnabled('backgroundServices')) {
290
288
  const backgroundServiceSectionTitle = i18nString(UIStrings.backgroundServices);