chrome-devtools-frontend 1.0.1652307 → 1.0.1656291

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 (267) hide show
  1. package/.agents/skills/fixing-skipped-tests/SKILL.md +32 -0
  2. package/.agents/skills/migrate-chromium-test/SKILL.md +144 -0
  3. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +116 -0
  4. package/.agents/skills/ui-eng-vision-logic-consolidator/SKILL.md +82 -0
  5. package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +123 -0
  6. package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +125 -0
  7. package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +75 -0
  8. package/AUTHORS +1 -0
  9. package/config/owner/COMMON_OWNERS +0 -4
  10. package/docs/get_the_code.md +1 -2
  11. package/docs/playbook.md +1 -1
  12. package/docs/ui_engineering.md +3 -1
  13. package/eslint.config.mjs +0 -5
  14. package/front_end/Tests.js +1 -0
  15. package/front_end/core/common/Settings.ts +47 -30
  16. package/front_end/core/sdk/CPUThrottlingManager.ts +23 -167
  17. package/front_end/core/sdk/CSSMetadata.ts +23 -0
  18. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +8 -4
  19. package/front_end/core/sdk/ConsoleModel.ts +13 -11
  20. package/front_end/core/sdk/DOMDebuggerModel.ts +11 -5
  21. package/front_end/core/sdk/DOMModel.ts +4 -0
  22. package/front_end/core/sdk/EmulationModel.ts +4 -0
  23. package/front_end/core/sdk/EventBreakpointsModel.ts +9 -5
  24. package/front_end/core/sdk/IsolateManager.ts +6 -6
  25. package/front_end/core/sdk/ResourceTreeModel.ts +8 -5
  26. package/front_end/core/sdk/TargetManager.ts +17 -0
  27. package/front_end/entrypoints/devtools_app/devtools_app.ts +0 -1
  28. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +459 -74
  29. package/front_end/entrypoints/main/MainImpl.ts +12 -42
  30. package/front_end/foundation/Universe.ts +116 -3
  31. package/front_end/generated/InspectorBackendCommands.ts +11 -6
  32. package/front_end/generated/SupportedCSSProperties.js +124 -34
  33. package/front_end/generated/protocol-mapping.d.ts +8 -0
  34. package/front_end/generated/protocol-proxy-api.d.ts +15 -0
  35. package/front_end/generated/protocol.ts +94 -1
  36. package/front_end/models/ai_assistance/AiConversation.ts +2 -7
  37. package/front_end/models/ai_assistance/README.md +4 -3
  38. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
  39. package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +1 -1
  40. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
  41. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +13 -320
  42. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
  43. package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -358
  44. package/front_end/models/ai_assistance/ai_assistance.ts +6 -8
  45. package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +295 -0
  46. package/front_end/models/ai_assistance/contexts/RequestContext.snapshot.txt +0 -1
  47. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +0 -2
  48. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +10 -10
  49. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +12 -11
  50. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
  51. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -14
  52. package/front_end/models/ai_assistance/skills/accessibility.md +4 -2
  53. package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +142 -0
  54. package/front_end/models/ai_assistance/tools/GetStyles.ts +1 -1
  55. package/front_end/models/ai_assistance/tools/README.md +21 -1
  56. package/front_end/models/ai_assistance/tools/{ResolveLighthousePath.ts → ResolveDevtoolsNodePath.ts} +18 -17
  57. package/front_end/models/ai_assistance/tools/Tool.ts +6 -1
  58. package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -2
  59. package/front_end/models/autofill_manager/AutofillManager.ts +6 -15
  60. package/front_end/models/bindings/NetworkProject.ts +4 -8
  61. package/front_end/models/breakpoints/BreakpointManager.ts +9 -9
  62. package/front_end/models/emulation/DeviceModeModel.ts +24 -0
  63. package/front_end/models/emulation/EmulatedDevices.ts +108 -0
  64. package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +36 -0
  65. package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +8 -0
  66. package/front_end/models/issues_manager/IssuesManager.ts +10 -6
  67. package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +4 -5
  68. package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
  69. package/front_end/models/live-metrics/LiveMetrics.ts +6 -6
  70. package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +5 -5
  71. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +3 -3
  72. package/front_end/models/logs/LogManager.ts +25 -10
  73. package/front_end/models/logs/NetworkLog.ts +24 -19
  74. package/front_end/models/persistence/AutomaticFileSystemManager.ts +14 -13
  75. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +26 -14
  76. package/front_end/models/persistence/IsolatedFileSystem.ts +9 -11
  77. package/front_end/models/persistence/IsolatedFileSystemManager.ts +22 -11
  78. package/front_end/models/persistence/NetworkPersistenceManager.ts +73 -44
  79. package/front_end/models/persistence/PersistenceImpl.ts +4 -5
  80. package/front_end/models/project_settings/ProjectSettingsModel.ts +12 -11
  81. package/front_end/models/trace/EntityMapper.ts +1 -1
  82. package/front_end/models/trace/handlers/ScreenshotsHandler.ts +14 -59
  83. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +12 -38
  84. package/front_end/panels/ai_assistance/ExportConversation.ts +4 -1
  85. package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
  86. package/front_end/panels/application/DeviceBoundSessionsView.ts +15 -3
  87. package/front_end/panels/application/FrameDetailsView.ts +2 -1
  88. package/front_end/panels/application/IndexedDBViews.ts +38 -36
  89. package/front_end/panels/application/ServiceWorkersView.ts +23 -16
  90. package/front_end/panels/application/components/AdsView.ts +4 -0
  91. package/front_end/panels/autofill/AutofillView.ts +1 -1
  92. package/front_end/panels/autofill/autofill-meta.ts +3 -2
  93. package/front_end/panels/common/CPUThrottlingOption.ts +142 -0
  94. package/front_end/panels/common/ThrottlingUtils.ts +9 -4
  95. package/front_end/panels/common/common.ts +1 -1
  96. package/front_end/panels/console/ConsoleViewMessage.ts +45 -0
  97. package/front_end/panels/elements/AccessibilityTreeUtils.ts +26 -15
  98. package/front_end/panels/elements/AccessibilityTreeView.ts +12 -9
  99. package/front_end/panels/elements/ElementsPanel.ts +0 -74
  100. package/front_end/panels/elements/ElementsTreeOutline.ts +5 -4
  101. package/front_end/panels/emulation/DeviceModeToolbar.ts +46 -45
  102. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +118 -68
  103. package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
  104. package/front_end/panels/layer_viewer/layerTreeOutline.css +20 -13
  105. package/front_end/panels/layers/LayersPanel.ts +1 -1
  106. package/front_end/panels/mobile_throttling/CalibrationController.ts +6 -5
  107. package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +1 -1
  108. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +40 -13
  109. package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +13 -17
  110. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +79 -30
  111. package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -0
  112. package/front_end/panels/network/LinkPreloadGenerator.ts +101 -0
  113. package/front_end/panels/network/NetworkLogView.ts +28 -9
  114. package/front_end/panels/network/NetworkPanel.ts +1 -63
  115. package/front_end/panels/network/RequestInitiatorView.ts +29 -4
  116. package/front_end/panels/network/components/HeaderSectionRow.css +9 -7
  117. package/front_end/panels/network/components/HeaderSectionRow.ts +20 -1
  118. package/front_end/panels/network/components/RequestHeaderSection.css +5 -3
  119. package/front_end/panels/network/components/RequestHeaderSection.ts +1 -2
  120. package/front_end/panels/network/components/RequestHeadersView.css +1 -1
  121. package/front_end/panels/network/network.ts +2 -0
  122. package/front_end/panels/profiler/HeapSnapshotView.ts +121 -33
  123. package/front_end/panels/profiler/ModuleUIStrings.ts +4 -0
  124. package/front_end/panels/security/SecurityPanel.ts +36 -23
  125. package/front_end/panels/settings/SettingsScreen.ts +18 -103
  126. package/front_end/panels/settings/settings-meta.ts +0 -24
  127. package/front_end/panels/timeline/TimelineController.ts +3 -2
  128. package/front_end/panels/timeline/TimelineHistoryManager.ts +38 -37
  129. package/front_end/panels/timeline/TimelinePanel.ts +52 -11
  130. package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +20 -18
  131. package/front_end/panels/timeline/components/LiveMetricsView.ts +38 -38
  132. package/front_end/panels/timeline/components/MetricCard.ts +18 -18
  133. package/front_end/panels/timeline/components/liveMetricsView.css +6 -6
  134. package/front_end/panels/timeline/components/metricCard.css +4 -4
  135. package/front_end/panels/timeline/timelineFlamechartPopover.css +2 -0
  136. package/front_end/panels/utils/utils.ts +25 -24
  137. package/front_end/panels/whats_new/ReleaseNoteText.ts +3 -3
  138. package/front_end/panels/whats_new/resources/WNDT.md +1 -1
  139. package/front_end/third_party/chromium/README.chromium +1 -1
  140. package/front_end/third_party/puppeteer/README.chromium +2 -2
  141. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +34 -55
  142. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +96 -83
  143. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +10 -1
  144. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
  146. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
  149. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.d.ts.map +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.js.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts +3 -2
  152. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
  153. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
  154. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
  156. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.d.ts +1 -1
  157. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.js +1 -1
  158. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
  159. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
  161. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +2 -1
  162. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.d.ts.map +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.js.map +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +2 -2
  166. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
  167. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +5 -2
  168. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
  169. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
  171. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +23 -13
  173. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +4 -1
  176. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Input.js +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.d.ts.map +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.js.map +1 -1
  180. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
  182. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +3 -41
  183. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
  184. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  187. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +4 -2
  188. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
  189. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts +5 -0
  190. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +1 -1
  193. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts +1 -1
  194. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts.map +1 -1
  195. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js +5 -5
  196. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js.map +1 -1
  197. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
  199. package/front_end/third_party/puppeteer/package/lib/types.d.ts +34 -55
  200. package/front_end/third_party/puppeteer/package/package.json +4 -4
  201. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +13 -1
  202. package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +2 -3
  203. package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +3 -1
  204. package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +3 -2
  205. package/front_end/third_party/puppeteer/package/src/api/Realm.ts +1 -2
  206. package/front_end/third_party/puppeteer/package/src/api/Target.ts +1 -1
  207. package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +1 -2
  208. package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +3 -1
  209. package/front_end/third_party/puppeteer/package/src/bidi/core/Realm.ts +1 -3
  210. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +13 -3
  211. package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +1 -1
  212. package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +24 -13
  213. package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +4 -1
  214. package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +1 -1
  215. package/front_end/third_party/puppeteer/package/src/cdp/LifecycleWatcher.ts +1 -4
  216. package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +2 -4
  217. package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +7 -76
  218. package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +1 -4
  219. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +4 -1
  220. package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +5 -0
  221. package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
  222. package/front_end/third_party/puppeteer/package/src/util/httpUtils.ts +5 -5
  223. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  224. package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -1
  225. package/front_end/ui/components/dialogs/Dialog.ts +3 -0
  226. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +0 -7
  227. package/front_end/ui/helpers/OpenInNewTab.ts +15 -7
  228. package/front_end/ui/legacy/InspectorDrawerView.ts +7 -5
  229. package/front_end/ui/legacy/ListWidget.ts +12 -0
  230. package/front_end/ui/legacy/SplitWidget.ts +12 -11
  231. package/front_end/ui/legacy/TabbedPane.ts +1 -108
  232. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -0
  233. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +192 -139
  234. package/front_end/ui/legacy/components/data_grid/DataGridExporter.ts +89 -0
  235. package/front_end/ui/legacy/components/data_grid/dataGrid.css +10 -0
  236. package/front_end/ui/legacy/components/data_grid/data_grid.ts +3 -1
  237. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +8 -1
  238. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +110 -17
  239. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +89 -40
  240. package/front_end/ui/legacy/treeoutline.css +1 -1
  241. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  242. package/package.json +4 -3
  243. package/front_end/Images/navigationControls.png +0 -0
  244. package/front_end/Images/navigationControls_2x.png +0 -0
  245. package/front_end/Images/popoverArrows.png +0 -0
  246. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -746
  247. package/front_end/entrypoints/greendev_floaty/floaty.css +0 -301
  248. package/front_end/entrypoints/greendev_floaty/floaty.html +0 -38
  249. package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -415
  250. package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +0 -834
  251. package/front_end/models/ai_assistance/agents/GreenDevAgentAntigravityCliSocketClient.ts +0 -53
  252. package/front_end/models/ai_assistance/agents/GreenDevAgentGeminiCliSocketClient.ts +0 -117
  253. package/front_end/models/annotations/AnnotationRepository.ts +0 -238
  254. package/front_end/models/annotations/AnnotationType.ts +0 -10
  255. package/front_end/models/annotations/README.md +0 -7
  256. package/front_end/models/annotations/annotations.ts +0 -6
  257. package/front_end/models/greendev/Prototypes.ts +0 -68
  258. package/front_end/models/greendev/README.md +0 -5
  259. package/front_end/models/greendev/greendev.ts +0 -5
  260. package/front_end/panels/common/Annotation.ts +0 -184
  261. package/front_end/panels/common/AnnotationManager.ts +0 -208
  262. package/front_end/panels/common/annotation.css +0 -40
  263. package/front_end/panels/greendev/GreenDevPanel.css +0 -282
  264. package/front_end/panels/greendev/GreenDevPanel.ts +0 -364
  265. package/front_end/panels/greendev/GreenDevShared.ts +0 -13
  266. package/front_end/panels/greendev/greendev-meta.ts +0 -52
  267. package/front_end/panels/greendev/greendev.ts +0 -9
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: ui-eng-vision-widget-promoter
3
+ description: Promotes legacy views to modern UI.Widget classes, hooks up performUpdate() rendering, and exports default views.
4
+ allowed-tools: code_search open_urls
5
+ ---
6
+
7
+ # Subskill: Widget Promoter (Pass 3)
8
+
9
+ This subskill completes the architectural transition, upgrading the component
10
+ from legacy base classes (like `SimpleView` or custom wrapper layouts) into
11
+ clean `UI.Widget` classes that use native update rendering delegates.
12
+
13
+ --------------------------------------------------------------------------------
14
+
15
+ ## 1. Widget Promotion Guidelines
16
+
17
+ 1. **Change Class Inheritance**:
18
+
19
+ * Rewrite class declarations to extend `UI.Widget` (or specialized
20
+ sub-layouts like `UI.Widget.VBox`).
21
+ * Clean up and remove older constructors that perform custom container
22
+ initializations or access `.element` directly for manual append
23
+ operations.
24
+
25
+ 2. **Upgrade View Delegates & Inject View**:
26
+
27
+ * Migrate the local Lit template strings into a formally exported default
28
+ view layout:
29
+
30
+ ```typescript
31
+ export const DEFAULT_VIEW: View = (input, output, target) => {
32
+ Lit.render(html`...`, target);
33
+ };
34
+ ```
35
+
36
+ * Make the view injectable in the constructor for testability (as per `docs/ui_engineering.md`):
37
+
38
+ ```typescript
39
+ class MyWidget extends UI.Widget.VBox {
40
+ #view: View;
41
+ constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
42
+ super(true, element);
43
+ this.#view = view;
44
+ }
45
+ ```
46
+
47
+ * Implement the standard modern `performUpdate()` override on the widget:
48
+
49
+ ```typescript
50
+ override performUpdate(): void {
51
+ this.#view(this.viewInput, this.viewOutput, this.contentElement);
52
+ }
53
+ ```
54
+
55
+ 3. **Clean Up Legacy Wrappers**:
56
+
57
+ * Remove any `LegacyWrapper` bindings or custom wrappable custom elements.
58
+ * Replace old panel instantiations with standard `<devtools-widget>`
59
+ declarative entries:
60
+
61
+ ```typescript
62
+ html`<devtools-widget .widgetConfig=${widgetConfig(MyWidgetClass, [params])}></devtools-widget>`
63
+ ```
64
+
65
+ * Inspect instantiator files (e.g., `ApplicationPanelSidebar.ts`) and
66
+ decouple any direct accesses to `.element`.
67
+
68
+ --------------------------------------------------------------------------------
69
+
70
+ ## 2. Safety & Verification Rules
71
+
72
+ * **CRITICAL**: Never update screenshot goldens without explicit consent of the user. Most likely the failure points to an issue in the implementation or (less likely) the test itself. Look at the screenshot diffs to debug.
73
+ * **Minimal Code Movement**: When migrating, try to move code around as little as possible, in particular around the lit rendering helpers. This minimizes the git diff and improves reviewability.
74
+
75
+ --------------------------------------------------------------------------------
package/AUTHORS CHANGED
@@ -49,6 +49,7 @@ Gautham Banasandra <gautham.bangalore@gmail.com>
49
49
  Han Xu <suyanhanx@gmail.com>
50
50
  Helmut Januschka <helmut@januschka.com>
51
51
  Henry Lim <henry@limhenry.xyz>
52
+ Hojeong Park <parkhj062@gmail.com>
52
53
  Jacky Hu <flameddd@gmail.com>
53
54
  Jake Mulhern <mulherje@gmail.com>
54
55
  Jan Keitel <jan.keitel@gmail.com>
@@ -2,19 +2,15 @@ file://config/owner/ENG_REVIEW_OWNERS
2
2
 
3
3
  alexrudenko@chromium.org
4
4
  alinavarkki@chromium.org
5
- andoli@chromium.org
6
5
  bmeurer@chromium.org
7
- changhaohan@chromium.org
8
6
  cjamcl@chromium.org
9
7
  dsv@chromium.org
10
- ergunsh@chromium.org
11
8
  finnur@chromium.org
12
9
  jacktfranklin@chromium.org
13
10
  kimanh@chromium.org
14
11
  kprokopenko@chromium.org
15
12
  leese@chromium.org
16
13
  mathias@chromium.org
17
- nancyly@chromium.org
18
14
  nharshunova@chromium.org
19
15
  nroscino@chromium.org
20
16
  nvitkov@chromium.org
@@ -56,8 +56,7 @@ out of bundling by setting `devtools_bundle` to `false`
56
56
  gn gen out/fast-build --args="devtools_skip_typecheck=true devtools_bundle=false"
57
57
  ```
58
58
 
59
- and use `npm run build -- -t fast-build` to build this target (you can of course
60
- also just change the `Default` target to skip bundling and type checking).
59
+ and use `npm run build -- -t fast-build` to build this target.
61
60
 
62
61
  ### Rebuilding automatically
63
62
 
package/docs/playbook.md CHANGED
@@ -36,7 +36,7 @@ For certain topics, there are dedicated points of contact (PoCs) within the DevT
36
36
  | Topic | PoC |
37
37
  | ------------------------------------- | --------------- |
38
38
  | Web Compass, Interop, and Baseline | pfaffe@chromium.org |
39
- | UI Capabilities | changhaohan@chromium.org |
39
+ | UI Capabilities | pfaffe@chromium.org |
40
40
  | Performance | paulirish@chromium.org |
41
41
  | JavaScript | szuend@chromium.org |
42
42
  | WebAssembly | pfaffe@chromium.org |
@@ -209,7 +209,9 @@ assert.deepStrictEqual((await viewCall).headersForSourceURL, [{...}]);
209
209
 
210
210
  // ❌ not recommended: mocking CDP responses to make the models behave in a certain way
211
211
  // while testing a presenter is fragile.
212
- setMockConnectionResponseHandler('CSS.getHeaders', () => ({}));
212
+ const connection = new MockCDPConnection();
213
+ connection.setSuccessHandler('CSS.getHeaders', () => ({}));
214
+ createTarget({connection});
213
215
  const presenter = new Presenter();
214
216
  presenter.doSomething();
215
217
  ```
package/eslint.config.mjs CHANGED
@@ -775,11 +775,6 @@ export default defineConfig([
775
775
 
776
776
  settings: {
777
777
  'mocha/additionalCustomNames': [
778
- {
779
- name: 'describeWithDevtoolsExtension',
780
- type: 'suite',
781
- interfaces: ['BDD', 'TDD'],
782
- },
783
778
  {
784
779
  name: 'describeWithEnvironment',
785
780
  type: 'suite',
@@ -958,6 +958,7 @@
958
958
  ...Main.Main.instanceForTest.createSettingsStorage(prefs),
959
959
  settingRegistrations: Common.SettingRegistration.getRegisteredSettings(),
960
960
  runSettingsMigration: false,
961
+ console: Common.Console.Console.instance(),
961
962
  });
962
963
 
963
964
  const localSetting = Common.Settings.Settings.instance().createLocalSetting('local', undefined);
@@ -5,7 +5,7 @@
5
5
  import * as Platform from '../platform/platform.js';
6
6
  import * as Root from '../root/root.js';
7
7
 
8
- import {Console} from './Console.js';
8
+ import type {Console} from './Console.js';
9
9
  import type {EventDescriptor, EventTargetEvent, GenericEvents} from './EventTarget.js';
10
10
  import {ObjectWrapper} from './Object.js';
11
11
  import {
@@ -30,6 +30,7 @@ export interface SettingsCreationOptions {
30
30
  settingRegistrations: SettingRegistration[];
31
31
  logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>;
32
32
  runSettingsMigration?: boolean;
33
+ console: Console;
33
34
  }
34
35
 
35
36
  export class Settings {
@@ -45,10 +46,18 @@ export class Settings {
45
46
  #registry = new Map<string, Setting<unknown>>();
46
47
  readonly moduleSettings = new Map<string, Setting<unknown>>();
47
48
  #logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>;
48
-
49
- constructor(
50
- {syncedStorage, globalStorage, localStorage, settingRegistrations, logSettingAccess, runSettingsMigration}:
51
- SettingsCreationOptions) {
49
+ readonly #console: Console;
50
+
51
+ constructor({
52
+ syncedStorage,
53
+ globalStorage,
54
+ localStorage,
55
+ settingRegistrations,
56
+ logSettingAccess,
57
+ runSettingsMigration,
58
+ console
59
+ }: SettingsCreationOptions) {
60
+ this.#console = console;
52
61
  this.syncedStorage = syncedStorage;
53
62
  this.globalStorage = globalStorage;
54
63
  this.localStorage = localStorage;
@@ -93,10 +102,17 @@ export class Settings {
93
102
  globalStorage: SettingsStorage|null,
94
103
  localStorage: SettingsStorage|null,
95
104
  settingRegistrations: SettingRegistration[]|null,
105
+ console: Console|null,
96
106
  logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>,
97
107
  runSettingsMigration?: boolean,
98
- } = {forceNew: null, syncedStorage: null, globalStorage: null, localStorage: null, settingRegistrations: null}):
99
- Settings {
108
+ } = {
109
+ forceNew: null,
110
+ syncedStorage: null,
111
+ globalStorage: null,
112
+ localStorage: null,
113
+ settingRegistrations: null,
114
+ console: null
115
+ }): Settings {
100
116
  const {
101
117
  forceNew,
102
118
  syncedStorage,
@@ -104,10 +120,11 @@ export class Settings {
104
120
  localStorage,
105
121
  settingRegistrations,
106
122
  logSettingAccess,
107
- runSettingsMigration
123
+ runSettingsMigration,
124
+ console,
108
125
  } = opts;
109
126
  if (!Root.DevToolsContext.globalInstance().has(Settings) || forceNew) {
110
- if (!syncedStorage || !globalStorage || !localStorage || !settingRegistrations) {
127
+ if (!syncedStorage || !globalStorage || !localStorage || !settingRegistrations || !console) {
111
128
  throw new Error(`Unable to create settings: global and local storage must be provided: ${new Error().stack}`);
112
129
  }
113
130
 
@@ -117,7 +134,8 @@ export class Settings {
117
134
  localStorage,
118
135
  settingRegistrations,
119
136
  logSettingAccess,
120
- runSettingsMigration
137
+ runSettingsMigration,
138
+ console,
121
139
  }));
122
140
  }
123
141
 
@@ -195,7 +213,7 @@ export class Settings {
195
213
  const storage = this.storageFromType(storageType);
196
214
  let setting = this.#registry.get(key) as Setting<T>;
197
215
  if (!setting) {
198
- setting = new Setting(key, defaultValue, this.#eventSupport, storage, this.#logSettingAccess);
216
+ setting = new Setting(key, defaultValue, this.#eventSupport, storage, this.#console, this.#logSettingAccess);
199
217
  this.#registry.set(key, setting);
200
218
  }
201
219
  return setting;
@@ -208,11 +226,9 @@ export class Settings {
208
226
  createRegExpSetting(key: string, defaultValue: string, regexFlags?: string, storageType?: SettingStorageType):
209
227
  RegExpSetting {
210
228
  if (!this.#registry.get(key)) {
211
- this.#registry.set(
212
- key,
213
- new RegExpSetting(
214
- key, defaultValue, this.#eventSupport, this.storageFromType(storageType), regexFlags,
215
- this.#logSettingAccess));
229
+ this.#registry.set(key,
230
+ new RegExpSetting(key, defaultValue, this.#eventSupport, this.storageFromType(storageType),
231
+ this.#console, regexFlags, this.#logSettingAccess));
216
232
  }
217
233
  return this.#registry.get(key) as RegExpSetting;
218
234
  }
@@ -324,8 +340,8 @@ export class SettingsStorage {
324
340
  return Object.keys(this.object);
325
341
  }
326
342
 
327
- dumpSizes(): void {
328
- Console.instance().log('Ten largest settings: ');
343
+ dumpSizes(commonConsole: Console): void {
344
+ commonConsole.log('Ten largest settings: ');
329
345
  // @ts-expect-error __proto__ optimization
330
346
  const sizes: Record<string, number> = {__proto__: null};
331
347
  for (const key in this.object) {
@@ -340,7 +356,7 @@ export class SettingsStorage {
340
356
  keys.sort(comparator);
341
357
 
342
358
  for (let i = 0; i < 10 && i < keys.length; ++i) {
343
- Console.instance().log('Setting: \'' + keys[i] + '\', size: ' + sizes[keys[i]]);
359
+ commonConsole.log('Setting: \'' + keys[i] + '\', size: ' + sizes[keys[i]]);
344
360
  }
345
361
  }
346
362
  }
@@ -375,12 +391,13 @@ export class Setting<V> {
375
391
  #deprecation: Deprecation|null = null;
376
392
  #loggedInitialAccess = false;
377
393
  #logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>;
394
+ readonly #console: Console;
378
395
 
379
- constructor(
380
- readonly name: string, readonly defaultValue: V, private readonly eventSupport: ObjectWrapper<GenericEvents>,
381
- readonly storage: SettingsStorage,
382
- logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>) {
396
+ constructor(readonly name: string, readonly defaultValue: V,
397
+ private readonly eventSupport: ObjectWrapper<GenericEvents>, readonly storage: SettingsStorage,
398
+ console: Console, logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>) {
383
399
  storage.register(this.name);
400
+ this.#console = console;
384
401
  this.#logSettingAccess = logSettingAccess;
385
402
  }
386
403
 
@@ -532,7 +549,7 @@ export class Setting<V> {
532
549
  this.printSettingsSavingError(e.message, settingString);
533
550
  }
534
551
  } catch (e) {
535
- Console.instance().error('Cannot stringify setting with name: ' + this.name + ', error: ' + e.message);
552
+ this.#console.error('Cannot stringify setting with name: ' + this.name + ', error: ' + e.message);
536
553
  }
537
554
  this.eventSupport.dispatchEventToListeners(this.name, value);
538
555
  }
@@ -623,8 +640,8 @@ export class Setting<V> {
623
640
  const errorMessage =
624
641
  'Error saving setting with name: ' + this.name + ', value length: ' + value.length + '. Error: ' + message;
625
642
  console.error(errorMessage);
626
- Console.instance().error(errorMessage);
627
- this.storage.dumpSizes();
643
+ this.#console.error(errorMessage);
644
+ this.storage.dumpSizes(this.#console);
628
645
  }
629
646
  }
630
647
 
@@ -633,10 +650,10 @@ export class RegExpSetting extends Setting<any> {
633
650
  #regexFlags?: string;
634
651
  #regex?: RegExp|null;
635
652
 
636
- constructor(
637
- name: string, defaultValue: string, eventSupport: ObjectWrapper<GenericEvents>, storage: SettingsStorage,
638
- regexFlags?: string, logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>) {
639
- super(name, defaultValue ? [{pattern: defaultValue}] : [], eventSupport, storage, logSettingAccess);
653
+ constructor(name: string, defaultValue: string, eventSupport: ObjectWrapper<GenericEvents>, storage: SettingsStorage,
654
+ console: Console, regexFlags?: string,
655
+ logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>) {
656
+ super(name, defaultValue ? [{pattern: defaultValue}] : [], eventSupport, storage, console, logSettingAccess);
640
657
  this.#regexFlags = regexFlags;
641
658
  }
642
659
 
@@ -3,110 +3,59 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Common from '../../core/common/common.js';
6
- import * as i18n from '../i18n/i18n.js';
6
+ import * as Root from '../root/root.js';
7
7
 
8
8
  import {EmulationModel} from './EmulationModel.js';
9
9
  import {type SDKModelObserver, TargetManager} from './TargetManager.js';
10
10
 
11
- const UIStrings = {
12
- /**
13
- * @description Text label for a menu item indicating that no throttling is applied.
14
- */
15
- noThrottling: 'No throttling',
16
- /**
17
- * @description Text label for a menu item indicating that a specific slowdown multiplier is applied.
18
- * @example {2} PH1
19
- */
20
- dSlowdown: '{PH1}× slowdown',
21
- /**
22
- * @description Text label for a menu item indicating an average mobile device.
23
- */
24
- calibratedMidTierMobile: 'Mid-tier mobile',
25
- /**
26
- * @description Text label for a menu item indicating a below-average mobile device.
27
- */
28
- calibratedLowTierMobile: 'Low-tier mobile',
29
- /**
30
- * @description Text label indicating why an option is not available, because the user's device is not fast enough to emulate a device.
31
- */
32
- calibrationErrorDeviceTooWeak: 'Device is not powerful enough',
33
- } as const;
34
- const str_ = i18n.i18n.registerUIStrings('core/sdk/CPUThrottlingManager.ts', UIStrings);
35
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
36
- const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
37
-
38
- let throttlingManagerInstance: CPUThrottlingManager|undefined;
39
-
40
11
  export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
41
12
  SDKModelObserver<EmulationModel> {
42
13
  readonly #targetManager: TargetManager;
43
- #cpuThrottlingOption: CPUThrottlingOption;
44
- #calibratedThrottlingSetting: Common.Settings.Setting<CalibratedCPUThrottling>;
14
+ #cpuThrottlingRate: number;
45
15
  #hardwareConcurrency?: number;
46
16
  #pendingMainTargetPromise?: (r: number) => void;
47
17
 
48
18
  constructor(settings: Common.Settings.Settings, targetManager: TargetManager) {
49
19
  super();
50
20
  this.#targetManager = targetManager;
51
- this.#cpuThrottlingOption = NoThrottlingOption;
52
- this.#calibratedThrottlingSetting = settings.createSetting<CalibratedCPUThrottling>(
53
- 'calibrated-cpu-throttling', {}, Common.Settings.SettingStorageType.GLOBAL);
54
- this.#calibratedThrottlingSetting.addChangeListener(this.#onCalibratedSettingChanged, this);
21
+ this.#cpuThrottlingRate = 1; // No throttling
55
22
  targetManager.observeModels(EmulationModel, this);
56
23
  }
57
24
 
58
- static instance(opts: {forceNew: boolean|null} = {forceNew: null}): CPUThrottlingManager {
25
+ static instance(opts: {
26
+ forceNew?: boolean|null,
27
+ settings?: Common.Settings.Settings,
28
+ targetManager?: TargetManager,
29
+ } = {forceNew: null}): CPUThrottlingManager {
59
30
  const {forceNew} = opts;
60
- if (!throttlingManagerInstance || forceNew) {
61
- throttlingManagerInstance =
62
- new CPUThrottlingManager(Common.Settings.Settings.instance(), TargetManager.instance());
31
+ if (!Root.DevToolsContext.globalInstance().has(CPUThrottlingManager) || forceNew) {
32
+ Root.DevToolsContext.globalInstance().set(
33
+ CPUThrottlingManager,
34
+ new CPUThrottlingManager(opts.settings ?? Common.Settings.Settings.instance(),
35
+ opts.targetManager ?? TargetManager.instance()));
63
36
  }
64
37
 
65
- return throttlingManagerInstance;
38
+ return Root.DevToolsContext.globalInstance().get(CPUThrottlingManager);
66
39
  }
67
40
 
68
41
  static removeInstance(): void {
69
- throttlingManagerInstance = undefined;
42
+ Root.DevToolsContext.globalInstance().delete(CPUThrottlingManager);
70
43
  }
71
44
 
72
45
  cpuThrottlingRate(): number {
73
- return this.#cpuThrottlingOption.rate();
74
- }
75
-
76
- cpuThrottlingOption(): CPUThrottlingOption {
77
- return this.#cpuThrottlingOption;
46
+ return this.#cpuThrottlingRate;
78
47
  }
79
48
 
80
- #onCalibratedSettingChanged(): void {
81
- // If a calibrated option is selected, need to propagate new rate.
82
- const currentOption = this.#cpuThrottlingOption;
83
- if (!currentOption.calibratedDeviceType) {
84
- return;
85
- }
86
-
87
- const rate = this.#cpuThrottlingOption.rate();
88
- if (rate === 0) {
89
- // This calibrated option is no longer valid.
90
- this.setCPUThrottlingOption(NoThrottlingOption);
49
+ setCPUThrottlingRate(rate: number): void {
50
+ if (rate === this.#cpuThrottlingRate) {
91
51
  return;
92
52
  }
93
53
 
54
+ this.#cpuThrottlingRate = rate;
94
55
  for (const emulationModel of this.#targetManager.models(EmulationModel)) {
95
- void emulationModel.setCPUThrottlingRate(rate);
56
+ void emulationModel.setCPUThrottlingRate(this.#cpuThrottlingRate);
96
57
  }
97
- this.dispatchEventToListeners(Events.RATE_CHANGED, rate);
98
- }
99
-
100
- setCPUThrottlingOption(option: CPUThrottlingOption): void {
101
- if (option === this.#cpuThrottlingOption) {
102
- return;
103
- }
104
-
105
- this.#cpuThrottlingOption = option;
106
- for (const emulationModel of this.#targetManager.models(EmulationModel)) {
107
- void emulationModel.setCPUThrottlingRate(this.#cpuThrottlingOption.rate());
108
- }
109
- this.dispatchEventToListeners(Events.RATE_CHANGED, this.#cpuThrottlingOption.rate());
58
+ this.dispatchEventToListeners(Events.RATE_CHANGED, this.#cpuThrottlingRate);
110
59
  }
111
60
 
112
61
  setHardwareConcurrency(concurrency: number): void {
@@ -161,8 +110,8 @@ export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Eve
161
110
  }
162
111
 
163
112
  modelAdded(emulationModel: EmulationModel): void {
164
- if (this.#cpuThrottlingOption !== NoThrottlingOption) {
165
- void emulationModel.setCPUThrottlingRate(this.#cpuThrottlingOption.rate());
113
+ if (this.#cpuThrottlingRate !== 1) {
114
+ void emulationModel.setCPUThrottlingRate(this.#cpuThrottlingRate);
166
115
  }
167
116
  if (this.#hardwareConcurrency !== undefined) {
168
117
  void emulationModel.setHardwareConcurrency(this.#hardwareConcurrency);
@@ -190,96 +139,3 @@ export interface EventTypes {
190
139
  [Events.RATE_CHANGED]: number;
191
140
  [Events.HARDWARE_CONCURRENCY_CHANGED]: number;
192
141
  }
193
-
194
- export enum CPUThrottlingRates {
195
- NO_THROTTLING = 1,
196
- MID_TIER_MOBILE = 4,
197
- LOW_TIER_MOBILE = 6,
198
- EXTRA_SLOW = 20,
199
-
200
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Used by web_tests.
201
- MidTierMobile = MID_TIER_MOBILE,
202
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Used by web_tests.
203
- LowEndMobile = LOW_TIER_MOBILE,
204
- }
205
-
206
- export type CalibratedDeviceType = 'low-tier-mobile'|'mid-tier-mobile';
207
-
208
- export interface CPUThrottlingOption {
209
- title: () => string;
210
- rate: () => number;
211
- calibratedDeviceType?: CalibratedDeviceType;
212
- jslogContext: string;
213
- }
214
-
215
- function makeFixedPresetThrottlingOption(rate: CPUThrottlingRates): CPUThrottlingOption {
216
- return {
217
- title: rate === 1 ? i18nLazyString(UIStrings.noThrottling) : i18nLazyString(UIStrings.dSlowdown, {PH1: rate}),
218
- rate: () => rate,
219
- jslogContext: rate === 1 ? 'cpu-no-throttling' : `cpu-throttled-${rate}`,
220
- };
221
- }
222
-
223
- export const NoThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.NO_THROTTLING);
224
- export const MidTierThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.MID_TIER_MOBILE);
225
- export const LowTierThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.LOW_TIER_MOBILE);
226
- export const ExtraSlowThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.EXTRA_SLOW);
227
-
228
- function makeCalibratedThrottlingOption(calibratedDeviceType: CalibratedDeviceType): CPUThrottlingOption {
229
- const getSettingValue = (): number|CalibrationError|null => {
230
- const setting = Common.Settings.Settings.instance().createSetting<CalibratedCPUThrottling>(
231
- 'calibrated-cpu-throttling', {}, Common.Settings.SettingStorageType.GLOBAL);
232
- const value = setting.get();
233
- if (calibratedDeviceType === 'low-tier-mobile') {
234
- return value.low ?? null;
235
- }
236
- if (calibratedDeviceType === 'mid-tier-mobile') {
237
- return value.mid ?? null;
238
- }
239
- return null;
240
- };
241
-
242
- return {
243
- title(): string {
244
- const typeString = calibratedDeviceType === 'low-tier-mobile' ? i18nString(UIStrings.calibratedLowTierMobile) :
245
- i18nString(UIStrings.calibratedMidTierMobile);
246
-
247
- const value = getSettingValue();
248
- if (typeof value === 'number') {
249
- return `${typeString} – ${value.toFixed(1)}×`;
250
- }
251
-
252
- return typeString;
253
- },
254
- rate(): number {
255
- const value = getSettingValue();
256
- if (typeof value === 'number') {
257
- return value;
258
- }
259
- return 0;
260
- },
261
- calibratedDeviceType,
262
- jslogContext: `cpu-throttled-calibrated-${calibratedDeviceType}`,
263
- };
264
- }
265
-
266
- export const CalibratedLowTierMobileThrottlingOption = makeCalibratedThrottlingOption('low-tier-mobile');
267
- export const CalibratedMidTierMobileThrottlingOption = makeCalibratedThrottlingOption('mid-tier-mobile');
268
-
269
- export interface CalibratedCPUThrottling {
270
- /** Either the CPU multiplier, or an error code for why it could not be determined. */
271
- low?: number|CalibrationError;
272
- mid?: number|CalibrationError;
273
- }
274
-
275
- export enum CalibrationError {
276
- DEVICE_TOO_WEAK = 'DEVICE_TOO_WEAK',
277
- }
278
-
279
- export function calibrationErrorToString(error: CalibrationError): string {
280
- if (error === CalibrationError.DEVICE_TOO_WEAK) {
281
- return i18nString(UIStrings.calibrationErrorDeviceTooWeak);
282
- }
283
-
284
- return error;
285
- }
@@ -108,6 +108,29 @@ export class CSSMetadata {
108
108
  propertyValueSets.set(propertyName, extraValues);
109
109
  }
110
110
  }
111
+ // and add common keywords for shorthands
112
+ const commonKeywordSet = new Set(CommonKeywords);
113
+ for (const propertyName of this.#longhands.keys()) {
114
+ // skip "all" because it is a CSS-wide keyword
115
+ // skip shorthands that are defined in generatedPropertyValues because they have their own value sets
116
+ if (propertyName === 'all' || propertyValueSets.has(propertyName)) {
117
+ continue;
118
+ }
119
+ const longhands = this.#longhands.get(propertyName);
120
+ if (!longhands) {
121
+ continue;
122
+ }
123
+ const values = new Array<string>();
124
+ for (const longhand of longhands) {
125
+ const longhandValues = propertyValueSets.get(longhand);
126
+ if (!longhandValues) {
127
+ continue;
128
+ }
129
+ const commonKeywordsInLonghandValues = longhandValues.intersection(commonKeywordSet);
130
+ values.push(...commonKeywordsInLonghandValues);
131
+ }
132
+ propertyValueSets.set(propertyName, new Set(values));
133
+ }
111
134
  // finally add keywords from alias property, common keywords to value sets and convert property #values
112
135
  // into arrays since callers expect arrays
113
136
  for (const [propertyName, values] of propertyValueSets) {
@@ -25,13 +25,17 @@ export class CompilerSourceMappingContentProvider implements TextUtils.ContentPr
25
25
  readonly #sourceURL: Platform.DevToolsPath.UrlString;
26
26
  readonly #contentType: Common.ResourceType.ResourceType;
27
27
  readonly #initiator: PageResourceLoadInitiator;
28
+ readonly #pageResourceLoader: PageResourceLoader;
28
29
 
29
- constructor(
30
- sourceURL: Platform.DevToolsPath.UrlString, contentType: Common.ResourceType.ResourceType,
31
- initiator: PageResourceLoadInitiator) {
30
+ constructor(sourceURL: Platform.DevToolsPath.UrlString, contentType: Common.ResourceType.ResourceType,
31
+ initiator: PageResourceLoadInitiator,
32
+ pageResourceLoader: PageResourceLoader = initiator.target ?
33
+ initiator.target.targetManager().context.get(PageResourceLoader) :
34
+ PageResourceLoader.instance()) {
32
35
  this.#sourceURL = sourceURL;
33
36
  this.#contentType = contentType;
34
37
  this.#initiator = initiator;
38
+ this.#pageResourceLoader = pageResourceLoader;
35
39
  }
36
40
 
37
41
  contentURL(): Platform.DevToolsPath.UrlString {
@@ -44,7 +48,7 @@ export class CompilerSourceMappingContentProvider implements TextUtils.ContentPr
44
48
 
45
49
  async requestContentData(): Promise<TextUtils.ContentData.ContentDataOrError> {
46
50
  try {
47
- const {content} = await PageResourceLoader.instance().loadResource(this.#sourceURL, this.#initiator);
51
+ const {content} = await this.#pageResourceLoader.loadResource(this.#sourceURL, this.#initiator);
48
52
  return new TextUtils.ContentData.ContentData(
49
53
  content, /* isBase64=*/ false, this.#contentType.canonicalMimeType());
50
54
  } catch (e) {