chrome-devtools-frontend 1.0.950850 → 1.0.952284

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 (379) hide show
  1. package/config/gni/devtools_grd_files.gni +3 -3
  2. package/extension-api/ExtensionAPI.d.ts +1 -1
  3. package/front_end/.eslintrc.js +6 -0
  4. package/front_end/Tests.js +10 -0
  5. package/front_end/core/common/App.ts +0 -3
  6. package/front_end/core/common/AppProvider.ts +0 -3
  7. package/front_end/core/common/JavaScriptMetaData.ts +0 -3
  8. package/front_end/core/common/QueryParamHandler.ts +0 -3
  9. package/front_end/core/common/Runnable.ts +0 -3
  10. package/front_end/core/common/SimpleHistoryManager.ts +0 -3
  11. package/front_end/core/i18n/locales/en-US.json +183 -183
  12. package/front_end/core/i18n/locales/en-XL.json +183 -183
  13. package/front_end/core/sdk/CSSRule.ts +1 -1
  14. package/front_end/core/sdk/DOMModel.ts +12 -37
  15. package/front_end/core/sdk/OverlayModel.ts +18 -34
  16. package/front_end/core/sdk/OverlayPersistentHighlighter.ts +0 -12
  17. package/front_end/core/sdk/RuntimeModel.ts +0 -1
  18. package/front_end/core/sdk/SourceMap.ts +1 -1
  19. package/front_end/core/sdk/TracingManager.ts +0 -3
  20. package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +36 -36
  21. package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +53 -53
  22. package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +11 -11
  23. package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +43 -43
  24. package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +106 -105
  25. package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +26 -26
  26. package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +51 -56
  27. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +201 -204
  28. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +84 -83
  29. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +16 -16
  30. package/front_end/entrypoints/inspector_main/InspectorMain.ts +21 -21
  31. package/front_end/entrypoints/main/ExecutionContextSelector.ts +30 -30
  32. package/front_end/entrypoints/main/MainImpl.ts +12 -12
  33. package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +33 -33
  34. package/front_end/entrypoints/node_app/NodeMain.ts +35 -35
  35. package/front_end/generated/InspectorBackendCommands.js +5 -1
  36. package/front_end/generated/protocol.d.ts +16 -0
  37. package/front_end/models/bindings/CSSWorkspaceBinding.ts +0 -3
  38. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +1 -2
  39. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -4
  40. package/front_end/models/bindings/FileUtils.ts +0 -4
  41. package/front_end/models/bindings/IgnoreListManager.ts +1 -2
  42. package/front_end/models/bindings/NetworkProject.ts +1 -2
  43. package/front_end/models/extensions/ExtensionAPI.ts +2 -2
  44. package/front_end/models/extensions/ExtensionTraceProvider.ts +0 -3
  45. package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +6 -6
  46. package/front_end/models/issues_manager/ContrastCheckTrigger.ts +15 -15
  47. package/front_end/models/issues_manager/CorsIssue.ts +9 -9
  48. package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -5
  49. package/front_end/models/issues_manager/DeprecationIssue.ts +7 -7
  50. package/front_end/models/issues_manager/GenericIssue.ts +5 -5
  51. package/front_end/models/issues_manager/HeavyAdIssue.ts +5 -5
  52. package/front_end/models/issues_manager/Issue.ts +10 -10
  53. package/front_end/models/issues_manager/IssueResolver.ts +11 -10
  54. package/front_end/models/issues_manager/IssuesManager.ts +56 -56
  55. package/front_end/models/issues_manager/LowTextContrastIssue.ts +4 -4
  56. package/front_end/models/issues_manager/MixedContentIssue.ts +7 -7
  57. package/front_end/models/issues_manager/NavigatorUserAgentIssue.ts +7 -7
  58. package/front_end/models/issues_manager/QuirksModeIssue.ts +4 -4
  59. package/front_end/models/issues_manager/SameSiteCookieIssue.ts +17 -18
  60. package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +5 -5
  61. package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +32 -31
  62. package/front_end/models/issues_manager/TrustedWebActivityIssue.ts +5 -5
  63. package/front_end/models/issues_manager/WasmCrossOriginModuleSharingIssue.ts +5 -5
  64. package/front_end/models/timeline_model/TimelineModel.ts +1 -1
  65. package/front_end/models/timeline_model/TracingLayerTree.ts +0 -1
  66. package/front_end/panels/accessibility/ARIAMetadata.ts +0 -1
  67. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +2 -2
  68. package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -2
  69. package/front_end/panels/animation/AnimationTimeline.ts +0 -1
  70. package/front_end/panels/application/ApplicationPanelCacheSection.ts +3 -4
  71. package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +0 -2
  72. package/front_end/panels/application/StorageView.ts +2 -6
  73. package/front_end/panels/application/{BackForwardCacheStrings.ts → components/BackForwardCacheStrings.ts} +2 -2
  74. package/front_end/panels/application/{BackForwardCacheView.ts → components/BackForwardCacheView.ts} +96 -62
  75. package/front_end/panels/application/components/EndpointsGrid.ts +12 -12
  76. package/front_end/panels/application/components/FrameDetailsView.ts +108 -110
  77. package/front_end/panels/application/components/OriginTrialTreeView.ts +45 -45
  78. package/front_end/panels/application/components/PermissionsPolicySection.ts +19 -19
  79. package/front_end/panels/application/components/ReportsGrid.ts +30 -30
  80. package/front_end/panels/application/components/StackTrace.ts +48 -47
  81. package/front_end/panels/application/components/TrustTokensView.ts +31 -31
  82. package/front_end/panels/application/{backForwardCacheView.css → components/backForwardCacheView.css} +9 -0
  83. package/front_end/panels/application/components/components.ts +2 -0
  84. package/front_end/panels/console/ConsoleViewMessage.ts +1 -25
  85. package/front_end/panels/console/consoleView.css +5 -0
  86. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +41 -52
  87. package/front_end/panels/css_overview/CSSOverviewController.ts +2 -2
  88. package/front_end/panels/css_overview/CSSOverviewPanel.ts +18 -27
  89. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
  90. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +6 -6
  91. package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +4 -4
  92. package/front_end/panels/elements/ComputedStyleModel.ts +2 -2
  93. package/front_end/panels/elements/ElementsPanel.ts +1 -5
  94. package/front_end/panels/elements/ElementsTreeElement.ts +2 -6
  95. package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
  96. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  97. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +17 -17
  98. package/front_end/panels/elements/components/AdornerManager.ts +21 -21
  99. package/front_end/panels/elements/components/AdornerSettingsPane.ts +14 -14
  100. package/front_end/panels/elements/components/CSSQuery.ts +16 -16
  101. package/front_end/panels/elements/components/ComputedStyleProperty.ts +14 -14
  102. package/front_end/panels/elements/components/ComputedStyleTrace.ts +15 -15
  103. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +78 -78
  104. package/front_end/panels/elements/components/ElementsPanelLink.ts +16 -16
  105. package/front_end/panels/elements/components/LayoutPane.ts +47 -47
  106. package/front_end/panels/elements/components/NodeText.ts +18 -18
  107. package/front_end/panels/elements/components/QueryContainer.ts +40 -40
  108. package/front_end/panels/elements/components/StylePropertyEditor.ts +18 -18
  109. package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +4 -4
  110. package/front_end/panels/event_listeners/EventListenersUtils.ts +2 -1
  111. package/front_end/panels/issues/AffectedBlockedByResponseView.ts +4 -4
  112. package/front_end/panels/issues/AffectedCookiesView.ts +4 -5
  113. package/front_end/panels/issues/AffectedDirectivesView.ts +19 -19
  114. package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +7 -8
  115. package/front_end/panels/issues/AffectedElementsView.ts +4 -4
  116. package/front_end/panels/issues/AffectedElementsWithLowContrastView.ts +7 -8
  117. package/front_end/panels/issues/AffectedHeavyAdView.ts +8 -8
  118. package/front_end/panels/issues/AffectedResourcesView.ts +25 -26
  119. package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +8 -8
  120. package/front_end/panels/issues/AffectedSourcesView.ts +4 -4
  121. package/front_end/panels/issues/AffectedTrustedWebActivityIssueDetailsView.ts +4 -4
  122. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +17 -17
  123. package/front_end/panels/issues/CSPViolationsListView.ts +22 -23
  124. package/front_end/panels/issues/CSPViolationsView.ts +17 -17
  125. package/front_end/panels/issues/ComboBoxOfCheckBoxes.ts +13 -13
  126. package/front_end/panels/issues/CorsIssueDetailsView.ts +23 -23
  127. package/front_end/panels/issues/GenericIssueDetailsView.ts +4 -4
  128. package/front_end/panels/issues/HiddenIssuesRow.ts +7 -7
  129. package/front_end/panels/issues/IssueAggregator.ts +95 -95
  130. package/front_end/panels/issues/IssueKindView.ts +14 -14
  131. package/front_end/panels/issues/IssueView.ts +98 -98
  132. package/front_end/panels/issues/IssuesPane.ts +102 -102
  133. package/front_end/panels/issues/WasmCrossOriginModuleSharingAffectedResourcesView.ts +5 -5
  134. package/front_end/panels/issues/components/HideIssuesMenu.ts +10 -10
  135. package/front_end/panels/layer_viewer/Layers3DView.ts +3 -9
  136. package/front_end/panels/lighthouse/LighthouseController.ts +4 -5
  137. package/front_end/panels/media/PlayerListView.ts +160 -97
  138. package/front_end/panels/media/PlayerMessagesView.ts +1 -0
  139. package/front_end/panels/media/TickingFlameChart.ts +1 -2
  140. package/front_end/panels/media/playerListView.css +58 -0
  141. package/front_end/panels/network/NetworkLogView.ts +2 -6
  142. package/front_end/panels/network/NetworkLogViewColumns.ts +1 -1
  143. package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -4
  144. package/front_end/panels/network/components/RequestTrustTokensView.ts +40 -40
  145. package/front_end/panels/network/components/WebBundleInfoView.ts +9 -9
  146. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +6 -12
  147. package/front_end/panels/profiler/HeapProfileView.ts +1 -1
  148. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +0 -1
  149. package/front_end/panels/profiler/HeapSnapshotView.ts +1 -2
  150. package/front_end/panels/profiler/heapProfiler.css +1 -1
  151. package/front_end/panels/search/SearchConfig.ts +0 -6
  152. package/front_end/panels/security/SecurityModel.ts +2 -4
  153. package/front_end/panels/security/SecurityPanel.ts +2 -2
  154. package/front_end/panels/settings/KeybindsSettingsTab.ts +4 -0
  155. package/front_end/panels/settings/components/SyncSection.ts +14 -14
  156. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +96 -96
  157. package/front_end/panels/settings/settingsScreen.css +8 -3
  158. package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
  159. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -2
  160. package/front_end/panels/sources/NavigatorView.ts +4 -10
  161. package/front_end/panels/sources/ScopeChainSidebarPane.ts +2 -3
  162. package/front_end/panels/sources/SourceMapNamesResolver.ts +3 -3
  163. package/front_end/panels/sources/SourcesPanel.ts +1 -3
  164. package/front_end/panels/sources/SourcesView.ts +0 -3
  165. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -4
  166. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +2 -5
  167. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +0 -1
  168. package/front_end/panels/timeline/TimelineFlameChartView.ts +0 -1
  169. package/front_end/panels/timeline/TimelineLoader.ts +0 -3
  170. package/front_end/panels/timeline/TimelinePanel.ts +2 -3
  171. package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
  172. package/front_end/panels/timeline/components/WebVitalsLane.ts +77 -76
  173. package/front_end/panels/timeline/components/WebVitalsTimeline.ts +133 -133
  174. package/front_end/panels/timeline/components/WebVitalsTooltip.ts +9 -9
  175. package/front_end/panels/webauthn/WebauthnPane.ts +203 -205
  176. package/front_end/third_party/codemirror.next/bundle.ts +3 -3
  177. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  178. package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -1
  179. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +10 -1
  180. package/front_end/third_party/codemirror.next/codemirror.next.js +2 -1
  181. package/front_end/third_party/codemirror.next/package.json +3 -3
  182. package/front_end/third_party/puppeteer/package/README.md +11 -11
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api-docs-entry.d.ts +4 -5
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js +2 -2
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts +4 -6
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts +1 -2
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts +1 -4
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts +1 -4
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts +9 -7
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js +21 -12
  193. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -1
  194. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Dialog.d.ts +1 -3
  195. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EvalTypes.d.ts +1 -2
  196. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.d.ts +3 -5
  197. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FileChooser.d.ts +1 -3
  198. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts +8 -10
  199. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js +3 -3
  200. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
  201. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts +50 -11
  202. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts.map +1 -1
  203. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js +70 -33
  204. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js.map +1 -1
  205. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts +12 -5
  206. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts.map +1 -1
  207. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js +25 -5
  208. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js.map +1 -1
  209. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.d.ts +2 -4
  210. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts +39 -6
  211. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
  212. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +36 -0
  213. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
  214. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts +3 -4
  215. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js +2 -1
  217. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js.map +1 -1
  218. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.d.ts +46 -0
  219. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.d.ts.map +1 -0
  220. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.js +124 -0
  221. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.js.map +1 -0
  222. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts +27 -10
  223. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts.map +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js +144 -74
  225. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js.map +1 -1
  226. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts +5 -6
  227. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.d.ts +1 -2
  228. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.d.ts +4 -6
  229. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.d.ts +3 -5
  230. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts +4 -5
  231. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts.map +1 -1
  232. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js +43 -17
  233. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +1 -1
  235. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts +1 -3
  236. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts.map +1 -1
  237. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js +101 -34
  238. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js.map +1 -1
  239. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts +1 -3
  240. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.d.ts +1 -2
  241. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts +5 -7
  242. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
  243. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.d.ts +4 -5
  244. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +2 -2
  245. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
  246. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +4 -6
  247. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +2 -3
  248. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts +1 -2
  249. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +3 -5
  250. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +1 -4
  251. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts +1 -4
  252. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js +1 -2
  253. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts +9 -7
  254. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -1
  255. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +24 -17
  256. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js.map +1 -1
  257. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts +1 -3
  258. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts +1 -2
  259. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts +3 -5
  260. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts +1 -3
  261. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +8 -10
  262. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +7 -8
  263. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
  264. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts +50 -11
  265. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -1
  266. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js +70 -34
  267. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js.map +1 -1
  268. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts +12 -5
  269. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -1
  270. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js +26 -7
  271. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js.map +1 -1
  272. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts +2 -4
  273. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +39 -6
  274. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
  275. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +38 -4
  276. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
  277. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts +3 -4
  278. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
  279. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js +4 -4
  280. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js.map +1 -1
  281. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.d.ts +46 -0
  282. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.d.ts.map +1 -0
  283. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.js +120 -0
  284. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.js.map +1 -0
  285. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +27 -10
  286. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -1
  287. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +144 -75
  288. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js.map +1 -1
  289. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +12 -14
  290. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +5 -6
  291. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js +3 -4
  292. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts +1 -2
  293. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts +4 -6
  294. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts +3 -5
  295. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js +1 -2
  296. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.js +3 -5
  297. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.js +1 -3
  298. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +10 -12
  299. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts +4 -5
  300. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -1
  301. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +43 -20
  302. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js.map +1 -1
  303. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +1 -1
  304. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts +1 -3
  305. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -1
  306. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js +104 -40
  307. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js.map +1 -1
  308. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts +1 -3
  309. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts +1 -2
  310. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +1 -2
  311. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts +5 -7
  312. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +1 -3
  313. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js +3 -5
  314. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.js +1 -2
  315. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node.js +1 -2
  316. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
  317. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/web.js +1 -2
  318. package/front_end/third_party/puppeteer/package/lib/types.d.ts +173 -36
  319. package/front_end/third_party/puppeteer/package/package.json +3 -3
  320. package/front_end/ui/components/adorners/Adorner.ts +2 -2
  321. package/front_end/ui/components/buttons/Button.ts +9 -9
  322. package/front_end/ui/components/data_grid/DataGrid.ts +62 -62
  323. package/front_end/ui/components/data_grid/DataGridController.ts +22 -22
  324. package/front_end/ui/components/diff_view/DiffView.ts +6 -6
  325. package/front_end/ui/components/expandable_list/ExpandableList.ts +5 -5
  326. package/front_end/ui/components/icon_button/Icon.ts +4 -4
  327. package/front_end/ui/components/icon_button/IconButton.ts +4 -4
  328. package/front_end/ui/components/issue_counter/IssueCounter.ts +3 -3
  329. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +11 -11
  330. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +50 -50
  331. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +6 -6
  332. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +4 -4
  333. package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +12 -12
  334. package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +11 -11
  335. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +40 -39
  336. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +18 -18
  337. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
  338. package/front_end/ui/components/linkifier/LinkifierImpl.ts +4 -4
  339. package/front_end/ui/components/markdown_view/MarkdownImage.ts +5 -5
  340. package/front_end/ui/components/markdown_view/MarkdownLink.ts +2 -2
  341. package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -5
  342. package/front_end/ui/components/panel_feedback/FeedbackButton.ts +2 -2
  343. package/front_end/ui/components/panel_feedback/PanelFeedback.ts +2 -2
  344. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +4 -4
  345. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +22 -22
  346. package/front_end/ui/components/report_view/ReportView.ts +16 -16
  347. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +14 -14
  348. package/front_end/ui/components/settings/SettingCheckbox.ts +5 -5
  349. package/front_end/ui/components/survey_link/SurveyLink.ts +8 -8
  350. package/front_end/ui/components/text_editor/TextEditor.ts +9 -9
  351. package/front_end/ui/components/text_editor/cursor_tooltip.ts +7 -1
  352. package/front_end/ui/components/text_prompt/TextPrompt.ts +18 -18
  353. package/front_end/ui/components/tree_outline/TreeOutline.ts +69 -70
  354. package/front_end/ui/legacy/ContextFlavorListener.ts +0 -4
  355. package/front_end/ui/legacy/ContextMenu.ts +2 -3
  356. package/front_end/ui/legacy/InspectorView.ts +1 -1
  357. package/front_end/ui/legacy/ReportView.ts +3 -4
  358. package/front_end/ui/legacy/SearchableView.ts +1 -2
  359. package/front_end/ui/legacy/SplitWidget.ts +2 -3
  360. package/front_end/ui/legacy/SuggestBox.ts +0 -3
  361. package/front_end/ui/legacy/TextPrompt.ts +1 -1
  362. package/front_end/ui/legacy/UIUtils.ts +1 -1
  363. package/front_end/ui/legacy/XLink.ts +1 -1
  364. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -2
  365. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -9
  366. package/front_end/ui/legacy/components/data_grid/dataGrid.css +7 -7
  367. package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
  368. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +1 -5
  369. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +0 -1
  370. package/front_end/ui/legacy/components/utils/Linkifier.ts +2 -2
  371. package/front_end/ui/legacy/themeColors.css +2 -0
  372. package/front_end/ui/legacy/theme_support/theme_support_impl.ts +24 -1
  373. package/inspector_overlay/main.ts +16 -2
  374. package/package.json +1 -1
  375. package/scripts/eslint_rules/lib/use_private_class_members.js +41 -0
  376. package/scripts/eslint_rules/tests/use_private_class_members_test.js +62 -0
  377. package/scripts/migration/class-fields/migrate.js +2 -3
  378. package/scripts/migration/class-fields/migrate.sh +1 -3
  379. package/scripts/migration/class-fields/package.json +1 -1
@@ -3,16 +3,16 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  export class FormattedContentBuilder {
6
- private lastOriginalPosition = 0;
7
- private formattedContent: string[] = [];
8
- private formattedContentLength = 0;
9
- private lastFormattedPosition = 0;
10
- private nestingLevel = 0;
11
- private newLines = 0;
12
- private enforceSpaceBetweenWords = true;
13
- private softSpace = false;
14
- private hardSpaces = 0;
15
- private cachedIndents = new Map<number, string>();
6
+ #lastOriginalPosition = 0;
7
+ #formattedContent: string[] = [];
8
+ #formattedContentLength = 0;
9
+ #lastFormattedPosition = 0;
10
+ #nestingLevel = 0;
11
+ #newLines = 0;
12
+ #enforceSpaceBetweenWords = true;
13
+ #softSpace = false;
14
+ #hardSpaces = 0;
15
+ #cachedIndents = new Map<number, string>();
16
16
 
17
17
  mapping = {original: [0], formatted: [0]};
18
18
 
@@ -20,14 +20,14 @@ export class FormattedContentBuilder {
20
20
  }
21
21
 
22
22
  setEnforceSpaceBetweenWords(value: boolean): boolean {
23
- const oldValue = this.enforceSpaceBetweenWords;
24
- this.enforceSpaceBetweenWords = value;
23
+ const oldValue = this.#enforceSpaceBetweenWords;
24
+ this.#enforceSpaceBetweenWords = value;
25
25
  return oldValue;
26
26
  }
27
27
 
28
28
  addToken(token: string, offset: number): void {
29
- const last = this.formattedContent[this.formattedContent.length - 1];
30
- if (this.enforceSpaceBetweenWords && last && /\w/.test(last[last.length - 1]) && /\w/.test(token)) {
29
+ const last = this.#formattedContent[this.#formattedContent.length - 1];
30
+ if (this.#enforceSpaceBetweenWords && last && /\w/.test(last[last.length - 1]) && /\w/.test(token)) {
31
31
  this.addSoftSpace();
32
32
  }
33
33
 
@@ -39,91 +39,91 @@ export class FormattedContentBuilder {
39
39
  }
40
40
 
41
41
  addSoftSpace(): void {
42
- if (!this.hardSpaces) {
43
- this.softSpace = true;
42
+ if (!this.#hardSpaces) {
43
+ this.#softSpace = true;
44
44
  }
45
45
  }
46
46
 
47
47
  addHardSpace(): void {
48
- this.softSpace = false;
49
- ++this.hardSpaces;
48
+ this.#softSpace = false;
49
+ ++this.#hardSpaces;
50
50
  }
51
51
 
52
52
  addNewLine(noSquash?: boolean): void {
53
53
  // Avoid leading newlines.
54
- if (!this.formattedContentLength) {
54
+ if (!this.#formattedContentLength) {
55
55
  return;
56
56
  }
57
57
  if (noSquash) {
58
- ++this.newLines;
58
+ ++this.#newLines;
59
59
  } else {
60
- this.newLines = this.newLines || 1;
60
+ this.#newLines = this.#newLines || 1;
61
61
  }
62
62
  }
63
63
 
64
64
  increaseNestingLevel(): void {
65
- this.nestingLevel += 1;
65
+ this.#nestingLevel += 1;
66
66
  }
67
67
 
68
68
  decreaseNestingLevel(): void {
69
- if (this.nestingLevel > 0) {
70
- this.nestingLevel -= 1;
69
+ if (this.#nestingLevel > 0) {
70
+ this.#nestingLevel -= 1;
71
71
  }
72
72
  }
73
73
 
74
74
  content(): string {
75
- return this.formattedContent.join('') + (this.newLines ? '\n' : '');
75
+ return this.#formattedContent.join('') + (this.#newLines ? '\n' : '');
76
76
  }
77
77
 
78
78
  private appendFormatting(): void {
79
- if (this.newLines) {
80
- for (let i = 0; i < this.newLines; ++i) {
79
+ if (this.#newLines) {
80
+ for (let i = 0; i < this.#newLines; ++i) {
81
81
  this.addText('\n');
82
82
  }
83
83
  this.addText(this.indent());
84
- } else if (this.softSpace) {
84
+ } else if (this.#softSpace) {
85
85
  this.addText(' ');
86
86
  }
87
- if (this.hardSpaces) {
88
- for (let i = 0; i < this.hardSpaces; ++i) {
87
+ if (this.#hardSpaces) {
88
+ for (let i = 0; i < this.#hardSpaces; ++i) {
89
89
  this.addText(' ');
90
90
  }
91
91
  }
92
- this.newLines = 0;
93
- this.softSpace = false;
94
- this.hardSpaces = 0;
92
+ this.#newLines = 0;
93
+ this.#softSpace = false;
94
+ this.#hardSpaces = 0;
95
95
  }
96
96
 
97
97
  private indent(): string {
98
- const cachedValue = this.cachedIndents.get(this.nestingLevel);
98
+ const cachedValue = this.#cachedIndents.get(this.#nestingLevel);
99
99
  if (cachedValue) {
100
100
  return cachedValue;
101
101
  }
102
102
 
103
103
  let fullIndent = '';
104
- for (let i = 0; i < this.nestingLevel; ++i) {
104
+ for (let i = 0; i < this.#nestingLevel; ++i) {
105
105
  fullIndent += this.indentString;
106
106
  }
107
107
 
108
108
  // Cache a maximum of 20 nesting level indents.
109
- if (this.nestingLevel <= 20) {
110
- this.cachedIndents.set(this.nestingLevel, fullIndent);
109
+ if (this.#nestingLevel <= 20) {
110
+ this.#cachedIndents.set(this.#nestingLevel, fullIndent);
111
111
  }
112
112
  return fullIndent;
113
113
  }
114
114
 
115
115
  private addText(text: string): void {
116
- this.formattedContent.push(text);
117
- this.formattedContentLength += text.length;
116
+ this.#formattedContent.push(text);
117
+ this.#formattedContentLength += text.length;
118
118
  }
119
119
 
120
120
  private addMappingIfNeeded(originalPosition: number): void {
121
- if (originalPosition - this.lastOriginalPosition === this.formattedContentLength - this.lastFormattedPosition) {
121
+ if (originalPosition - this.#lastOriginalPosition === this.#formattedContentLength - this.#lastFormattedPosition) {
122
122
  return;
123
123
  }
124
124
  this.mapping.original.push(originalPosition);
125
- this.lastOriginalPosition = originalPosition;
126
- this.mapping.formatted.push(this.formattedContentLength);
127
- this.lastFormattedPosition = this.formattedContentLength;
125
+ this.#lastOriginalPosition = originalPosition;
126
+ this.mapping.formatted.push(this.#formattedContentLength);
127
+ this.#lastFormattedPosition = this.#formattedContentLength;
128
128
  }
129
129
  }
@@ -10,36 +10,36 @@ import {AbortTokenization, createTokenizer} from './FormatterWorker.js';
10
10
  import {JavaScriptFormatter} from './JavaScriptFormatter.js';
11
11
 
12
12
  export class HTMLFormatter {
13
- private readonly builder: FormattedContentBuilder;
14
- private readonly jsFormatter: JavaScriptFormatter;
15
- private readonly cssFormatter: CSSFormatter;
16
- private text?: string;
17
- private lineEndings?: number[];
18
- private model?: HTMLModel;
13
+ readonly #builder: FormattedContentBuilder;
14
+ readonly #jsFormatter: JavaScriptFormatter;
15
+ readonly #cssFormatter: CSSFormatter;
16
+ #text?: string;
17
+ #lineEndings?: number[];
18
+ #model?: HTMLModel;
19
19
 
20
20
  constructor(builder: FormattedContentBuilder) {
21
- this.builder = builder;
22
- this.jsFormatter = new JavaScriptFormatter(builder);
23
- this.cssFormatter = new CSSFormatter(builder);
21
+ this.#builder = builder;
22
+ this.#jsFormatter = new JavaScriptFormatter(builder);
23
+ this.#cssFormatter = new CSSFormatter(builder);
24
24
  }
25
25
 
26
26
  format(text: string, lineEndings: number[]): void {
27
- this.text = text;
28
- this.lineEndings = lineEndings;
29
- this.model = new HTMLModel(text);
30
- this.walk(this.model.document());
27
+ this.#text = text;
28
+ this.#lineEndings = lineEndings;
29
+ this.#model = new HTMLModel(text);
30
+ this.walk(this.#model.document());
31
31
  }
32
32
 
33
33
  private formatTokensTill(element: FormatterElement, offset: number): void {
34
- if (!this.model) {
34
+ if (!this.#model) {
35
35
  return;
36
36
  }
37
37
 
38
- let nextToken = this.model.peekToken();
38
+ let nextToken = this.#model.peekToken();
39
39
  while (nextToken && nextToken.startOffset < offset) {
40
- const token = (this.model.nextToken() as Token);
40
+ const token = (this.#model.nextToken() as Token);
41
41
  this.formatToken(element, token);
42
- nextToken = this.model.peekToken();
42
+ nextToken = this.#model.peekToken();
43
43
  }
44
44
  }
45
45
 
@@ -65,42 +65,42 @@ export class HTMLFormatter {
65
65
  }
66
66
 
67
67
  private beforeOpenTag(element: FormatterElement): void {
68
- if (!this.model) {
68
+ if (!this.#model) {
69
69
  return;
70
70
  }
71
71
 
72
- if (!element.children.length || element === this.model.document()) {
72
+ if (!element.children.length || element === this.#model.document()) {
73
73
  return;
74
74
  }
75
- this.builder.addNewLine();
75
+ this.#builder.addNewLine();
76
76
  }
77
77
 
78
78
  private afterOpenTag(element: FormatterElement): void {
79
- if (!this.model) {
79
+ if (!this.#model) {
80
80
  return;
81
81
  }
82
82
 
83
- if (!element.children.length || element === this.model.document()) {
83
+ if (!element.children.length || element === this.#model.document()) {
84
84
  return;
85
85
  }
86
- this.builder.increaseNestingLevel();
87
- this.builder.addNewLine();
86
+ this.#builder.increaseNestingLevel();
87
+ this.#builder.addNewLine();
88
88
  }
89
89
 
90
90
  private beforeCloseTag(element: FormatterElement): void {
91
- if (!this.model) {
91
+ if (!this.#model) {
92
92
  return;
93
93
  }
94
94
 
95
- if (!element.children.length || element === this.model.document()) {
95
+ if (!element.children.length || element === this.#model.document()) {
96
96
  return;
97
97
  }
98
- this.builder.decreaseNestingLevel();
99
- this.builder.addNewLine();
98
+ this.#builder.decreaseNestingLevel();
99
+ this.#builder.addNewLine();
100
100
  }
101
101
 
102
102
  private afterCloseTag(_element: FormatterElement): void {
103
- this.builder.addNewLine();
103
+ this.#builder.addNewLine();
104
104
  }
105
105
 
106
106
  private formatToken(element: FormatterElement, token: Token): void {
@@ -108,9 +108,9 @@ export class HTMLFormatter {
108
108
  return;
109
109
  }
110
110
  if (hasTokenInSet(token.type, 'comment') || hasTokenInSet(token.type, 'meta')) {
111
- this.builder.addNewLine();
112
- this.builder.addToken(token.value.trim(), token.startOffset);
113
- this.builder.addNewLine();
111
+ this.#builder.addNewLine();
112
+ this.#builder.addToken(token.value.trim(), token.startOffset);
113
+ this.#builder.addNewLine();
114
114
  return;
115
115
  }
116
116
 
@@ -121,30 +121,30 @@ export class HTMLFormatter {
121
121
  const isBodyToken =
122
122
  element.openTag.endOffset <= token.startOffset && token.startOffset < element.closeTag.startOffset;
123
123
  if (isBodyToken && element.name === 'style') {
124
- this.builder.addNewLine();
125
- this.builder.increaseNestingLevel();
126
- this.cssFormatter.format(this.text || '', this.lineEndings || [], token.startOffset, token.endOffset);
127
- this.builder.decreaseNestingLevel();
124
+ this.#builder.addNewLine();
125
+ this.#builder.increaseNestingLevel();
126
+ this.#cssFormatter.format(this.#text || '', this.#lineEndings || [], token.startOffset, token.endOffset);
127
+ this.#builder.decreaseNestingLevel();
128
128
  return;
129
129
  }
130
130
  if (isBodyToken && element.name === 'script') {
131
- this.builder.addNewLine();
132
- this.builder.increaseNestingLevel();
131
+ this.#builder.addNewLine();
132
+ this.#builder.increaseNestingLevel();
133
133
  if (this.scriptTagIsJavaScript(element)) {
134
- this.jsFormatter.format(this.text || '', this.lineEndings || [], token.startOffset, token.endOffset);
134
+ this.#jsFormatter.format(this.#text || '', this.#lineEndings || [], token.startOffset, token.endOffset);
135
135
  } else {
136
- this.builder.addToken(token.value, token.startOffset);
137
- this.builder.addNewLine();
136
+ this.#builder.addToken(token.value, token.startOffset);
137
+ this.#builder.addNewLine();
138
138
  }
139
- this.builder.decreaseNestingLevel();
139
+ this.#builder.decreaseNestingLevel();
140
140
  return;
141
141
  }
142
142
 
143
143
  if (!isBodyToken && hasTokenInSet(token.type, 'attribute')) {
144
- this.builder.addSoftSpace();
144
+ this.#builder.addSoftSpace();
145
145
  }
146
146
 
147
- this.builder.addToken(token.value, token.startOffset);
147
+ this.#builder.addToken(token.value, token.startOffset);
148
148
  }
149
149
 
150
150
  private scriptTagIsJavaScript(element: FormatterElement): boolean {
@@ -200,34 +200,34 @@ function hasTokenInSet(tokenTypes: Set<string>, type: string): boolean {
200
200
  }
201
201
 
202
202
  export class HTMLModel {
203
- private state: ParseState;
204
- private readonly documentInternal: FormatterElement;
205
- private stack: FormatterElement[];
206
- private readonly tokens: Token[];
207
- private tokenIndex: number;
208
- private attributes: Map<string, string>;
209
- private attributeName: string;
210
- private tagName: string;
211
- private isOpenTag: boolean;
212
- private tagStartOffset?: number|null;
213
- private tagEndOffset?: number|null;
203
+ #state: ParseState;
204
+ readonly #documentInternal: FormatterElement;
205
+ #stack: FormatterElement[];
206
+ readonly #tokens: Token[];
207
+ #tokenIndex: number;
208
+ #attributes: Map<string, string>;
209
+ #attributeName: string;
210
+ #tagName: string;
211
+ #isOpenTag: boolean;
212
+ #tagStartOffset?: number|null;
213
+ #tagEndOffset?: number|null;
214
214
 
215
215
  constructor(text: string) {
216
- this.state = ParseState.Initial;
217
- this.documentInternal = new FormatterElement('document');
218
- this.documentInternal.openTag = new Tag('document', 0, 0, new Map(), true, false);
219
- this.documentInternal.closeTag = new Tag('document', text.length, text.length, new Map(), false, false);
216
+ this.#state = ParseState.Initial;
217
+ this.#documentInternal = new FormatterElement('document');
218
+ this.#documentInternal.openTag = new Tag('document', 0, 0, new Map(), true, false);
219
+ this.#documentInternal.closeTag = new Tag('document', text.length, text.length, new Map(), false, false);
220
220
 
221
- this.stack = [this.documentInternal];
221
+ this.#stack = [this.#documentInternal];
222
222
 
223
- this.tokens = [];
224
- this.tokenIndex = 0;
223
+ this.#tokens = [];
224
+ this.#tokenIndex = 0;
225
225
  this.build(text);
226
226
 
227
- this.attributes = new Map();
228
- this.attributeName = '';
229
- this.tagName = '';
230
- this.isOpenTag = false;
227
+ this.#attributes = new Map();
228
+ this.#attributeName = '';
229
+ this.#tagName = '';
230
+ this.#isOpenTag = false;
231
231
  }
232
232
 
233
233
  private build(text: string): void {
@@ -240,7 +240,7 @@ export class HTMLModel {
240
240
  if (lastOffset >= text.length) {
241
241
  break;
242
242
  }
243
- const element = this.stack[this.stack.length - 1];
243
+ const element = this.#stack[this.#stack.length - 1];
244
244
  if (!element) {
245
245
  break;
246
246
  }
@@ -257,11 +257,11 @@ export class HTMLModel {
257
257
  const tokenStart = element.openTag.endOffset;
258
258
  const tokenEnd = lastOffset;
259
259
  const tokenValue = text.substring(tokenStart, tokenEnd);
260
- this.tokens.push(new Token(tokenValue, new Set(), tokenStart, tokenEnd));
260
+ this.#tokens.push(new Token(tokenValue, new Set(), tokenStart, tokenEnd));
261
261
  }
262
262
 
263
- while (this.stack.length > 1) {
264
- const element = this.stack[this.stack.length - 1];
263
+ while (this.#stack.length > 1) {
264
+ const element = this.#stack[this.#stack.length - 1];
265
265
  if (!element) {
266
266
  break;
267
267
  }
@@ -278,10 +278,10 @@ export class HTMLModel {
278
278
 
279
279
  const tokenType = type ? new Set<string>(type.split(' ')) : new Set<string>();
280
280
  const token = new Token(tokenValue, tokenType, tokenStart, tokenEnd);
281
- this.tokens.push(token);
281
+ this.#tokens.push(token);
282
282
  this.updateDOM(token);
283
283
 
284
- const element = this.stack[this.stack.length - 1];
284
+ const element = this.#stack[this.#stack.length - 1];
285
285
  if (element && (element.name === 'script' || element.name === 'style') && element.openTag &&
286
286
  element.openTag.endOffset === lastOffset) {
287
287
  return AbortTokenization;
@@ -294,68 +294,69 @@ export class HTMLModel {
294
294
  private updateDOM(token: Token): void {
295
295
  const value = token.value;
296
296
  const type = token.type;
297
- switch (this.state) {
297
+ switch (this.#state) {
298
298
  case ParseState.Initial:
299
299
  if (hasTokenInSet(type, 'bracket') && (value === '<' || value === '</')) {
300
300
  this.onStartTag(token);
301
- this.state = ParseState.Tag;
301
+ this.#state = ParseState.Tag;
302
302
  }
303
303
  return;
304
304
  case ParseState.Tag:
305
305
  if (hasTokenInSet(type, 'tag') && !hasTokenInSet(type, 'bracket')) {
306
- this.tagName = value.trim().toLowerCase();
306
+ this.#tagName = value.trim().toLowerCase();
307
307
  } else if (hasTokenInSet(type, 'attribute')) {
308
- this.attributeName = value.trim().toLowerCase();
309
- this.attributes.set(this.attributeName, '');
310
- this.state = ParseState.AttributeName;
308
+ this.#attributeName = value.trim().toLowerCase();
309
+ this.#attributes.set(this.#attributeName, '');
310
+ this.#state = ParseState.AttributeName;
311
311
  } else if (hasTokenInSet(type, 'bracket') && (value === '>' || value === '/>')) {
312
312
  this.onEndTag(token);
313
- this.state = ParseState.Initial;
313
+ this.#state = ParseState.Initial;
314
314
  }
315
315
  return;
316
316
  case ParseState.AttributeName:
317
317
  if (!type.size && value === '=') {
318
- this.state = ParseState.AttributeValue;
318
+ this.#state = ParseState.AttributeValue;
319
319
  } else if (hasTokenInSet(type, 'bracket') && (value === '>' || value === '/>')) {
320
320
  this.onEndTag(token);
321
- this.state = ParseState.Initial;
321
+ this.#state = ParseState.Initial;
322
322
  }
323
323
  return;
324
324
  case ParseState.AttributeValue:
325
325
  if (hasTokenInSet(type, 'string')) {
326
- this.attributes.set(this.attributeName, value);
327
- this.state = ParseState.Tag;
326
+ this.#attributes.set(this.#attributeName, value);
327
+ this.#state = ParseState.Tag;
328
328
  } else if (hasTokenInSet(type, 'bracket') && (value === '>' || value === '/>')) {
329
329
  this.onEndTag(token);
330
- this.state = ParseState.Initial;
330
+ this.#state = ParseState.Initial;
331
331
  }
332
332
  return;
333
333
  }
334
334
  }
335
335
 
336
336
  private onStartTag(token: Token): void {
337
- this.tagName = '';
338
- this.tagStartOffset = token.startOffset;
339
- this.tagEndOffset = null;
340
- this.attributes = new Map();
341
- this.attributeName = '';
342
- this.isOpenTag = token.value === '<';
337
+ this.#tagName = '';
338
+ this.#tagStartOffset = token.startOffset;
339
+ this.#tagEndOffset = null;
340
+ this.#attributes = new Map();
341
+ this.#attributeName = '';
342
+ this.#isOpenTag = token.value === '<';
343
343
  }
344
344
 
345
345
  private onEndTag(token: Token): void {
346
- this.tagEndOffset = token.endOffset;
347
- const selfClosingTag = token.value === '/>' || SelfClosingTags.has(this.tagName);
346
+ this.#tagEndOffset = token.endOffset;
347
+ const selfClosingTag = token.value === '/>' || SelfClosingTags.has(this.#tagName);
348
348
  const tag = new Tag(
349
- this.tagName, this.tagStartOffset || 0, this.tagEndOffset, this.attributes, this.isOpenTag, selfClosingTag);
349
+ this.#tagName, this.#tagStartOffset || 0, this.#tagEndOffset, this.#attributes, this.#isOpenTag,
350
+ selfClosingTag);
350
351
  this.onTagComplete(tag);
351
352
  }
352
353
 
353
354
  private onTagComplete(tag: Tag): void {
354
355
  if (tag.isOpenTag) {
355
- const topElement = this.stack[this.stack.length - 1];
356
+ const topElement = this.#stack[this.#stack.length - 1];
356
357
  if (topElement) {
357
358
  const tagSet = AutoClosingTags.get(topElement.name);
358
- if (topElement !== this.documentInternal && topElement.openTag && topElement.openTag.selfClosingTag) {
359
+ if (topElement !== this.#documentInternal && topElement.openTag && topElement.openTag.selfClosingTag) {
359
360
  this.popElement(autocloseTag(topElement, topElement.openTag.endOffset));
360
361
  } else if (tagSet && tagSet.has(tag.name)) {
361
362
  this.popElement(autocloseTag(topElement, tag.startOffset));
@@ -365,12 +366,12 @@ export class HTMLModel {
365
366
  return;
366
367
  }
367
368
 
368
- let lastTag = this.stack[this.stack.length - 1];
369
- while (this.stack.length > 1 && lastTag && lastTag.name !== tag.name) {
369
+ let lastTag = this.#stack[this.#stack.length - 1];
370
+ while (this.#stack.length > 1 && lastTag && lastTag.name !== tag.name) {
370
371
  this.popElement(autocloseTag(lastTag, tag.startOffset));
371
- lastTag = this.stack[this.stack.length - 1];
372
+ lastTag = this.#stack[this.#stack.length - 1];
372
373
  }
373
- if (this.stack.length === 1) {
374
+ if (this.#stack.length === 1) {
374
375
  return;
375
376
  }
376
377
  this.popElement(tag);
@@ -381,7 +382,7 @@ export class HTMLModel {
381
382
  }
382
383
 
383
384
  private popElement(closeTag: Tag): void {
384
- const element = this.stack.pop();
385
+ const element = this.#stack.pop();
385
386
  if (!element) {
386
387
  return;
387
388
  }
@@ -389,26 +390,26 @@ export class HTMLModel {
389
390
  }
390
391
 
391
392
  private pushElement(openTag: Tag): void {
392
- const topElement = this.stack[this.stack.length - 1];
393
+ const topElement = this.#stack[this.#stack.length - 1];
393
394
  const newElement = new FormatterElement(openTag.name);
394
395
  if (topElement) {
395
396
  newElement.parent = topElement;
396
397
  topElement.children.push(newElement);
397
398
  }
398
399
  newElement.openTag = openTag;
399
- this.stack.push(newElement);
400
+ this.#stack.push(newElement);
400
401
  }
401
402
 
402
403
  peekToken(): Token|null {
403
- return this.tokenIndex < this.tokens.length ? this.tokens[this.tokenIndex] : null;
404
+ return this.#tokenIndex < this.#tokens.length ? this.#tokens[this.#tokenIndex] : null;
404
405
  }
405
406
 
406
407
  nextToken(): Token|null {
407
- return this.tokens[this.tokenIndex++];
408
+ return this.#tokens[this.#tokenIndex++];
408
409
  }
409
410
 
410
411
  document(): FormatterElement {
411
- return this.documentInternal;
412
+ return this.#documentInternal;
412
413
  }
413
414
  }
414
415
 
@@ -36,23 +36,23 @@ import {ESTreeWalker} from './ESTreeWalker.js';
36
36
  import type {FormattedContentBuilder} from './FormattedContentBuilder.js';
37
37
 
38
38
  export class JavaScriptFormatter {
39
- private readonly builder: FormattedContentBuilder;
40
- private tokenizer!: AcornTokenizer;
41
- private content!: string;
42
- private fromOffset!: number;
43
- private lastLineNumber!: number;
44
- private toOffset?: number;
39
+ readonly #builder: FormattedContentBuilder;
40
+ #tokenizer!: AcornTokenizer;
41
+ #content!: string;
42
+ #fromOffset!: number;
43
+ #lastLineNumber!: number;
44
+ #toOffset?: number;
45
45
  constructor(builder: FormattedContentBuilder) {
46
- this.builder = builder;
46
+ this.#builder = builder;
47
47
  }
48
48
 
49
49
  format(text: string, lineEndings: number[], fromOffset: number, toOffset: number): void {
50
- this.fromOffset = fromOffset;
51
- this.toOffset = toOffset;
52
- this.content = text.substring(this.fromOffset, this.toOffset);
53
- this.lastLineNumber = 0;
54
- this.tokenizer = new AcornTokenizer(this.content);
55
- const ast = Acorn.parse(this.content, {
50
+ this.#fromOffset = fromOffset;
51
+ this.#toOffset = toOffset;
52
+ this.#content = text.substring(this.#fromOffset, this.#toOffset);
53
+ this.#lastLineNumber = 0;
54
+ this.#tokenizer = new AcornTokenizer(this.#content);
55
+ const ast = Acorn.parse(this.#content, {
56
56
  ranges: false,
57
57
  preserveParens: true,
58
58
  allowImportExportEverywhere: true,
@@ -70,22 +70,22 @@ export class JavaScriptFormatter {
70
70
  private push(token: Acorn.Token|Acorn.Comment|null, format: string): void {
71
71
  for (let i = 0; i < format.length; ++i) {
72
72
  if (format[i] === 's') {
73
- this.builder.addSoftSpace();
73
+ this.#builder.addSoftSpace();
74
74
  } else if (format[i] === 'S') {
75
- this.builder.addHardSpace();
75
+ this.#builder.addHardSpace();
76
76
  } else if (format[i] === 'n') {
77
- this.builder.addNewLine();
77
+ this.#builder.addNewLine();
78
78
  } else if (format[i] === '>') {
79
- this.builder.increaseNestingLevel();
79
+ this.#builder.increaseNestingLevel();
80
80
  } else if (format[i] === '<') {
81
- this.builder.decreaseNestingLevel();
81
+ this.#builder.decreaseNestingLevel();
82
82
  } else if (format[i] === 't') {
83
- if (this.tokenizer.tokenLineStart() - this.lastLineNumber > 1) {
84
- this.builder.addNewLine(true);
83
+ if (this.#tokenizer.tokenLineStart() - this.#lastLineNumber > 1) {
84
+ this.#builder.addNewLine(true);
85
85
  }
86
- this.lastLineNumber = this.tokenizer.tokenLineEnd();
86
+ this.#lastLineNumber = this.#tokenizer.tokenLineEnd();
87
87
  if (token) {
88
- this.builder.addToken(this.content.substring(token.start, token.end), this.fromOffset + token.start);
88
+ this.#builder.addToken(this.#content.substring(token.start, token.end), this.#fromOffset + token.start);
89
89
  }
90
90
  }
91
91
  }
@@ -96,8 +96,8 @@ export class JavaScriptFormatter {
96
96
  return;
97
97
  }
98
98
  let token;
99
- while ((token = this.tokenizer.peekToken()) && token.start < node.start) {
100
- const token = (this.tokenizer.nextToken() as TokenOrComment);
99
+ while ((token = this.#tokenizer.peekToken()) && token.start < node.start) {
100
+ const token = (this.#tokenizer.nextToken() as TokenOrComment);
101
101
  // @ts-ignore Same reason as above about Acorn types and ESTree types
102
102
  const format = this.formatToken(node.parent, token);
103
103
  this.push(token, format);
@@ -107,8 +107,8 @@ export class JavaScriptFormatter {
107
107
 
108
108
  private afterVisit(node: Acorn.ESTree.Node): void {
109
109
  let token;
110
- while ((token = this.tokenizer.peekToken()) && token.start < node.end) {
111
- const token = (this.tokenizer.nextToken() as TokenOrComment);
110
+ while ((token = this.#tokenizer.peekToken()) && token.start < node.end) {
111
+ const token = (this.#tokenizer.nextToken() as TokenOrComment);
112
112
  const format = this.formatToken(node, token);
113
113
  this.push(token, format);
114
114
  }