chrome-devtools-frontend 1.0.1726686 → 1.0.1730971
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.
- package/.agents/rules/tests/test-strict-assertions-and-literal-expectations.md +1 -1
- package/.agents/rules/tests/test-view-and-presenter-isolation.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-accessibility-and-semantic-html.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-declarative-child-widget-composition.md +5 -5
- package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-localization-and-uistrings-hygiene.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-modern-component-and-encapsulation-standards.md +3 -3
- package/.agents/rules/ui-and-widgets/ui-pure-view-and-presenter-separation.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-reactive-widget-update-lifecycle.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-view-output-and-callback-contracts.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +2 -2
- package/.agents/skills/code-review/SKILL.md +63 -12
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +38 -10
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +1 -0
- package/.agents/skills/ui-widgets/SKILL.md +8 -2
- package/.agents/skills/write-ai-eval-test/SKILL.md +106 -0
- package/AUTHORS +2 -0
- package/DIR_METADATA +1 -2
- package/README.md +48 -26
- package/config/typescript/tsconfig.base.json +1 -0
- package/config/typescript/tsconfig.eslint.json +1 -0
- package/docs/contributing/changes.md +25 -0
- package/docs/ui_engineering.md +13 -4
- package/eslint.config.mjs +323 -41
- package/front_end/core/common/Color.ts +7 -7
- package/front_end/core/common/ParsedURL.ts +3 -3
- package/front_end/core/common/ResolverBase.ts +3 -3
- package/front_end/core/common/SegmentedRange.ts +3 -3
- package/front_end/core/common/SimpleHistoryManager.ts +14 -14
- package/front_end/core/common/Trie.ts +3 -3
- package/front_end/core/common/VersionController.ts +7 -7
- package/front_end/core/host/InspectorFrontendHost.ts +2 -2
- package/front_end/core/host/InspectorFrontendHostAPI.ts +9 -1
- package/front_end/core/host/InspectorFrontendHostStub.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +4 -0
- package/front_end/core/host/UserMetricsEnums.ts +2 -1
- package/front_end/core/platform/StringUtilities.ts +54 -13
- package/front_end/core/platform/node/HostRuntime.ts +13 -7
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +4 -5
- package/front_end/core/root/Runtime.ts +5 -0
- package/front_end/core/sdk/AccessibilityModel.ts +5 -5
- package/front_end/core/sdk/AnimationModel.ts +17 -19
- package/front_end/core/sdk/CPUProfilerModel.ts +3 -3
- package/front_end/core/sdk/CPUThrottlingManager.ts +7 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +73 -13
- package/front_end/core/sdk/CSSMetadata.ts +7 -7
- package/front_end/core/sdk/CSSModel.ts +33 -33
- package/front_end/core/sdk/CSSProperty.ts +5 -5
- package/front_end/core/sdk/CSSRule.ts +6 -6
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +4 -4
- package/front_end/core/sdk/Connections.ts +16 -16
- package/front_end/core/sdk/ConsoleModel.ts +44 -47
- package/front_end/core/sdk/CookieParser.ts +11 -11
- package/front_end/core/sdk/EmulationModel.ts +35 -36
- package/front_end/core/sdk/EventBreakpointsModel.ts +11 -11
- package/front_end/core/sdk/FrameManager.ts +16 -16
- package/front_end/core/sdk/IsolateManager.ts +2 -2
- package/front_end/core/sdk/IssuesModel.ts +2 -2
- package/front_end/core/sdk/OverlayModel.ts +19 -19
- package/front_end/core/sdk/PageResourceLoader.ts +14 -16
- package/front_end/core/sdk/RemoteObject.ts +9 -9
- package/front_end/core/sdk/Resource.ts +2 -2
- package/front_end/core/sdk/RuntimeModel.ts +7 -7
- package/front_end/core/sdk/Script.ts +6 -6
- package/front_end/core/sdk/ServiceWorkerManager.ts +36 -10
- package/front_end/core/sdk/SourceMap.ts +18 -20
- package/front_end/core/sdk/SourceMapManager.ts +2 -2
- package/front_end/core/sdk/TargetManager.ts +2 -2
- package/front_end/devtools_compatibility.js +7 -3
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +2 -2
- package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +203 -115
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.ts +1 -3
- package/front_end/generated/protocol.ts +1 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +36 -12
- package/front_end/models/ai_assistance/AiConversation.ts +8 -2
- package/front_end/models/ai_assistance/agents/AiAgent.ts +137 -62
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +2 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +149 -2
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +269 -42
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +3 -0
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +9 -0
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +13 -2
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +23 -7
- package/front_end/models/ai_assistance/tools/Tool.ts +7 -5
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +22 -24
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +60 -60
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +24 -24
- package/front_end/models/bindings/DefaultScriptMapping.ts +8 -8
- package/front_end/models/bindings/FileUtils.ts +13 -13
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +3 -3
- package/front_end/models/bindings/ResourceScriptMapping.ts +23 -23
- package/front_end/models/comment_manager/CommentManager.ts +3 -3
- package/front_end/models/comment_manager/CommentThread.ts +50 -5
- package/front_end/models/cpu_profile/CPUProfileDataModel.ts +14 -14
- package/front_end/models/cpu_profile/ProfileTreeModel.ts +4 -4
- package/front_end/models/elements/StyleChanges.ts +38 -0
- package/front_end/models/emulation/EmulatedDevices.ts +12 -12
- package/front_end/models/har/HARFormat.ts +4 -4
- package/front_end/models/javascript_metadata/NativeFunctions.ts +5 -1
- package/front_end/models/lighthouse/LighthouseReporterTypes.ts +57 -3
- package/front_end/models/lighthouse/RunTypes.ts +9 -1
- package/front_end/models/logs/LogManager.ts +2 -2
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +3 -0
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +24 -24
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +6 -0
- package/front_end/models/persistence/NetworkPersistenceManager.ts +8 -3
- package/front_end/models/trace/LanternComputationData.ts +37 -11
- package/front_end/models/trace/Processor.ts +2 -1
- package/front_end/models/trace/extras/TraceTree.ts +36 -10
- package/front_end/models/trace/handlers/InitiatorsHandler.ts +27 -34
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -6
- package/front_end/models/trace/handlers/SamplesHandler.ts +9 -6
- package/front_end/models/workspace/FileManager.ts +6 -0
- package/front_end/panels/accessibility/ARIAAttributesView.ts +4 -4
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +8 -1
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +15 -17
- package/front_end/panels/accessibility/AccessibilitySubPane.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/ExternalHandler.ts +10 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +27 -22
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +19 -23
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +2 -2
- package/front_end/panels/ai_assistance/components/PermissionPrompt.ts +23 -9
- package/front_end/panels/ai_assistance/components/chatInput.css +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +37 -17
- package/front_end/panels/animation/animationTimeline.css +19 -3
- package/front_end/panels/application/AppManifestView.ts +1 -2
- package/front_end/panels/application/ApplicationPanelSidebar.ts +143 -128
- package/front_end/panels/application/DOMStorageItemsView.ts +14 -14
- package/front_end/panels/application/DeviceBoundSessionsView.ts +10 -13
- package/front_end/panels/application/ExtensionStorageItemsView.ts +3 -4
- package/front_end/panels/application/IndexedDBViews.ts +8 -4
- package/front_end/panels/application/KeyValueStorageItemsView.ts +4 -5
- package/front_end/panels/application/PrivateVerificationTokensView.ts +53 -0
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +12 -8
- package/front_end/panels/application/ServiceWorkersView.ts +1 -2
- package/front_end/panels/application/StorageItemsToolbar.ts +3 -3
- package/front_end/panels/application/StorageView.ts +2 -2
- package/front_end/panels/application/WebMCPView.ts +91 -109
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/StorageMetadataView.ts +6 -6
- package/front_end/panels/application/preloading/PreloadingView.ts +70 -37
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +3 -3
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +12 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +10 -11
- package/front_end/panels/application/privateVerificationTokensView.css +20 -0
- package/front_end/panels/application/serviceWorkersView.css +2 -2
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +24 -24
- package/front_end/panels/changes/ChangesSidebar.ts +5 -5
- package/front_end/panels/changes/ChangesView.ts +10 -11
- package/front_end/panels/comments/CommentsPane.ts +292 -102
- package/front_end/panels/comments/commentsPane.css +93 -12
- package/front_end/panels/common/CommentThreadWidget.ts +69 -0
- package/front_end/panels/common/CommentsOverlayWidget.ts +108 -29
- package/front_end/panels/common/CommentsStatusBarPill.ts +17 -6
- package/front_end/panels/common/DOMLinkifier.ts +37 -12
- package/front_end/panels/common/ExtensionPanel.ts +13 -4
- package/front_end/panels/common/ExtensionServer.ts +27 -3
- package/front_end/panels/common/PersistenceUtils.ts +3 -3
- package/front_end/panels/common/commentThreadWidget.css +25 -1
- package/front_end/panels/common/common-meta.ts +10 -0
- package/front_end/panels/console/ConsolePinPane.ts +13 -15
- package/front_end/panels/console/ConsolePrompt.ts +173 -95
- package/front_end/panels/console/ConsoleSidebar.ts +2 -2
- package/front_end/panels/console/ConsoleView.ts +75 -79
- package/front_end/panels/console/ConsoleViewMessage.ts +52 -4
- package/front_end/panels/console/SymbolizedErrorWidget.ts +8 -4
- package/front_end/panels/console/consolePrompt.css +1 -1
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/console_counters/WarningErrorCounter.ts +3 -4
- package/front_end/panels/coverage/CoverageListView.ts +2 -2
- package/front_end/panels/coverage/CoverageView.ts +20 -5
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +4 -3
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewStartView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewUnusedDeclarations.ts +8 -8
- package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +2 -3
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +4 -5
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +6 -7
- package/front_end/panels/elements/CSSValueTraceView.ts +3 -3
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -2
- package/front_end/panels/elements/ComputedStyleWidget.ts +15 -14
- package/front_end/panels/elements/DOMTreeElementWidget.ts +5 -4
- package/front_end/panels/elements/DOMTreeWidget.ts +2 -1
- package/front_end/panels/elements/ElementStatePaneWidget.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +1 -0
- package/front_end/panels/elements/EventListenersWidget.ts +2 -2
- package/front_end/panels/elements/LayoutPane.ts +2 -2
- package/front_end/panels/elements/PlatformFontsWidget.ts +3 -3
- package/front_end/panels/elements/PropertiesWidget.ts +9 -10
- package/front_end/panels/elements/PropertyRenderer.ts +72 -11
- package/front_end/panels/elements/StandaloneStylesContainer.ts +5 -10
- package/front_end/panels/elements/StyleEditorWidget.ts +30 -16
- package/front_end/panels/elements/StylePropertiesSection.ts +93 -44
- package/front_end/panels/elements/StylePropertyTreeElement.ts +230 -302
- package/front_end/panels/elements/StylesContainer.ts +2 -3
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -13
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +66 -37
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +51 -41
- package/front_end/panels/elements/components/CSSPropertyDocsView.ts +75 -65
- package/front_end/panels/elements/components/CSSQuery.ts +112 -74
- package/front_end/panels/elements/components/CSSVariableValueView.ts +109 -68
- package/front_end/panels/elements/components/ComputedStyleProperty.ts +64 -45
- package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +35 -28
- package/front_end/panels/elements/components/QueryContainer.ts +104 -74
- package/front_end/panels/elements/components/accessibilityTreeNode.css +22 -20
- package/front_end/panels/elements/components/computedStyleProperty.css +2 -0
- package/front_end/panels/elements/components/cssHintDetailsView.css +23 -21
- package/front_end/panels/elements/components/cssPropertyDocsView.css +38 -36
- package/front_end/panels/elements/components/cssVariableValueView.css +42 -40
- package/front_end/panels/elements/components/elementsTreeExpandButton.css +5 -2
- package/front_end/panels/elements/components/queryContainer.css +23 -21
- package/front_end/panels/elements/stylesSidebarPane.css +3 -3
- package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -2
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +2 -2
- package/front_end/panels/emulation/MediaQueryInspector.ts +9 -10
- package/front_end/panels/emulation/mediaQueryInspector.css +1 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +2 -2
- package/front_end/panels/issues/AffectedCookiesView.ts +144 -101
- package/front_end/panels/issues/AffectedDescendantsWithinSelectElementView.ts +83 -31
- package/front_end/panels/issues/AffectedDirectivesView.ts +218 -135
- package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +84 -34
- package/front_end/panels/issues/AffectedElementsView.ts +86 -23
- package/front_end/panels/issues/AffectedLazyLoadImagesView.ts +2 -2
- package/front_end/panels/issues/AffectedMetadataAllowedSitesView.ts +2 -2
- package/front_end/panels/issues/AffectedPartitioningBlobURLView.ts +36 -11
- package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +135 -58
- package/front_end/panels/issues/AffectedSourcesView.ts +49 -28
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +3 -4
- package/front_end/panels/issues/CorsIssueDetailsView.ts +490 -269
- package/front_end/panels/issues/GenericIssueDetailsView.ts +2 -2
- package/front_end/panels/issues/IssueKindView.ts +63 -48
- package/front_end/panels/issues/IssueView.ts +14 -18
- package/front_end/panels/issues/components/ElementsPanelLink.ts +70 -34
- package/front_end/panels/issues/components/HideIssuesMenu.ts +56 -32
- package/front_end/panels/issues/components/elementsPanelLink.css +10 -6
- package/front_end/panels/issues/components/hideIssuesMenu.css +16 -14
- package/front_end/panels/issues/issues.ts +2 -0
- package/front_end/panels/issues/issuesTree.css +4 -4
- package/front_end/panels/lighthouse/LighthouseController.ts +6 -6
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +12 -13
- package/front_end/panels/lighthouse/lighthouseStartView.css +1 -1
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +159 -161
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorView.ts +228 -0
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +32 -41
- package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +2 -2
- package/front_end/panels/linear_memory_inspector/linear_memory_inspector.ts +2 -0
- package/front_end/panels/media/EventDisplayTable.ts +2 -2
- package/front_end/panels/media/MainView.ts +132 -66
- package/front_end/panels/media/PlayerDetailView.ts +32 -14
- package/front_end/panels/media/PlayerListView.ts +83 -23
- package/front_end/panels/media/PlayerPropertiesView.ts +2 -2
- package/front_end/panels/media/TickingFlameChart.ts +153 -63
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +615 -464
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +43 -0
- package/front_end/panels/network/EventSourceMessagesView.ts +3 -3
- package/front_end/panels/network/NetworkConfigView.ts +6 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
- package/front_end/panels/network/NetworkItemView.ts +27 -26
- package/front_end/panels/network/NetworkManageCustomHeadersView.ts +236 -97
- package/front_end/panels/network/NetworkOverview.ts +8 -10
- package/front_end/panels/network/RequestConditionsDrawer.ts +8 -4
- package/front_end/panels/network/RequestDeviceBoundSessionsView.ts +2 -4
- package/front_end/panels/network/RequestHTMLView.ts +26 -7
- package/front_end/panels/network/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/RequestInitiatorView.ts +21 -22
- package/front_end/panels/network/RequestPayloadView.ts +2 -16
- package/front_end/panels/network/RequestPreviewView.ts +5 -5
- package/front_end/panels/network/RequestTimingView.ts +6 -6
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +5 -6
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +4 -3
- package/front_end/panels/network/ShowMoreDetailsWidget.ts +11 -12
- package/front_end/panels/network/SignedExchangeInfoView.ts +2 -2
- package/front_end/panels/network/networkLogView.css +2 -2
- package/front_end/panels/network/networkManageCustomHeadersView.css +27 -6
- package/front_end/panels/network/requestConditionsDrawer.css +1 -1
- package/front_end/panels/network/requestInitiatorView.css +5 -3
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -2
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +1 -2
- package/front_end/panels/profiler/HeapTimelineOverview.ts +77 -15
- package/front_end/panels/profiler/IsolateSelector.ts +258 -187
- package/front_end/panels/profiler/ProfileLauncherView.ts +7 -29
- package/front_end/panels/profiler/profileLauncherView.css +6 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +4 -5
- package/front_end/panels/recorder/ControlButton.ts +1 -1
- package/front_end/panels/recorder/RecordingListView.ts +2 -4
- package/front_end/panels/recorder/RecordingView.ts +1 -2
- package/front_end/panels/recorder/SelectorPicker.ts +2 -4
- package/front_end/panels/recorder/StepView.ts +24 -10
- package/front_end/panels/recorder/TimelineSection.ts +1 -1
- package/front_end/panels/recorder/recordingView.css +1 -1
- package/front_end/panels/screencast/ScreencastApp.ts +1 -1
- package/front_end/panels/search/SearchResultsPane.ts +11 -12
- package/front_end/panels/search/SearchView.ts +8 -10
- package/front_end/panels/security/SecurityPanel.ts +1 -8
- package/front_end/panels/security/SecurityPanelSidebar.ts +2 -2
- package/front_end/panels/security/mainView.css +1 -1
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -2
- package/front_end/panels/settings/AISettingsTab.ts +1 -1
- package/front_end/panels/settings/BackendLinkingSettingsTab.ts +34 -20
- package/front_end/panels/settings/EditFileSystemView.ts +2 -2
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +375 -197
- package/front_end/panels/settings/KeybindsSettingsTab.ts +570 -414
- package/front_end/panels/settings/SettingsScreen.ts +312 -114
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +2 -2
- package/front_end/panels/settings/aiSettingsTab.css +1 -4
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +924 -578
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +9 -2
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +39 -0
- package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +37 -8
- package/front_end/panels/settings/settingsScreen.css +0 -24
- package/front_end/panels/sources/BreakpointEditDialog.ts +9 -6
- package/front_end/panels/sources/BreakpointsView.ts +25 -4
- package/front_end/panels/sources/CallStackSidebarPane.ts +7 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -0
- package/front_end/panels/sources/GoToLineQuickOpen.ts +8 -8
- package/front_end/panels/sources/NavigatorView.ts +521 -439
- package/front_end/panels/sources/PersistenceActions.ts +11 -12
- package/front_end/panels/sources/ProfilePlugin.ts +28 -17
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -4
- package/front_end/panels/sources/SourcesNavigator.ts +9 -9
- package/front_end/panels/sources/SourcesPanel.ts +2 -2
- package/front_end/panels/sources/SourcesView.ts +3 -3
- package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -2
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -2
- package/front_end/panels/sources/components/HeadersView.ts +1 -2
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +5 -6
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +73 -34
- package/front_end/panels/timeline/IsolateSelector.ts +25 -37
- package/front_end/panels/timeline/StatusDialog.ts +5 -7
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +10 -13
- package/front_end/panels/timeline/TimelineDetailsView.ts +40 -21
- package/front_end/panels/timeline/TimelineEventOverview.ts +130 -34
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -1
- package/front_end/panels/timeline/TimelineMiniMap.ts +255 -103
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +19 -11
- package/front_end/panels/timeline/TimelinePanel.ts +1 -0
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +11 -12
- package/front_end/panels/timeline/TimelineTreeView.ts +240 -122
- package/front_end/panels/timeline/TimelineUIUtils.ts +12 -0
- package/front_end/panels/timeline/components/BreadcrumbsUI.ts +5 -4
- package/front_end/panels/timeline/components/DetailsView.ts +97 -65
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +2 -2
- package/front_end/panels/timeline/components/MetricCard.ts +2 -2
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +11 -12
- package/front_end/panels/timeline/components/NetworkTrackWidget.ts +57 -50
- package/front_end/panels/timeline/components/RelatedInsightChips.ts +2 -2
- package/front_end/panels/timeline/components/Sidebar.ts +161 -109
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +33 -12
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +3 -0
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +11 -11
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +6 -7
- package/front_end/panels/timeline/components/networkTrackWidget.css +24 -22
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -1
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +15 -10
- package/front_end/panels/timeline/overlays/components/entryLabelOverlay.css +1 -1
- package/front_end/panels/timeline/timelinePanel.css +5 -0
- package/front_end/panels/timeline/timelineStatusDialog.css +1 -1
- package/front_end/panels/web_audio/WebAudioView.ts +2 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/legacy-javascript/README.chromium +2 -2
- package/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +2 -2
- package/front_end/third_party/legacy-javascript/package.json +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1983 -2022
- package/front_end/third_party/lighthouse/locales/ar-XB.json +157 -142
- package/front_end/third_party/lighthouse/locales/ar.json +157 -142
- package/front_end/third_party/lighthouse/locales/bg.json +154 -139
- package/front_end/third_party/lighthouse/locales/ca.json +157 -142
- package/front_end/third_party/lighthouse/locales/cs.json +148 -133
- package/front_end/third_party/lighthouse/locales/da.json +153 -138
- package/front_end/third_party/lighthouse/locales/de.json +152 -137
- package/front_end/third_party/lighthouse/locales/el.json +153 -138
- package/front_end/third_party/lighthouse/locales/en-GB.json +160 -145
- package/front_end/third_party/lighthouse/locales/en-US.json +239 -218
- package/front_end/third_party/lighthouse/locales/en-XL.json +239 -218
- package/front_end/third_party/lighthouse/locales/es-419.json +150 -135
- package/front_end/third_party/lighthouse/locales/es.json +149 -134
- package/front_end/third_party/lighthouse/locales/fi.json +151 -136
- package/front_end/third_party/lighthouse/locales/fil.json +154 -139
- package/front_end/third_party/lighthouse/locales/fr.json +150 -135
- package/front_end/third_party/lighthouse/locales/he.json +160 -145
- package/front_end/third_party/lighthouse/locales/hi.json +156 -141
- package/front_end/third_party/lighthouse/locales/hr.json +154 -139
- package/front_end/third_party/lighthouse/locales/hu.json +111 -96
- package/front_end/third_party/lighthouse/locales/id.json +153 -138
- package/front_end/third_party/lighthouse/locales/it.json +153 -138
- package/front_end/third_party/lighthouse/locales/ja.json +150 -135
- package/front_end/third_party/lighthouse/locales/ko.json +42 -27
- package/front_end/third_party/lighthouse/locales/lt.json +152 -137
- package/front_end/third_party/lighthouse/locales/lv.json +93 -78
- package/front_end/third_party/lighthouse/locales/nl.json +149 -134
- package/front_end/third_party/lighthouse/locales/no.json +152 -137
- package/front_end/third_party/lighthouse/locales/pl.json +153 -138
- package/front_end/third_party/lighthouse/locales/pt-PT.json +152 -137
- package/front_end/third_party/lighthouse/locales/pt.json +157 -142
- package/front_end/third_party/lighthouse/locales/ro.json +149 -134
- package/front_end/third_party/lighthouse/locales/ru.json +76 -61
- package/front_end/third_party/lighthouse/locales/sk.json +153 -138
- package/front_end/third_party/lighthouse/locales/sl.json +149 -134
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +151 -136
- package/front_end/third_party/lighthouse/locales/sr.json +151 -136
- package/front_end/third_party/lighthouse/locales/sv.json +152 -137
- package/front_end/third_party/lighthouse/locales/ta.json +156 -141
- package/front_end/third_party/lighthouse/locales/te.json +157 -142
- package/front_end/third_party/lighthouse/locales/th.json +111 -96
- package/front_end/third_party/lighthouse/locales/tr.json +153 -138
- package/front_end/third_party/lighthouse/locales/uk.json +149 -134
- package/front_end/third_party/lighthouse/locales/vi.json +162 -147
- package/front_end/third_party/lighthouse/locales/zh-HK.json +150 -135
- package/front_end/third_party/lighthouse/locales/zh-TW.json +154 -139
- package/front_end/third_party/lighthouse/locales/zh.json +152 -137
- package/front_end/third_party/lighthouse/report/bundle.d.ts +9 -8
- package/front_end/third_party/lighthouse/report/bundle.js +10 -10
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -7
- package/front_end/tsconfig.compatibility.json +1 -0
- package/front_end/tsconfig.json +3 -2
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +0 -2
- package/front_end/ui/components/dialogs/typeToAllowDialog.css +0 -4
- package/front_end/ui/components/icon_button/fileSourceIcon.css +1 -1
- package/front_end/ui/components/input/textInput.css +1 -1
- package/front_end/ui/components/lists/List.ts +26 -14
- package/front_end/ui/components/menus/menus.ts +0 -2
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +351 -138
- package/front_end/ui/components/survey_link/surveyLink.css +3 -3
- package/front_end/ui/components/switch/switch.css +6 -6
- package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +2 -3
- package/front_end/ui/components/text_editor/TextEditor.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +53 -4
- package/front_end/ui/components/tree_outline/treeOutline.css +7 -7
- package/front_end/ui/helpers/OpenInNewTab.ts +8 -3
- package/front_end/ui/legacy/EmptyWidget.ts +4 -4
- package/front_end/ui/legacy/ForwardedInputEventHandler.ts +2 -2
- package/front_end/ui/legacy/GlassPane.ts +1 -1
- package/front_end/ui/legacy/KeyboardShortcut.ts +7 -7
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +198 -66
- package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +71 -68
- package/front_end/ui/legacy/View.ts +7 -4
- package/front_end/ui/legacy/ViewManager.ts +49 -37
- package/front_end/ui/legacy/Widget.ts +32 -12
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +2 -3
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingUI.ts +8 -8
- package/front_end/ui/legacy/components/inline_editor/BezierUI.ts +8 -9
- package/front_end/ui/legacy/components/inline_editor/LinkSwatch.ts +2 -2
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/cssAngleSwatch.css +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +45 -11
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +10 -12
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +102 -29
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +148 -122
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +20 -14
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -1
- package/front_end/ui/legacy/components/source_frame/FontView.ts +29 -5
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +79 -12
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +20 -2
- package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +6 -10
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +11 -11
- package/front_end/ui/legacy/components/source_frame/fontView.css +7 -0
- package/front_end/ui/legacy/components/source_frame/imageView.css +7 -0
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +14 -3
- package/front_end/ui/legacy/components/utils/Linkifier.ts +126 -2
- package/front_end/ui/legacy/emptyWidget.css +2 -1
- package/front_end/ui/legacy/inspectorCommon.css +3 -3
- package/front_end/ui/legacy/smallBubble.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +6 -0
- package/front_end/ui/lit/Directives.ts +35 -18
- package/front_end/ui/lit/lit.ts +0 -2
- package/front_end/ui/lit/render.ts +0 -7
- package/front_end/ui/visual_logging/KnownContextValues.ts +5 -0
- package/package.json +1 -1
- package/vpython.toml +8 -0
- package/vpython.toml.uv.lock +3 -0
- package/.agents/skills/review-models-core/SKILL.md +0 -73
- package/.agents/skills/review-tests/SKILL.md +0 -67
- package/.agents/skills/review-ui-widgets/SKILL.md +0 -115
- package/front_end/generated/ARIAProperties.ts +0 -2686
- package/front_end/ui/components/menus/README.md +0 -119
- package/front_end/ui/components/menus/SelectMenu.ts +0 -473
- package/front_end/ui/components/menus/selectMenu.css +0 -54
- package/front_end/ui/components/menus/selectMenuButton.css +0 -108
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
|
-
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
6
5
|
|
|
7
6
|
import * as Common from '../../core/common/common.js';
|
|
8
7
|
import * as Host from '../../core/host/host.js';
|
|
@@ -21,6 +20,7 @@ import * as ColorPicker from '../../ui/legacy/components/color_picker/color_pick
|
|
|
21
20
|
import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
22
21
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
23
22
|
import * as Lit from '../../ui/lit/lit.js';
|
|
23
|
+
import {Directives, html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
24
24
|
import * as SettingsUI from '../../ui/settings/settings.js';
|
|
25
25
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
26
26
|
|
|
@@ -56,7 +56,8 @@ import {getCssDeclarationAsJavascriptProperty} from './StylePropertyUtils.js';
|
|
|
56
56
|
import type {StylesContainer} from './StylesContainer.js';
|
|
57
57
|
import {CSSPropertyPrompt, REGISTERED_PROPERTY_SECTION_NAME} from './StylesSidebarPane.js';
|
|
58
58
|
|
|
59
|
-
const {
|
|
59
|
+
const {classMap, ref, until} = Directives;
|
|
60
|
+
const {ifExpanded} = Tooltips.Tooltip;
|
|
60
61
|
const ASTUtils = SDK.CSSPropertyParser.ASTUtils;
|
|
61
62
|
const FlexboxEditor = ElementsComponents.StylePropertyEditor.FlexboxEditor;
|
|
62
63
|
const GridEditor = ElementsComponents.StylePropertyEditor.GridEditor;
|
|
@@ -418,8 +419,6 @@ export class VariableRenderer extends VariableRendererBase {
|
|
|
418
419
|
|
|
419
420
|
const varCall = this.#treeElement?.getTracingTooltip(
|
|
420
421
|
'var', match.node, this.#matchedStyles, this.#computedStyles, this.#computedStyleExtraFields, context);
|
|
421
|
-
const tooltipContents =
|
|
422
|
-
this.#stylesContainer.getVariablePopoverContents(this.#matchedStyles, match.name, variableValue ?? null);
|
|
423
422
|
const tooltipId = this.#treeElement?.getTooltipId('custom-property-var');
|
|
424
423
|
const tooltip = tooltipId ? {tooltipId} : undefined;
|
|
425
424
|
// clang-format off
|
|
@@ -436,13 +435,17 @@ export class VariableRenderer extends VariableRendererBase {
|
|
|
436
435
|
tooltipId ? html`<devtools-tooltip
|
|
437
436
|
id=${tooltipId}
|
|
438
437
|
variant=rich
|
|
439
|
-
jslogContext=elements.css-var>${
|
|
440
|
-
|
|
438
|
+
jslogContext=elements.css-var>${widget(ElementsComponents.CSSVariableValueView.CSSVariableValueView, {
|
|
439
|
+
variableName: match.name,
|
|
440
|
+
value: variableValue ?? undefined,
|
|
441
|
+
details: this.#stylesContainer.getRegisteredPropertyDetails(this.#matchedStyles, match.name),
|
|
442
|
+
})}</devtools-tooltip>` : nothing}`;
|
|
443
|
+
// clang-format on
|
|
441
444
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
445
|
+
const color = computedValue && Common.Color.parse(computedValue);
|
|
446
|
+
if (!color) {
|
|
447
|
+
return varSwatch;
|
|
448
|
+
}
|
|
446
449
|
|
|
447
450
|
const colorSwatch =
|
|
448
451
|
new ColorRenderer(this.#stylesContainer, this.#treeElement).renderColorSwatch(color, match, context);
|
|
@@ -487,8 +490,6 @@ export class VariableNameRenderer extends VariableNameRendererBase {
|
|
|
487
490
|
const onLinkActivate = (name: string): void =>
|
|
488
491
|
handleVarDefinitionActivate(declaration ?? name, this.#stylesContainer);
|
|
489
492
|
|
|
490
|
-
const tooltipContents =
|
|
491
|
-
this.#stylesContainer.getVariablePopoverContents(this.#matchedStyles, match.text, variableValue ?? null);
|
|
492
493
|
const tooltipId = this.#treeElement?.getTooltipId('custom-property-var');
|
|
493
494
|
const tooltip = tooltipId ? {tooltipId} : undefined;
|
|
494
495
|
// clang-format off
|
|
@@ -500,8 +501,12 @@ export class VariableNameRenderer extends VariableNameRendererBase {
|
|
|
500
501
|
}}></devtools-link-swatch>${tooltipId ? html`<devtools-tooltip
|
|
501
502
|
id=${tooltipId}
|
|
502
503
|
variant=rich
|
|
503
|
-
jslogContext=elements.css-var>${
|
|
504
|
-
|
|
504
|
+
jslogContext=elements.css-var>${widget(ElementsComponents.CSSVariableValueView.CSSVariableValueView, {
|
|
505
|
+
variableName: match.text,
|
|
506
|
+
value: variableValue ?? undefined,
|
|
507
|
+
details: this.#stylesContainer.getRegisteredPropertyDetails(this.#matchedStyles, match.text),
|
|
508
|
+
})}</devtools-tooltip>` : nothing}`;
|
|
509
|
+
// clang-format on
|
|
505
510
|
}
|
|
506
511
|
}
|
|
507
512
|
|
|
@@ -992,7 +997,7 @@ export class ColorMixRenderer extends ColorMixRendererBase {
|
|
|
992
997
|
this.#treeElement = treeElement;
|
|
993
998
|
}
|
|
994
999
|
|
|
995
|
-
override render(match: SDK.CSSPropertyParserMatchers.ColorMixMatch, context: RenderingContext):
|
|
1000
|
+
override render(match: SDK.CSSPropertyParserMatchers.ColorMixMatch, context: RenderingContext): Lit.LitTemplate {
|
|
996
1001
|
const hookUpColorArg = (node: Node, onChange: (newColorText: string) => void): boolean => {
|
|
997
1002
|
if (node instanceof InlineEditor.ColorMixSwatch.ColorMixSwatch ||
|
|
998
1003
|
node instanceof InlineEditor.ColorSwatch.ColorSwatch) {
|
|
@@ -1020,23 +1025,20 @@ export class ColorMixRenderer extends ColorMixRendererBase {
|
|
|
1020
1025
|
const color2RenderingContext = childTracingContexts?.at(1)?.renderingContext(context) ?? context;
|
|
1021
1026
|
const spaceRenderingContext = childTracingContexts?.at(2)?.renderingContext(context) ?? context;
|
|
1022
1027
|
|
|
1023
|
-
const
|
|
1024
|
-
const
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
match.space.length ? html`${Renderer.render(match.space, spaceRenderingContext).nodes}, ` :
|
|
1031
|
-
''}${color1.nodes}, ${color2.nodes})`,
|
|
1032
|
-
contentChild);
|
|
1028
|
+
const color1 = Renderer.render(match.color1, color1RenderingContext);
|
|
1029
|
+
const color2 = Renderer.render(match.color2, color2RenderingContext);
|
|
1030
|
+
const contentChild = html`<span>${
|
|
1031
|
+
this.#treeElement?.getTracingTooltip('color-mix', match.node, this.#matchedStyles, this.#computedStyles,
|
|
1032
|
+
this.#computedStyleExtraFields, context) ??
|
|
1033
|
+
'color-mix'}(${match.space.length ? html`${Renderer.render(match.space, spaceRenderingContext).nodes}, ` : ''}${
|
|
1034
|
+
color1.nodes}, ${color2.nodes})</span>`;
|
|
1033
1035
|
|
|
1034
1036
|
const color1Controls = color1.cssControls.get('color') ?? [];
|
|
1035
1037
|
const color2Controls = color2.cssControls.get('color') ?? [];
|
|
1036
1038
|
|
|
1037
1039
|
if (context.matchedResult.hasUnresolvedSubstitutions(match.node) || color1Controls.length !== 1 ||
|
|
1038
1040
|
color2Controls.length !== 1) {
|
|
1039
|
-
return
|
|
1041
|
+
return contentChild;
|
|
1040
1042
|
}
|
|
1041
1043
|
|
|
1042
1044
|
const space = match.space.map(space => context.matchedResult.getComputedText(space)).join(' ');
|
|
@@ -1048,11 +1050,10 @@ export class ColorMixRenderer extends ColorMixRendererBase {
|
|
|
1048
1050
|
if (nodeId !== undefined && childTracingContexts) {
|
|
1049
1051
|
const evaluation = context.tracing?.applyEvaluation(childTracingContexts, () => {
|
|
1050
1052
|
const initialColor = Common.Color.parse('#000') as Common.Color.Color;
|
|
1051
|
-
const
|
|
1052
|
-
colorText.textContent = initialColor.asString();
|
|
1053
|
+
const {promise, resolve} = Promise.withResolvers<string>();
|
|
1053
1054
|
const swatch = new ColorRenderer(this.#stylesContainer, null).renderColorSwatch(initialColor, match, context);
|
|
1054
1055
|
swatch.addEventListener(InlineEditor.ColorSwatch.ColorChangedEvent.eventName, ev => {
|
|
1055
|
-
|
|
1056
|
+
resolve(ev.data.color.asString());
|
|
1056
1057
|
});
|
|
1057
1058
|
context.addControl('color', swatch);
|
|
1058
1059
|
const asyncEvalCallback = async(): Promise<boolean> => {
|
|
@@ -1069,7 +1070,10 @@ export class ColorMixRenderer extends ColorMixRendererBase {
|
|
|
1069
1070
|
}
|
|
1070
1071
|
return false;
|
|
1071
1072
|
};
|
|
1072
|
-
return {
|
|
1073
|
+
return {
|
|
1074
|
+
placeholder: html`${swatch}<span>${until(promise, initialColor.asString())}</span>`,
|
|
1075
|
+
asyncEvalCallback,
|
|
1076
|
+
};
|
|
1073
1077
|
});
|
|
1074
1078
|
if (evaluation) {
|
|
1075
1079
|
return evaluation;
|
|
@@ -1079,7 +1083,7 @@ export class ColorMixRenderer extends ColorMixRendererBase {
|
|
|
1079
1083
|
const swatch = new InlineEditor.ColorMixSwatch.ColorMixSwatch();
|
|
1080
1084
|
if (!hookUpColorArg(color1Controls[0], text => swatch.setFirstColor(text)) ||
|
|
1081
1085
|
!hookUpColorArg(color2Controls[0], text => swatch.setSecondColor(text))) {
|
|
1082
|
-
return
|
|
1086
|
+
return contentChild;
|
|
1083
1087
|
}
|
|
1084
1088
|
swatch.tabIndex = -1;
|
|
1085
1089
|
swatch.setColorMixText(colorMixText);
|
|
@@ -1087,34 +1091,28 @@ export class ColorMixRenderer extends ColorMixRendererBase {
|
|
|
1087
1091
|
context.addControl('color', swatch);
|
|
1088
1092
|
|
|
1089
1093
|
if (context.tracing) {
|
|
1090
|
-
return
|
|
1094
|
+
return html`${swatch}${contentChild}`;
|
|
1091
1095
|
}
|
|
1092
1096
|
|
|
1093
1097
|
const tooltipId = this.#treeElement?.getTooltipId('color-mix');
|
|
1094
1098
|
if (!tooltipId) {
|
|
1095
|
-
return
|
|
1099
|
+
return html`${swatch}${contentChild}`;
|
|
1096
1100
|
}
|
|
1097
1101
|
swatch.setAttribute('aria-details', tooltipId);
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
}
|
|
1113
|
-
const rgb = color.as(Common.Color.Format.HEX);
|
|
1114
|
-
colorTextSpan.textContent = rgb.isGamutClipped() ? color.asString() : rgb.asString();
|
|
1115
|
-
};
|
|
1116
|
-
|
|
1117
|
-
return [swatch, contentChild, tooltip];
|
|
1102
|
+
// clang-format off
|
|
1103
|
+
return html`${swatch}${contentChild}<devtools-tooltip
|
|
1104
|
+
id=${tooltipId}
|
|
1105
|
+
variant=rich
|
|
1106
|
+
jslogContext=elements.css-color-mix
|
|
1107
|
+
>${ifExpanded(() => {
|
|
1108
|
+
const color = swatch.mixedColor();
|
|
1109
|
+
if (!color) {
|
|
1110
|
+
return Lit.nothing;
|
|
1111
|
+
}
|
|
1112
|
+
const rgb = color.as(Common.Color.Format.HEX);
|
|
1113
|
+
return html`${rgb.isGamutClipped() ? color.asString() : rgb.asString()}`;
|
|
1114
|
+
})}</devtools-tooltip>`;
|
|
1115
|
+
// clang-format on
|
|
1118
1116
|
}
|
|
1119
1117
|
}
|
|
1120
1118
|
|
|
@@ -1131,16 +1129,11 @@ export class ContrastColorRenderer extends ContrastColorRendererBase {
|
|
|
1131
1129
|
this.#stylesContainer = stylesContainer;
|
|
1132
1130
|
}
|
|
1133
1131
|
|
|
1134
|
-
override render(match: SDK.CSSPropertyParserMatchers.ContrastColorMatch,
|
|
1135
|
-
|
|
1136
|
-
const content = document.createElement('span');
|
|
1137
|
-
content.appendChild(document.createTextNode('contrast-color('));
|
|
1138
|
-
const param = content.appendChild(document.createElement('span'));
|
|
1139
|
-
content.appendChild(document.createTextNode(')'));
|
|
1140
|
-
Renderer.renderInto(match.color, context, param);
|
|
1132
|
+
override render(match: SDK.CSSPropertyParserMatchers.ContrastColorMatch, context: RenderingContext): Lit.LitTemplate {
|
|
1133
|
+
const content = html`<span>contrast-color(${Renderer.render(match.color, context).nodes})</span>`;
|
|
1141
1134
|
|
|
1142
1135
|
if (context.matchedResult.hasUnresolvedSubstitutions(match.node)) {
|
|
1143
|
-
return
|
|
1136
|
+
return content;
|
|
1144
1137
|
}
|
|
1145
1138
|
|
|
1146
1139
|
const colorText = context.matchedResult.getComputedText(match.node);
|
|
@@ -1151,7 +1144,7 @@ export class ContrastColorRenderer extends ContrastColorRendererBase {
|
|
|
1151
1144
|
|
|
1152
1145
|
const color = Common.Color.parse(resolvedColorText);
|
|
1153
1146
|
if (!color) {
|
|
1154
|
-
return
|
|
1147
|
+
return content;
|
|
1155
1148
|
}
|
|
1156
1149
|
|
|
1157
1150
|
const colorSwatch =
|
|
@@ -1160,7 +1153,7 @@ export class ContrastColorRenderer extends ContrastColorRendererBase {
|
|
|
1160
1153
|
|
|
1161
1154
|
return this.#treeElement?.editable() ?
|
|
1162
1155
|
html`<devtools-widget ${widget(EditableContent)}>${colorSwatch}${content}</devtools-widget>` :
|
|
1163
|
-
|
|
1156
|
+
html`${colorSwatch}${content}`;
|
|
1164
1157
|
}
|
|
1165
1158
|
}
|
|
1166
1159
|
|
|
@@ -1279,10 +1272,10 @@ export class LinkableNameRenderer extends LinkableNameRendererBase {
|
|
|
1279
1272
|
}
|
|
1280
1273
|
}
|
|
1281
1274
|
|
|
1282
|
-
override render(match: SDK.CSSPropertyParserMatchers.LinkableNameMatch):
|
|
1283
|
-
const swatch = new InlineEditor.LinkSwatch.LinkSwatch();
|
|
1275
|
+
override render(match: SDK.CSSPropertyParserMatchers.LinkableNameMatch): Lit.LitTemplate {
|
|
1284
1276
|
const {metric, jslogContext, ruleBlock, isDefined} = this.#getLinkData(match);
|
|
1285
|
-
|
|
1277
|
+
// clang-format off
|
|
1278
|
+
const swatch = html`<devtools-link-swatch .data=${{
|
|
1286
1279
|
text: match.text,
|
|
1287
1280
|
tooltip: isDefined ? undefined : {title: i18nString(UIStrings.sIsNotDefined, {PH1: match.text})},
|
|
1288
1281
|
isDefined,
|
|
@@ -1299,37 +1292,30 @@ export class LinkableNameRenderer extends LinkableNameRendererBase {
|
|
|
1299
1292
|
}
|
|
1300
1293
|
},
|
|
1301
1294
|
jslogContext,
|
|
1302
|
-
}
|
|
1295
|
+
} as InlineEditor.LinkSwatch.LinkSwatchRenderData}></devtools-link-swatch>`;
|
|
1303
1296
|
|
|
1304
1297
|
if (match.propertyName === SDK.CSSPropertyParserMatchers.LinkableNameProperties.ANIMATION ||
|
|
1305
1298
|
match.propertyName === SDK.CSSPropertyParserMatchers.LinkableNameProperties.ANIMATION_NAME) {
|
|
1306
|
-
const el = document.createElement('span');
|
|
1307
|
-
el.appendChild(swatch);
|
|
1308
|
-
|
|
1309
1299
|
const node = this.#stylesContainer.node();
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
});
|
|
1326
|
-
el.insertBefore(icon, swatch);
|
|
1327
|
-
});
|
|
1328
|
-
}
|
|
1329
|
-
return [el];
|
|
1300
|
+
const animationModel = node?.domModel().target().model(SDK.AnimationModel.AnimationModel);
|
|
1301
|
+
const icon = node && animationModel ?
|
|
1302
|
+
until(animationModel.getAnimationGroupForAnimation(match.text, node.id).then(maybeAnimationGroup =>
|
|
1303
|
+
maybeAnimationGroup ? html`<devtools-icon
|
|
1304
|
+
class="open-in-animations-panel"
|
|
1305
|
+
name="animation"
|
|
1306
|
+
jslog=${VisualLogging.link('open-in-animations-panel').track({click: true})}
|
|
1307
|
+
role="button"
|
|
1308
|
+
title=${i18nString(UIStrings.jumpToAnimationsPanel)}
|
|
1309
|
+
@mouseup=${(ev: Event) => {
|
|
1310
|
+
ev.consume(true);
|
|
1311
|
+
void Common.Revealer.reveal(maybeAnimationGroup);
|
|
1312
|
+
}}></devtools-icon>` : Lit.nothing)) :
|
|
1313
|
+
Lit.nothing;
|
|
1314
|
+
return html`<span>${icon}${swatch}</span>`;
|
|
1330
1315
|
}
|
|
1316
|
+
// clang-format on
|
|
1331
1317
|
|
|
1332
|
-
return
|
|
1318
|
+
return swatch;
|
|
1333
1319
|
}
|
|
1334
1320
|
}
|
|
1335
1321
|
|
|
@@ -1378,26 +1364,17 @@ export class AutoBaseRenderer extends AutoBaseRendererBase {
|
|
|
1378
1364
|
this.#computedStyleExtraFields = computedStyleExtraFields;
|
|
1379
1365
|
}
|
|
1380
1366
|
|
|
1381
|
-
override render(match: SDK.CSSPropertyParserMatchers.AutoBaseMatch, context: RenderingContext):
|
|
1382
|
-
const
|
|
1383
|
-
|
|
1384
|
-
const auto = content.appendChild(document.createElement('span'));
|
|
1385
|
-
content.appendChild(document.createTextNode(', '));
|
|
1386
|
-
const base = content.appendChild(document.createElement('span'));
|
|
1387
|
-
content.appendChild(document.createTextNode(')'));
|
|
1388
|
-
|
|
1389
|
-
Renderer.renderInto(match.auto, context, auto);
|
|
1390
|
-
Renderer.renderInto(match.base, context, base);
|
|
1367
|
+
override render(match: SDK.CSSPropertyParserMatchers.AutoBaseMatch, context: RenderingContext): Lit.LitTemplate {
|
|
1368
|
+
const auto = Renderer.render(match.auto, context).nodes;
|
|
1369
|
+
const base = Renderer.render(match.base, context).nodes;
|
|
1391
1370
|
|
|
1392
1371
|
// TODO(crbug.com/475522248): Consider cases with nested elements which
|
|
1393
1372
|
// support base appearance and ensure the logic matches StyleAdjuster in blink.
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
return [content];
|
|
1373
|
+
const isAppearanceBase = Boolean(this.#computedStyleExtraFields?.isAppearanceBase);
|
|
1374
|
+
// clang-format off
|
|
1375
|
+
return html`<span>-internal-auto-base(<span class=${classMap({'inactive-value': isAppearanceBase})}>${auto}</span>,
|
|
1376
|
+
<span class=${classMap({'inactive-value': !isAppearanceBase})}>${base}</span>)</span>`;
|
|
1377
|
+
// clang-format on
|
|
1401
1378
|
}
|
|
1402
1379
|
}
|
|
1403
1380
|
|
|
@@ -1424,6 +1401,7 @@ type ShadowLengthProperty = ShadowProperty&{
|
|
|
1424
1401
|
|
|
1425
1402
|
// A part of a shadow as it is rendered: either text, or a node together with the context to render and read it in.
|
|
1426
1403
|
type ShadowPart = string|{node: CodeMirror.SyntaxNode, context: RenderingContext};
|
|
1404
|
+
|
|
1427
1405
|
/**
|
|
1428
1406
|
* The shadow model is an abstraction over the various shadow properties on the one hand and the order they were defined
|
|
1429
1407
|
* in on the other, so that modifications through the shadow editor can retain the property order in the authored text.
|
|
@@ -1580,6 +1558,7 @@ export class ShadowModel implements InlineEditor.CSSShadowEditor.CSSShadowModel
|
|
|
1580
1558
|
}
|
|
1581
1559
|
return html`${parts}`;
|
|
1582
1560
|
}
|
|
1561
|
+
|
|
1583
1562
|
// The text of the shadow as `renderContents` renders it, including the changes that renderers recorded for its parts.
|
|
1584
1563
|
text(): string {
|
|
1585
1564
|
const texts = this.#parts().map(part => {
|
|
@@ -1630,7 +1609,7 @@ class ShadowWidget extends UI.Widget.Widget {
|
|
|
1630
1609
|
|
|
1631
1610
|
constructor(element?: HTMLElement, view: ShadowWidgetView = SHADOW_WIDGET_DEFAULT_VIEW) {
|
|
1632
1611
|
super(element);
|
|
1633
|
-
this.element.classList.remove('
|
|
1612
|
+
this.element.classList.remove('widget');
|
|
1634
1613
|
this.#view = view;
|
|
1635
1614
|
}
|
|
1636
1615
|
|
|
@@ -1822,16 +1801,13 @@ const GridTemplateRendererBase: RendererBase<SDK.CSSPropertyParserMatchers.GridT
|
|
|
1822
1801
|
// clang-format off
|
|
1823
1802
|
export class GridTemplateRenderer extends GridTemplateRendererBase {
|
|
1824
1803
|
// clang-format on
|
|
1825
|
-
override render(match: SDK.CSSPropertyParserMatchers.GridTemplateMatch,
|
|
1826
|
-
context: RenderingContext): Node[]|Lit.LitTemplate {
|
|
1804
|
+
override render(match: SDK.CSSPropertyParserMatchers.GridTemplateMatch, context: RenderingContext): Lit.LitTemplate {
|
|
1827
1805
|
if (match.lines.length <= 1) {
|
|
1828
1806
|
return Renderer.render(ASTUtils.siblings(ASTUtils.declValue(match.node)), context).nodes;
|
|
1829
1807
|
}
|
|
1830
1808
|
|
|
1831
1809
|
const indent = Common.Settings.Settings.instance().resolve(SDK.SDKSettings.textEditorIndentSettingDescriptor).get();
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
const template = html`
|
|
1810
|
+
return html`
|
|
1835
1811
|
${match.lines.map(line => {
|
|
1836
1812
|
const lines = Renderer.render(line, context).nodes;
|
|
1837
1813
|
return html`
|
|
@@ -1839,9 +1815,6 @@ export class GridTemplateRenderer extends GridTemplateRendererBase {
|
|
|
1839
1815
|
${lines}`;
|
|
1840
1816
|
})}
|
|
1841
1817
|
`;
|
|
1842
|
-
|
|
1843
|
-
render(template, container);
|
|
1844
|
-
return [container];
|
|
1845
1818
|
}
|
|
1846
1819
|
}
|
|
1847
1820
|
|
|
@@ -1892,66 +1865,33 @@ export class LengthRenderer extends LengthRendererBase {
|
|
|
1892
1865
|
this.#propertyName = propertyName;
|
|
1893
1866
|
}
|
|
1894
1867
|
|
|
1895
|
-
override render(match: SDK.CSSPropertyParserMatchers.LengthMatch, context: RenderingContext):
|
|
1896
|
-
const
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
const evaluation = context.tracing?.applyEvaluation([], () => {
|
|
1903
|
-
return {
|
|
1904
|
-
placeholder: [valueElement],
|
|
1905
|
-
asyncEvalCallback: () => this.#applyEvaluation(valueElement, match, context),
|
|
1906
|
-
};
|
|
1907
|
-
});
|
|
1908
|
-
|
|
1909
|
-
if (evaluation) {
|
|
1910
|
-
return evaluation;
|
|
1911
|
-
}
|
|
1912
|
-
|
|
1913
|
-
return tooltip ? [valueElement, tooltip] : [valueElement];
|
|
1914
|
-
}
|
|
1915
|
-
|
|
1916
|
-
async #applyEvaluation(
|
|
1917
|
-
valueElement: HTMLElement, match: SDK.CSSPropertyParser.Match, context: RenderingContext): Promise<boolean> {
|
|
1918
|
-
const pixelValue = await resolveValues(this.#stylesContainer, this.#propertyName, match, context, match.text);
|
|
1919
|
-
|
|
1920
|
-
if (context.signal?.aborted) {
|
|
1921
|
-
return false;
|
|
1922
|
-
}
|
|
1923
|
-
|
|
1924
|
-
if (pixelValue?.[0] && pixelValue?.[0] !== match.text) {
|
|
1925
|
-
valueElement.textContent = pixelValue[0];
|
|
1926
|
-
return true;
|
|
1927
|
-
}
|
|
1928
|
-
|
|
1929
|
-
return false;
|
|
1930
|
-
}
|
|
1931
|
-
|
|
1932
|
-
#getTooltip(valueElement: HTMLElement, match: SDK.CSSPropertyParser.Match, context: RenderingContext):
|
|
1933
|
-
Tooltips.Tooltip.Tooltip|undefined {
|
|
1868
|
+
override render(match: SDK.CSSPropertyParserMatchers.LengthMatch, context: RenderingContext): Lit.LitTemplate {
|
|
1869
|
+
const template = html`${match.text}`;
|
|
1870
|
+
const evaluation =
|
|
1871
|
+
context.tracing?.applyEvaluation([], () => ({
|
|
1872
|
+
template,
|
|
1873
|
+
asyncEvalCallback: () => this.getTooltipValue(match, context),
|
|
1874
|
+
}));
|
|
1934
1875
|
const tooltipId = this.#treeElement?.getTooltipId('length');
|
|
1935
|
-
if (!tooltipId) {
|
|
1936
|
-
return
|
|
1876
|
+
if (evaluation || !tooltipId) {
|
|
1877
|
+
return html`<span tabindex=-1>${evaluation ?? template}</span>`;
|
|
1937
1878
|
}
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1879
|
+
// clang-format off
|
|
1880
|
+
return html`<span tabindex=-1 aria-details=${tooltipId}>${template}</span><devtools-tooltip
|
|
1881
|
+
variant=rich
|
|
1882
|
+
id=${tooltipId}
|
|
1883
|
+
jslogContext=length-popover
|
|
1884
|
+
>${ifExpanded(async () => (await this.getTooltipValue(match, context)) ?? template)}</devtools-tooltip>`;
|
|
1885
|
+
// clang-format on
|
|
1943
1886
|
}
|
|
1944
1887
|
|
|
1945
|
-
async getTooltipValue(
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
if (context.signal?.aborted) {
|
|
1949
|
-
return;
|
|
1950
|
-
}
|
|
1951
|
-
if (!pixelValue) {
|
|
1952
|
-
return;
|
|
1888
|
+
async getTooltipValue(match: SDK.CSSPropertyParser.Match, context: RenderingContext): Promise<Lit.LitTemplate|null> {
|
|
1889
|
+
const pixelValue =
|
|
1890
|
+
(await resolveValues(this.#stylesContainer, this.#propertyName, match, context, match.text))?.[0];
|
|
1891
|
+
if (context.signal?.aborted || !pixelValue || pixelValue === match.text) {
|
|
1892
|
+
return null;
|
|
1953
1893
|
}
|
|
1954
|
-
|
|
1894
|
+
return html`${pixelValue}`;
|
|
1955
1895
|
}
|
|
1956
1896
|
}
|
|
1957
1897
|
|
|
@@ -1979,41 +1919,41 @@ export class BaseFunctionRenderer extends BaseFunctionRendererBase {
|
|
|
1979
1919
|
this.#propertyName = propertyName;
|
|
1980
1920
|
}
|
|
1981
1921
|
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
return span;
|
|
1989
|
-
});
|
|
1922
|
+
#renderArgs(renderedArgs: Lit.LitTemplate[], activeArgs?: boolean[]): Lit.TemplateResult {
|
|
1923
|
+
return html`${renderedArgs.map((arg, idx) => {
|
|
1924
|
+
const classes = classMap({'inactive-value': activeArgs?.[idx] === false});
|
|
1925
|
+
return html`${idx === 0 ? nothing : ', '}<span class=${classes}>${arg}</span>`;
|
|
1926
|
+
})}`;
|
|
1927
|
+
}
|
|
1990
1928
|
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1929
|
+
override render(match: SDK.CSSPropertyParserMatchers.BaseFunctionMatch<string>,
|
|
1930
|
+
context: RenderingContext): Lit.LitTemplate {
|
|
1931
|
+
const childTracingContexts = context.tracing?.evaluation(match.args, {match, context});
|
|
1932
|
+
const renderedArgs = match.args.map(
|
|
1933
|
+
(arg, idx) =>
|
|
1934
|
+
Renderer.render(arg, childTracingContexts ? childTracingContexts[idx].renderingContext(context) : context)
|
|
1935
|
+
.nodes);
|
|
1936
|
+
const func = this.#treeElement?.getTracingTooltip(match.func, match.node, this.#matchedStyles, this.#computedStyles,
|
|
1937
|
+
this.#computedStyleExtraFields, context) ??
|
|
1938
|
+
match.func;
|
|
1939
|
+
const args = this.#renderArgs(renderedArgs);
|
|
1999
1940
|
|
|
2000
1941
|
if (childTracingContexts) {
|
|
1942
|
+
const template = html`${func}(${args})`;
|
|
2001
1943
|
const evaluation = context.tracing?.applyEvaluation(
|
|
2002
|
-
childTracingContexts,
|
|
2003
|
-
() => ({placeholder: [span], asyncEvalCallback: () => this.applyEvaluation(span, match, context)}));
|
|
1944
|
+
childTracingContexts, () => ({template, asyncEvalCallback: () => this.applyEvaluation(match, context)}));
|
|
2004
1945
|
if (evaluation) {
|
|
2005
|
-
return evaluation
|
|
1946
|
+
return html`<span>${evaluation}</span>`;
|
|
2006
1947
|
}
|
|
2007
1948
|
} else if (match instanceof SDK.CSSPropertyParserMatchers.MathFunctionMatch && !match.isArithmeticFunctionCall()) {
|
|
2008
|
-
|
|
1949
|
+
return html`<span>${func}(${until(this.applyMathFunction(renderedArgs, match, context), args)})</span>`;
|
|
2009
1950
|
}
|
|
2010
1951
|
|
|
2011
|
-
return
|
|
1952
|
+
return html`<span>${func}(${args})</span>`;
|
|
2012
1953
|
}
|
|
2013
1954
|
|
|
2014
|
-
async applyEvaluation(
|
|
2015
|
-
|
|
2016
|
-
context: RenderingContext): Promise<boolean> {
|
|
1955
|
+
async applyEvaluation(match: SDK.CSSPropertyParserMatchers.BaseFunctionMatch<string>,
|
|
1956
|
+
context: RenderingContext): Promise<Lit.LitTemplate|null> {
|
|
2017
1957
|
const value = context.matchedResult.getComputedText(match.node, match => {
|
|
2018
1958
|
if (match instanceof SDK.CSSPropertyParserMatchers.RelativeColorChannelMatch) {
|
|
2019
1959
|
const relativeColor =
|
|
@@ -2023,19 +1963,15 @@ export class BaseFunctionRenderer extends BaseFunctionRendererBase {
|
|
|
2023
1963
|
return null;
|
|
2024
1964
|
});
|
|
2025
1965
|
const evaled = await resolveValues(this.#stylesContainer, this.#propertyName, match, context, value);
|
|
2026
|
-
if (context.signal?.aborted) {
|
|
2027
|
-
return
|
|
2028
|
-
}
|
|
2029
|
-
if (!evaled?.[0] || evaled[0] === value) {
|
|
2030
|
-
return false;
|
|
1966
|
+
if (context.signal?.aborted || !evaled?.[0] || evaled[0] === value) {
|
|
1967
|
+
return null;
|
|
2031
1968
|
}
|
|
2032
|
-
|
|
2033
|
-
return true;
|
|
1969
|
+
return html`${evaled[0]}`;
|
|
2034
1970
|
}
|
|
2035
1971
|
|
|
2036
|
-
async applyMathFunction(
|
|
2037
|
-
|
|
2038
|
-
|
|
1972
|
+
async applyMathFunction(renderedArgs: Lit.LitTemplate[],
|
|
1973
|
+
match: SDK.CSSPropertyParserMatchers.BaseFunctionMatch<string>,
|
|
1974
|
+
context: RenderingContext): Promise<Lit.LitTemplate> {
|
|
2039
1975
|
// To understand which argument was selected by the function, we evaluate the function as well as all the arguments
|
|
2040
1976
|
// and compare the function result to the values of all its arguments. Evaluating the arguments eliminates nested
|
|
2041
1977
|
// function calls and normalizes all units to px.
|
|
@@ -2048,21 +1984,11 @@ export class BaseFunctionRenderer extends BaseFunctionRendererBase {
|
|
|
2048
1984
|
});
|
|
2049
1985
|
values.unshift(context.matchedResult.getComputedText(match.node));
|
|
2050
1986
|
const evaledArgs = await resolveValues(this.#stylesContainer, this.#propertyName, match, context, ...values);
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
if (!evaledArgs) {
|
|
2055
|
-
return;
|
|
2056
|
-
}
|
|
2057
|
-
const functionResult = evaledArgs.shift();
|
|
2058
|
-
if (!functionResult) {
|
|
2059
|
-
return;
|
|
2060
|
-
}
|
|
2061
|
-
for (let i = 0; i < renderedArgs.length; ++i) {
|
|
2062
|
-
if (evaledArgs[i] !== functionResult) {
|
|
2063
|
-
renderedArgs[i].classList.add('inactive-value');
|
|
2064
|
-
}
|
|
1987
|
+
const functionResult = evaledArgs?.shift();
|
|
1988
|
+
if (context.signal?.aborted || !evaledArgs || !functionResult) {
|
|
1989
|
+
return this.#renderArgs(renderedArgs);
|
|
2065
1990
|
}
|
|
1991
|
+
return this.#renderArgs(renderedArgs, evaledArgs.map(evaledArg => evaledArg === functionResult));
|
|
2066
1992
|
}
|
|
2067
1993
|
}
|
|
2068
1994
|
|
|
@@ -2083,17 +2009,13 @@ export class AnchorFunctionRenderer extends AnchorFunctionRendererBase {
|
|
|
2083
2009
|
// clang-format on
|
|
2084
2010
|
readonly #stylesContainer: StylesContainer;
|
|
2085
2011
|
|
|
2086
|
-
static async decorateAnchorForAnchorLink(
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
if (identifier) {
|
|
2090
|
-
render(html`${identifier}`, container, {host: container});
|
|
2091
|
-
}
|
|
2092
|
-
|
|
2012
|
+
static async decorateAnchorForAnchorLink(stylesContainer: StylesContainer,
|
|
2013
|
+
{identifier, needsSpace}: {identifier?: string, needsSpace?: boolean}):
|
|
2014
|
+
Promise<LitTemplate> {
|
|
2093
2015
|
const anchorNode = await stylesContainer.node()?.getAnchorBySpecifier(identifier) ?? undefined;
|
|
2094
2016
|
|
|
2095
2017
|
if (!identifier && !anchorNode) {
|
|
2096
|
-
return;
|
|
2018
|
+
return nothing;
|
|
2097
2019
|
}
|
|
2098
2020
|
|
|
2099
2021
|
const onLinkActivate = (): void => {
|
|
@@ -2114,37 +2036,33 @@ export class AnchorFunctionRenderer extends AnchorFunctionRendererBase {
|
|
|
2114
2036
|
};
|
|
2115
2037
|
|
|
2116
2038
|
if (identifier) {
|
|
2117
|
-
render(
|
|
2118
|
-
// clang-format off
|
|
2119
|
-
html`<devtools-link-swatch
|
|
2120
|
-
@mouseenter=${onMouseEnter}
|
|
2121
|
-
@mouseleave=${onMouseLeave}
|
|
2122
|
-
.data=${{
|
|
2123
|
-
text: identifier,
|
|
2124
|
-
tooltip: anchorNode ? undefined :
|
|
2125
|
-
{title: i18nString(UIStrings.sIsNotDefined, {PH1: identifier})},
|
|
2126
|
-
isDefined: Boolean(anchorNode),
|
|
2127
|
-
jslogContext: 'anchor-link',
|
|
2128
|
-
onLinkActivate,
|
|
2129
|
-
} as InlineEditor.LinkSwatch.LinkSwatchRenderData}
|
|
2130
|
-
></devtools-link-swatch>${needsSpace ? ' ' : ''}`,
|
|
2131
|
-
// clang-format on
|
|
2132
|
-
container, {host: container});
|
|
2133
|
-
} else {
|
|
2134
2039
|
// clang-format off
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2040
|
+
return html`<devtools-link-swatch
|
|
2041
|
+
@mouseenter=${onMouseEnter}
|
|
2042
|
+
@mouseleave=${onMouseLeave}
|
|
2043
|
+
.data=${{
|
|
2044
|
+
text: identifier,
|
|
2045
|
+
tooltip: anchorNode ? undefined : {title: i18nString(UIStrings.sIsNotDefined, {PH1: identifier})},
|
|
2046
|
+
isDefined: Boolean(anchorNode),
|
|
2047
|
+
jslogContext: 'anchor-link',
|
|
2048
|
+
onLinkActivate,
|
|
2049
|
+
} as InlineEditor.LinkSwatch.LinkSwatchRenderData}
|
|
2050
|
+
></devtools-link-swatch>${needsSpace ? ' ' : nothing}`;
|
|
2146
2051
|
// clang-format on
|
|
2147
2052
|
}
|
|
2053
|
+
// clang-format off
|
|
2054
|
+
return html`<devtools-icon
|
|
2055
|
+
role='button'
|
|
2056
|
+
title=${i18nString(UIStrings.jumpToAnchorNode)}
|
|
2057
|
+
class='icon-link'
|
|
2058
|
+
name='open-externally'
|
|
2059
|
+
jslog=${VisualLogging.action('jump-to-anchor-node').track({click: true})}
|
|
2060
|
+
@mouseenter=${onMouseEnter}
|
|
2061
|
+
@mouseleave=${onMouseLeave}
|
|
2062
|
+
@mousedown=${(ev: MouseEvent) => ev.stopPropagation()}
|
|
2063
|
+
@click=${handleIconClick}
|
|
2064
|
+
></devtools-icon>${needsSpace ? ' ' : nothing}`;
|
|
2065
|
+
// clang-format on
|
|
2148
2066
|
}
|
|
2149
2067
|
|
|
2150
2068
|
constructor(stylesContainer: StylesContainer) {
|
|
@@ -2152,25 +2070,22 @@ export class AnchorFunctionRenderer extends AnchorFunctionRendererBase {
|
|
|
2152
2070
|
this.#stylesContainer = stylesContainer;
|
|
2153
2071
|
}
|
|
2154
2072
|
|
|
2155
|
-
override render(match: SDK.CSSPropertyParserMatchers.AnchorFunctionMatch, context: RenderingContext):
|
|
2156
|
-
const content = document.createElement('span');
|
|
2073
|
+
override render(match: SDK.CSSPropertyParserMatchers.AnchorFunctionMatch, context: RenderingContext): LitTemplate {
|
|
2157
2074
|
if (match.node.name === 'VariableName') {
|
|
2158
2075
|
// Link an anchor double-dashed ident to its matching anchor element.
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
}
|
|
2173
|
-
return [content];
|
|
2076
|
+
return html`<span>${
|
|
2077
|
+
until(AnchorFunctionRenderer.decorateAnchorForAnchorLink(this.#stylesContainer, {identifier: match.text}),
|
|
2078
|
+
match.text)}</span>`;
|
|
2079
|
+
}
|
|
2080
|
+
// The matcher passes a 'CallExpression' node with a functionName
|
|
2081
|
+
// ('anchor' or 'anchor-size') if the arguments need to have an implicit
|
|
2082
|
+
// anchor link swatch rendered.
|
|
2083
|
+
const args = ASTUtils.children(match.node.getChild('ArgList'));
|
|
2084
|
+
const remainingArgs = args.splice(1);
|
|
2085
|
+
return html`<span>${match.functionName}(${
|
|
2086
|
+
until(AnchorFunctionRenderer.decorateAnchorForAnchorLink(
|
|
2087
|
+
this.#stylesContainer,
|
|
2088
|
+
{needsSpace: remainingArgs.length > 1}))}${Renderer.render(remainingArgs, context).nodes}</span>`;
|
|
2174
2089
|
}
|
|
2175
2090
|
}
|
|
2176
2091
|
|
|
@@ -2186,10 +2101,10 @@ export class PositionAnchorRenderer extends PositionAnchorRendererBase {
|
|
|
2186
2101
|
this.#stylesContainer = stylesContainer;
|
|
2187
2102
|
}
|
|
2188
2103
|
|
|
2189
|
-
override render(match: SDK.CSSPropertyParserMatchers.PositionAnchorMatch):
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2104
|
+
override render(match: SDK.CSSPropertyParserMatchers.PositionAnchorMatch): LitTemplate {
|
|
2105
|
+
return html`<span>${
|
|
2106
|
+
until(AnchorFunctionRenderer.decorateAnchorForAnchorLink(this.#stylesContainer, {identifier: match.text}),
|
|
2107
|
+
match.text)}</span>`;
|
|
2193
2108
|
}
|
|
2194
2109
|
}
|
|
2195
2110
|
|
|
@@ -2260,7 +2175,6 @@ export class PositionAreaRenderer extends PositionAreaRendererBase {
|
|
|
2260
2175
|
button?.dispatchEvent(new ValueEditEvent(value));
|
|
2261
2176
|
context.recordEdit(match, value);
|
|
2262
2177
|
};
|
|
2263
|
-
|
|
2264
2178
|
const treeElement = this.#treeElement;
|
|
2265
2179
|
const popoverHelper = this.#stylesContainer.swatchPopoverHelper();
|
|
2266
2180
|
const isActive =
|
|
@@ -2425,7 +2339,7 @@ export class PositionTryRenderer extends PositionTryRendererBase {
|
|
|
2425
2339
|
}
|
|
2426
2340
|
|
|
2427
2341
|
override render(match: SDK.CSSPropertyParserMatchers.PositionTryMatch, context: RenderingContext): Lit.LitTemplate {
|
|
2428
|
-
const content:
|
|
2342
|
+
const content: Lit.LitTemplate[] = [];
|
|
2429
2343
|
if (match.preamble.length > 0) {
|
|
2430
2344
|
const {nodes} = Renderer.render(match.preamble, context);
|
|
2431
2345
|
content.push(nodes);
|
|
@@ -2434,23 +2348,18 @@ export class PositionTryRenderer extends PositionTryRendererBase {
|
|
|
2434
2348
|
this.#matchedStyles.node();
|
|
2435
2349
|
const fallbackLabels: string[] = [];
|
|
2436
2350
|
for (const [i, fallback] of match.fallbacks.entries()) {
|
|
2437
|
-
const
|
|
2438
|
-
const
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
}
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2351
|
+
const important = fallback.find(node => node.name === 'Important');
|
|
2352
|
+
const classes = classMap({
|
|
2353
|
+
'inactive-value': !this.#treeElement?.inherited() && node === this.#matchedStyles.node() &&
|
|
2354
|
+
i !== this.#matchedStyles.activePositionFallbackIndex(),
|
|
2355
|
+
});
|
|
2356
|
+
content.push(html`<span class=${classes}>${i > 0 ? ', ' : nothing}${
|
|
2357
|
+
Renderer.render(fallback.filter(node => node.name !== 'Important'), context).nodes}</span>`);
|
|
2358
|
+
if (important) {
|
|
2359
|
+
content.push(html` ${Renderer.render(important, context).nodes}`);
|
|
2445
2360
|
}
|
|
2446
|
-
Renderer.renderInto(fallback.filter(node => node.name !== 'Important'), context, fallbackContent);
|
|
2447
2361
|
fallbackLabels.push(
|
|
2448
2362
|
context.matchedResult.getComputedTextRange(fallback[0], fallback[fallback.length - 1]).trim());
|
|
2449
|
-
|
|
2450
|
-
content.push(fallbackContent);
|
|
2451
|
-
if (isImportant) {
|
|
2452
|
-
content.push(document.createTextNode(' '), Renderer.render(isImportant, context).nodes);
|
|
2453
|
-
}
|
|
2454
2363
|
}
|
|
2455
2364
|
if (!this.#treeElement || this.#treeElement.overloaded() || this.#treeElement.inherited() ||
|
|
2456
2365
|
!this.#treeElement.property.activeInStyle() || !node) {
|
|
@@ -3009,6 +2918,12 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3009
2918
|
this.getComputedStyles() ?? new Map(), this.getComputedStyleExtraFields()) :
|
|
3010
2919
|
[];
|
|
3011
2920
|
|
|
2921
|
+
const existingDocWidget =
|
|
2922
|
+
this.listItemElement.querySelector('devtools-tooltip[jslogcontext="elements.css-property-doc"]')
|
|
2923
|
+
?.firstElementChild;
|
|
2924
|
+
if (existingDocWidget) {
|
|
2925
|
+
UI.Widget.Widget.get(existingDocWidget)?.detach(/* overrideHideOnDetach= */ true);
|
|
2926
|
+
}
|
|
3012
2927
|
this.listItemElement.removeChildren();
|
|
3013
2928
|
const matchedResult = this.property.parseValue(this.matchedStyles(), this.computedStyles);
|
|
3014
2929
|
this.#edits = matchedResult ? new ValueUpdateTracking(matchedResult.ast) : undefined;
|
|
@@ -3029,14 +2944,15 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3029
2944
|
|
|
3030
2945
|
if (this.property.name.startsWith('--') &&
|
|
3031
2946
|
!(this.property.ownerStyle.parentRule instanceof SDK.CSSRule.CSSFunctionRule)) {
|
|
3032
|
-
const contents =
|
|
3033
|
-
|
|
3034
|
-
|
|
2947
|
+
const contents = new ElementsComponents.CSSVariableValueView.CSSVariableValueView();
|
|
2948
|
+
contents.variableName = this.property.name;
|
|
2949
|
+
contents.value = this.#matchedStyles.computeCSSVariable(this.style, this.property.name)?.value;
|
|
2950
|
+
contents.details = this.#stylesContainer.getRegisteredPropertyDetails(this.matchedStyles(), this.property.name);
|
|
3035
2951
|
const tooltipId = this.getTooltipId('custom-property-decl');
|
|
3036
2952
|
this.nameElement.setAttribute('aria-details', tooltipId);
|
|
3037
2953
|
const tooltip = new Tooltips.Tooltip.Tooltip(
|
|
3038
2954
|
{anchor: this.nameElement, variant: 'rich', id: tooltipId, jslogContext: 'elements.css-var'});
|
|
3039
|
-
|
|
2955
|
+
contents.show(tooltip, undefined, /* suppressOrphanWidgetError= */ true);
|
|
3040
2956
|
tooltip.onbeforetoggle = (e: Event) => {
|
|
3041
2957
|
if ((e as ToggleEvent).newState === 'open') {
|
|
3042
2958
|
contents.value = this.#matchedStyles.computeCSSVariable(this.style, this.property.name)?.value;
|
|
@@ -3071,8 +2987,12 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3071
2987
|
event.consume(true);
|
|
3072
2988
|
return;
|
|
3073
2989
|
}
|
|
3074
|
-
tooltip.
|
|
3075
|
-
|
|
2990
|
+
if (tooltip.firstElementChild) {
|
|
2991
|
+
return;
|
|
2992
|
+
}
|
|
2993
|
+
const docsView = new ElementsComponents.CSSPropertyDocsView.CSSPropertyDocsView(cssProperty);
|
|
2994
|
+
docsView.markAsExternallyManaged();
|
|
2995
|
+
docsView.show(tooltip, undefined, /* suppressOrphanWidgetError= */ true);
|
|
3076
2996
|
};
|
|
3077
2997
|
this.listItemElement.appendChild(tooltip);
|
|
3078
2998
|
}
|
|
@@ -3157,7 +3077,9 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3157
3077
|
}
|
|
3158
3078
|
}
|
|
3159
3079
|
|
|
3160
|
-
createExclamationMark(property: SDK.CSSProperty.CSSProperty,
|
|
3080
|
+
createExclamationMark(property: SDK.CSSProperty.CSSProperty,
|
|
3081
|
+
title: ElementsComponents.CSSVariableValueView.CSSVariableParserError|HTMLElement|
|
|
3082
|
+
null): Element {
|
|
3161
3083
|
const container = document.createElement('span');
|
|
3162
3084
|
const exclamationElement = container.createChild('span');
|
|
3163
3085
|
exclamationElement.tabIndex = -1;
|
|
@@ -3176,7 +3098,11 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3176
3098
|
id: tooltipId,
|
|
3177
3099
|
jslogContext: 'elements.invalid-property-decl-popover',
|
|
3178
3100
|
});
|
|
3179
|
-
|
|
3101
|
+
if (title instanceof UI.Widget.Widget) {
|
|
3102
|
+
title.show(tooltip, undefined, /* suppressOrphanWidgetError= */ true);
|
|
3103
|
+
} else {
|
|
3104
|
+
tooltip.appendChild(title);
|
|
3105
|
+
}
|
|
3180
3106
|
container.appendChild(tooltip);
|
|
3181
3107
|
}
|
|
3182
3108
|
const invalidString =
|
|
@@ -3321,7 +3247,9 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3321
3247
|
hintIcon.setAttribute('aria-details', tooltipId);
|
|
3322
3248
|
const tooltip = new Tooltips.Tooltip.Tooltip(
|
|
3323
3249
|
{anchor: hintIcon, variant: 'rich', padding: 'large', id: tooltipId, jslogContext: 'elements.css-hint'});
|
|
3324
|
-
|
|
3250
|
+
const hintDetailsView = new ElementsComponents.CSSHintDetailsView.CSSHintDetailsView(hint);
|
|
3251
|
+
hintDetailsView.markAsRoot();
|
|
3252
|
+
hintDetailsView.show(tooltip);
|
|
3325
3253
|
this.listItemElement.appendChild(tooltip);
|
|
3326
3254
|
break;
|
|
3327
3255
|
}
|