chrome-devtools-frontend 1.0.1522585 → 1.0.1525561

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 (357) hide show
  1. package/AUTHORS +1 -0
  2. package/docs/README.md +1 -0
  3. package/docs/policy/README.md +1 -0
  4. package/docs/policy/console-policy.md +144 -0
  5. package/docs/policy/images/console-policy1.png +0 -0
  6. package/docs/policy/images/console-policy2.png +0 -0
  7. package/docs/policy/images/console-policy3.png +0 -0
  8. package/docs/policy/slow-close.md +22 -19
  9. package/docs/ui_engineering.md +22 -0
  10. package/front_end/Tests.js +1 -1
  11. package/front_end/core/common/Color.ts +13 -9
  12. package/front_end/core/common/ColorConverter.ts +9 -7
  13. package/front_end/core/common/Gzip.ts +1 -1
  14. package/front_end/core/common/MapWithDefault.ts +5 -3
  15. package/front_end/core/common/ResourceType.ts +0 -12
  16. package/front_end/core/common/ReturnToPanel.ts +6 -4
  17. package/front_end/core/common/Trie.ts +4 -2
  18. package/front_end/core/host/AidaClient.ts +3 -3
  19. package/front_end/core/host/GdpClient.ts +7 -5
  20. package/front_end/core/host/InspectorFrontendHostAPI.ts +7 -5
  21. package/front_end/core/host/Platform.ts +5 -3
  22. package/front_end/core/host/UserMetrics.ts +6 -4
  23. package/front_end/core/platform/ArrayUtilities.ts +1 -1
  24. package/front_end/core/platform/StringUtilities.ts +34 -31
  25. package/front_end/core/root/Runtime.ts +1 -1
  26. package/front_end/core/sdk/CSSMetadata.ts +6 -4
  27. package/front_end/core/sdk/CSSPropertyParser.ts +17 -13
  28. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +19 -13
  29. package/front_end/core/sdk/ChildTargetManager.ts +35 -0
  30. package/front_end/core/sdk/DOMModel.ts +1 -1
  31. package/front_end/core/sdk/EventBreakpointsModel.ts +4 -2
  32. package/front_end/core/sdk/HttpReasonPhraseStrings.ts +4 -2
  33. package/front_end/core/sdk/NetworkManager.ts +8 -48
  34. package/front_end/core/sdk/NetworkRequest.ts +0 -28
  35. package/front_end/core/sdk/PageResourceLoader.ts +1 -1
  36. package/front_end/core/sdk/PreloadingModel.ts +22 -18
  37. package/front_end/core/sdk/RehydratingConnection.ts +1 -1
  38. package/front_end/core/sdk/RehydratingObject.ts +1 -1
  39. package/front_end/core/sdk/RemoteObject.ts +1 -1
  40. package/front_end/core/sdk/ResourceTreeModel.ts +2 -0
  41. package/front_end/{models/source_map_scopes → core/sdk}/ScopeTreeCache.ts +8 -7
  42. package/front_end/core/sdk/ScreenCaptureModel.ts +24 -20
  43. package/front_end/core/sdk/Target.ts +7 -1
  44. package/front_end/core/sdk/TraceObject.ts +2 -2
  45. package/front_end/core/sdk/sdk.ts +2 -0
  46. package/front_end/entrypoints/formatter_worker/FormatterActions.ts +7 -0
  47. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +15 -12
  48. package/front_end/entrypoints/formatter_worker/Substitute.ts +6 -4
  49. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +24 -16
  50. package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +2 -1
  51. package/front_end/entrypoints/main/MainImpl.ts +6 -4
  52. package/front_end/generated/InspectorBackendCommands.js +2 -2
  53. package/front_end/generated/protocol-mapping.d.ts +3 -2
  54. package/front_end/generated/protocol-proxy-api.d.ts +3 -1
  55. package/front_end/generated/protocol.ts +7 -1
  56. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +55 -14
  57. package/front_end/models/ai_assistance/agents/StylingAgent.ts +83 -222
  58. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +23 -0
  59. package/front_end/models/ai_assistance/performance/AIContext.ts +19 -4
  60. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +4 -2
  61. package/front_end/models/autofill_manager/AutofillManager.ts +4 -2
  62. package/front_end/models/cpu_profile/CPUProfileDataModel.ts +1 -1
  63. package/front_end/models/crux-manager/CrUXManager.ts +1 -1
  64. package/front_end/models/extensions/HostUrlPattern.ts +13 -5
  65. package/front_end/models/formatter/FormatterWorkerPool.ts +1 -1
  66. package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +1 -1
  67. package/front_end/models/issues_manager/CookieIssue.ts +2 -2
  68. package/front_end/models/issues_manager/MarkdownIssueDescription.ts +1 -1
  69. package/front_end/models/issues_manager/SharedDictionaryIssue.ts +20 -0
  70. package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
  71. package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
  72. package/front_end/models/javascript_metadata/NativeFunctions.js +8 -0
  73. package/front_end/models/network_time_calculator/Calculator.ts +4 -2
  74. package/front_end/models/network_time_calculator/RequestTimeRanges.ts +6 -4
  75. package/front_end/models/source_map_scopes/NamesResolver.ts +8 -8
  76. package/front_end/models/source_map_scopes/source_map_scopes.ts +0 -2
  77. package/front_end/models/text_utils/ContentProvider.ts +6 -4
  78. package/front_end/models/trace/extras/TraceTree.ts +1 -1
  79. package/front_end/models/trace/handlers/FramesHandler.ts +7 -5
  80. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +13 -7
  81. package/front_end/models/trace/handlers/MetaHandler.ts +16 -14
  82. package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +20 -8
  83. package/front_end/models/trace/handlers/helpers.ts +1 -1
  84. package/front_end/models/trace/handlers/types.ts +23 -19
  85. package/front_end/models/trace/helpers/Timing.ts +4 -2
  86. package/front_end/models/trace/helpers/Trace.ts +8 -4
  87. package/front_end/models/trace/insights/DocumentLatency.ts +1 -1
  88. package/front_end/models/trace/insights/INPBreakdown.ts +13 -2
  89. package/front_end/models/trace/insights/LCPBreakdown.ts +14 -2
  90. package/front_end/models/trace/insights/NetworkDependencyTree.ts +2 -2
  91. package/front_end/models/trace/types/File.ts +12 -8
  92. package/front_end/models/trace/types/Timing.ts +1 -1
  93. package/front_end/models/trace/types/TraceEvents.ts +37 -23
  94. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +1 -1
  95. package/front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.ts +12 -10
  96. package/front_end/panels/application/KeyValueStorageItemsView.ts +31 -33
  97. package/front_end/panels/application/components/InterestGroupAccessGrid.ts +6 -11
  98. package/front_end/panels/application/components/OriginTrialTreeView.ts +7 -5
  99. package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -0
  100. package/front_end/panels/application/components/ReportsGrid.ts +4 -10
  101. package/front_end/panels/application/components/SharedStorageAccessGrid.ts +5 -13
  102. package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +1 -1
  103. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +3 -7
  104. package/front_end/panels/application/preloading/components/PreloadingString.ts +2 -2
  105. package/front_end/panels/application/preloading/components/RuleSetGrid.ts +3 -10
  106. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -2
  107. package/front_end/panels/browser_debugger/browser_debugger-meta.ts +7 -5
  108. package/front_end/panels/changes/ChangesSidebar.ts +105 -96
  109. package/front_end/panels/changes/ChangesView.ts +69 -69
  110. package/front_end/panels/changes/CombinedDiffView.ts +1 -1
  111. package/front_end/panels/changes/changesSidebar.css +3 -0
  112. package/front_end/panels/changes/changesView.css +4 -0
  113. package/front_end/panels/console/ConsoleView.ts +2 -2
  114. package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +22 -35
  115. package/front_end/panels/elements/ComputedStyleWidget.ts +1 -1
  116. package/front_end/panels/elements/ElementStatePaneWidget.ts +12 -0
  117. package/front_end/panels/elements/ElementsTreeElement.ts +9 -5
  118. package/front_end/panels/elements/ElementsTreeOutline.ts +11 -8
  119. package/front_end/panels/elements/PropertyRenderer.ts +19 -15
  120. package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -4
  121. package/front_end/panels/elements/StylesSidebarPane.ts +2 -2
  122. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +4 -2
  123. package/front_end/panels/elements/components/AdornerManager.ts +5 -3
  124. package/front_end/panels/lighthouse/LighthouseController.ts +5 -0
  125. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +43 -46
  126. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +260 -157
  127. package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +28 -21
  128. package/front_end/panels/media/PlayerPropertiesView.ts +1 -1
  129. package/front_end/panels/network/NetworkDataGridNode.ts +2 -44
  130. package/front_end/panels/network/NetworkLogView.ts +6 -4
  131. package/front_end/panels/network/RequestPreviewView.ts +0 -7
  132. package/front_end/panels/network/components/RequestHeadersView.ts +0 -6
  133. package/front_end/panels/network/components/components.ts +0 -2
  134. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +1 -1
  135. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +4 -2
  136. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +12 -19
  137. package/front_end/panels/search/SearchResultsPane.ts +2 -3
  138. package/front_end/panels/security/IPProtectionView.ts +1 -1
  139. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +4 -0
  140. package/front_end/panels/settings/emulation/utils/StructuredHeaders.ts +45 -37
  141. package/front_end/panels/sources/BreakpointsViewUtils.ts +11 -9
  142. package/front_end/panels/sources/DebuggerPlugin.ts +8 -4
  143. package/front_end/panels/sources/SourcesPanel.ts +1 -1
  144. package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
  145. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +4 -2
  146. package/front_end/panels/timeline/CountersGraph.ts +12 -5
  147. package/front_end/panels/timeline/EasterEgg.d.ts +5 -3
  148. package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +8 -6
  149. package/front_end/panels/timeline/ModificationsManager.ts +5 -3
  150. package/front_end/panels/timeline/ThreadAppender.ts +7 -5
  151. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +10 -8
  152. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -1
  153. package/front_end/panels/timeline/TimelinePanel.ts +10 -8
  154. package/front_end/panels/timeline/TimelineSelection.ts +4 -2
  155. package/front_end/panels/timeline/TimelineUIUtils.ts +5 -3
  156. package/front_end/panels/timeline/components/BreadcrumbsUI.ts +6 -4
  157. package/front_end/panels/timeline/components/Utils.ts +1 -1
  158. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +5 -3
  159. package/front_end/panels/timeline/utils/Helpers.ts +1 -1
  160. package/front_end/panels/utils/utils.ts +1 -7
  161. package/front_end/services/trace_bounds/TraceBounds.ts +4 -2
  162. package/front_end/services/tracing/PerformanceTracing.ts +1 -1
  163. package/front_end/third_party/chromium/README.chromium +1 -1
  164. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  165. package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
  166. package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
  167. package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
  168. package/front_end/third_party/codemirror.next/package.json +3 -2
  169. package/front_end/third_party/puppeteer/README.chromium +2 -2
  170. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.d.ts +8 -10
  171. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.d.ts.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.js +8 -10
  173. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.js.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts +28 -30
  175. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
  176. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js +27 -29
  177. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +34 -38
  179. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
  180. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js +34 -38
  181. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
  182. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.d.ts +8 -1
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.d.ts.map +1 -1
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.js +12 -14
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.js.map +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +92 -108
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +33 -39
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +5 -3
  192. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
  193. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
  194. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
  195. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
  196. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts +4 -2
  197. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +14 -5
  199. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
  200. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +1 -0
  201. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  202. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +12 -6
  203. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  204. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  205. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js +24 -2
  206. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js.map +1 -1
  207. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
  208. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts +1 -0
  209. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  210. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js +3 -0
  211. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
  212. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.d.ts +13 -22
  213. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.d.ts.map +1 -1
  214. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.js +13 -22
  215. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.js.map +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.d.ts +6 -8
  217. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.d.ts.map +1 -1
  218. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.js +6 -8
  219. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.js.map +1 -1
  220. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
  221. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
  222. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  223. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  225. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +6 -3
  226. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
  227. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts +5 -7
  228. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
  229. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js +5 -7
  230. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js.map +1 -1
  231. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  232. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  233. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  235. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +188 -224
  236. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +140 -166
  237. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.d.ts +8 -10
  238. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.d.ts.map +1 -1
  239. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.js +8 -10
  240. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.js.map +1 -1
  241. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts +28 -30
  242. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
  243. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js +27 -29
  244. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
  245. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +34 -38
  246. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
  247. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js +34 -38
  248. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
  249. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.d.ts +8 -1
  250. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.d.ts.map +1 -1
  251. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.js +12 -14
  252. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.js.map +1 -1
  253. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +92 -108
  254. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  255. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +33 -39
  256. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  257. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
  258. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +5 -3
  259. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
  260. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
  261. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
  262. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
  263. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts +4 -2
  264. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  265. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +15 -6
  266. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
  267. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +1 -0
  268. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  269. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +12 -6
  270. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  271. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  272. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js +24 -2
  273. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js.map +1 -1
  274. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts +1 -0
  275. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  276. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js +3 -0
  277. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
  278. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.d.ts +13 -22
  279. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.d.ts.map +1 -1
  280. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.js +13 -22
  281. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.js.map +1 -1
  282. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.d.ts +6 -8
  283. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.d.ts.map +1 -1
  284. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.js +6 -8
  285. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.js.map +1 -1
  286. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
  287. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
  288. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +1 -1
  289. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  290. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +6 -3
  291. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
  292. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts +5 -7
  293. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
  294. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js +5 -7
  295. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js.map +1 -1
  296. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  297. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  298. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  299. package/front_end/third_party/puppeteer/package/lib/types.d.ts +188 -224
  300. package/front_end/third_party/puppeteer/package/package.json +3 -3
  301. package/front_end/third_party/puppeteer/package/src/api/Dialog.ts +8 -10
  302. package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +27 -29
  303. package/front_end/third_party/puppeteer/package/src/api/Frame.ts +34 -38
  304. package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +17 -14
  305. package/front_end/third_party/puppeteer/package/src/api/Page.ts +92 -108
  306. package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +5 -3
  307. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +5 -1
  308. package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +28 -3
  309. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +16 -7
  310. package/front_end/third_party/puppeteer/package/src/bidi/core/Browser.ts +28 -2
  311. package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +4 -0
  312. package/front_end/third_party/puppeteer/package/src/cdp/PredefinedNetworkConditions.ts +13 -22
  313. package/front_end/third_party/puppeteer/package/src/common/Device.ts +6 -8
  314. package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
  315. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +6 -3
  316. package/front_end/third_party/puppeteer/package/src/node/PuppeteerNode.ts +5 -7
  317. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  318. package/front_end/ui/components/chrome_link/ChromeLink.ts +4 -2
  319. package/front_end/ui/components/dialogs/Dialog.ts +13 -9
  320. package/front_end/ui/components/docs/linear_memory_inspector/basic.ts +21 -9
  321. package/front_end/ui/components/highlighting/HighlightElement.ts +77 -0
  322. package/front_end/ui/components/highlighting/HighlightManager.ts +58 -1
  323. package/front_end/ui/components/highlighting/highlighting.ts +2 -0
  324. package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +5 -3
  325. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -3
  326. package/front_end/ui/components/menus/SelectMenu.ts +6 -4
  327. package/front_end/ui/components/survey_link/SurveyLink.ts +4 -2
  328. package/front_end/ui/components/text_editor/config.ts +10 -6
  329. package/front_end/ui/components/text_editor/javascript.ts +8 -4
  330. package/front_end/ui/components/tooltips/Tooltip.ts +22 -5
  331. package/front_end/ui/legacy/ForwardedInputEventHandler.ts +4 -2
  332. package/front_end/ui/legacy/GlassPane.ts +1 -1
  333. package/front_end/ui/legacy/SettingsUI.ts +1 -5
  334. package/front_end/ui/legacy/Treeoutline.ts +12 -33
  335. package/front_end/ui/legacy/UIUtils.ts +19 -1
  336. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +12 -10
  337. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +30 -32
  338. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
  339. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +25 -25
  340. package/front_end/ui/legacy/components/data_grid/dataGrid.css +5 -0
  341. package/front_end/ui/legacy/components/inline_editor/AnimationTimingModel.ts +4 -2
  342. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +4 -2
  343. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +8 -6
  344. package/front_end/ui/legacy/components/perf_ui/PieChart.ts +6 -4
  345. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -3
  346. package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +18 -20
  347. package/front_end/ui/legacy/components/source_frame/XMLView.ts +22 -16
  348. package/front_end/ui/legacy/components/source_frame/xmlView.css +0 -2
  349. package/front_end/ui/legacy/components/utils/Linkifier.ts +6 -4
  350. package/front_end/ui/visual_logging/Debugging.ts +10 -6
  351. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -3
  352. package/inspector_overlay/common.ts +5 -3
  353. package/inspector_overlay/highlight_grid_common.ts +1 -1
  354. package/package.json +1 -1
  355. package/front_end/Images/src/bundle.svg +0 -3
  356. package/front_end/panels/network/components/WebBundleInfoView.css +0 -27
  357. package/front_end/panels/network/components/WebBundleInfoView.ts +0 -95
@@ -3,20 +3,19 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import '../../ui/legacy/components/data_grid/data_grid.js';
6
+ import '../../ui/components/highlighting/highlighting.js';
6
7
 
7
8
  import * as Host from '../../core/host/host.js';
8
9
  import * as i18n from '../../core/i18n/i18n.js';
9
10
  import * as Platform from '../../core/platform/platform.js';
10
11
  import * as SDK from '../../core/sdk/sdk.js';
11
12
  import type * as Protocol from '../../generated/protocol.js';
12
- import * as TextUtils from '../../models/text_utils/text_utils.js';
13
+ import type * as TextUtils from '../../models/text_utils/text_utils.js';
13
14
  import * as UI from '../../ui/legacy/legacy.js';
14
- import {Directives, html, nothing, render} from '../../ui/lit/lit.js';
15
+ import {html, nothing, render} from '../../ui/lit/lit.js';
15
16
 
16
17
  import developerResourcesListViewStyles from './developerResourcesListView.css.js';
17
18
 
18
- const {ref} = Directives;
19
-
20
19
  const UIStrings = {
21
20
  /**
22
21
  * @description Text for the status of something
@@ -87,7 +86,6 @@ const {withThousandsSeparator} = Platform.NumberUtilities;
87
86
  export interface ViewInput {
88
87
  items: SDK.PageResourceLoader.PageResource[];
89
88
  selectedItem: SDK.PageResourceLoader.PageResource|null;
90
- highlight: (element: Element|undefined, textContent: string|undefined, columnId: string) => void;
91
89
  filters: TextUtils.TextUtils.ParsedFilter[];
92
90
  onContextMenu: (e: CustomEvent<{menu: UI.ContextMenu.ContextMenu, element: HTMLElement}>) => void;
93
91
  onSelect: (e: CustomEvent<HTMLElement>) => void;
@@ -98,6 +96,20 @@ export interface ViewInput {
98
96
  export type View = (input: ViewInput, output: object, target: HTMLElement) => void;
99
97
 
100
98
  const DEFAULT_VIEW: View = (input, _output, target) => {
99
+ function highlightRange(textContent: string|undefined, columnId: string): string {
100
+ if (!textContent) {
101
+ return '';
102
+ }
103
+ const filter = input.filters.find(filter => filter.key?.split(',')?.includes(columnId));
104
+ if (!filter?.regex) {
105
+ return '';
106
+ }
107
+ const matches = filter.regex.exec(textContent ?? '');
108
+ if (!matches?.length) {
109
+ return '';
110
+ }
111
+ return `${matches.index},${matches[0].length}`;
112
+ }
101
113
  // clang-format off
102
114
  render(html`
103
115
  <style>${developerResourcesListViewStyles}</style>
@@ -135,11 +147,11 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
135
147
  item.success === false ? i18nString(UIStrings.failure) :
136
148
  i18nString(UIStrings.pending)}</td>
137
149
  <td title=${item.url} aria-label=${item.url}>
138
- <div aria-hidden="true" part="url-outer"
139
- ${ref(e => input.highlight(e, item.url, 'url'))}>
150
+ <devtools-highlight aria-hidden="true" part="url-outer"
151
+ ranges=${highlightRange(item.url, 'url')}>
140
152
  <div part="url-prefix">${splitURL ? splitURL[1] : item.url}</div>
141
153
  <div part="url-suffix">${splitURL ? splitURL[2] : ''}</div>
142
- </div>
154
+ </devtools-highlight>
143
155
  </td>
144
156
  <td title=${item.initiator.initiatorUrl || ''}
145
157
  aria-label=${item.initiator.initiatorUrl || ''}
@@ -154,9 +166,9 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
154
166
  item.duration !== null ? html`<span>${i18n.TimeUtilities.millisToString(item.duration)}</span>` : ''}</td>
155
167
  <td class="error-message">
156
168
  ${item.errorMessage ? html`
157
- <span ${ref(e => input.highlight(e, item.errorMessage, 'error-message'))}>
169
+ <devtools-highlight ranges=${highlightRange(item.errorMessage, 'error-message')}>
158
170
  ${item.errorMessage}
159
- </span>` : nothing}
171
+ </devtools-highlight>` : nothing}
160
172
  </td>
161
173
  </tr>`;
162
174
  })}
@@ -233,7 +245,6 @@ export class DeveloperResourcesListView extends UI.Widget.VBox {
233
245
  items: this.#items,
234
246
  selectedItem: this.#selectedItem,
235
247
  filters: this.#filters,
236
- highlight: this.#highlight.bind(this),
237
248
  onContextMenu: (e: CustomEvent<{menu: UI.ContextMenu.ContextMenu, element: HTMLElement}>) => {
238
249
  if (e.detail?.element) {
239
250
  this.#populateContextMenu(e.detail.menu, e.detail.element);
@@ -256,28 +267,4 @@ export class DeveloperResourcesListView extends UI.Widget.VBox {
256
267
  const output = {};
257
268
  this.#view(input, output, this.contentElement);
258
269
  }
259
-
260
- #highlight(element: Element|undefined, textContent: string|undefined, columnId: string): void {
261
- if (!element || !textContent) {
262
- return;
263
- }
264
- const highlightContainers =
265
- new Set<Element>([...element.querySelectorAll('.filter-highlight')].map(e => e.parentElement as Element));
266
- for (const container of highlightContainers) {
267
- container.textContent = container.textContent;
268
- }
269
- const filter = this.#filters.find(filter => filter.key?.split(',')?.includes(columnId));
270
- if (!filter?.regex) {
271
- return;
272
- }
273
- const matches = filter.regex.exec(element.textContent ?? '');
274
- if (!matches?.length) {
275
- return;
276
- }
277
- const range = new TextUtils.TextRange.SourceRange(matches.index, matches[0].length);
278
- UI.UIUtils.highlightRangesWithStyleClass(element, [range], 'filter-highlight');
279
- for (const el of element.querySelectorAll('.filter-highlight')) {
280
- el.setAttribute('part', 'filter-highlight');
281
- }
282
- }
283
270
  }
@@ -191,7 +191,7 @@ const createTraceElement =
191
191
  return trace;
192
192
  };
193
193
 
194
- // clang-format off
194
+ /** clang-format off **/
195
195
  class ColorRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.ColorMatch) {
196
196
  // clang-format on
197
197
  override render(match: SDK.CSSPropertyParserMatchers.ColorMatch, context: RenderingContext): Node[] {
@@ -66,6 +66,7 @@ enum SpecificPseudoStates {
66
66
  PLACEHOLDER_SHOWN = 'placeholder-shown',
67
67
  AUTOFILL = 'autofill',
68
68
  OPEN = 'open',
69
+ TARGET_CURRENT = 'target-current',
69
70
  }
70
71
 
71
72
  interface ElementState {
@@ -179,6 +180,8 @@ export class ElementStatePaneWidget extends UI.Widget.Widget {
179
180
  SpecificPseudoStates.PLACEHOLDER_SHOWN, {state: SpecificPseudoStates.PLACEHOLDER_SHOWN, type: 'specific'});
180
181
  this.#states.set(SpecificPseudoStates.AUTOFILL, {state: SpecificPseudoStates.AUTOFILL, type: 'specific'});
181
182
  this.#states.set(SpecificPseudoStates.OPEN, {state: SpecificPseudoStates.OPEN, type: 'specific'});
183
+ this.#states.set(
184
+ SpecificPseudoStates.TARGET_CURRENT, {state: SpecificPseudoStates.TARGET_CURRENT, type: 'specific'});
182
185
 
183
186
  setDualStateCheckboxes(SpecificPseudoStates.VALID, SpecificPseudoStates.INVALID);
184
187
  setDualStateCheckboxes(SpecificPseudoStates.USER_VALID, SpecificPseudoStates.USER_INVALID);
@@ -268,6 +271,9 @@ export class ElementStatePaneWidget extends UI.Widget.Widget {
268
271
  const isElementOfTypes = (node: SDK.DOMModel.DOMNode, types: string[]): boolean => {
269
272
  return types.includes(node.nodeName()?.toLowerCase());
270
273
  };
274
+ const isAnchorElementWithHref = (node: SDK.DOMModel.DOMNode): boolean => {
275
+ return isElementOfTypes(node, ['a']) && node.getAttribute('href') !== undefined;
276
+ };
271
277
  const isInputWithTypeRadioOrCheckbox = (node: SDK.DOMModel.DOMNode): boolean => {
272
278
  return isElementOfTypes(node, ['input']) &&
273
279
  (node.getAttribute('type') === 'checkbox' || node.getAttribute('type') === 'radio');
@@ -385,6 +391,12 @@ export class ElementStatePaneWidget extends UI.Widget.Widget {
385
391
  } else {
386
392
  hideSpecificCheckbox(SpecificPseudoStates.OPEN, true);
387
393
  }
394
+
395
+ if (isAnchorElementWithHref(node) || node.pseudoType() === 'scroll-marker') {
396
+ hideSpecificCheckbox(SpecificPseudoStates.TARGET_CURRENT, false);
397
+ } else {
398
+ hideSpecificCheckbox(SpecificPseudoStates.TARGET_CURRENT, true);
399
+ }
388
400
  }
389
401
  }
390
402
 
@@ -2950,14 +2950,16 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
2950
2950
 
2951
2951
  export const InitialChildrenLimit = 500;
2952
2952
 
2953
- // A union of HTML4 and HTML5-Draft elements that explicitly
2954
- // or implicitly (for HTML5) forbid the closing tag.
2953
+ /**
2954
+ * A union of HTML4 and HTML5-Draft elements that explicitly
2955
+ * or implicitly (for HTML5) forbid the closing tag.
2956
+ **/
2955
2957
  export const ForbiddenClosingTagElements = new Set<string>([
2956
2958
  'area', 'base', 'basefont', 'br', 'canvas', 'col', 'command', 'embed', 'frame', 'hr',
2957
2959
  'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr',
2958
2960
  ]);
2959
2961
 
2960
- // These tags we do not allow editing their tag name.
2962
+ /** These tags we do not allow editing their tag name. **/
2961
2963
  export const EditTagBlocklist = new Set<string>(['html', 'head', 'body']);
2962
2964
 
2963
2965
  export function adornerComparator(adornerA: Adorners.Adorner.Adorner, adornerB: Adorners.Adorner.Adorner): number {
@@ -3000,8 +3002,10 @@ export interface EditorHandles {
3000
3002
  resize: () => void;
3001
3003
  }
3002
3004
 
3003
- // As a privacy measure we are logging elements tree outline as a flat list where every tree item is a
3004
- // child of a tree outline.
3005
+ /**
3006
+ * As a privacy measure we are logging elements tree outline as a flat list where every tree item is a
3007
+ * child of a tree outline.
3008
+ **/
3005
3009
  function loggingParentProvider(e: Element): Element|undefined {
3006
3010
  const treeElement = UI.TreeOutline.TreeElement.getTreeElementBylistItemNode(e);
3007
3011
  return treeElement?.treeOutline?.contentElement;
@@ -1230,11 +1230,6 @@ export class ElementsTreeOutline extends
1230
1230
  }
1231
1231
 
1232
1232
  private contextMenuEventFired(event: MouseEvent): void {
1233
- // The context menu construction may be async. In order to
1234
- // make sure that no other (default) context menu shows up, we need
1235
- // to stop propagating and prevent the default action.
1236
- event.stopPropagation();
1237
- event.preventDefault();
1238
1233
  const treeElement = this.treeElementFromEventInternal(event);
1239
1234
  if (treeElement instanceof ElementsTreeElement) {
1240
1235
  void this.showContextMenu(treeElement, event);
@@ -1246,13 +1241,21 @@ export class ElementsTreeOutline extends
1246
1241
  return;
1247
1242
  }
1248
1243
 
1249
- const contextMenu = new UI.ContextMenu.ContextMenu(event);
1250
- const isPseudoElement = Boolean(treeElement.node().pseudoType());
1251
- const isTag = treeElement.node().nodeType() === Node.ELEMENT_NODE && !isPseudoElement;
1252
1244
  const node = (event.target as Node | null);
1253
1245
  if (!node) {
1254
1246
  return;
1255
1247
  }
1248
+
1249
+ // The context menu construction may be async. In order to
1250
+ // make sure that no other (default) context menu shows up, we need
1251
+ // to stop propagating and prevent the default action.
1252
+ event.stopPropagation();
1253
+ event.preventDefault();
1254
+
1255
+ const contextMenu = new UI.ContextMenu.ContextMenu(event);
1256
+ const isPseudoElement = Boolean(treeElement.node().pseudoType());
1257
+ const isTag = treeElement.node().nodeType() === Node.ELEMENT_NODE && !isPseudoElement;
1258
+
1256
1259
  let textNode: Element|null = node.enclosingNodeOrSelfWithClass('webkit-html-text-node');
1257
1260
  if (textNode?.classList.contains('bogus')) {
1258
1261
  textNode = null;
@@ -57,8 +57,10 @@ export function rendererBase<MatchT extends SDK.CSSPropertyParser.Match>(
57
57
  return RendererBase;
58
58
  }
59
59
 
60
- // This class implements highlighting for rendered nodes in value traces. On hover, all nodes belonging to the same
61
- // Match (using object identity) are highlighted.
60
+ /**
61
+ * This class implements highlighting for rendered nodes in value traces. On hover, all nodes belonging to the same
62
+ * Match (using object identity) are highlighted.
63
+ **/
62
64
  export class Highlighting {
63
65
  static readonly REGISTRY_NAME = 'css-value-tracing';
64
66
  // This holds a stack of active ranges, the top-stack is the currently highlighted set. mouseenter and mouseleave
@@ -145,19 +147,21 @@ export class Highlighting {
145
147
  }
146
148
  }
147
149
 
148
- // This class is used to guide value tracing when passed to the Renderer. Tracing has two phases. First, substitutions
149
- // such as var() are applied step by step. In each step, all vars in the value are replaced by their definition until no
150
- // vars remain. In the second phase, we evaluate other functions such as calc() or min() or color-mix(). Which CSS
151
- // function types are actually substituted or evaluated is not relevant here, rather it is decided by an individual
152
- // MatchRenderer.
153
- //
154
- // Callers don't need to keep track of the tracing depth (i.e., the number of substitution/evaluation steps).
155
- // TracingContext is stateful and keeps track of the depth, so callers can progressively produce steps by calling
156
- // TracingContext#nextSubstitution or TracingContext#nextEvaluation. Calling Renderer with the tracing context will then
157
- // produce the next step of tracing. The tracing depth is passed to the individual MatchRenderers by way of
158
- // TracingContext#substitution or TracingContext#applyEvaluation/TracingContext#evaluation (see function-level comments
159
- // about how these two play together), which MatchRenderers call to request a fresh TracingContext for the next level of
160
- // substitution/evaluation.
150
+ /**
151
+ * This class is used to guide value tracing when passed to the Renderer. Tracing has two phases. First, substitutions
152
+ * such as var() are applied step by step. In each step, all vars in the value are replaced by their definition until no
153
+ * vars remain. In the second phase, we evaluate other functions such as calc() or min() or color-mix(). Which CSS
154
+ * function types are actually substituted or evaluated is not relevant here, rather it is decided by an individual
155
+ * MatchRenderer.
156
+ *
157
+ * Callers don't need to keep track of the tracing depth (i.e., the number of substitution/evaluation steps).
158
+ * TracingContext is stateful and keeps track of the depth, so callers can progressively produce steps by calling
159
+ * TracingContext#nextSubstitution or TracingContext#nextEvaluation. Calling Renderer with the tracing context will then
160
+ * produce the next step of tracing. The tracing depth is passed to the individual MatchRenderers by way of
161
+ * TracingContext#substitution or TracingContext#applyEvaluation/TracingContext#evaluation (see function-level comments
162
+ * about how these two play together), which MatchRenderers call to request a fresh TracingContext for the next level of
163
+ * substitution/evaluation.
164
+ **/
161
165
  export class TracingContext {
162
166
  #substitutionDepth = 0;
163
167
  #hasMoreSubstitutions: boolean;
@@ -1193,10 +1193,12 @@ type ShadowLengthProperty = ShadowProperty&{
1193
1193
  propertyType: Exclude<ShadowPropertyType, ShadowPropertyType.INSET|ShadowPropertyType.COLOR>,
1194
1194
  };
1195
1195
 
1196
- // The shadow model is an abstraction over the various shadow properties on the one hand and the order they were defined
1197
- // in on the other, so that modifications through the shadow editor can retain the property order in the authored text.
1198
- // The model also looks through var()s by keeping a mapping between individual properties and any var()s they are coming
1199
- // from, replacing the var() functions as needed with concrete values when edited.
1196
+ /**
1197
+ * The shadow model is an abstraction over the various shadow properties on the one hand and the order they were defined
1198
+ * in on the other, so that modifications through the shadow editor can retain the property order in the authored text.
1199
+ * The model also looks through var()s by keeping a mapping between individual properties and any var()s they are coming
1200
+ * from, replacing the var() functions as needed with concrete values when edited.
1201
+ **/
1200
1202
  export class ShadowModel implements InlineEditor.CSSShadowEditor.CSSShadowModel {
1201
1203
  readonly #properties: ShadowProperty[];
1202
1204
  readonly #shadowType: SDK.CSSPropertyParserMatchers.ShadowType;
@@ -135,9 +135,9 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
135
135
  const FILTER_IDLE_PERIOD = 500;
136
136
  // Minimum number of @property rules for the @property section block to be folded initially
137
137
  const MIN_FOLDED_SECTIONS_COUNT = 5;
138
- // Title of the registered properties section
138
+ /** Title of the registered properties section **/
139
139
  export const REGISTERED_PROPERTY_SECTION_NAME = '@property';
140
- // Title of the function section
140
+ /** Title of the function section **/
141
141
  export const FUNCTION_SECTION_NAME = '@function';
142
142
 
143
143
  // Highlightable properties are those that can be hovered in the sidebar to trigger a specific
@@ -21,8 +21,10 @@ const UIStrings = {
21
21
  const str_ = i18n.i18n.registerUIStrings('panels/elements/components/AccessibilityTreeNode.ts', UIStrings);
22
22
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
23
23
 
24
- // TODO(jobay) move this to Platform.StringUtilities if still needed.
25
- // This function is a variant of setTextContentTruncatedIfNeeded found in DOMExtension.
24
+ /**
25
+ * TODO(jobay) move this to Platform.StringUtilities if still needed.
26
+ * This function is a variant of setTextContentTruncatedIfNeeded found in DOMExtension.
27
+ **/
26
28
  function truncateTextIfNeeded(text: string): string {
27
29
  const maxTextContentLength = 10000;
28
30
 
@@ -38,8 +38,10 @@ export enum RegisteredAdorners {
38
38
  POPOVER = 'popover',
39
39
  }
40
40
 
41
- // This enum-like const object serves as the authoritative registry for all the
42
- // adorners available.
41
+ /**
42
+ * This enum-like const object serves as the authoritative registry for all the
43
+ * adorners available.
44
+ **/
43
45
  export function getRegisteredAdorner(which: RegisteredAdorners): RegisteredAdorner {
44
46
  switch (which) {
45
47
  case RegisteredAdorners.GRID:
@@ -215,7 +217,7 @@ const OrderedAdornerCategories = [
215
217
  AdornerCategories.DEFAULT,
216
218
  ];
217
219
 
218
- // Use idx + 1 for the order to avoid JavaScript's 0 == false issue
220
+ /** Use idx + 1 for the order to avoid JavaScript's 0 == false issue **/
219
221
  export const AdornerCategoryOrder = new Map(OrderedAdornerCategories.map((category, idx) => [category, idx + 1]));
220
222
 
221
223
  export function compareAdornerNamesByCategory(nameA: string, nameB: string): number {
@@ -401,8 +401,13 @@ export class LighthouseController extends Common.ObjectWrapper.ObjectWrapper<Eve
401
401
  }
402
402
 
403
403
  getCategoryIDs(): string[] {
404
+ const {mode} = this.getFlags();
404
405
  const categoryIDs = [];
405
406
  for (const preset of Presets) {
407
+ if (mode && !preset.supportedModes.includes(mode)) {
408
+ continue;
409
+ }
410
+
406
411
  if (preset.setting.get()) {
407
412
  categoryIDs.push(preset.configID);
408
413
  }
@@ -122,6 +122,8 @@ export interface EventTypes {
122
122
 
123
123
  export class LinearMemoryInspectorView extends UI.Widget.VBox {
124
124
  #memoryWrapper: LazyUint8Array;
125
+ #memory?: Uint8Array<ArrayBuffer>;
126
+ #offset = 0;
125
127
  #address: number;
126
128
  #tabId: string;
127
129
  #inspector: LinearMemoryInspectorComponents.LinearMemoryInspector.LinearMemoryInspector;
@@ -140,32 +142,52 @@ export class LinearMemoryInspectorView extends UI.Widget.VBox {
140
142
  this.#address = address;
141
143
  this.#tabId = tabId;
142
144
  this.#hideValueInspector = Boolean(hideValueInspector);
145
+ this.firstTimeOpen = true;
146
+
143
147
  this.#inspector = new LinearMemoryInspectorComponents.LinearMemoryInspector.LinearMemoryInspector();
144
- this.#inspector.addEventListener(
148
+ this.#inspector.contentElement.addEventListener(
145
149
  LinearMemoryInspectorComponents.LinearMemoryInspector.MemoryRequestEvent.eventName,
146
- (event: LinearMemoryInspectorComponents.LinearMemoryInspector.MemoryRequestEvent) => {
147
- this.#memoryRequested(event);
148
- });
149
- this.#inspector.addEventListener(
150
+ (event: LinearMemoryInspectorComponents.LinearMemoryInspector.MemoryRequestEvent) =>
151
+ this.#memoryRequested(event));
152
+ this.#inspector.contentElement.addEventListener(
150
153
  LinearMemoryInspectorComponents.LinearMemoryInspector.AddressChangedEvent.eventName,
151
- (event: LinearMemoryInspectorComponents.LinearMemoryInspector.AddressChangedEvent) => {
152
- this.updateAddress(event.data);
153
- });
154
- this.#inspector.addEventListener(
154
+ (event: LinearMemoryInspectorComponents.LinearMemoryInspector.AddressChangedEvent) =>
155
+ this.updateAddress(event.data));
156
+ this.#inspector.contentElement.addEventListener(
155
157
  LinearMemoryInspectorComponents.LinearMemoryInspector.SettingsChangedEvent.eventName,
156
158
  (event: LinearMemoryInspectorComponents.LinearMemoryInspector.SettingsChangedEvent) => {
157
159
  // Stop event from bubbling up, since no element further up needs the event.
158
160
  event.stopPropagation();
159
161
  this.saveSettings(event.data);
160
162
  });
161
- this.#inspector.addEventListener(
163
+ this.#inspector.contentElement.addEventListener(
162
164
  LinearMemoryInspectorComponents.LinearMemoryHighlightChipList.DeleteMemoryHighlightEvent.eventName,
163
165
  (event: LinearMemoryInspectorComponents.LinearMemoryHighlightChipList.DeleteMemoryHighlightEvent) => {
164
166
  LinearMemoryInspectorController.instance().removeHighlight(this.#tabId, event.data);
165
167
  this.refreshData();
166
168
  });
167
- this.contentElement.appendChild(this.#inspector);
168
- this.firstTimeOpen = true;
169
+ this.#inspector.show(this.contentElement);
170
+ }
171
+
172
+ render(): void {
173
+ if (this.firstTimeOpen) {
174
+ const settings = LinearMemoryInspectorController.instance().loadSettings();
175
+ this.#inspector.valueTypes = settings.valueTypes;
176
+ this.#inspector.valueTypeModes = settings.modes;
177
+ this.#inspector.endianness = settings.endianness;
178
+ this.firstTimeOpen = false;
179
+ }
180
+
181
+ if (!this.#memory) {
182
+ return;
183
+ }
184
+
185
+ this.#inspector.memory = this.#memory;
186
+ this.#inspector.memoryOffset = this.#offset;
187
+ this.#inspector.address = this.#address;
188
+ this.#inspector.outerMemoryLength = this.#memoryWrapper.length();
189
+ this.#inspector.highlightInfo = this.#getHighlightInfo();
190
+ this.#inspector.hideValueInspector = this.#hideValueInspector;
169
191
  }
170
192
 
171
193
  override wasShown(): void {
@@ -184,32 +206,12 @@ export class LinearMemoryInspectorView extends UI.Widget.VBox {
184
206
  }
185
207
 
186
208
  refreshData(): void {
187
- void LinearMemoryInspectorController.getMemoryForAddress(this.#memoryWrapper, this.#address).then(({
188
- memory,
189
- offset,
190
- }) => {
191
- let valueTypes;
192
- let valueTypeModes;
193
- let endianness;
194
- if (this.firstTimeOpen) {
195
- const settings = LinearMemoryInspectorController.instance().loadSettings();
196
- valueTypes = settings.valueTypes;
197
- valueTypeModes = settings.modes;
198
- endianness = settings.endianness;
199
- this.firstTimeOpen = false;
200
- }
201
- this.#inspector.data = {
202
- memory,
203
- address: this.#address,
204
- memoryOffset: offset,
205
- outerMemoryLength: this.#memoryWrapper.length(),
206
- valueTypes,
207
- valueTypeModes,
208
- endianness,
209
- highlightInfo: this.#getHighlightInfo(),
210
- hideValueInspector: this.#hideValueInspector,
211
- };
212
- });
209
+ void LinearMemoryInspectorController.getMemoryForAddress(this.#memoryWrapper, this.#address)
210
+ .then(({memory, offset}) => {
211
+ this.#memory = memory;
212
+ this.#offset = offset;
213
+ this.render();
214
+ });
213
215
  }
214
216
 
215
217
  #memoryRequested(event: LinearMemoryInspectorComponents.LinearMemoryInspector.MemoryRequestEvent): void {
@@ -219,14 +221,9 @@ export class LinearMemoryInspectorView extends UI.Widget.VBox {
219
221
  }
220
222
 
221
223
  void LinearMemoryInspectorController.getMemoryRange(this.#memoryWrapper, start, end).then(memory => {
222
- this.#inspector.data = {
223
- memory,
224
- address,
225
- memoryOffset: start,
226
- outerMemoryLength: this.#memoryWrapper.length(),
227
- highlightInfo: this.#getHighlightInfo(),
228
- hideValueInspector: this.#hideValueInspector,
229
- };
224
+ this.#memory = memory;
225
+ this.#offset = start;
226
+ this.render();
230
227
  });
231
228
  }
232
229