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
@@ -1,7 +1,6 @@
1
1
  // Copyright 2020 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
- /* eslint-disable rulesdir/no-lit-render-outside-of-view */
5
4
 
6
5
  import './LinearMemoryValueInterpreter.js';
7
6
  import './LinearMemoryHighlightChipList.js';
@@ -9,6 +8,7 @@ import './LinearMemoryViewer.js';
9
8
 
10
9
  import * as Common from '../../../core/common/common.js';
11
10
  import * as i18n from '../../../core/i18n/i18n.js';
11
+ import * as UI from '../../../ui/legacy/legacy.js';
12
12
  import {html, nothing, render} from '../../../ui/lit/lit.js';
13
13
 
14
14
  import type {DeleteMemoryHighlightEvent, JumpToHighlightedMemoryEvent} from './LinearMemoryHighlightChipList.js';
@@ -44,10 +44,12 @@ const UIStrings = {
44
44
  const str_ =
45
45
  i18n.i18n.registerUIStrings('panels/linear_memory_inspector/components/LinearMemoryInspector.ts', UIStrings);
46
46
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
47
- // If the LinearMemoryInspector only receives a portion
48
- // of the original Uint8Array to show, it requires information
49
- // on the 1. memoryOffset (at which index this portion starts),
50
- // and on the 2. outerMemoryLength (length of the original Uint8Array).
47
+ /**
48
+ * If the LinearMemoryInspector only receives a portion
49
+ * of the original Uint8Array to show, it requires information
50
+ * on the 1. memoryOffset (at which index this portion starts),
51
+ * and on the 2. outerMemoryLength (length of the original Uint8Array).
52
+ **/
51
53
  export interface LinearMemoryInspectorData {
52
54
  memory: Uint8Array<ArrayBuffer>;
53
55
  address: number;
@@ -117,8 +119,151 @@ class AddressHistoryEntry implements Common.SimpleHistoryManager.HistoryEntry {
117
119
  }
118
120
  }
119
121
 
120
- export class LinearMemoryInspector extends HTMLElement {
121
- readonly #shadow = this.attachShadow({mode: 'open'});
122
+ export interface ViewInput {
123
+ memory: Uint8Array;
124
+ address: number;
125
+ memoryOffset: number;
126
+ outerMemoryLength: number;
127
+ valueTypes: Set<ValueType>;
128
+ valueTypeModes: Map<ValueType, ValueTypeMode>;
129
+ endianness: Endianness;
130
+ highlightInfo?: HighlightInfo;
131
+ hideValueInspector: boolean;
132
+ currentNavigatorMode: Mode;
133
+ currentNavigatorAddressLine: string;
134
+ canGoBackInHistory: boolean;
135
+ canGoForwardInHistory: boolean;
136
+ onRefreshRequest: () => void;
137
+ onAddressChange: (e: AddressInputChangedEvent) => void;
138
+ onNavigatePage: (e: PageNavigationEvent) => void;
139
+ onNavigateHistory: (e: HistoryNavigationEvent) => boolean;
140
+ onJumpToAddress: (e: JumpToPointerAddressEvent|JumpToHighlightedMemoryEvent) => void;
141
+ onByteSelected: (e: ByteSelectedEvent) => void;
142
+ onResize: (e: ResizeEvent) => void;
143
+ onValueTypeToggled: (e: ValueTypeToggledEvent) => void;
144
+ onValueTypeModeChanged: (e: ValueTypeModeChangedEvent) => void;
145
+ onEndiannessChanged: (e: EndiannessChangedEvent) => void;
146
+ memorySlice: Uint8Array<ArrayBuffer>;
147
+ viewerStart: number;
148
+ }
149
+
150
+ export const DEFAULT_VIEW = (input: ViewInput, _output: Record<string, unknown>, target: HTMLElement): void => {
151
+ const navigatorAddressToShow =
152
+ input.currentNavigatorMode === Mode.SUBMITTED ? formatAddress(input.address) : input.currentNavigatorAddressLine;
153
+ const navigatorAddressIsValid = isValidAddress(navigatorAddressToShow, input.outerMemoryLength);
154
+
155
+ const invalidAddressMsg = i18nString(
156
+ UIStrings.addressHasToBeANumberBetweenSAnd, {PH1: formatAddress(0), PH2: formatAddress(input.outerMemoryLength)});
157
+
158
+ const errorMsg = navigatorAddressIsValid ? undefined : invalidAddressMsg;
159
+
160
+ const highlightedMemoryAreas = input.highlightInfo ? [input.highlightInfo] : [];
161
+ const focusedMemoryHighlight = getSmallestEnclosingMemoryHighlight(highlightedMemoryAreas, input.address);
162
+ // Disabled until https://crbug.com/1079231 is fixed.
163
+ // clang-format off
164
+ render(html`
165
+ <style>${linearMemoryInspectorStyles}</style>
166
+ <div class="view">
167
+ <devtools-linear-memory-inspector-navigator
168
+ .data=${
169
+ {
170
+ address: navigatorAddressToShow,
171
+ valid: navigatorAddressIsValid,
172
+ mode: input.currentNavigatorMode,
173
+ error: errorMsg,
174
+ canGoBackInHistory: input.canGoBackInHistory,
175
+ canGoForwardInHistory: input.canGoForwardInHistory,
176
+ }}
177
+ @refreshrequested=${input.onRefreshRequest}
178
+ @addressinputchanged=${input.onAddressChange}
179
+ @pagenavigation=${input.onNavigatePage}
180
+ @historynavigation=${input.onNavigateHistory}></devtools-linear-memory-inspector-navigator>
181
+ <devtools-linear-memory-highlight-chip-list
182
+ .data=${{highlightInfos: highlightedMemoryAreas, focusedMemoryHighlight}}
183
+ @jumptohighlightedmemory=${input.onJumpToAddress}>
184
+ </devtools-linear-memory-highlight-chip-list>
185
+ <devtools-linear-memory-inspector-viewer
186
+ .data=${
187
+ {
188
+ memory: input.memorySlice,
189
+ address: input.address,
190
+ memoryOffset: input.viewerStart,
191
+ focus: input.currentNavigatorMode === Mode.SUBMITTED,
192
+ highlightInfo: input.highlightInfo,
193
+ focusedMemoryHighlight,
194
+ }}
195
+ @byteselected=${input.onByteSelected}
196
+ @resize=${input.onResize}>
197
+ </devtools-linear-memory-inspector-viewer>
198
+ </div>
199
+ ${
200
+ input.hideValueInspector ? nothing : html`
201
+ <div class="value-interpreter">
202
+ <devtools-linear-memory-inspector-interpreter
203
+ .data=${
204
+ {
205
+ value: input.memory
206
+ .slice(
207
+ input.address - input.memoryOffset,
208
+ input.address + VALUE_INTEPRETER_MAX_NUM_BYTES,
209
+ )
210
+ .buffer,
211
+ valueTypes: input.valueTypes,
212
+ valueTypeModes: input.valueTypeModes,
213
+ endianness: input.endianness,
214
+ memoryLength: input.outerMemoryLength,
215
+ }}
216
+ @valuetypetoggled=${input.onValueTypeToggled}
217
+ @valuetypemodechanged=${input.onValueTypeModeChanged}
218
+ @endiannesschanged=${input.onEndiannessChanged}
219
+ @jumptopointeraddress=${input.onJumpToAddress}
220
+ >
221
+ </devtools-linear-memory-inspector-interpreter/>
222
+ </div>`}
223
+ `,
224
+ target);
225
+ // clang-format on
226
+ };
227
+
228
+ function getPageRangeForAddress(
229
+ address: number, numBytesPerPage: number, outerMemoryLength: number): {start: number, end: number} {
230
+ const pageNumber = Math.floor(address / numBytesPerPage);
231
+ const pageStartAddress = pageNumber * numBytesPerPage;
232
+ const pageEndAddress = Math.min(pageStartAddress + numBytesPerPage, outerMemoryLength);
233
+ return {start: pageStartAddress, end: pageEndAddress};
234
+ }
235
+
236
+ function isValidAddress(address: string, outerMemoryLength: number): boolean {
237
+ const newAddress = parseAddress(address);
238
+ return newAddress !== undefined && newAddress >= 0 && newAddress < outerMemoryLength;
239
+ }
240
+
241
+ // Returns the highlightInfo with the smallest size property that encloses the provided address.
242
+ // If there are multiple smallest enclosing highlights, we pick the one appearing the earliest in highlightedMemoryAreas.
243
+ // If no such highlightInfo exists, it returns undefined.
244
+ //
245
+ // Selecting the smallest enclosing memory highlight is a heuristic that aims to pick the
246
+ // most specific highlight given a provided address. This way, objects contained in other objects are
247
+ // potentially still accessible.
248
+ function getSmallestEnclosingMemoryHighlight(highlightedMemoryAreas: HighlightInfo[], address: number): HighlightInfo|
249
+ undefined {
250
+ let smallestEnclosingHighlight;
251
+ for (const highlightedMemory of highlightedMemoryAreas) {
252
+ if (highlightedMemory.startAddress <= address &&
253
+ address < highlightedMemory.startAddress + highlightedMemory.size) {
254
+ if (!smallestEnclosingHighlight) {
255
+ smallestEnclosingHighlight = highlightedMemory;
256
+ } else if (highlightedMemory.size < smallestEnclosingHighlight.size) {
257
+ smallestEnclosingHighlight = highlightedMemory;
258
+ }
259
+ }
260
+ }
261
+ return smallestEnclosingHighlight;
262
+ }
263
+
264
+ export type View = typeof DEFAULT_VIEW;
265
+
266
+ export class LinearMemoryInspector extends UI.Widget.Widget {
122
267
  readonly #history = new Common.SimpleHistoryManager.SimpleHistoryManager(10);
123
268
 
124
269
  #memory = new Uint8Array();
@@ -138,102 +283,109 @@ export class LinearMemoryInspector extends HTMLElement {
138
283
  #endianness = Endianness.LITTLE;
139
284
 
140
285
  #hideValueInspector = false;
286
+ #view: View;
141
287
 
142
- set data(data: LinearMemoryInspectorData) {
143
- if (data.address < data.memoryOffset || data.address > data.memoryOffset + data.memory.length || data.address < 0) {
144
- throw new Error('Address is out of bounds.');
288
+ constructor(element?: HTMLElement, view?: View) {
289
+ super(element);
290
+ this.#view = view ?? DEFAULT_VIEW;
291
+ }
292
+
293
+ set memory(value: Uint8Array<ArrayBuffer>) {
294
+ this.#memory = value;
295
+ void this.requestUpdate();
296
+ }
297
+
298
+ set memoryOffset(value: number) {
299
+ this.#memoryOffset = value;
300
+ void this.requestUpdate();
301
+ }
302
+
303
+ set outerMemoryLength(value: number) {
304
+ this.#outerMemoryLength = value;
305
+ void this.requestUpdate();
306
+ }
307
+
308
+ set highlightInfo(value: HighlightInfo|undefined) {
309
+ this.#highlightInfo = value;
310
+ void this.requestUpdate();
311
+ }
312
+
313
+ set valueTypeModes(value: Map<ValueType, ValueTypeMode>) {
314
+ this.#valueTypeModes = value;
315
+ void this.requestUpdate();
316
+ }
317
+
318
+ set valueTypes(value: Set<ValueType>) {
319
+ this.#valueTypes = value;
320
+ void this.requestUpdate();
321
+ }
322
+
323
+ set endianness(value: Endianness) {
324
+ this.#endianness = value;
325
+ void this.requestUpdate();
326
+ }
327
+
328
+ set hideValueInspector(value: boolean) {
329
+ this.#hideValueInspector = value;
330
+ void this.requestUpdate();
331
+ }
332
+
333
+ get hideValueInspector(): boolean {
334
+ return this.#hideValueInspector;
335
+ }
336
+
337
+ override performUpdate(): void {
338
+ const {start, end} = getPageRangeForAddress(this.#address, this.#numBytesPerPage, this.#outerMemoryLength);
339
+
340
+ if (start < this.#memoryOffset || end > this.#memoryOffset + this.#memory.length) {
341
+ this.contentElement.dispatchEvent(new MemoryRequestEvent(start, end, this.#address));
342
+ return;
145
343
  }
146
344
 
147
- if (data.memoryOffset < 0) {
148
- throw new Error('Memory offset has to be greater or equal to zero.');
345
+ if (this.#address < this.#memoryOffset || this.#address > this.#memoryOffset + this.#memory.length ||
346
+ this.#address < 0) {
347
+ throw new Error('Address is out of bounds.');
149
348
  }
150
349
 
151
- if (data.highlightInfo) {
152
- if (data.highlightInfo.size < 0) {
350
+ if (this.#highlightInfo) {
351
+ if (this.#highlightInfo.size < 0) {
352
+ this.#highlightInfo = undefined;
153
353
  throw new Error('Object size has to be greater than or equal to zero');
154
354
  }
155
- if (data.highlightInfo.startAddress < 0 || data.highlightInfo.startAddress >= data.outerMemoryLength) {
355
+ if (this.#highlightInfo.startAddress < 0 || this.#highlightInfo.startAddress >= this.#outerMemoryLength) {
356
+ this.#highlightInfo = undefined;
156
357
  throw new Error('Object start address is out of bounds.');
157
358
  }
158
359
  }
159
360
 
160
- this.#memory = data.memory;
161
- this.#memoryOffset = data.memoryOffset;
162
- this.#outerMemoryLength = data.outerMemoryLength;
163
- this.#valueTypeModes = data.valueTypeModes || this.#valueTypeModes;
164
- this.#valueTypes = data.valueTypes || this.#valueTypes;
165
- this.#endianness = data.endianness || this.#endianness;
166
- this.#highlightInfo = data.highlightInfo;
167
- this.#hideValueInspector = data.hideValueInspector ?? this.#hideValueInspector;
168
- this.#setAddress(data.address);
169
- this.#render();
170
- }
171
-
172
- #render(): void {
173
- const {start, end} = this.#getPageRangeForAddress(this.#address, this.#numBytesPerPage);
174
-
175
- const navigatorAddressToShow = this.#currentNavigatorMode === Mode.SUBMITTED ? formatAddress(this.#address) :
176
- this.#currentNavigatorAddressLine;
177
- const navigatorAddressIsValid = this.#isValidAddress(navigatorAddressToShow);
178
-
179
- const invalidAddressMsg = i18nString(
180
- UIStrings.addressHasToBeANumberBetweenSAnd,
181
- {PH1: formatAddress(0), PH2: formatAddress(this.#outerMemoryLength)});
182
-
183
- const errorMsg = navigatorAddressIsValid ? undefined : invalidAddressMsg;
184
-
185
- const canGoBackInHistory = this.#history.canRollback();
186
- const canGoForwardInHistory = this.#history.canRollover();
187
-
188
- const highlightedMemoryAreas = this.#highlightInfo ? [this.#highlightInfo] : [];
189
- const focusedMemoryHighlight = this.#getSmallestEnclosingMemoryHighlight(highlightedMemoryAreas, this.#address);
190
- // Disabled until https://crbug.com/1079231 is fixed.
191
- // clang-format off
192
- render(html`
193
- <style>${linearMemoryInspectorStyles}</style>
194
- <div class="view">
195
- <devtools-linear-memory-inspector-navigator
196
- .data=${{address: navigatorAddressToShow, valid: navigatorAddressIsValid, mode: this.#currentNavigatorMode, error: errorMsg, canGoBackInHistory, canGoForwardInHistory}}
197
- @refreshrequested=${this.#onRefreshRequest}
198
- @addressinputchanged=${this.#onAddressChange}
199
- @pagenavigation=${this.#navigatePage}
200
- @historynavigation=${this.#navigateHistory}></devtools-linear-memory-inspector-navigator>
201
- <devtools-linear-memory-highlight-chip-list
202
- .data=${{highlightInfos: highlightedMemoryAreas, focusedMemoryHighlight }}
203
- @jumptohighlightedmemory=${this.#onJumpToAddress}>
204
- </devtools-linear-memory-highlight-chip-list>
205
- <devtools-linear-memory-inspector-viewer
206
- .data=${{
207
- memory: this.#memory.slice(start - this.#memoryOffset,
208
- end - this.#memoryOffset),
209
- address: this.#address, memoryOffset: start,
210
- focus: this.#currentNavigatorMode === Mode.SUBMITTED,
211
- highlightInfo: this.#highlightInfo,
212
- focusedMemoryHighlight }}
213
- @byteselected=${this.#onByteSelected}
214
- @resize=${this.#resize}>
215
- </devtools-linear-memory-inspector-viewer>
216
- </div>
217
- ${this.#hideValueInspector ? nothing : html`
218
- <div class="value-interpreter">
219
- <devtools-linear-memory-inspector-interpreter
220
- .data=${{
221
- value: this.#memory.slice(this.#address - this.#memoryOffset, this.#address + VALUE_INTEPRETER_MAX_NUM_BYTES).buffer,
222
- valueTypes: this.#valueTypes,
223
- valueTypeModes: this.#valueTypeModes,
224
- endianness: this.#endianness,
225
- memoryLength: this.#outerMemoryLength }}
226
- @valuetypetoggled=${this.#onValueTypeToggled}
227
- @valuetypemodechanged=${this.#onValueTypeModeChanged}
228
- @endiannesschanged=${this.#onEndiannessChanged}
229
- @jumptopointeraddress=${this.#onJumpToAddress}
230
- >
231
- </devtools-linear-memory-inspector-interpreter/>
232
- </div>`}
233
- `, this.#shadow, {
234
- host: this,
235
- });
236
- // clang-format on
361
+ const viewInput: ViewInput = {
362
+ memory: this.#memory,
363
+ address: this.#address,
364
+ memoryOffset: this.#memoryOffset,
365
+ outerMemoryLength: this.#outerMemoryLength,
366
+ valueTypes: this.#valueTypes,
367
+ valueTypeModes: this.#valueTypeModes,
368
+ endianness: this.#endianness,
369
+ highlightInfo: this.#highlightInfo,
370
+ hideValueInspector: this.#hideValueInspector,
371
+ currentNavigatorMode: this.#currentNavigatorMode,
372
+ currentNavigatorAddressLine: this.#currentNavigatorAddressLine,
373
+ canGoBackInHistory: this.#history.canRollback(),
374
+ canGoForwardInHistory: this.#history.canRollover(),
375
+ onRefreshRequest: this.#onRefreshRequest.bind(this),
376
+ onAddressChange: this.#onAddressChange.bind(this),
377
+ onNavigatePage: this.#navigatePage.bind(this),
378
+ onNavigateHistory: this.#navigateHistory.bind(this),
379
+ onJumpToAddress: this.#onJumpToAddress.bind(this),
380
+ onByteSelected: this.#onByteSelected.bind(this),
381
+ onResize: this.#resize.bind(this),
382
+ onValueTypeToggled: this.#onValueTypeToggled.bind(this),
383
+ onValueTypeModeChanged: this.#onValueTypeModeChanged.bind(this),
384
+ onEndiannessChanged: this.#onEndiannessChanged.bind(this),
385
+ memorySlice: this.#memory.slice(start - this.#memoryOffset, end - this.#memoryOffset),
386
+ viewerStart: start,
387
+ };
388
+ this.#view(viewInput, {}, this.contentElement);
237
389
  }
238
390
 
239
391
  #onJumpToAddress(e: JumpToPointerAddressEvent|JumpToHighlightedMemoryEvent): void {
@@ -245,8 +397,8 @@ export class LinearMemoryInspector extends HTMLElement {
245
397
  }
246
398
 
247
399
  #onRefreshRequest(): void {
248
- const {start, end} = this.#getPageRangeForAddress(this.#address, this.#numBytesPerPage);
249
- this.dispatchEvent(new MemoryRequestEvent(start, end, this.#address));
400
+ const {start, end} = getPageRangeForAddress(this.#address, this.#numBytesPerPage, this.#outerMemoryLength);
401
+ this.contentElement.dispatchEvent(new MemoryRequestEvent(start, end, this.#address));
250
402
  }
251
403
 
252
404
  #onByteSelected(e: ByteSelectedEvent): void {
@@ -261,18 +413,13 @@ export class LinearMemoryInspector extends HTMLElement {
261
413
 
262
414
  #onEndiannessChanged(e: EndiannessChangedEvent): void {
263
415
  this.#endianness = e.data;
264
- this.dispatchEvent(new SettingsChangedEvent(this.#createSettings()));
265
- this.#render();
266
- }
267
-
268
- #isValidAddress(address: string): boolean {
269
- const newAddress = parseAddress(address);
270
- return newAddress !== undefined && newAddress >= 0 && newAddress < this.#outerMemoryLength;
416
+ this.contentElement.dispatchEvent(new SettingsChangedEvent(this.#createSettings()));
417
+ void this.requestUpdate();
271
418
  }
272
419
 
273
420
  #onAddressChange(e: AddressInputChangedEvent): void {
274
421
  const {address, mode} = e.data;
275
- const isValid = this.#isValidAddress(address);
422
+ const isValid = isValidAddress(address, this.#outerMemoryLength);
276
423
  const newAddress = parseAddress(address);
277
424
  this.#currentNavigatorAddressLine = address;
278
425
 
@@ -288,7 +435,7 @@ export class LinearMemoryInspector extends HTMLElement {
288
435
  this.#currentNavigatorMode = Mode.EDIT;
289
436
  }
290
437
 
291
- this.#render();
438
+ void this.requestUpdate();
292
439
  }
293
440
 
294
441
  #onValueTypeToggled(e: ValueTypeToggledEvent): void {
@@ -298,16 +445,16 @@ export class LinearMemoryInspector extends HTMLElement {
298
445
  } else {
299
446
  this.#valueTypes.delete(type);
300
447
  }
301
- this.dispatchEvent(new SettingsChangedEvent(this.#createSettings()));
302
- this.#render();
448
+ this.contentElement.dispatchEvent(new SettingsChangedEvent(this.#createSettings()));
449
+ void this.requestUpdate();
303
450
  }
304
451
 
305
452
  #onValueTypeModeChanged(e: ValueTypeModeChangedEvent): void {
306
453
  e.stopImmediatePropagation();
307
454
  const {type, mode} = e.data;
308
455
  this.#valueTypeModes.set(type, mode);
309
- this.dispatchEvent(new SettingsChangedEvent(this.#createSettings()));
310
- this.#render();
456
+ this.contentElement.dispatchEvent(new SettingsChangedEvent(this.#createSettings()));
457
+ void this.requestUpdate();
311
458
  }
312
459
 
313
460
  #navigateHistory(e: HistoryNavigationEvent): boolean {
@@ -326,32 +473,16 @@ export class LinearMemoryInspector extends HTMLElement {
326
473
  console.warn(`Specified address is out of bounds: ${address}`);
327
474
  return;
328
475
  }
329
- this.#setAddress(address);
330
- this.#update();
331
- }
332
-
333
- #getPageRangeForAddress(address: number, numBytesPerPage: number): {start: number, end: number} {
334
- const pageNumber = Math.floor(address / numBytesPerPage);
335
- const pageStartAddress = pageNumber * numBytesPerPage;
336
- const pageEndAddress = Math.min(pageStartAddress + numBytesPerPage, this.#outerMemoryLength);
337
- return {start: pageStartAddress, end: pageEndAddress};
476
+ this.address = address;
477
+ void this.requestUpdate();
338
478
  }
339
479
 
340
480
  #resize(event: ResizeEvent): void {
341
481
  this.#numBytesPerPage = event.data;
342
- this.#update();
343
- }
344
-
345
- #update(): void {
346
- const {start, end} = this.#getPageRangeForAddress(this.#address, this.#numBytesPerPage);
347
- if (start < this.#memoryOffset || end > this.#memoryOffset + this.#memory.length) {
348
- this.dispatchEvent(new MemoryRequestEvent(start, end, this.#address));
349
- } else {
350
- this.#render();
351
- }
482
+ void this.requestUpdate();
352
483
  }
353
484
 
354
- #setAddress(address: number): void {
485
+ set address(address: number) {
355
486
  // If we are already showing the address that is requested, no need to act upon it.
356
487
  if (this.#address === address) {
357
488
  return;
@@ -359,40 +490,12 @@ export class LinearMemoryInspector extends HTMLElement {
359
490
  const historyEntry = new AddressHistoryEntry(address, () => this.#jumpToAddress(address));
360
491
  this.#history.push(historyEntry);
361
492
  this.#address = address;
362
- this.dispatchEvent(new AddressChangedEvent(this.#address));
363
- }
364
-
365
- // Returns the highlightInfo with the smallest size property that encloses the provided address.
366
- // If there are multiple smallest enclosing highlights, we pick the one appearing the earliest in highlightedMemoryAreas.
367
- // If no such highlightInfo exists, it returns undefined.
368
- //
369
- // Selecting the smallest enclosing memory highlight is a heuristic that aims to pick the
370
- // most specific highlight given a provided address. This way, objects contained in other objects are
371
- // potentially still accessible.
372
- #getSmallestEnclosingMemoryHighlight(highlightedMemoryAreas: HighlightInfo[], address: number): HighlightInfo
373
- |undefined {
374
- let smallestEnclosingHighlight;
375
- for (const highlightedMemory of highlightedMemoryAreas) {
376
- if (highlightedMemory.startAddress <= address &&
377
- address < highlightedMemory.startAddress + highlightedMemory.size) {
378
- if (!smallestEnclosingHighlight) {
379
- smallestEnclosingHighlight = highlightedMemory;
380
- } else if (highlightedMemory.size < smallestEnclosingHighlight.size) {
381
- smallestEnclosingHighlight = highlightedMemory;
382
- }
383
- }
384
- }
385
- return smallestEnclosingHighlight;
493
+ this.contentElement.dispatchEvent(new AddressChangedEvent(this.#address));
494
+ void this.requestUpdate();
386
495
  }
387
496
  }
388
497
 
389
- customElements.define('devtools-linear-memory-inspector-inspector', LinearMemoryInspector);
390
-
391
498
  declare global {
392
- interface HTMLElementTagNameMap {
393
- 'devtools-linear-memory-inspector-inspector': LinearMemoryInspector;
394
- }
395
-
396
499
  interface HTMLElementEventMap {
397
500
  memoryrequest: MemoryRequestEvent;
398
501
  addresschanged: AddressChangedEvent;
@@ -4,29 +4,36 @@
4
4
  * found in the LICENSE file.
5
5
  */
6
6
 
7
- :host {
8
- flex: auto;
9
- display: flex;
10
- }
7
+ @scope to (devtools-widget > *) {
8
+ :scope {
9
+ flex: auto;
10
+ display: flex;
11
+ }
11
12
 
12
- .view {
13
- width: 100%;
14
- display: flex;
15
- flex: 1;
16
- flex-direction: column;
17
- font-family: var(--monospace-font-family);
18
- font-size: var(--monospace-font-size);
19
- padding: 9px 12px 9px 7px;
20
- }
13
+ * {
14
+ min-width: unset;
15
+ box-sizing: content-box;
16
+ }
21
17
 
22
- devtools-linear-memory-inspector-viewer {
23
- justify-content: center;
24
- }
18
+ .view {
19
+ width: 100%;
20
+ display: flex;
21
+ flex: 1;
22
+ flex-direction: column;
23
+ font-family: var(--monospace-font-family);
24
+ font-size: var(--monospace-font-size);
25
+ padding: 9px 12px 9px 7px;
26
+ }
25
27
 
26
- devtools-linear-memory-inspector-navigator + devtools-linear-memory-inspector-viewer {
27
- margin-top: 12px;
28
- }
28
+ devtools-linear-memory-inspector-viewer {
29
+ justify-content: center;
30
+ }
31
+
32
+ devtools-linear-memory-inspector-navigator + devtools-linear-memory-inspector-viewer {
33
+ margin-top: 12px;
34
+ }
29
35
 
30
- .value-interpreter {
31
- display: flex;
36
+ .value-interpreter {
37
+ display: flex;
38
+ }
32
39
  }
@@ -143,7 +143,7 @@ const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined
143
143
 
144
144
  type TabData = Record<string, string|object>;
145
145
 
146
- // Keep this enum in sync with panels/media/base/media_log_properties.h
146
+ /** Keep this enum in sync with panels/media/base/media_log_properties.h **/
147
147
  export const enum PlayerPropertyKeys {
148
148
  RESOLUTION = 'kResolution',
149
149
  TOTAL_BYTES = 'kTotalBytes',
@@ -232,11 +232,6 @@ const UIStrings = {
232
232
  * @example {4 B} PH1
233
233
  */
234
234
  servedFromSignedHttpExchange: 'Served from Signed HTTP Exchange, resource size: {PH1}',
235
- /**
236
- * @description Cell title in Network Data Grid Node of the Network panel. Indicates that the response came from preloaded web bundle. See https://web.dev/web-bundles/
237
- * @example {4 B} PH1
238
- */
239
- servedFromWebBundle: 'Served from Web Bundle, resource size: {PH1}',
240
235
  /**
241
236
  * @description Text of a DOM element in Network Data Grid Node of the Network panel
242
237
  */
@@ -278,19 +273,6 @@ const UIStrings = {
278
273
  * @description Text describing the depth of a top level node in the network datagrid
279
274
  */
280
275
  level: 'level 1',
281
- /**
282
- * @description Text in Network Data Grid Node of the Network panel
283
- */
284
- webBundleError: 'Web Bundle error',
285
- /**
286
- * @description Alternative text for the web bundle inner request icon in Network Data Grid Node of the Network panel
287
- * Indicates that the response came from preloaded web bundle. See https://web.dev/web-bundles/
288
- */
289
- webBundleInnerRequest: 'Served from Web Bundle',
290
- /**
291
- * @description Text in Network Data Grid Node of the Network panel
292
- */
293
- webBundle: '(Web Bundle)',
294
276
  /**
295
277
  * @description Tooltip text for subtitles of Time cells in Network request rows. Latency is the time difference
296
278
  * between the time a response to a network request is received and the time the request is started.
@@ -1202,22 +1184,6 @@ export class NetworkRequestNode extends NetworkNode {
1202
1184
  }
1203
1185
 
1204
1186
  if (columnId === 'name') {
1205
- const webBundleInnerRequestInfo = this.requestInternal.webBundleInnerRequestInfo();
1206
- if (webBundleInnerRequestInfo) {
1207
- const secondIconElement = IconButton.Icon.create('bundle', 'icon');
1208
- secondIconElement.style.color = 'var(--icon-info)';
1209
- secondIconElement.title = i18nString(UIStrings.webBundleInnerRequest);
1210
-
1211
- const networkManager = SDK.NetworkManager.NetworkManager.forRequest(this.requestInternal);
1212
- if (webBundleInnerRequestInfo.bundleRequestId && networkManager) {
1213
- cell.appendChild(Components.Linkifier.Linkifier.linkifyRevealable(
1214
- new NetworkForward.NetworkRequestId.NetworkRequestId(
1215
- webBundleInnerRequestInfo.bundleRequestId, networkManager),
1216
- secondIconElement, undefined, undefined, undefined, 'webbundle-request'));
1217
- } else {
1218
- cell.appendChild(secondIconElement);
1219
- }
1220
- }
1221
1187
  const name = Platform.StringUtilities.trimMiddle(this.requestInternal.name(), 100);
1222
1188
  const networkManager = SDK.NetworkManager.NetworkManager.forRequest(this.requestInternal);
1223
1189
  UI.UIUtils.createTextChild(cell, networkManager ? networkManager.target().decorateLabel(name) : name);
@@ -1236,12 +1202,8 @@ export class NetworkRequestNode extends NetworkNode {
1236
1202
  'network-dim-cell', !this.isFailed() && (this.requestInternal.cached() || !this.requestInternal.statusCode));
1237
1203
 
1238
1204
  const corsErrorStatus = this.requestInternal.corsErrorStatus();
1239
- const webBundleErrorMessage = this.requestInternal.webBundleInfo()?.errorMessage ||
1240
- this.requestInternal.webBundleInnerRequestInfo()?.errorMessage;
1241
- if (webBundleErrorMessage) {
1242
- this.setTextAndTitle(cell, i18nString(UIStrings.webBundleError), webBundleErrorMessage);
1243
- } else if (
1244
- this.requestInternal.failed && !this.requestInternal.canceled && !this.requestInternal.wasBlocked() &&
1205
+
1206
+ if (this.requestInternal.failed && !this.requestInternal.canceled && !this.requestInternal.wasBlocked() &&
1245
1207
  !corsErrorStatus) {
1246
1208
  const failText = i18nString(UIStrings.failed);
1247
1209
  if (this.requestInternal.localizedFailDescription) {
@@ -1526,10 +1488,6 @@ export class NetworkRequestNode extends NetworkNode {
1526
1488
  UI.UIUtils.createTextChild(cell, i18n.i18n.lockedString('(signed-exchange)'));
1527
1489
  UI.Tooltip.Tooltip.install(cell, i18nString(UIStrings.servedFromSignedHttpExchange, {PH1: resourceSize}));
1528
1490
  cell.classList.add('network-dim-cell');
1529
- } else if (this.requestInternal.webBundleInnerRequestInfo()) {
1530
- UI.UIUtils.createTextChild(cell, i18nString(UIStrings.webBundle));
1531
- UI.Tooltip.Tooltip.install(cell, i18nString(UIStrings.servedFromWebBundle, {PH1: resourceSize}));
1532
- cell.classList.add('network-dim-cell');
1533
1491
  } else if (this.requestInternal.fromPrefetchCache()) {
1534
1492
  UI.UIUtils.createTextChild(cell, i18nString(UIStrings.prefetchCache));
1535
1493
  UI.Tooltip.Tooltip.install(cell, i18nString(UIStrings.servedFromPrefetchCacheResource, {PH1: resourceSize}));