chrome-devtools-frontend 1.0.1548980 → 1.0.1550444

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 (323) hide show
  1. package/docs/contributing/settings-experiments-features.md +35 -0
  2. package/docs/styleguide/ux/components.md +53 -12
  3. package/docs/styleguide/ux/images/cards.png +0 -0
  4. package/docs/styleguide/ux/patterns.md +27 -0
  5. package/docs/ui_engineering.md +2 -2
  6. package/eslint.config.mjs +1 -0
  7. package/front_end/Tests.js +2 -0
  8. package/front_end/core/host/InspectorFrontendHost.ts +26 -558
  9. package/front_end/core/host/InspectorFrontendHostAPI.ts +6 -3
  10. package/front_end/core/host/InspectorFrontendHostStub.ts +558 -0
  11. package/front_end/core/host/ResourceLoader.ts +9 -23
  12. package/front_end/core/host/UserMetrics.ts +4 -4
  13. package/front_end/core/root/DevToolsContext.ts +4 -0
  14. package/front_end/core/root/Runtime.ts +10 -0
  15. package/front_end/core/sdk/CSSMatchedStyles.ts +2 -2
  16. package/front_end/core/sdk/CSSModel.ts +24 -24
  17. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +11 -11
  18. package/front_end/core/sdk/CSSQuery.ts +1 -1
  19. package/front_end/core/sdk/CSSRule.ts +2 -2
  20. package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
  21. package/front_end/core/sdk/CSSStyleSheetHeader.ts +1 -1
  22. package/front_end/core/sdk/DOMModel.ts +3 -0
  23. package/front_end/core/sdk/NetworkManager.ts +41 -41
  24. package/front_end/core/sdk/NetworkRequest.ts +4 -0
  25. package/front_end/core/sdk/OverlayModel.ts +2 -2
  26. package/front_end/core/sdk/PageResourceLoader.ts +71 -38
  27. package/front_end/core/sdk/SourceMap.ts +6 -0
  28. package/front_end/core/sdk/SourceMapCache.ts +21 -0
  29. package/front_end/core/sdk/SourceMapManager.ts +14 -7
  30. package/front_end/core/sdk/SourceMapScopesInfo.ts +6 -2
  31. package/front_end/core/sdk/TargetManager.ts +14 -2
  32. package/front_end/core/sdk/sdk-meta.ts +13 -0
  33. package/front_end/entrypoints/formatter_worker/FormatterActions.ts +1 -0
  34. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +1 -1
  35. package/front_end/entrypoints/main/MainImpl.ts +5 -4
  36. package/front_end/foundation/Universe.ts +8 -1
  37. package/front_end/generated/Deprecation.ts +18 -4
  38. package/front_end/generated/InspectorBackendCommands.ts +38 -33
  39. package/front_end/generated/SupportedCSSProperties.js +41 -41
  40. package/front_end/generated/protocol-mapping.d.ts +20 -0
  41. package/front_end/generated/protocol-proxy-api.d.ts +17 -0
  42. package/front_end/generated/protocol.ts +146 -35
  43. package/front_end/models/ai_assistance/AiConversation.ts +5 -4
  44. package/front_end/models/ai_assistance/BuiltInAi.ts +79 -5
  45. package/front_end/models/ai_assistance/ChangeManager.ts +4 -4
  46. package/front_end/models/ai_assistance/ConversationHandler.ts +0 -15
  47. package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -6
  48. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +135 -3
  49. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +24 -0
  50. package/front_end/models/bindings/CompilerScriptMapping.ts +43 -0
  51. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +19 -0
  52. package/front_end/models/bindings/ResourceMapping.ts +73 -0
  53. package/front_end/models/bindings/ResourceScriptMapping.ts +50 -0
  54. package/front_end/models/issues_manager/AttributionReportingIssue.ts +6 -8
  55. package/front_end/models/issues_manager/BounceTrackingIssue.ts +4 -14
  56. package/front_end/models/issues_manager/ClientHintIssue.ts +5 -12
  57. package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +5 -12
  58. package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +7 -14
  59. package/front_end/models/issues_manager/CookieIssue.ts +27 -30
  60. package/front_end/models/issues_manager/CorsIssue.ts +8 -17
  61. package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -8
  62. package/front_end/models/issues_manager/DeprecationIssue.ts +7 -14
  63. package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +7 -14
  64. package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +4 -11
  65. package/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.ts +4 -11
  66. package/front_end/models/issues_manager/GenericIssue.ts +28 -16
  67. package/front_end/models/issues_manager/HeavyAdIssue.ts +4 -11
  68. package/front_end/models/issues_manager/Issue.ts +12 -4
  69. package/front_end/models/issues_manager/IssueAggregator.ts +8 -2
  70. package/front_end/models/issues_manager/LowTextContrastIssue.ts +3 -10
  71. package/front_end/models/issues_manager/MixedContentIssue.ts +7 -13
  72. package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +4 -11
  73. package/front_end/models/issues_manager/PropertyRuleIssue.ts +6 -12
  74. package/front_end/models/issues_manager/QuirksModeIssue.ts +3 -10
  75. package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +7 -13
  76. package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +4 -11
  77. package/front_end/models/issues_manager/SharedDictionaryIssue.ts +6 -13
  78. package/front_end/models/issues_manager/StylesheetLoadingIssue.ts +8 -13
  79. package/front_end/models/issues_manager/UnencodedDigestIssue.ts +2 -9
  80. package/front_end/models/issues_manager/descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
  81. package/front_end/models/javascript_metadata/NativeFunctions.js +7 -16
  82. package/front_end/models/source_map_scopes/FunctionCodeResolver.snapshot.txt +98 -0
  83. package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +270 -0
  84. package/front_end/models/source_map_scopes/source_map_scopes.ts +2 -0
  85. package/front_end/models/workspace/UISourceCode.ts +51 -44
  86. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +76 -34
  87. package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -0
  88. package/front_end/panels/ai_assistance/components/ChatView.ts +23 -11
  89. package/front_end/panels/application/AppManifestView.ts +7 -6
  90. package/front_end/panels/application/ApplicationPanelSidebar.ts +21 -21
  91. package/front_end/panels/application/BackForwardCacheTreeElement.ts +2 -2
  92. package/front_end/panels/application/BounceTrackingMitigationsTreeElement.ts +2 -2
  93. package/front_end/panels/application/FrameDetailsView.ts +5 -6
  94. package/front_end/panels/application/InterestGroupTreeElement.ts +2 -2
  95. package/front_end/panels/application/OpenedWindowDetailsView.ts +2 -2
  96. package/front_end/panels/application/OriginTrialTreeView.ts +1 -1
  97. package/front_end/panels/application/PreloadingTreeElement.ts +3 -3
  98. package/front_end/panels/application/ReportingApiTreeElement.ts +2 -2
  99. package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +3 -3
  100. package/front_end/panels/application/ServiceWorkersView.ts +2 -2
  101. package/front_end/panels/application/SharedStorageListTreeElement.ts +2 -2
  102. package/front_end/panels/application/StorageBucketsTreeElement.ts +3 -3
  103. package/front_end/panels/application/StorageView.ts +2 -2
  104. package/front_end/panels/application/TrustTokensTreeElement.ts +4 -8
  105. package/front_end/panels/application/components/PermissionsPolicySection.ts +202 -158
  106. package/front_end/panels/application/components/ProtocolHandlersView.ts +118 -81
  107. package/front_end/panels/application/components/ServiceWorkerRouterView.ts +47 -41
  108. package/front_end/panels/application/components/SharedStorageMetadataView.ts +1 -1
  109. package/front_end/panels/application/components/StorageMetadataView.ts +31 -34
  110. package/front_end/panels/application/components/TrustTokensView.ts +77 -69
  111. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +1 -1
  112. package/front_end/panels/application/preloading/components/RuleSetGrid.ts +1 -1
  113. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +1 -1
  114. package/front_end/panels/changes/ChangesSidebar.ts +2 -0
  115. package/front_end/panels/changes/CombinedDiffView.ts +2 -0
  116. package/front_end/panels/common/AnnotationManager.ts +71 -0
  117. package/front_end/panels/common/PersistenceUtils.ts +6 -7
  118. package/front_end/panels/common/common.ts +1 -0
  119. package/front_end/panels/console/ConsolePrompt.ts +4 -4
  120. package/front_end/panels/console/ConsoleView.ts +5 -4
  121. package/front_end/panels/console/ConsoleViewMessage.ts +16 -15
  122. package/front_end/panels/console/console-meta.ts +0 -13
  123. package/front_end/panels/console_counters/WarningErrorCounter.ts +2 -0
  124. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
  125. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +3 -1
  126. package/front_end/panels/elements/CSSRuleValidator.ts +7 -7
  127. package/front_end/panels/elements/CSSRuleValidatorHelper.ts +2 -2
  128. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +3 -3
  129. package/front_end/panels/elements/ElementsPanel.ts +49 -0
  130. package/front_end/panels/elements/ElementsTreeElement.ts +172 -121
  131. package/front_end/panels/elements/ElementsTreeOutline.ts +11 -3
  132. package/front_end/panels/elements/LayoutPane.ts +12 -10
  133. package/front_end/panels/elements/ShortcutTreeElement.ts +2 -2
  134. package/front_end/panels/elements/StyleEditorWidget.ts +2 -2
  135. package/front_end/panels/elements/StylePropertyTreeElement.ts +18 -18
  136. package/front_end/panels/elements/StylesSidebarPane.ts +4 -5
  137. package/front_end/panels/elements/TopLayerContainer.ts +2 -2
  138. package/front_end/panels/elements/components/AdornerManager.ts +3 -3
  139. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
  140. package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +1 -1
  141. package/front_end/panels/elements/components/QueryContainer.ts +1 -1
  142. package/front_end/panels/elements/components/StylePropertyEditor.ts +7 -7
  143. package/front_end/panels/emulation/DeviceModeWrapper.ts +48 -3
  144. package/front_end/panels/explain/components/ConsoleInsight.ts +6 -4
  145. package/front_end/panels/issues/AffectedResourcesView.ts +2 -2
  146. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +2 -2
  147. package/front_end/panels/issues/IssueKindView.ts +2 -2
  148. package/front_end/panels/issues/IssueView.ts +4 -4
  149. package/front_end/panels/js_timeline/js_timeline-meta.ts +4 -2
  150. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +28 -50
  151. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +15 -11
  152. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +1 -1
  153. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +1 -1
  154. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +1 -1
  155. package/front_end/panels/media/PlayerListView.ts +100 -73
  156. package/front_end/panels/media/playerListView.css +5 -0
  157. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +2 -2
  158. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +4 -5
  159. package/front_end/panels/network/NetworkDataGridNode.ts +3 -3
  160. package/front_end/panels/network/NetworkFrameGrouper.ts +2 -2
  161. package/front_end/panels/network/NetworkItemView.ts +4 -4
  162. package/front_end/panels/network/NetworkLogViewColumns.ts +3 -3
  163. package/front_end/panels/network/RequestConditionsDrawer.ts +5 -5
  164. package/front_end/panels/network/RequestCookiesView.ts +2 -2
  165. package/front_end/panels/network/SignedExchangeInfoView.ts +2 -2
  166. package/front_end/panels/network/components/DirectSocketConnectionView.ts +17 -0
  167. package/front_end/panels/network/components/RequestTrustTokensView.ts +5 -6
  168. package/front_end/panels/network/resourceChunkView.css +4 -0
  169. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +3 -3
  170. package/front_end/panels/profiler/ProfileDataGrid.ts +2 -2
  171. package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
  172. package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
  173. package/front_end/panels/recorder/components/CreateRecordingView.ts +1 -1
  174. package/front_end/panels/recorder/components/ExtensionView.ts +1 -1
  175. package/front_end/panels/recorder/components/RecordingListView.ts +1 -1
  176. package/front_end/panels/recorder/components/RecordingView.ts +1 -1
  177. package/front_end/panels/recorder/components/StepView.ts +1 -1
  178. package/front_end/panels/screencast/ScreencastView.ts +8 -8
  179. package/front_end/panels/search/SearchView.ts +1 -1
  180. package/front_end/panels/security/CookieControlsTreeElement.ts +2 -2
  181. package/front_end/panels/security/CookieControlsView.ts +1 -1
  182. package/front_end/panels/security/CookieReportTreeElement.ts +2 -2
  183. package/front_end/panels/security/SecurityPanel.ts +5 -5
  184. package/front_end/panels/security/SecurityPanelSidebar.ts +3 -4
  185. package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
  186. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
  187. package/front_end/panels/settings/KeybindsSettingsTab.ts +5 -5
  188. package/front_end/panels/settings/SettingsScreen.ts +7 -8
  189. package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
  190. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +1 -1
  191. package/front_end/panels/snippets/SnippetsQuickOpen.ts +16 -6
  192. package/front_end/panels/sources/BreakpointEditDialog.ts +3 -3
  193. package/front_end/panels/sources/BreakpointsView.ts +1 -1
  194. package/front_end/panels/sources/CSSPlugin.ts +4 -4
  195. package/front_end/panels/sources/CallStackSidebarPane.ts +4 -4
  196. package/front_end/panels/sources/DebuggerPausedMessage.ts +3 -3
  197. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +40 -23
  198. package/front_end/panels/sources/GoToLineQuickOpen.ts +11 -5
  199. package/front_end/panels/sources/NavigatorView.ts +4 -4
  200. package/front_end/panels/sources/OpenFileQuickOpen.ts +11 -16
  201. package/front_end/panels/sources/OutlineQuickOpen.ts +23 -23
  202. package/front_end/panels/sources/ProfilePlugin.ts +21 -12
  203. package/front_end/panels/sources/SourcesView.ts +2 -2
  204. package/front_end/panels/sources/TabbedEditorContainer.ts +4 -5
  205. package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -2
  206. package/front_end/panels/sources/UISourceCodeFrame.ts +5 -6
  207. package/front_end/panels/sources/filteredUISourceCodeListProvider.css +41 -0
  208. package/front_end/panels/timeline/TimelineHistoryManager.ts +2 -2
  209. package/front_end/panels/timeline/TimelinePanel.ts +29 -25
  210. package/front_end/panels/timeline/TimelineSelectorStatsView.ts +3 -3
  211. package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +1 -1
  212. package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -1
  213. package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +1 -1
  214. package/front_end/panels/timeline/components/NetworkThrottlingSelector.ts +1 -1
  215. package/front_end/panels/timeline/components/OriginMap.ts +1 -1
  216. package/front_end/panels/timeline/components/insights/Checklist.ts +1 -1
  217. package/front_end/panels/timeline/components/insights/DOMSize.ts +1 -1
  218. package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -1
  219. package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +1 -1
  220. package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
  221. package/front_end/panels/timeline/docs/flame_chart_migration.md +11 -16
  222. package/front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts +1 -1
  223. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +1 -1
  224. package/front_end/panels/timeline/timeline-meta.ts +3 -2
  225. package/front_end/panels/utils/utils.ts +18 -3
  226. package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -20
  227. package/front_end/panels/whats_new/resources/WNDT.md +8 -8
  228. package/front_end/third_party/chromium/README.chromium +1 -1
  229. package/front_end/third_party/puppeteer/third_party/mitt/README.chromium +1 -0
  230. package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -0
  231. package/front_end/third_party/puppeteer/third_party/rxjs/README.chromium +1 -0
  232. package/front_end/ui/components/adorners/Adorner.ts +21 -1
  233. package/front_end/ui/components/annotations/AnnotationRepository.ts +98 -0
  234. package/front_end/ui/components/annotations/AnnotationType.ts +10 -0
  235. package/front_end/ui/components/annotations/annotations.ts +6 -0
  236. package/front_end/ui/components/buttons/Button.ts +2 -2
  237. package/front_end/ui/components/buttons/FloatingButton.ts +2 -2
  238. package/front_end/ui/components/chrome_link/ChromeLink.ts +1 -1
  239. package/front_end/ui/components/dialogs/ButtonDialog.ts +1 -1
  240. package/front_end/ui/components/dialogs/Dialog.ts +1 -1
  241. package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -0
  242. package/front_end/ui/components/diff_view/DiffView.ts +1 -1
  243. package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
  244. package/front_end/ui/components/highlighting/HighlightElement.ts +16 -2
  245. package/front_end/ui/components/highlighting/MarkupHighlight.ts +162 -0
  246. package/front_end/ui/components/highlighting/highlighting.ts +7 -0
  247. package/front_end/ui/components/icon_button/FileSourceIcon.ts +2 -2
  248. package/front_end/ui/components/icon_button/IconButton.ts +2 -2
  249. package/front_end/ui/components/icon_button/icon_button.ts +0 -2
  250. package/front_end/ui/components/issue_counter/IssueCounter.ts +2 -2
  251. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +2 -2
  252. package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +1 -1
  253. package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
  254. package/front_end/ui/components/list/List.ts +184 -0
  255. package/front_end/ui/components/list/list.css +90 -0
  256. package/front_end/ui/components/{cards/cards.ts → list/lists.ts} +3 -3
  257. package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
  258. package/front_end/ui/components/markdown_view/MarkdownImage.ts +4 -4
  259. package/front_end/ui/components/markdown_view/MarkdownLink.ts +1 -1
  260. package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -1
  261. package/front_end/ui/components/menus/Menu.ts +1 -1
  262. package/front_end/ui/components/menus/SelectMenu.ts +1 -1
  263. package/front_end/ui/components/node_text/NodeText.ts +1 -1
  264. package/front_end/ui/components/panel_feedback/FeedbackButton.ts +1 -1
  265. package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
  266. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
  267. package/front_end/ui/components/panel_introduction_steps/PanelIntroductionSteps.ts +1 -1
  268. package/front_end/ui/components/report_view/ReportView.ts +1 -1
  269. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +2 -2
  270. package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
  271. package/front_end/ui/components/settings/SettingDeprecationWarning.ts +2 -2
  272. package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
  273. package/front_end/ui/components/spinners/Spinner.ts +1 -1
  274. package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
  275. package/front_end/ui/components/suggestion_input/SuggestionInput.ts +1 -0
  276. package/front_end/ui/components/survey_link/SurveyLink.ts +2 -2
  277. package/front_end/ui/components/switch/SwitchImpl.ts +1 -1
  278. package/front_end/ui/components/text_editor/TextEditor.ts +1 -0
  279. package/front_end/ui/components/text_editor/config.ts +2 -2
  280. package/front_end/ui/components/text_prompt/TextPrompt.ts +1 -1
  281. package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
  282. package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -1
  283. package/front_end/ui/kit/cards/Card.docs.ts +43 -0
  284. package/front_end/ui/{components/icon_button → kit/icons}/Icon.docs.ts +3 -4
  285. package/front_end/ui/{components/icon_button → kit/icons}/Icon.ts +6 -4
  286. package/front_end/ui/kit/kit.ts +6 -0
  287. package/front_end/ui/legacy/Infobar.ts +3 -3
  288. package/front_end/ui/legacy/InspectorView.ts +3 -3
  289. package/front_end/ui/legacy/SearchableView.ts +2 -2
  290. package/front_end/ui/legacy/SoftContextMenu.ts +5 -5
  291. package/front_end/ui/legacy/SoftDropDown.ts +2 -2
  292. package/front_end/ui/legacy/TabbedPane.ts +106 -8
  293. package/front_end/ui/legacy/Toolbar.ts +3 -3
  294. package/front_end/ui/legacy/Treeoutline.ts +2 -2
  295. package/front_end/ui/legacy/UIUtils.ts +4 -188
  296. package/front_end/ui/legacy/ViewManager.ts +27 -12
  297. package/front_end/ui/legacy/ViewRegistration.ts +21 -22
  298. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +8 -8
  299. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +4 -4
  300. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +4 -4
  301. package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +2 -2
  302. package/front_end/ui/legacy/components/inline_editor/Swatches.ts +5 -5
  303. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +3 -3
  304. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +5 -4
  305. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +73 -35
  306. package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +11 -2
  307. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +3 -3
  308. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +23 -31
  309. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +11 -27
  310. package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +11 -15
  311. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +18 -65
  312. package/front_end/ui/legacy/components/source_frame/JSONView.ts +2 -1
  313. package/front_end/ui/legacy/components/utils/Linkifier.ts +3 -3
  314. package/front_end/ui/legacy/tabbedPane.css +10 -0
  315. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  316. package/inspector_overlay/README.md +3 -3
  317. package/mcp/HostBindings.ts +310 -0
  318. package/mcp/mcp.ts +18 -0
  319. package/mcp/tsconfig.json +6 -1
  320. package/package.json +26 -24
  321. /package/front_end/ui/{components → kit}/cards/Card.ts +0 -0
  322. /package/front_end/ui/{components → kit}/cards/card.css +0 -0
  323. /package/front_end/ui/{components/icon_button → kit/icons}/icon.css +0 -0
@@ -41,9 +41,8 @@ import * as Host from '../../core/host/host.js';
41
41
  import * as i18n from '../../core/i18n/i18n.js';
42
42
  import * as Platform from '../../core/platform/platform.js';
43
43
  import * as Geometry from '../../models/geometry/geometry.js';
44
- import * as TextUtils from '../../models/text_utils/text_utils.js';
45
44
  import * as Buttons from '../components/buttons/buttons.js';
46
- import * as IconButton from '../components/icon_button/icon_button.js';
45
+ import {Icon, type IconData} from '../kit/kit.js';
47
46
  import * as Lit from '../lit/lit.js';
48
47
  import * as VisualLogging from '../visual_logging/visual_logging.js';
49
48
 
@@ -125,9 +124,6 @@ const UIStrings = {
125
124
  const str_ = i18n.i18n.registerUIStrings('ui/legacy/UIUtils.ts', UIStrings);
126
125
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
127
126
 
128
- export const highlightedSearchResultClassName = 'highlighted-search-result';
129
- export const highlightedCurrentSearchResultClassName = 'current-search-result';
130
-
131
127
  export function installDragHandle(
132
128
  element: Element, elementDragStart: ((arg0: MouseEvent) => boolean)|null, elementDrag: (arg0: MouseEvent) => void,
133
129
  elementDragEnd: ((arg0: MouseEvent) => void)|null, cursor: string|null, hoverCursor?: string|null,
@@ -698,17 +694,6 @@ export class ElementFocusRestorer {
698
694
  }
699
695
  }
700
696
 
701
- export function highlightSearchResult(
702
- element: Element, offset: number, length: number, domChanges?: HighlightChange[]): Element|null {
703
- const result = highlightSearchResults(element, [new TextUtils.TextRange.SourceRange(offset, length)], domChanges);
704
- return result.length ? result[0] : null;
705
- }
706
-
707
- export function highlightSearchResults(
708
- element: Element, resultRanges: TextUtils.TextRange.SourceRange[], changes?: HighlightChange[]): Element[] {
709
- return highlightRangesWithStyleClass(element, resultRanges, highlightedSearchResultClassName, changes);
710
- }
711
-
712
697
  export function runCSSAnimationOnce(element: Element, className: string): void {
713
698
  function animationEndCallback(): void {
714
699
  element.classList.remove(className);
@@ -725,166 +710,6 @@ export function runCSSAnimationOnce(element: Element, className: string): void {
725
710
  element.classList.add(className);
726
711
  }
727
712
 
728
- export function highlightRangesWithStyleClass(
729
- element: Element, resultRanges: TextUtils.TextRange.SourceRange[], styleClass: string,
730
- changes?: HighlightChange[]): Element[] {
731
- changes = changes || [];
732
- const highlightNodes: Element[] = [];
733
- const textNodes = element.childTextNodes();
734
- const lineText = textNodes
735
- .map(function(node) {
736
- return node.textContent;
737
- })
738
- .join('');
739
- const ownerDocument = element.ownerDocument;
740
-
741
- if (textNodes.length === 0) {
742
- return highlightNodes;
743
- }
744
-
745
- const nodeRanges: TextUtils.TextRange.SourceRange[] = [];
746
- let rangeEndOffset = 0;
747
- for (const textNode of textNodes) {
748
- const range =
749
- new TextUtils.TextRange.SourceRange(rangeEndOffset, textNode.textContent ? textNode.textContent.length : 0);
750
- rangeEndOffset = range.offset + range.length;
751
- nodeRanges.push(range);
752
- }
753
-
754
- let startIndex = 0;
755
- for (let i = 0; i < resultRanges.length; ++i) {
756
- const startOffset = resultRanges[i].offset;
757
- const endOffset = startOffset + resultRanges[i].length;
758
-
759
- while (startIndex < textNodes.length &&
760
- nodeRanges[startIndex].offset + nodeRanges[startIndex].length <= startOffset) {
761
- startIndex++;
762
- }
763
- let endIndex = startIndex;
764
- while (endIndex < textNodes.length && nodeRanges[endIndex].offset + nodeRanges[endIndex].length < endOffset) {
765
- endIndex++;
766
- }
767
- if (endIndex === textNodes.length) {
768
- break;
769
- }
770
-
771
- const highlightNode = ownerDocument.createElement('span');
772
- highlightNode.className = styleClass;
773
- highlightNode.textContent = lineText.substring(startOffset, endOffset);
774
-
775
- const lastTextNode = textNodes[endIndex];
776
- const lastText = lastTextNode.textContent || '';
777
- lastTextNode.textContent = lastText.substring(endOffset - nodeRanges[endIndex].offset);
778
- changes.push({
779
- node: (lastTextNode as Element),
780
- type: 'changed',
781
- oldText: lastText,
782
- newText: lastTextNode.textContent,
783
- nextSibling: undefined,
784
- parent: undefined,
785
- });
786
-
787
- if (startIndex === endIndex && lastTextNode.parentElement) {
788
- lastTextNode.parentElement.insertBefore(highlightNode, lastTextNode);
789
- changes.push({
790
- node: highlightNode,
791
- type: 'added',
792
- nextSibling: lastTextNode,
793
- parent: lastTextNode.parentElement,
794
- oldText: undefined,
795
- newText: undefined,
796
- });
797
- highlightNodes.push(highlightNode);
798
-
799
- const prefixNode =
800
- ownerDocument.createTextNode(lastText.substring(0, startOffset - nodeRanges[startIndex].offset));
801
- lastTextNode.parentElement.insertBefore(prefixNode, highlightNode);
802
- changes.push({
803
- node: prefixNode,
804
- type: 'added',
805
- nextSibling: highlightNode,
806
- parent: lastTextNode.parentElement,
807
- oldText: undefined,
808
- newText: undefined,
809
- });
810
- } else {
811
- const firstTextNode = textNodes[startIndex];
812
- const firstText = firstTextNode.textContent || '';
813
- const anchorElement = firstTextNode.nextSibling;
814
-
815
- if (firstTextNode.parentElement) {
816
- firstTextNode.parentElement.insertBefore(highlightNode, anchorElement);
817
- changes.push({
818
- node: highlightNode,
819
- type: 'added',
820
- nextSibling: anchorElement || undefined,
821
- parent: firstTextNode.parentElement,
822
- oldText: undefined,
823
- newText: undefined,
824
- });
825
- highlightNodes.push(highlightNode);
826
- }
827
-
828
- firstTextNode.textContent = firstText.substring(0, startOffset - nodeRanges[startIndex].offset);
829
- changes.push({
830
- node: (firstTextNode as Element),
831
- type: 'changed',
832
- oldText: firstText,
833
- newText: firstTextNode.textContent,
834
- nextSibling: undefined,
835
- parent: undefined,
836
- });
837
-
838
- for (let j = startIndex + 1; j < endIndex; j++) {
839
- const textNode = textNodes[j];
840
- const text = textNode.textContent;
841
- textNode.textContent = '';
842
- changes.push({
843
- node: (textNode as Element),
844
- type: 'changed',
845
- oldText: text || undefined,
846
- newText: textNode.textContent,
847
- nextSibling: undefined,
848
- parent: undefined,
849
- });
850
- }
851
- }
852
- startIndex = endIndex;
853
- nodeRanges[startIndex].offset = endOffset;
854
- nodeRanges[startIndex].length = lastTextNode.textContent.length;
855
- }
856
- return highlightNodes;
857
- }
858
-
859
- /** Used in chromium/src/third_party/blink/web_tests/http/tests/devtools/components/utilities-highlight-results.js **/
860
- export function applyDomChanges(domChanges: HighlightChange[]): void {
861
- for (let i = 0, size = domChanges.length; i < size; ++i) {
862
- const entry = domChanges[i];
863
- switch (entry.type) {
864
- case 'added':
865
- entry.parent?.insertBefore(entry.node, entry.nextSibling ?? null);
866
- break;
867
- case 'changed':
868
- entry.node.textContent = entry.newText ?? null;
869
- break;
870
- }
871
- }
872
- }
873
-
874
- export function revertDomChanges(domChanges: HighlightChange[]): void {
875
- for (let i = domChanges.length - 1; i >= 0; --i) {
876
- const entry = domChanges[i];
877
- switch (entry.type) {
878
- case 'added':
879
- entry.node.remove();
880
- break;
881
- case 'changed':
882
- entry.node.textContent = entry.oldText ?? null;
883
- break;
884
- }
885
- }
886
- }
887
-
888
713
  export function measurePreferredSize(element: Element, containerElement?: Element|null): Geometry.Size {
889
714
  const oldParent = element.parentElement;
890
715
  const oldNextSibling = element.nextSibling;
@@ -1456,19 +1281,19 @@ export class CheckboxLabel extends HTMLElement {
1456
1281
  customElements.define('devtools-checkbox', CheckboxLabel);
1457
1282
 
1458
1283
  export class DevToolsIconLabel extends HTMLElement {
1459
- readonly #icon: IconButton.Icon.Icon;
1284
+ readonly #icon: Icon;
1460
1285
 
1461
1286
  constructor() {
1462
1287
  super();
1463
1288
  const root = createShadowRootWithCoreStyles(this);
1464
- this.#icon = new IconButton.Icon.Icon();
1289
+ this.#icon = new Icon();
1465
1290
  this.#icon.style.setProperty('margin-right', '4px');
1466
1291
  this.#icon.style.setProperty('vertical-align', 'baseline');
1467
1292
  root.appendChild(this.#icon);
1468
1293
  root.createChild('slot');
1469
1294
  }
1470
1295
 
1471
- set data(data: IconButton.Icon.IconData) {
1296
+ set data(data: IconData) {
1472
1297
  this.#icon.data = data;
1473
1298
  // TODO(crbug.com/1427397): Clean this up. This was necessary so `DevToolsIconLabel` can use Lit icon
1474
1299
  // while being backwards-compatible with the legacy Icon while working for both small and large icons.
@@ -1802,15 +1627,6 @@ export interface Options {
1802
1627
  expand?: boolean;
1803
1628
  }
1804
1629
 
1805
- export interface HighlightChange {
1806
- node: Element|Text;
1807
- type: string;
1808
- oldText?: string;
1809
- newText?: string;
1810
- nextSibling?: Node;
1811
- parent?: Node;
1812
- }
1813
-
1814
1630
  export const isScrolledToBottom = (element: Element): boolean => {
1815
1631
  // This code works only for 0-width border.
1816
1632
  // The scrollTop, clientHeight and scrollHeight are computed in double values internally.
@@ -10,7 +10,8 @@ import * as Host from '../../core/host/host.js';
10
10
  import * as i18n from '../../core/i18n/i18n.js';
11
11
  import * as Platform from '../../core/platform/platform.js';
12
12
  import * as Root from '../../core/root/root.js';
13
- import * as IconButton from '../components/icon_button/icon_button.js';
13
+ import type * as Foundation from '../../foundation/foundation.js';
14
+ import {createIcon, type Icon} from '../kit/kit.js';
14
15
  import * as VisualLogging from '../visual_logging/visual_logging.js';
15
16
 
16
17
  import * as ARIAUtils from './ARIAUtils.js';
@@ -52,10 +53,12 @@ export const defaultOptionsForTabs = {
52
53
 
53
54
  export class PreRegisteredView implements View {
54
55
  private readonly viewRegistration: ViewRegistration;
56
+ private readonly universe?: Foundation.Universe.Universe;
55
57
  private widgetPromise: Promise<Widget>|null;
56
58
 
57
- constructor(viewRegistration: ViewRegistration) {
59
+ constructor(viewRegistration: ViewRegistration, universe?: Foundation.Universe.Universe) {
58
60
  this.viewRegistration = viewRegistration;
61
+ this.universe = universe;
59
62
  this.widgetPromise = null;
60
63
  }
61
64
 
@@ -124,7 +127,10 @@ export class PreRegisteredView implements View {
124
127
 
125
128
  widget(): Promise<Widget> {
126
129
  if (this.widgetPromise === null) {
127
- this.widgetPromise = this.viewRegistration.loadView();
130
+ if (!this.universe) {
131
+ throw new Error('Creating views via ViewManager requires a Foundation.Universe');
132
+ }
133
+ this.widgetPromise = this.viewRegistration.loadView(this.universe);
128
134
  }
129
135
  return this.widgetPromise;
130
136
  }
@@ -168,7 +174,11 @@ export class ViewManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
168
174
  private readonly locationNameByViewId = new Map<string, string>();
169
175
  private readonly locationOverrideSetting: Common.Settings.Setting<Record<string, string>>;
170
176
 
171
- private constructor() {
177
+ private readonly preRegisteredViews: PreRegisteredView[] = [];
178
+
179
+ // TODO(crbug.com/458180550): Pass the universe unconditionally once tests no longer rely
180
+ // on `instance()` to create ViewManagers lazily in after/afterEach blocks.
181
+ private constructor(universe?: Foundation.Universe.Universe) {
172
182
  super();
173
183
 
174
184
  // Read override setting for location
@@ -180,9 +190,9 @@ export class ViewManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
180
190
 
181
191
  const viewsByLocation = new Map<ViewLocationValues|'none', PreRegisteredView[]>();
182
192
  for (const view of getRegisteredViewExtensions()) {
183
- const location = view.location() || 'none';
193
+ const location = view.location || 'none';
184
194
  const views = viewsByLocation.get(location) || [];
185
- views.push(view);
195
+ views.push(new PreRegisteredView(view, universe));
186
196
  viewsByLocation.set(location, views);
187
197
  }
188
198
 
@@ -209,6 +219,7 @@ export class ViewManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
209
219
  throw new Error(`Invalid view ID '${viewId}'`);
210
220
  }
211
221
  this.views.set(viewId, view);
222
+ this.preRegisteredViews.push(view);
212
223
  // Use the preferred user location if available
213
224
  const locationName = preferredExtensionLocations[viewId] || location;
214
225
  this.locationNameByViewId.set(viewId, locationName as string);
@@ -217,10 +228,11 @@ export class ViewManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
217
228
 
218
229
  static instance(opts: {
219
230
  forceNew: boolean|null,
231
+ universe?: Foundation.Universe.Universe,
220
232
  } = {forceNew: null}): ViewManager {
221
- const {forceNew} = opts;
233
+ const {forceNew, universe} = opts;
222
234
  if (!viewManagerInstance || forceNew) {
223
- viewManagerInstance = new ViewManager();
235
+ viewManagerInstance = new ViewManager(universe);
224
236
  }
225
237
 
226
238
  return viewManagerInstance;
@@ -241,6 +253,10 @@ export class ViewManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
241
253
  return toolbar;
242
254
  }
243
255
 
256
+ getRegisteredViewExtensions(): PreRegisteredView[] {
257
+ return this.preRegisteredViews;
258
+ }
259
+
244
260
  locationNameForViewId(viewId: string): string {
245
261
  const locationName = this.locationNameByViewId.get(viewId);
246
262
  if (!locationName) {
@@ -456,7 +472,7 @@ export class ContainerWidget extends VBox {
456
472
 
457
473
  class ExpandableContainerWidget extends VBox {
458
474
  private titleElement: HTMLDivElement;
459
- private readonly titleExpandIcon: IconButton.Icon.Icon;
475
+ private readonly titleExpandIcon: Icon;
460
476
  private readonly view: View;
461
477
  private widget?: Widget;
462
478
  private materializePromise?: Promise<void>;
@@ -473,7 +489,7 @@ class ExpandableContainerWidget extends VBox {
473
489
  keydown: 'Enter|Space|ArrowLeft|ArrowRight',
474
490
  })}`);
475
491
  ARIAUtils.markAsTreeitem(this.titleElement);
476
- this.titleExpandIcon = IconButton.Icon.create('triangle-right', 'title-expand-icon');
492
+ this.titleExpandIcon = createIcon('triangle-right', 'title-expand-icon');
477
493
  this.titleElement.appendChild(this.titleExpandIcon);
478
494
  const titleText = view.title();
479
495
  createTextChild(this.titleElement, titleText);
@@ -793,7 +809,7 @@ class TabbedLocation extends Location implements TabbedViewLocation {
793
809
  view.isCloseable() || view.isTransient(), view.isPreviewFeature(), index);
794
810
  const iconName = view.iconName();
795
811
  if (iconName) {
796
- const icon = IconButton.Icon.create(iconName);
812
+ const icon = createIcon(iconName);
797
813
  this.#tabbedPane.setTabIcon(view.viewId(), icon);
798
814
  }
799
815
  }
@@ -1004,7 +1020,6 @@ class StackLocation extends Location implements ViewLocation {
1004
1020
  export {
1005
1021
  getLocalizedViewLocationCategory,
1006
1022
  getRegisteredLocationResolvers,
1007
- getRegisteredViewExtensions,
1008
1023
  maybeRemoveViewExtension,
1009
1024
  registerLocationResolver,
1010
1025
  registerViewExtension,
@@ -5,9 +5,9 @@
5
5
  import * as i18n from '../../core/i18n/i18n.js';
6
6
  import type * as Platform from '../../core/platform/platform.js';
7
7
  import * as Root from '../../core/root/root.js';
8
+ import type * as Foundation from '../../foundation/foundation.js';
8
9
 
9
10
  import type {ViewLocationResolver} from './View.js';
10
- import {PreRegisteredView} from './ViewManager.js';
11
11
  import type {Widget} from './Widget.js';
12
12
 
13
13
  const UIStrings = {
@@ -43,8 +43,6 @@ const UIStrings = {
43
43
  const str_ = i18n.i18n.registerUIStrings('ui/legacy/ViewRegistration.ts', UIStrings);
44
44
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
45
45
 
46
- const registeredViewExtensions: PreRegisteredView[] = [];
47
-
48
46
  export const enum ViewPersistence {
49
47
  CLOSEABLE = 'closeable',
50
48
  PERMANENT = 'permanent',
@@ -115,7 +113,11 @@ export interface ViewRegistration {
115
113
  /**
116
114
  * Returns an instance of the class that wraps the view.
117
115
  * The common pattern for implementing this function is loading the module with the wrapping 'Widget'
118
- * lazily loaded. As an example:
116
+ * lazily loaded.
117
+ * The DevTools universe is passed along, allowing `loadView` to retrieve necessary dependencies.
118
+ * Prefer passing individual dependencies one by one instead of forwarding the full universe. This
119
+ * makes testing easier.
120
+ * As an example:
119
121
  *
120
122
  * ```js
121
123
  * let loadedElementsModule;
@@ -129,15 +131,16 @@ export interface ViewRegistration {
129
131
  * }
130
132
  * UI.ViewManager.registerViewExtension({
131
133
  * <...>
132
- * async loadView() {
134
+ * async loadView(universe) {
133
135
  * const Elements = await loadElementsModule();
134
- * return Elements.ElementsPanel.ElementsPanel.instance();
136
+ * const pageResourceLoader = universe.context.get(SDK.PageResourceLoader.PageResourceLoader);
137
+ * return new Elements.ElementsPanel.ElementsPanel(pageResourceLoader);
135
138
  * },
136
139
  * <...>
137
140
  * });
138
141
  * ```
139
142
  */
140
- loadView: () => Promise<Widget>;
143
+ loadView: (universe: Foundation.Universe.Universe) => Promise<Widget>;
141
144
  /**
142
145
  * Used to sort the views that appear in a shared location.
143
146
  */
@@ -160,28 +163,25 @@ export interface ViewRegistration {
160
163
  featurePromotionId?: string;
161
164
  }
162
165
 
163
- const viewIdSet = new Set<string>();
166
+ const registeredViewExtensions = new Map<string, ViewRegistration>();
167
+
164
168
  export function registerViewExtension(registration: ViewRegistration): void {
165
169
  const viewId = registration.id;
166
- if (viewIdSet.has(viewId)) {
170
+ if (registeredViewExtensions.has(viewId)) {
167
171
  throw new Error(`Duplicate view id '${viewId}'`);
168
172
  }
169
- viewIdSet.add(viewId);
170
- registeredViewExtensions.push(new PreRegisteredView(registration));
173
+ registeredViewExtensions.set(viewId, registration);
171
174
  }
172
175
 
173
- export function getRegisteredViewExtensions(): PreRegisteredView[] {
174
- return registeredViewExtensions.filter(
175
- view => Root.Runtime.Runtime.isDescriptorEnabled({experiment: view.experiment(), condition: view.condition()}));
176
+ export function getRegisteredViewExtensions(): ViewRegistration[] {
177
+ return registeredViewExtensions.values()
178
+ .filter(
179
+ view => Root.Runtime.Runtime.isDescriptorEnabled({experiment: view.experiment, condition: view.condition}))
180
+ .toArray();
176
181
  }
177
182
 
178
183
  export function maybeRemoveViewExtension(viewId: string): boolean {
179
- const viewIndex = registeredViewExtensions.findIndex(view => view.viewId() === viewId);
180
- if (viewIndex < 0 || !viewIdSet.delete(viewId)) {
181
- return false;
182
- }
183
- registeredViewExtensions.splice(viewIndex, 1);
184
- return true;
184
+ return registeredViewExtensions.delete(viewId);
185
185
  }
186
186
 
187
187
  const registeredLocationResolvers: LocationResolverRegistration[] = [];
@@ -202,10 +202,9 @@ export function getRegisteredLocationResolvers(): LocationResolverRegistration[]
202
202
  }
203
203
 
204
204
  export function resetViewRegistration(): void {
205
- registeredViewExtensions.length = 0;
205
+ registeredViewExtensions.clear();
206
206
  registeredLocationResolvers.length = 0;
207
207
  viewLocationNameSet.clear();
208
- viewIdSet.clear();
209
208
  }
210
209
 
211
210
  export const enum ViewLocationCategory {
@@ -10,7 +10,7 @@ import * as Host from '../../../../core/host/host.js';
10
10
  import * as i18n from '../../../../core/i18n/i18n.js';
11
11
  import * as Platform from '../../../../core/platform/platform.js';
12
12
  import * as Root from '../../../../core/root/root.js';
13
- import * as IconButton from '../../../../ui/components/icon_button/icon_button.js';
13
+ import {createIcon, Icon} from '../../../../ui/kit/kit.js';
14
14
  import * as UIHelpers from '../../../helpers/helpers.js';
15
15
  import * as UI from '../../legacy.js';
16
16
 
@@ -134,9 +134,9 @@ export class ContrastDetails extends Common.ObjectWrapper.ObjectWrapper<EventTyp
134
134
  this.contrastValueBubble = contrastValueRowContents.createChild('span', 'contrast-details-value');
135
135
  this.contrastValue = this.contrastValueBubble.createChild('span');
136
136
  this.contrastValueBubbleIcons = [];
137
- this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(IconButton.Icon.create('checkmark')));
138
- this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(IconButton.Icon.create('check-double')));
139
- this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(IconButton.Icon.create('clear')));
137
+ this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(createIcon('checkmark')));
138
+ this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(createIcon('check-double')));
139
+ this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(createIcon('clear')));
140
140
  this.contrastValueBubbleIcons.forEach(button => button.addEventListener('click', (event: Event) => {
141
141
  ContrastDetails.showHelp();
142
142
  event.consume(false);
@@ -492,8 +492,8 @@ export class Swatch {
492
492
  }
493
493
  }
494
494
 
495
- function createIconCheckmark(): IconButton.Icon.Icon {
496
- const icon = new IconButton.Icon.Icon();
495
+ function createIconCheckmark(): Icon {
496
+ const icon = new Icon();
497
497
  icon.name = 'checkmark';
498
498
  icon.style.color = 'var(--icon-checkmark-green)';
499
499
  icon.style.width = 'var(--sys-size-9)';
@@ -501,8 +501,8 @@ function createIconCheckmark(): IconButton.Icon.Icon {
501
501
  return icon;
502
502
  }
503
503
 
504
- function createIconNo(): IconButton.Icon.Icon {
505
- const icon = new IconButton.Icon.Icon();
504
+ function createIconNo(): Icon {
505
+ const icon = new Icon();
506
506
  icon.name = 'clear';
507
507
  icon.style.color = 'var(--icon-error)';
508
508
  icon.classList.add('small');
@@ -39,8 +39,8 @@ import * as i18n from '../../../../core/i18n/i18n.js';
39
39
  import * as Platform from '../../../../core/platform/platform.js';
40
40
  import * as SDK from '../../../../core/sdk/sdk.js';
41
41
  import * as TextUtils from '../../../../models/text_utils/text_utils.js';
42
- import * as IconButton from '../../../components/icon_button/icon_button.js';
43
42
  import * as SrgbOverlay from '../../../components/srgb_overlay/srgb_overlay.js';
43
+ import {createIcon, Icon} from '../../../kit/kit.js';
44
44
  import * as VisualLogging from '../../../visual_logging/visual_logging.js';
45
45
  import * as UI from '../../legacy.js';
46
46
 
@@ -563,7 +563,7 @@ export class Spectrum extends Common.ObjectWrapper.eventMixin<EventTypes, typeof
563
563
  }
564
564
 
565
565
  function appendSwitcherIcon(parentElement: Element): void {
566
- const switcherIcon = new IconButton.Icon.Icon();
566
+ const switcherIcon = new Icon();
567
567
  switcherIcon.name = 'fold-more';
568
568
  switcherIcon.classList.add('medium');
569
569
  parentElement.appendChild(switcherIcon);
@@ -1650,7 +1650,7 @@ export class Swatch {
1650
1650
  private colorString!: string|null;
1651
1651
  private swatchInnerElement: HTMLElement;
1652
1652
  private swatchOverlayElement: HTMLElement;
1653
- private readonly swatchCopyIcon: IconButton.Icon.Icon;
1653
+ private readonly swatchCopyIcon: Icon;
1654
1654
  constructor(parentElement: HTMLElement) {
1655
1655
  const swatchElement = parentElement.createChild('span', 'swatch');
1656
1656
  swatchElement.setAttribute('jslog', `${VisualLogging.action('copy-color').track({click: true})}`);
@@ -1662,7 +1662,7 @@ export class Swatch {
1662
1662
  self.onInvokeElement(this.swatchOverlayElement, this.onCopyText.bind(this));
1663
1663
  this.swatchOverlayElement.addEventListener('mouseout', this.onCopyIconMouseout.bind(this));
1664
1664
  this.swatchOverlayElement.addEventListener('blur', this.onCopyIconMouseout.bind(this));
1665
- this.swatchCopyIcon = IconButton.Icon.create('copy', 'copy-color-icon');
1665
+ this.swatchCopyIcon = createIcon('copy', 'copy-color-icon');
1666
1666
  UI.Tooltip.Tooltip.install(this.swatchCopyIcon, i18nString(UIStrings.copyColorToClipboard));
1667
1667
  this.swatchOverlayElement.appendChild(this.swatchCopyIcon);
1668
1668
  UI.ARIAUtils.setLabel(this.swatchOverlayElement, this.swatchCopyIcon.title);
@@ -42,7 +42,7 @@ import * as SDK from '../../../../core/sdk/sdk.js';
42
42
  import type * as Protocol from '../../../../generated/protocol.js';
43
43
  import * as IssuesManager from '../../../../models/issues_manager/issues_manager.js';
44
44
  import * as NetworkForward from '../../../../panels/network/forward/forward.js';
45
- import * as IconButton from '../../../components/icon_button/icon_button.js';
45
+ import {Icon} from '../../../kit/kit.js';
46
46
  import {Directives, html, render} from '../../../lit/lit.js';
47
47
  import * as UI from '../../legacy.js';
48
48
 
@@ -72,7 +72,7 @@ type CookieData = Partial<Record<SDK.Cookie.Attribute, string>>&{
72
72
  }&{
73
73
  key?: string,
74
74
  flagged?: boolean,
75
- icons?: Partial<Record<AttributeWithIcon, IconButton.Icon.Icon>>,
75
+ icons?: Partial<Record<AttributeWithIcon, Icon>>,
76
76
  priorityValue?: number,
77
77
  expiresTooltip?: string,
78
78
  dirty?: boolean,
@@ -513,7 +513,7 @@ export class CookiesTable extends UI.Widget.VBox {
513
513
  const attribute = (blockedReason.attribute || SDK.Cookie.Attribute.NAME) as AttributeWithIcon;
514
514
  data.icons = data.icons || {};
515
515
  if (!(attribute in data.icons)) {
516
- data.icons[attribute] = new IconButton.Icon.Icon();
516
+ data.icons[attribute] = new Icon();
517
517
  if (attribute === SDK.Cookie.Attribute.NAME &&
518
518
  IssuesManager.RelatedIssue.hasThirdPartyPhaseoutCookieIssue(cookie)) {
519
519
  data.icons[attribute].name = 'warning-filled';
@@ -532,7 +532,7 @@ export class CookiesTable extends UI.Widget.VBox {
532
532
  if (exemptionReason) {
533
533
  data.icons = data.icons || {};
534
534
  data.flagged = true;
535
- data.icons.name = new IconButton.Icon.Icon();
535
+ data.icons.name = new Icon();
536
536
  data.icons.name.name = 'info';
537
537
  data.icons.name.classList.add('small');
538
538
  data.icons.name.title = exemptionReason;
@@ -8,7 +8,7 @@ import '../../legacy.js';
8
8
  import * as Common from '../../../../core/common/common.js';
9
9
  import * as i18n from '../../../../core/i18n/i18n.js';
10
10
  import * as Platform from '../../../../core/platform/platform.js';
11
- import * as IconButton from '../../../components/icon_button/icon_button.js';
11
+ import {Icon} from '../../../kit/kit.js';
12
12
  import * as VisualLogging from '../../../visual_logging/visual_logging.js';
13
13
  import * as UI from '../../legacy.js';
14
14
 
@@ -733,7 +733,7 @@ class FontPropertyInputs {
733
733
 
734
734
  private createTypeToggle(field: Element, jslogContext: string): void {
735
735
  const displaySwitcher = field.createChild('div', 'spectrum-switcher');
736
- const icon = new IconButton.Icon.Icon();
736
+ const icon = new Icon();
737
737
  icon.name = 'fold-more';
738
738
  icon.classList.add('medium');
739
739
  displaySwitcher.appendChild(icon);
@@ -3,16 +3,16 @@
3
3
  // found in the LICENSE file.
4
4
  /* eslint-disable @devtools/no-lit-render-outside-of-view */
5
5
 
6
- import '../../../components/icon_button/icon_button.js';
6
+ import '../../../kit/kit.js';
7
7
 
8
- import type * as IconButton from '../../../components/icon_button/icon_button.js';
8
+ import type {Icon} from '../../../kit/kit.js';
9
9
  import {html, render} from '../../../lit/lit.js';
10
10
 
11
11
  import type {CSSShadowModel} from './CSSShadowEditor.js';
12
12
  import cssShadowSwatchStyles from './cssShadowSwatch.css.js';
13
13
 
14
14
  export class CSSShadowSwatch extends HTMLElement {
15
- readonly #icon: IconButton.Icon.Icon;
15
+ readonly #icon: Icon;
16
16
  readonly #model: CSSShadowModel;
17
17
 
18
18
  constructor(model: CSSShadowModel) {
@@ -26,14 +26,14 @@ export class CSSShadowSwatch extends HTMLElement {
26
26
  this, {host: this});
27
27
  // clang-format on
28
28
 
29
- this.#icon = this.querySelector('devtools-icon') as IconButton.Icon.Icon;
29
+ this.#icon = this.querySelector('devtools-icon') as Icon;
30
30
  }
31
31
 
32
32
  model(): CSSShadowModel {
33
33
  return this.#model;
34
34
  }
35
35
 
36
- iconElement(): IconButton.Icon.Icon {
36
+ iconElement(): Icon {
37
37
  return this.#icon;
38
38
  }
39
39
  }
@@ -7,7 +7,7 @@ import * as Common from '../../../../core/common/common.js';
7
7
  import * as i18n from '../../../../core/i18n/i18n.js';
8
8
  import type * as SDK from '../../../../core/sdk/sdk.js';
9
9
  import type * as Protocol from '../../../../generated/protocol.js';
10
- import * as IconButton from '../../../components/icon_button/icon_button.js';
10
+ import {createIcon, type Icon} from '../../../kit/kit.js';
11
11
  import * as UI from '../../legacy.js';
12
12
 
13
13
  import customPreviewComponentStyles from './customPreviewComponent.css.js';
@@ -33,7 +33,7 @@ export class CustomPreviewSection {
33
33
  private expanded: boolean;
34
34
  private cachedContent: Node|null;
35
35
  private readonly header: Node|undefined;
36
- private readonly expandIcon: IconButton.Icon.Icon|undefined;
36
+ private readonly expandIcon: Icon|undefined;
37
37
  constructor(object: SDK.RemoteObject.RemoteObject) {
38
38
  this.sectionElement = document.createElement('span');
39
39
  this.sectionElement.classList.add('custom-expandable-section');
@@ -64,7 +64,7 @@ export class CustomPreviewSection {
64
64
  this.header.classList.add('custom-expandable-section-header');
65
65
  }
66
66
  this.header.addEventListener('click', this.onClick.bind(this), false);
67
- this.expandIcon = IconButton.Icon.create('triangle-right', 'custom-expand-icon');
67
+ this.expandIcon = createIcon('triangle-right', 'custom-expand-icon');
68
68
  this.header.insertBefore(this.expandIcon, this.header.firstChild);
69
69
  }
70
70