chrome-devtools-frontend 1.0.1664496 → 1.0.1665921
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/skills/devtools-testing-guidance/SKILL.md +48 -0
- package/.agents/skills/devtools-ux-writing-refactor/SKILL.md +3 -3
- package/.agents/skills/repro-flaky-tests/SKILL.md +2 -2
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +7 -1
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +2 -0
- package/.agents/skills/version-control/SKILL.md +4 -3
- package/docs/ui_engineering.md +89 -0
- package/eslint.config.mjs +9 -2
- package/front_end/Images/rollup.config.mjs +1 -1
- package/front_end/Tests.js +15 -16
- package/front_end/core/common/Gzip.ts +2 -2
- package/front_end/core/common/Settings.ts +4 -20
- package/front_end/core/common/Srcset.ts +1 -1
- package/front_end/core/common/VersionController.ts +1 -1
- package/front_end/core/host/AidaClient.ts +19 -4
- package/front_end/core/host/AidaGcaTranslation.ts +2 -2
- package/front_end/core/host/GcaClient.ts +2 -2
- package/front_end/core/host/GdpClient.ts +3 -3
- package/front_end/core/host/InspectorFrontendHostStub.ts +1 -1
- package/front_end/core/host/ResourceLoader.ts +15 -15
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +2 -2
- package/front_end/core/protocol_client/InspectorBackend.ts +1 -1
- package/front_end/core/root/Runtime.ts +0 -1
- package/front_end/core/sdk/CSSMatchedStyles.ts +78 -3
- package/front_end/core/sdk/CSSMetadata.ts +17 -12
- package/front_end/core/sdk/CSSProperty.ts +1 -1
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +2 -2
- package/front_end/core/sdk/CSSRule.ts +3 -3
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +3 -3
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +1 -1
- package/front_end/core/sdk/Connections.ts +1 -1
- package/front_end/core/sdk/DebuggerModel.ts +13 -13
- package/front_end/core/sdk/NetworkManager.ts +19 -19
- package/front_end/core/sdk/NetworkRequest.ts +57 -57
- package/front_end/core/sdk/OverlayModel.ts +1 -1
- package/front_end/core/sdk/PageResourceLoader.ts +2 -2
- package/front_end/core/sdk/RehydratingConnection.ts +5 -5
- package/front_end/core/sdk/ScreenCaptureModel.ts +1 -1
- package/front_end/core/sdk/Script.ts +2 -2
- package/front_end/core/sdk/ServerTiming.ts +7 -7
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +1 -1
- package/front_end/core/sdk/ServiceWorkerManager.ts +11 -11
- package/front_end/core/sdk/SourceMapScopeChainEntry.ts +2 -2
- package/front_end/core/sdk/SourceMapScopesInfo.ts +1 -1
- package/front_end/core/sdk/StorageKeyManager.ts +1 -1
- package/front_end/core/sdk/sdk-meta.ts +98 -98
- package/front_end/devtools_compatibility.js +15 -13
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +4 -8
- package/front_end/entrypoints/main/MainImpl.ts +2 -3
- package/front_end/entrypoints/main/main-meta.ts +1 -16
- package/front_end/entrypoints/shell/shell.ts +1 -0
- package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
- package/front_end/foundation/README.md +1 -1
- package/front_end/foundation/Universe.test.api.ts +73 -0
- package/front_end/foundation/Universe.ts +22 -0
- package/front_end/generated/InspectorBackendCommands.ts +2 -2
- package/front_end/generated/SupportedCSSProperties.js +1 -1
- package/front_end/generated/protocol.ts +19 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +1 -1
- package/front_end/models/ai_assistance/AiConversation.ts +1 -1
- package/front_end/models/ai_assistance/BuiltInAi.ts +1 -1
- package/front_end/models/ai_assistance/ChangeManager.ts +0 -70
- package/front_end/models/ai_assistance/ExtensionScope.ts +2 -36
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +9 -9
- package/front_end/models/ai_assistance/agents/AiAgent.ts +10 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +4 -4
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +21 -21
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +4 -4
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +0 -5
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +11 -4
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +8 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +14 -11
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +2 -2
- package/front_end/models/ai_assistance/performance/AICallTree.ts +2 -2
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +1 -1
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +9 -2
- package/front_end/models/ai_assistance/tools/GetStyles.ts +4 -4
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +2 -5
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -2
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -2
- package/front_end/models/badges/badges-meta.ts +27 -0
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -3
- package/front_end/models/bindings/ContentProviderBasedProject.ts +1 -1
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +6 -7
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +5 -4
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +72 -29
- package/front_end/models/bindings/ResourceMapping.ts +38 -32
- package/front_end/models/bindings/ResourceScriptMapping.ts +5 -7
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -1
- package/front_end/models/har/Writer.ts +2 -2
- package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +1 -1
- package/front_end/models/issues_manager/GenericIssue.ts +1 -1
- package/front_end/models/issues_manager/IssuesManager.ts +14 -5
- package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +1 -1
- package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +2 -2
- package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +13 -2
- package/front_end/models/issues_manager/issues_manager.ts +0 -2
- package/front_end/models/live-metrics/LiveMetrics.ts +22 -5
- package/front_end/models/live-metrics/web-vitals-injected/rollup.config.mjs +1 -1
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +10 -4
- package/front_end/models/logs/logs-meta.ts +23 -16
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +2 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +1 -1
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +1 -1
- package/front_end/models/source_map_scopes/NamesResolver.ts +104 -86
- package/front_end/models/source_map_scopes/ScopeChainModel.ts +6 -2
- package/front_end/models/stack_trace/StackTraceModel.ts +1 -1
- package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +1 -1
- package/front_end/models/trace/handlers/UserTimingsHandler.ts +17 -6
- package/front_end/models/trace/helpers/SamplesIntegrator.ts +1 -1
- package/front_end/models/trace/helpers/Timing.ts +1 -1
- package/front_end/models/trace/insights/Common.ts +1 -1
- package/front_end/models/trace/insights/DocumentLatency.ts +3 -3
- package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +1 -1
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +2 -2
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +14 -9
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +2 -15
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -2
- package/front_end/panels/ai_assistance/components/ChatInput.ts +23 -19
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +9 -18
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -35
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +1 -1
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +4 -4
- package/front_end/panels/ai_assistance/components/ImageResize.ts +74 -0
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +2 -2
- package/front_end/panels/animation/AnimationGroupPreviewUI.ts +28 -29
- package/front_end/panels/animation/AnimationTimeline.ts +3 -3
- package/front_end/panels/animation/animationTimeline.css +0 -2
- package/front_end/panels/application/AppManifestView.ts +1 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -1
- package/front_end/panels/application/CookieItemsView.ts +1 -1
- package/front_end/panels/application/CrashReportContextView.ts +3 -3
- package/front_end/panels/application/DeviceBoundSessionsModel.ts +1 -1
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +1 -1
- package/front_end/panels/application/DeviceBoundSessionsView.ts +1 -1
- package/front_end/panels/application/IndexedDBViews.ts +1 -1
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -1
- package/front_end/panels/application/OriginTrialTreeView.ts +1 -1
- package/front_end/panels/application/ServiceWorkersView.ts +6 -6
- package/front_end/panels/application/StorageBucketsTreeElement.ts +1 -1
- package/front_end/panels/application/StorageItemsToolbar.ts +3 -3
- package/front_end/panels/application/WebMCPView.ts +7 -5
- package/front_end/panels/application/components/AdsView.ts +21 -6
- package/front_end/panels/application/components/BackForwardCacheView.ts +2 -2
- package/front_end/panels/application/components/ProtocolHandlersView.ts +1 -1
- package/front_end/panels/application/components/StorageMetadataView.ts +1 -1
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +2 -1
- package/front_end/panels/application/preloading/components/PreloadingString.ts +3 -3
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -1
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +1 -1
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +2 -2
- package/front_end/panels/changes/ChangesSidebar.ts +2 -2
- package/front_end/panels/changes/ChangesView.ts +4 -5
- package/front_end/panels/changes/CombinedDiffView.ts +3 -3
- package/front_end/panels/changes/changes-meta.ts +2 -2
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +1 -1
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +3 -3
- package/front_end/panels/common/BadgeNotification.ts +8 -8
- package/front_end/panels/common/DOMLinkifier.ts +1 -1
- package/front_end/panels/common/GdpSignUpDialog.ts +2 -2
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
- package/front_end/panels/common/aiCodeCompletionDisclaimer.css +0 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +1 -1
- package/front_end/panels/console/ConsolePinPane.ts +3 -3
- package/front_end/panels/console/ConsolePrompt.ts +6 -4
- package/front_end/panels/console/ConsoleSidebar.ts +8 -10
- package/front_end/panels/console_counters/WarningErrorCounter.ts +10 -11
- package/front_end/panels/coverage/CoverageView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -3
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +1 -1
- package/front_end/panels/elements/ComputedStyleWidget.ts +3 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +3 -3
- package/front_end/panels/elements/EventListenersWidget.ts +1 -3
- package/front_end/panels/elements/LayoutPane.ts +23 -13
- package/front_end/panels/elements/StandaloneStylesContainer.ts +7 -7
- package/front_end/panels/elements/StylePropertiesSection.ts +33 -5
- package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -5
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +6 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -3
- package/front_end/panels/elements/elements-meta.ts +18 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +100 -40
- package/front_end/panels/emulation/DeviceModeView.ts +5 -4
- package/front_end/panels/emulation/MediaQueryInspector.ts +35 -19
- package/front_end/panels/event_listeners/EventListenersView.ts +4 -4
- package/front_end/panels/explain/components/ConsoleInsight.ts +8 -9
- package/front_end/panels/explain/explain-meta.ts +3 -3
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +135 -167
- package/front_end/panels/layer_viewer/Layers3DView.ts +10 -23
- package/front_end/panels/layer_viewer/layer_viewer-meta.ts +27 -0
- package/front_end/panels/lighthouse/LighthouseController.ts +44 -55
- package/front_end/panels/lighthouse/LighthousePanel.ts +9 -9
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +2 -2
- package/front_end/panels/lighthouse/LighthouseStartView.ts +9 -12
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +33 -33
- package/front_end/panels/lighthouse/RadioSetting.ts +1 -1
- package/front_end/panels/lighthouse/lighthouse-meta.ts +131 -1
- package/front_end/panels/media/EventDisplayTable.ts +67 -94
- package/front_end/panels/media/PlayerListView.ts +1 -1
- package/front_end/panels/media/eventDisplayTable.css +9 -4
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +5 -5
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
- package/front_end/panels/network/EventSourceMessagesView.ts +98 -107
- package/front_end/panels/network/NetworkLogViewColumns.ts +1 -1
- package/front_end/panels/network/NetworkWaterfallColumn.ts +1 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
- package/front_end/panels/network/RequestCookiesView.ts +2 -2
- package/front_end/panels/network/RequestHeadersView.ts +5 -5
- package/front_end/panels/network/RequestPayloadView.ts +4 -4
- package/front_end/panels/network/RequestTimingView.ts +2 -2
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +1 -1
- package/front_end/panels/network/eventSourceMessagesView.css +12 -3
- package/front_end/panels/network/networkTimingTable.css +2 -2
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
- package/front_end/panels/profiler/BottomUpProfileDataGrid.ts +25 -29
- package/front_end/panels/profiler/HeapProfileView.ts +308 -247
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +13 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +30 -10
- package/front_end/panels/profiler/HeapTimelineOverview.ts +5 -2
- package/front_end/panels/profiler/ProfileDataGrid.ts +128 -157
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +17 -5
- package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
- package/front_end/panels/profiler/TopDownProfileDataGrid.ts +17 -21
- package/front_end/panels/profiler/profilesPanel.css +9 -13
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
- package/front_end/panels/recorder/CreateRecordingView.ts +4 -4
- package/front_end/panels/recorder/RecorderPanel.ts +6 -6
- package/front_end/panels/recorder/RecordingView.ts +1 -1
- package/front_end/panels/recorder/ReplaySection.ts +1 -1
- package/front_end/panels/recorder/StepView.ts +1 -1
- package/front_end/panels/recorder/injected/rollup.config.mjs +1 -1
- package/front_end/panels/search/SearchView.ts +1 -1
- package/front_end/panels/security/SecurityPanel.ts +54 -41
- package/front_end/panels/sensors/LocationsSettingsTab.ts +246 -233
- package/front_end/panels/sensors/SensorsView.ts +1 -1
- package/front_end/panels/settings/AISettingsTab.ts +11 -10
- package/front_end/panels/settings/SettingsScreen.ts +29 -24
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +5 -5
- package/front_end/panels/sources/BreakpointEditDialog.ts +2 -2
- package/front_end/panels/sources/BreakpointsView.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +2 -2
- package/front_end/panels/sources/DebuggerPausedMessage.ts +2 -2
- package/front_end/panels/sources/DebuggerPlugin.ts +25 -22
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -1
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +7 -5
- package/front_end/panels/sources/sources-meta.ts +1 -1
- package/front_end/panels/timeline/CountersGraph.ts +1 -2
- package/front_end/panels/timeline/ExtensionTrackAppender.ts +1 -1
- package/front_end/panels/timeline/TimelineDetailsView.ts +2 -2
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +2 -2
- package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -4
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +1 -1
- package/front_end/panels/timeline/TimelinePanel.ts +53 -81
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +10 -3
- package/front_end/panels/timeline/TimelineUIUtils.ts +18 -4
- package/front_end/panels/timeline/TrackConfigBanner.ts +1 -1
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +1 -1
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +8 -9
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +1 -1
- package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +1 -1
- package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +2 -2
- package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +1 -1
- package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +1 -1
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +5 -0
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +13 -8
- package/front_end/panels/timeline/overlays/components/timespanBreakdownOverlay.css +1 -0
- package/front_end/panels/timeline/timeline-meta.ts +169 -0
- package/front_end/panels/timeline/timelineFlameChartView.css +5 -0
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
- package/front_end/panels/whats_new/ReleaseNoteText.ts +9 -9
- package/front_end/panels/whats_new/resources/WNDT.md +7 -8
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/web-vitals/README.chromium +2 -2
- package/front_end/third_party/web-vitals/package/README.md +120 -19
- package/front_end/third_party/web-vitals/package/attribution.d.ts +16 -0
- package/front_end/third_party/web-vitals/package/attribution.js +18 -0
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.d.ts +1 -7
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +53 -32
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +43 -12
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +21 -3
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +30 -24
- package/front_end/third_party/web-vitals/package/dist/modules/lib/FCPEntryManager.d.ts +3 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/FCPEntryManager.js +18 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +2 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +18 -2
- package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.d.ts +1 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.js +1 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.js +7 -7
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +4 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +7 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js +20 -11
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.js +8 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.d.ts +3 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +19 -4
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.d.ts +3 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.js +38 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/whenIdleOrHidden.js +5 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onCLS.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +30 -11
- package/front_end/third_party/web-vitals/package/dist/modules/onFCP.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onFCP.js +36 -4
- package/front_end/third_party/web-vitals/package/dist/modules/onINP.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onINP.js +42 -22
- package/front_end/third_party/web-vitals/package/dist/modules/onLCP.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onLCP.js +109 -30
- package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.js +25 -7
- package/front_end/third_party/web-vitals/package/dist/modules/types/base.d.ts +24 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/fcp.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +14 -6
- package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/ttfb.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +26 -4
- package/front_end/third_party/web-vitals/package/package.json +21 -22
- package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +62 -39
- package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +52 -15
- package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +25 -7
- package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +43 -37
- package/front_end/third_party/web-vitals/package/src/lib/{polyfills/getFirstHiddenTimePolyfill.ts → FCPEntryManager.ts} +4 -14
- package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +22 -2
- package/front_end/third_party/web-vitals/package/src/lib/LCPEntryManager.ts +1 -0
- package/front_end/third_party/web-vitals/package/src/lib/bindReporter.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/generateUniqueID.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/getLoadState.ts +11 -12
- package/front_end/third_party/web-vitals/package/src/lib/getSelector.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +4 -1
- package/front_end/third_party/web-vitals/package/src/lib/initMetric.ts +24 -11
- package/front_end/third_party/web-vitals/package/src/lib/initUnique.ts +12 -4
- package/front_end/third_party/web-vitals/package/src/lib/observe.ts +26 -5
- package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/softNavs.ts +48 -0
- package/front_end/third_party/web-vitals/package/src/lib/whenIdleOrHidden.ts +12 -4
- package/front_end/third_party/web-vitals/package/src/onCLS.ts +75 -18
- package/front_end/third_party/web-vitals/package/src/onFCP.ts +66 -7
- package/front_end/third_party/web-vitals/package/src/onINP.ts +100 -39
- package/front_end/third_party/web-vitals/package/src/onLCP.ts +169 -34
- package/front_end/third_party/web-vitals/package/src/onTTFB.ts +50 -13
- package/front_end/third_party/web-vitals/package/src/types/base.ts +31 -10
- package/front_end/third_party/web-vitals/package/src/types/fcp.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/types/inp.ts +14 -6
- package/front_end/third_party/web-vitals/package/src/types/lcp.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/types/ttfb.ts +2 -2
- package/front_end/third_party/web-vitals/package/src/types.ts +32 -9
- package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +11 -11
- package/front_end/third_party/web-vitals/rebuild.sh +2 -2
- package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +2 -0
- package/front_end/ui/components/buttons/Button.ts +16 -0
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightManager.ts +6 -1
- package/front_end/ui/components/highlighting/highlighting.ts +1 -1
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +2 -2
- package/front_end/ui/components/settings/SettingCheckbox.ts +12 -7
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +2 -2
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +6 -6
- package/front_end/ui/components/text_editor/javascript.ts +3 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
- package/front_end/ui/legacy/ContextMenu.ts +12 -2
- package/front_end/ui/legacy/ListControl.ts +1 -1
- package/front_end/ui/legacy/SelectMenu.docs.ts +17 -19
- package/front_end/ui/legacy/Toolbar.ts +4 -1
- package/front_end/ui/legacy/Treeoutline.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/spectrum.css +1 -2
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +50 -4
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +3 -1
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +4 -4
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +8 -7
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +14 -11
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +1 -1
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +15 -5
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +4 -4
- package/front_end/ui/legacy/components/utils/Linkifier.ts +5 -1
- package/front_end/ui/lit/render.ts +1 -1
- package/front_end/ui/settings/SettingUIRegistration.ts +8 -3
- package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
- package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
- package/inspector_overlay/main.ts +1 -1
- package/mcp/mcp.ts +5 -4
- package/package.json +13 -13
- package/front_end/models/ai_assistance/AgentProject.ts +0 -261
- package/front_end/models/ai_assistance/agents/PatchAgent.ts +0 -306
- package/front_end/models/issues_manager/CheckFormsIssuesTrigger.ts +0 -45
- package/front_end/models/text_utils/text_utils.ts +0 -5
- package/front_end/panels/ai_assistance/PatchWidget.ts +0 -867
- package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +0 -368
- package/front_end/panels/ai_assistance/selectWorkspaceDialog.css +0 -92
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
RenderingContext,
|
|
42
42
|
StringRenderer,
|
|
43
43
|
type TracingContext,
|
|
44
|
-
URLRenderer
|
|
44
|
+
URLRenderer,
|
|
45
45
|
} from './PropertyRenderer.js';
|
|
46
46
|
import {StyleEditorWidget} from './StyleEditorWidget.js';
|
|
47
47
|
import type {ActiveAiSuggestionProperty, StylePropertiesSection} from './StylePropertiesSection.js';
|
|
@@ -1748,7 +1748,7 @@ export class LengthRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.L
|
|
|
1748
1748
|
const evaluation = context.tracing?.applyEvaluation([], () => {
|
|
1749
1749
|
return {
|
|
1750
1750
|
placeholder: [valueElement],
|
|
1751
|
-
asyncEvalCallback: () => this.#applyEvaluation(valueElement, match, context)
|
|
1751
|
+
asyncEvalCallback: () => this.#applyEvaluation(valueElement, match, context),
|
|
1752
1752
|
};
|
|
1753
1753
|
});
|
|
1754
1754
|
|
|
@@ -2711,7 +2711,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2711
2711
|
anchor: exclamationElement,
|
|
2712
2712
|
variant: 'simple',
|
|
2713
2713
|
id: tooltipId,
|
|
2714
|
-
jslogContext: 'elements.invalid-property-decl-popover'
|
|
2714
|
+
jslogContext: 'elements.invalid-property-decl-popover',
|
|
2715
2715
|
});
|
|
2716
2716
|
tooltip.appendChild(title);
|
|
2717
2717
|
container.appendChild(tooltip);
|
|
@@ -2894,7 +2894,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2894
2894
|
variant: 'rich',
|
|
2895
2895
|
padding: 'large',
|
|
2896
2896
|
id: tooltipId,
|
|
2897
|
-
jslogContext: 'elements.css-animation-hint'
|
|
2897
|
+
jslogContext: 'elements.css-animation-hint',
|
|
2898
2898
|
});
|
|
2899
2899
|
const message = i18nString(UIStrings.overriddenByAnimation);
|
|
2900
2900
|
const content = document.createElement('div');
|
|
@@ -3417,7 +3417,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3417
3417
|
hasChildren: this.isExpandable(),
|
|
3418
3418
|
isEditingName,
|
|
3419
3419
|
originalProperty: this.property,
|
|
3420
|
-
previousContent: isEditingName ? this.name : this.value
|
|
3420
|
+
previousContent: isEditingName ? this.name : this.value,
|
|
3421
3421
|
};
|
|
3422
3422
|
|
|
3423
3423
|
this.removePrompt();
|
|
@@ -60,12 +60,12 @@ export class StylesAiCodeCompletionProvider {
|
|
|
60
60
|
if (this.#aiCodeCompletionConfig.completionContext.stopSequences) {
|
|
61
61
|
stopSequences.push(...this.#aiCodeCompletionConfig.completionContext.stopSequences);
|
|
62
62
|
}
|
|
63
|
-
this.#aiCodeCompletion = new AiCodeCompletion.AiCodeCompletion.AiCodeCompletion(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
this.#aiCodeCompletion = new AiCodeCompletion.AiCodeCompletion.AiCodeCompletion({
|
|
64
|
+
aidaClient: this.#aidaClient,
|
|
65
|
+
serverSideLoggingEnabled: !Root.Runtime.hostConfig.aidaAvailability?.disallowLogging,
|
|
66
|
+
},
|
|
67
|
+
this.#aiCodeCompletionConfig.panel,
|
|
68
|
+
undefined, stopSequences);
|
|
69
69
|
this.#aiCodeCompletionConfig.onFeatureEnabled();
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -600,8 +600,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
|
600
600
|
const parentNodeId = this.matchedStyles?.getParentLayoutNodeId();
|
|
601
601
|
|
|
602
602
|
const [computedStyles, parentsComputedStyles, computedStyleExtraFields] = await Promise.all([
|
|
603
|
-
this.fetchComputedStylesFor(nodeId),
|
|
604
|
-
this.
|
|
603
|
+
this.fetchComputedStylesFor(nodeId),
|
|
604
|
+
this.fetchComputedStylesFor(parentNodeId),
|
|
605
|
+
this.fetchComputedStyleExtraFieldsFor(nodeId),
|
|
605
606
|
]);
|
|
606
607
|
|
|
607
608
|
signal?.throwIfAborted();
|
|
@@ -2402,7 +2403,7 @@ export class CSSPropertyPrompt extends UI.TextPrompt.TextPrompt {
|
|
|
2402
2403
|
});
|
|
2403
2404
|
}
|
|
2404
2405
|
}
|
|
2405
|
-
}
|
|
2406
|
+
},
|
|
2406
2407
|
});
|
|
2407
2408
|
return properties;
|
|
2408
2409
|
}
|
|
@@ -160,6 +160,10 @@ const UIStrings = {
|
|
|
160
160
|
* @description Whether CSS rules that do not apply active styles in the Styles pane are collapsed by default.
|
|
161
161
|
*/
|
|
162
162
|
collapseNonContributingCSSRules: 'Collapse non-contributing CSS rules',
|
|
163
|
+
/**
|
|
164
|
+
* @description Title of a setting in the Event Listeners widget.
|
|
165
|
+
*/
|
|
166
|
+
frameworkListeners: 'Framework listeners',
|
|
163
167
|
} as const;
|
|
164
168
|
const str_ = i18n.i18n.registerUIStrings('panels/elements/elements-meta.ts', UIStrings);
|
|
165
169
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
@@ -623,8 +627,11 @@ UI.ViewManager.registerLocationResolver({
|
|
|
623
627
|
Common.Revealer.registerRevealer({
|
|
624
628
|
contextTypes() {
|
|
625
629
|
return [
|
|
626
|
-
SDK.DOMModel.DOMNode,
|
|
627
|
-
|
|
630
|
+
SDK.DOMModel.DOMNode,
|
|
631
|
+
SDK.DOMModel.DeferredDOMNode,
|
|
632
|
+
SDK.RemoteObject.RemoteObject,
|
|
633
|
+
SDK.DOMModel.AdoptedStyleSheet,
|
|
634
|
+
Elements.ElementsPanel.NodeComputedStyles,
|
|
628
635
|
];
|
|
629
636
|
},
|
|
630
637
|
destination: Common.Revealer.RevealerDestination.ELEMENTS_PANEL,
|
|
@@ -698,3 +705,12 @@ UI.UIUtils.registerRenderer({
|
|
|
698
705
|
return Elements.ElementsTreeOutlineRenderer.Renderer.instance();
|
|
699
706
|
},
|
|
700
707
|
});
|
|
708
|
+
|
|
709
|
+
Common.Settings.registerSettingExtension({
|
|
710
|
+
category: Common.Settings.SettingCategory.NONE,
|
|
711
|
+
storageType: Common.Settings.SettingStorageType.GLOBAL,
|
|
712
|
+
title: i18nLazyString(UIStrings.frameworkListeners),
|
|
713
|
+
settingName: 'show-frameowkr-listeners',
|
|
714
|
+
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
715
|
+
defaultValue: true,
|
|
716
|
+
});
|
|
@@ -371,7 +371,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
371
371
|
jslog=${VisualLogging.dropDown().track({change: true}).context('device-pixel-ratio')}
|
|
372
372
|
?disabled=${!input.isResponsive}>
|
|
373
373
|
${input.dprOptions.map(o => html`<option value=${o.value} ?selected=${o.selected} jslog=${VisualLogging.item(o.jslogContext).track({click: true})}>${o.title}</option>`)}
|
|
374
|
-
</select
|
|
374
|
+
</select>`,
|
|
375
375
|
})}
|
|
376
376
|
</div>` : ''}
|
|
377
377
|
|
|
@@ -435,16 +435,15 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
435
435
|
`, target, {container: {
|
|
436
436
|
classes: ['device-mode-toolbar'],
|
|
437
437
|
attributes: {jslog: `${VisualLogging.toolbar('device-mode').track({resize: true})}`,
|
|
438
|
-
}
|
|
438
|
+
},
|
|
439
439
|
}});
|
|
440
440
|
// clang-format on
|
|
441
441
|
};
|
|
442
442
|
|
|
443
443
|
export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
444
|
-
|
|
444
|
+
#model?: EmulationModel.DeviceModeModel.DeviceModeModel;
|
|
445
445
|
private readonly showMediaInspectorSetting: Common.Settings.Setting<boolean>;
|
|
446
446
|
private readonly showRulersSetting: Common.Settings.Setting<boolean>;
|
|
447
|
-
private readonly deviceOutlineSetting: Common.Settings.Setting<boolean>;
|
|
448
447
|
private readonly showDeviceScaleFactorSetting: Common.Settings.Setting<boolean>;
|
|
449
448
|
private readonly showUserAgentTypeSetting: Common.Settings.Setting<boolean>;
|
|
450
449
|
private autoAdjustScaleSetting: Common.Settings.Setting<boolean>;
|
|
@@ -453,17 +452,15 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
453
452
|
private readonly persistenceSetting: Common.Settings.Setting<{device: string, orientation: string, mode: string}>;
|
|
454
453
|
private readonly view: View;
|
|
455
454
|
|
|
456
|
-
constructor(
|
|
457
|
-
|
|
458
|
-
showMediaInspectorSetting: Common.Settings.Setting<boolean>, showRulersSetting: Common.Settings.Setting<boolean>,
|
|
459
|
-
view: View = DEFAULT_VIEW) {
|
|
460
|
-
super();
|
|
455
|
+
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
456
|
+
super(element);
|
|
461
457
|
this.view = view;
|
|
462
|
-
this.model = model;
|
|
463
|
-
this.showMediaInspectorSetting = showMediaInspectorSetting;
|
|
464
|
-
this.showRulersSetting = showRulersSetting;
|
|
465
458
|
|
|
466
|
-
this.
|
|
459
|
+
this.showMediaInspectorSetting = Common.Settings.Settings.instance().moduleSetting('show-media-query-inspector');
|
|
460
|
+
this.showMediaInspectorSetting.addChangeListener(this.requestUpdate, this);
|
|
461
|
+
this.showRulersSetting = Common.Settings.Settings.instance().moduleSetting('emulation.show-rulers');
|
|
462
|
+
this.showRulersSetting.addChangeListener(this.requestUpdate, this);
|
|
463
|
+
|
|
467
464
|
this.showDeviceScaleFactorSetting =
|
|
468
465
|
Common.Settings.Settings.instance().createSetting('emulation.show-device-scale-factor', false);
|
|
469
466
|
this.showDeviceScaleFactorSetting.addChangeListener(this.requestUpdate, this);
|
|
@@ -486,17 +483,42 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
486
483
|
|
|
487
484
|
this.persistenceSetting = Common.Settings.Settings.instance().createSetting(
|
|
488
485
|
'emulation.device-mode-value', {device: '', orientation: '', mode: ''});
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
get model(): EmulationModel.DeviceModeModel.DeviceModeModel|undefined {
|
|
489
|
+
return this.#model;
|
|
490
|
+
}
|
|
489
491
|
|
|
490
|
-
|
|
491
|
-
this
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
this
|
|
492
|
+
set model(model: EmulationModel.DeviceModeModel.DeviceModeModel) {
|
|
493
|
+
if (this.#model === model) {
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
if (this.#model) {
|
|
497
|
+
this.#model.toolbarControlsEnabledSetting().removeChangeListener(this.requestUpdate, this);
|
|
498
|
+
this.#model.scaleSetting().removeChangeListener(this.requestUpdate, this);
|
|
499
|
+
this.#model.uaSetting().removeChangeListener(this.requestUpdate, this);
|
|
500
|
+
this.#model.deviceScaleFactorSetting().removeChangeListener(this.requestUpdate, this);
|
|
501
|
+
this.#model.removeEventListener(EmulationModel.DeviceModeModel.Events.UPDATED, this.requestUpdate, this);
|
|
502
|
+
}
|
|
503
|
+
this.#model = model;
|
|
504
|
+
this.#model.toolbarControlsEnabledSetting().addChangeListener(this.requestUpdate, this);
|
|
505
|
+
this.#model.scaleSetting().addChangeListener(this.requestUpdate, this);
|
|
506
|
+
this.#model.uaSetting().addChangeListener(this.requestUpdate, this);
|
|
507
|
+
this.#model.deviceScaleFactorSetting().addChangeListener(this.requestUpdate, this);
|
|
508
|
+
this.#model.addEventListener(EmulationModel.DeviceModeModel.Events.UPDATED, this.requestUpdate, this);
|
|
509
|
+
this.requestUpdate();
|
|
510
|
+
}
|
|
495
511
|
|
|
496
|
-
|
|
512
|
+
override wasShown(): void {
|
|
513
|
+
super.wasShown();
|
|
514
|
+
// TODO(crbug.com/407750803): Revisit once DeviceModeView is migrated.
|
|
515
|
+
this.performUpdate(); // Trigger a manual update eagerly, DeviceModeView needs to measure our height.
|
|
497
516
|
}
|
|
498
517
|
|
|
499
518
|
override performUpdate(): void {
|
|
519
|
+
if (!this.model) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
500
522
|
const isResponsive = this.model.type() === EmulationModel.DeviceModeModel.Type.Responsive;
|
|
501
523
|
const isFullHeight = isResponsive && this.model.isFullHeight();
|
|
502
524
|
const size = this.model.appliedDeviceSize();
|
|
@@ -598,17 +620,17 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
598
620
|
onWidthChange: (event: Event) => {
|
|
599
621
|
const width = Number((event.target as HTMLInputElement).value);
|
|
600
622
|
if (this.autoAdjustScaleSetting.get()) {
|
|
601
|
-
this.model
|
|
623
|
+
this.model?.setWidthAndScaleToFit(width);
|
|
602
624
|
} else {
|
|
603
|
-
this.model
|
|
625
|
+
this.model?.setWidth(width);
|
|
604
626
|
}
|
|
605
627
|
},
|
|
606
628
|
onHeightChange: (event: Event) => {
|
|
607
629
|
const height = Number((event.target as HTMLInputElement).value);
|
|
608
630
|
if (this.autoAdjustScaleSetting.get()) {
|
|
609
|
-
this.model
|
|
631
|
+
this.model?.setHeightAndScaleToFit(height);
|
|
610
632
|
} else {
|
|
611
|
-
this.model
|
|
633
|
+
this.model?.setHeight(height);
|
|
612
634
|
}
|
|
613
635
|
},
|
|
614
636
|
onScaleChange: this.onScaleChange.bind(this),
|
|
@@ -643,7 +665,7 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
643
665
|
}
|
|
644
666
|
|
|
645
667
|
private currentDevicePosture(): string {
|
|
646
|
-
const mode = this.model
|
|
668
|
+
const mode = this.model?.mode();
|
|
647
669
|
if (mode &&
|
|
648
670
|
(mode.orientation === EmulationModel.EmulatedDevices.VerticalSpanned ||
|
|
649
671
|
mode.orientation === EmulationModel.EmulatedDevices.HorizontalSpanned)) {
|
|
@@ -653,6 +675,9 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
653
675
|
}
|
|
654
676
|
|
|
655
677
|
private getScaleOptions(): Array<{title: string, value: number, selected: boolean, jslogContext: string}> {
|
|
678
|
+
if (!this.model) {
|
|
679
|
+
return [];
|
|
680
|
+
}
|
|
656
681
|
const values = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
657
682
|
const isAutoAdjusting = this.autoAdjustScaleSetting.get();
|
|
658
683
|
const currentScale = this.model.scaleSetting().get();
|
|
@@ -684,6 +709,9 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
684
709
|
}
|
|
685
710
|
|
|
686
711
|
private onScaleChange(event: Event): void {
|
|
712
|
+
if (!this.model) {
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
687
715
|
const value = Number((event.target as HTMLSelectElement).value);
|
|
688
716
|
if (value === 0) {
|
|
689
717
|
this.autoAdjustScaleSetting.set(true);
|
|
@@ -705,6 +733,9 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
705
733
|
|
|
706
734
|
private getDeviceScaleFactorOptions():
|
|
707
735
|
Array<{title: string, value: number, selected: boolean, jslogContext: string}> {
|
|
736
|
+
if (!this.model) {
|
|
737
|
+
return [];
|
|
738
|
+
}
|
|
708
739
|
const deviceScaleFactorSetting = this.model.deviceScaleFactorSetting();
|
|
709
740
|
const defaultValue = this.model.uaSetting().get() === EmulationModel.DeviceModeModel.UA.MOBILE ||
|
|
710
741
|
this.model.uaSetting().get() === EmulationModel.DeviceModeModel.UA.MOBILE_NO_TOUCH ?
|
|
@@ -728,18 +759,21 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
728
759
|
title,
|
|
729
760
|
value: value === defaultValue ? 0 : value,
|
|
730
761
|
selected: currentDPR === value || (value === defaultValue && currentDPR === 0),
|
|
731
|
-
jslogContext
|
|
762
|
+
jslogContext,
|
|
732
763
|
};
|
|
733
764
|
});
|
|
734
765
|
}
|
|
735
766
|
|
|
736
767
|
private onDeviceScaleChange(event: Event): void {
|
|
737
768
|
const value = Number((event.target as HTMLSelectElement).value);
|
|
738
|
-
this.model
|
|
769
|
+
this.model?.deviceScaleFactorSetting().set(value);
|
|
739
770
|
}
|
|
740
771
|
|
|
741
772
|
private getUserAgentOptions():
|
|
742
773
|
Array<{title: string, value: EmulationModel.DeviceModeModel.UA, selected: boolean, jslogContext: string}> {
|
|
774
|
+
if (!this.model) {
|
|
775
|
+
return [];
|
|
776
|
+
}
|
|
743
777
|
const uaSetting = this.model.uaSetting();
|
|
744
778
|
const currentUserAgent = uaSetting.get();
|
|
745
779
|
return [
|
|
@@ -751,18 +785,21 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
751
785
|
title: value,
|
|
752
786
|
value,
|
|
753
787
|
selected: currentUserAgent === value,
|
|
754
|
-
jslogContext: Platform.StringUtilities.toKebabCase(value)
|
|
788
|
+
jslogContext: Platform.StringUtilities.toKebabCase(value),
|
|
755
789
|
}));
|
|
756
790
|
}
|
|
757
791
|
|
|
758
792
|
private onUAChange(event: Event): void {
|
|
759
793
|
const value = (event.target as HTMLSelectElement).value as EmulationModel.DeviceModeModel.UA;
|
|
760
|
-
this.model
|
|
794
|
+
this.model?.uaSetting().set(value);
|
|
761
795
|
}
|
|
762
796
|
|
|
763
797
|
private appendOptionsMenuItems(contextMenu: UI.ContextMenu.ContextMenu): void {
|
|
798
|
+
if (!this.model) {
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
764
801
|
const model = this.model;
|
|
765
|
-
appendToggleItem(contextMenu.headerSection(),
|
|
802
|
+
appendToggleItem(contextMenu.headerSection(), model.deviceOutlineSetting(), i18nString(UIStrings.hideDeviceFrame),
|
|
766
803
|
i18nString(UIStrings.showDeviceFrame), !model.canShowDeviceFrame(), 'device-frame');
|
|
767
804
|
appendToggleItem(
|
|
768
805
|
contextMenu.headerSection(), this.showMediaInspectorSetting, i18nString(UIStrings.hideMediaQueries),
|
|
@@ -800,22 +837,25 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
800
837
|
}
|
|
801
838
|
|
|
802
839
|
private reset(): void {
|
|
803
|
-
this.deviceOutlineSetting.set(false);
|
|
840
|
+
this.model?.deviceOutlineSetting().set(false);
|
|
804
841
|
this.showDeviceScaleFactorSetting.set(false);
|
|
805
842
|
this.showUserAgentTypeSetting.set(false);
|
|
806
843
|
this.showMediaInspectorSetting.set(false);
|
|
807
844
|
this.showRulersSetting.set(false);
|
|
808
|
-
this.model
|
|
845
|
+
this.model?.reset();
|
|
809
846
|
}
|
|
810
847
|
|
|
811
848
|
private emulateDevice(device: EmulationModel.EmulatedDevices.EmulatedDevice): void {
|
|
849
|
+
if (!this.model) {
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
812
852
|
const scale = this.autoAdjustScaleSetting.get() ? undefined : this.model.scaleSetting().get();
|
|
813
853
|
this.model.emulate(
|
|
814
854
|
EmulationModel.DeviceModeModel.Type.Device, device, this.lastMode.get(device) || device.modes[0], scale);
|
|
815
855
|
}
|
|
816
856
|
|
|
817
857
|
private switchToResponsive(): void {
|
|
818
|
-
this.model
|
|
858
|
+
this.model?.emulate(EmulationModel.DeviceModeModel.Type.Responsive, null, null);
|
|
819
859
|
}
|
|
820
860
|
|
|
821
861
|
private filterDevices(devices: EmulationModel.EmulatedDevices.EmulatedDevice[]):
|
|
@@ -855,28 +895,36 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
855
895
|
}>,
|
|
856
896
|
edit: {title: string, jslogContext: string},
|
|
857
897
|
} {
|
|
898
|
+
if (!this.model) {
|
|
899
|
+
return {
|
|
900
|
+
responsive: {title: i18nString(UIStrings.responsive), selected: false, jslogContext: 'responsive'},
|
|
901
|
+
standard: [],
|
|
902
|
+
custom: [],
|
|
903
|
+
edit: {title: i18nString(UIStrings.edit), jslogContext: 'edit'},
|
|
904
|
+
};
|
|
905
|
+
}
|
|
858
906
|
return {
|
|
859
907
|
responsive: {
|
|
860
908
|
title: i18nString(UIStrings.responsive),
|
|
861
909
|
selected: this.model.type() === EmulationModel.DeviceModeModel.Type.Responsive,
|
|
862
|
-
jslogContext: 'responsive'
|
|
910
|
+
jslogContext: 'responsive',
|
|
863
911
|
},
|
|
864
912
|
standard: this.standardDevices().map(device => ({
|
|
865
913
|
device,
|
|
866
914
|
title: device.title,
|
|
867
|
-
selected: this.model
|
|
868
|
-
jslogContext: Platform.StringUtilities.toKebabCase(device.title)
|
|
915
|
+
selected: this.model?.device() === device,
|
|
916
|
+
jslogContext: Platform.StringUtilities.toKebabCase(device.title),
|
|
869
917
|
})),
|
|
870
918
|
custom: this.customDevices().map(device => ({
|
|
871
919
|
device,
|
|
872
920
|
title: device.title,
|
|
873
|
-
selected: this.model
|
|
874
|
-
jslogContext: Platform.StringUtilities.toKebabCase(device.title)
|
|
921
|
+
selected: this.model?.device() === device,
|
|
922
|
+
jslogContext: Platform.StringUtilities.toKebabCase(device.title),
|
|
875
923
|
})),
|
|
876
924
|
edit: {
|
|
877
925
|
title: i18nString(UIStrings.edit),
|
|
878
926
|
jslogContext: 'edit',
|
|
879
|
-
}
|
|
927
|
+
},
|
|
880
928
|
};
|
|
881
929
|
}
|
|
882
930
|
|
|
@@ -899,6 +947,9 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
899
947
|
|
|
900
948
|
private deviceListChanged(): void {
|
|
901
949
|
this.requestUpdate();
|
|
950
|
+
if (!this.model) {
|
|
951
|
+
return;
|
|
952
|
+
}
|
|
902
953
|
const device = this.model.device();
|
|
903
954
|
if (!device) {
|
|
904
955
|
return;
|
|
@@ -917,6 +968,9 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
917
968
|
}
|
|
918
969
|
|
|
919
970
|
private spanClicked(): void {
|
|
971
|
+
if (!this.model) {
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
920
974
|
const device = this.model.device();
|
|
921
975
|
|
|
922
976
|
if (!device || (!device.isDualScreen && !device.isFoldableScreen)) {
|
|
@@ -938,6 +992,9 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
938
992
|
}
|
|
939
993
|
|
|
940
994
|
private modeMenuClicked(event: Event): void {
|
|
995
|
+
if (!this.model) {
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
941
998
|
if (this.model.isScreenOrientationLocked()) {
|
|
942
999
|
return;
|
|
943
1000
|
}
|
|
@@ -1015,14 +1072,17 @@ export class DeviceModeToolbar extends UI.Widget.Widget {
|
|
|
1015
1072
|
}
|
|
1016
1073
|
|
|
1017
1074
|
private getPrettyFitZoomPercentage(): string {
|
|
1018
|
-
return `${(this.model.fitScale() * 100).toFixed(0)}`;
|
|
1075
|
+
return !this.model ? '' : `${(this.model.fitScale() * 100).toFixed(0)}`;
|
|
1019
1076
|
}
|
|
1020
1077
|
|
|
1021
1078
|
private getPrettyZoomPercentage(): string {
|
|
1022
|
-
return `${(this.model.scale() * 100).toFixed(0)}`;
|
|
1079
|
+
return !this.model ? '' : `${(this.model.scale() * 100).toFixed(0)}`;
|
|
1023
1080
|
}
|
|
1024
1081
|
|
|
1025
1082
|
restore(): void {
|
|
1083
|
+
if (!this.model) {
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1026
1086
|
for (const device of this.allDevices()) {
|
|
1027
1087
|
if (device.title === this.persistenceSetting.get().device) {
|
|
1028
1088
|
for (const mode of device.modes) {
|
|
@@ -105,9 +105,9 @@ export class DeviceModeView extends UI.Widget.VBox {
|
|
|
105
105
|
|
|
106
106
|
this.model = EmulationModel.DeviceModeModel.DeviceModeModel.instance();
|
|
107
107
|
this.model.addEventListener(EmulationModel.DeviceModeModel.Events.UPDATED, this.updateUI, this);
|
|
108
|
-
this.mediaInspector = new MediaQueryInspector(
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
this.mediaInspector = new MediaQueryInspector();
|
|
109
|
+
this.mediaInspector.getWidthCallback = () => this.model.appliedDeviceSize().width;
|
|
110
|
+
this.mediaInspector.setWidthCallback = this.model.setWidth.bind(this.model);
|
|
111
111
|
this.showMediaInspectorSetting = Common.Settings.Settings.instance().moduleSetting('show-media-query-inspector');
|
|
112
112
|
this.showMediaInspectorSetting.addChangeListener(this.updateUI, this);
|
|
113
113
|
this.showRulersSetting = Common.Settings.Settings.instance().moduleSetting('emulation.show-rulers');
|
|
@@ -130,7 +130,8 @@ export class DeviceModeView extends UI.Widget.VBox {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
private createUI(): void {
|
|
133
|
-
this.toolbar = new DeviceModeToolbar(
|
|
133
|
+
this.toolbar = new DeviceModeToolbar();
|
|
134
|
+
this.toolbar.model = this.model;
|
|
134
135
|
this.toolbar.show(this.contentElement);
|
|
135
136
|
this.contentClip = this.contentElement.createChild('div', 'device-mode-content-clip vbox');
|
|
136
137
|
this.responsivePresetsContainer = this.contentClip.createChild('div', 'device-mode-presets-container');
|
|
@@ -138,12 +138,12 @@ function renderLabel(
|
|
|
138
138
|
const containerClassMap = {
|
|
139
139
|
'media-inspector-marker-label-container': true,
|
|
140
140
|
'media-inspector-marker-label-container-left': atLeft,
|
|
141
|
-
'media-inspector-marker-label-container-right': !atLeft
|
|
141
|
+
'media-inspector-marker-label-container-right': !atLeft,
|
|
142
142
|
};
|
|
143
143
|
const labelClassMap = {
|
|
144
144
|
'media-inspector-marker-label': true,
|
|
145
145
|
'media-inspector-label-left': leftAlign,
|
|
146
|
-
'media-inspector-label-right': !leftAlign
|
|
146
|
+
'media-inspector-label-right': !leftAlign,
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
// clang-format off
|
|
@@ -158,22 +158,16 @@ function renderLabel(
|
|
|
158
158
|
export class MediaQueryInspector extends UI.Widget.Widget<ShadowRoot> implements
|
|
159
159
|
SDK.TargetManager.SDKModelObserver<SDK.CSSModel.CSSModel> {
|
|
160
160
|
private readonly view: typeof DEFAULT_VIEW;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
readonly mediaThrottler: Common.Throttler.Throttler = new Common.Throttler.Throttler(0);
|
|
162
|
+
#getWidthCallback?: () => number;
|
|
163
|
+
#setWidthCallback?: (arg0: number) => void;
|
|
164
164
|
private scale: number;
|
|
165
165
|
private cssModel?: SDK.CSSModel.CSSModel;
|
|
166
166
|
private cachedQueryModels?: MediaQueryUIModel[];
|
|
167
167
|
|
|
168
|
-
constructor(
|
|
169
|
-
|
|
170
|
-
mediaThrottler: Common.Throttler.Throttler, view = DEFAULT_VIEW) {
|
|
171
|
-
super({useShadowDom: 'pure'});
|
|
168
|
+
constructor(element?: HTMLElement, view = DEFAULT_VIEW) {
|
|
169
|
+
super(element, {useShadowDom: 'pure'});
|
|
172
170
|
this.view = view;
|
|
173
|
-
this.mediaThrottler = mediaThrottler;
|
|
174
|
-
|
|
175
|
-
this.getWidthCallback = getWidthCallback;
|
|
176
|
-
this.setWidthCallback = setWidthCallback;
|
|
177
171
|
this.scale = 1;
|
|
178
172
|
|
|
179
173
|
SDK.TargetManager.TargetManager.instance().observeModels(SDK.CSSModel.CSSModel, this);
|
|
@@ -181,6 +175,24 @@ export class MediaQueryInspector extends UI.Widget.Widget<ShadowRoot> implements
|
|
|
181
175
|
UI.ZoomManager.Events.ZOOM_CHANGED, this.requestUpdate.bind(this), this);
|
|
182
176
|
}
|
|
183
177
|
|
|
178
|
+
get getWidthCallback(): (() => number)|undefined {
|
|
179
|
+
return this.#getWidthCallback;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
set getWidthCallback(callback: (() => number)|undefined) {
|
|
183
|
+
this.#getWidthCallback = callback;
|
|
184
|
+
this.requestUpdate();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
get setWidthCallback(): ((arg0: number) => void)|undefined {
|
|
188
|
+
return this.#setWidthCallback;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
set setWidthCallback(callback: ((arg0: number) => void)|undefined) {
|
|
192
|
+
this.#setWidthCallback = callback;
|
|
193
|
+
this.requestUpdate();
|
|
194
|
+
}
|
|
195
|
+
|
|
184
196
|
modelAdded(cssModel: SDK.CSSModel.CSSModel): void {
|
|
185
197
|
// FIXME: adapt this to multiple targets.
|
|
186
198
|
if (cssModel.target() !== SDK.TargetManager.TargetManager.instance().primaryPageTarget()) {
|
|
@@ -210,7 +222,7 @@ export class MediaQueryInspector extends UI.Widget.Widget<ShadowRoot> implements
|
|
|
210
222
|
return;
|
|
211
223
|
}
|
|
212
224
|
this.scale = scale;
|
|
213
|
-
this.
|
|
225
|
+
this.requestUpdate();
|
|
214
226
|
}
|
|
215
227
|
|
|
216
228
|
private onMediaQueryClicked(model: MediaQueryUIModel): void {
|
|
@@ -218,18 +230,18 @@ export class MediaQueryInspector extends UI.Widget.Widget<ShadowRoot> implements
|
|
|
218
230
|
const modelMinWidth = model.minWidthExpression();
|
|
219
231
|
|
|
220
232
|
if (model.section() === Section.MAX) {
|
|
221
|
-
this.setWidthCallback(modelMaxWidth ? modelMaxWidth.computedLength() || 0 : 0);
|
|
233
|
+
this.setWidthCallback?.(modelMaxWidth ? modelMaxWidth.computedLength() || 0 : 0);
|
|
222
234
|
return;
|
|
223
235
|
}
|
|
224
236
|
if (model.section() === Section.MIN) {
|
|
225
|
-
this.setWidthCallback(modelMinWidth ? modelMinWidth.computedLength() || 0 : 0);
|
|
237
|
+
this.setWidthCallback?.(modelMinWidth ? modelMinWidth.computedLength() || 0 : 0);
|
|
226
238
|
return;
|
|
227
239
|
}
|
|
228
|
-
const currentWidth = this.getWidthCallback();
|
|
240
|
+
const currentWidth = this.getWidthCallback?.() ?? 0;
|
|
229
241
|
if (modelMinWidth && currentWidth !== modelMinWidth.computedLength()) {
|
|
230
|
-
this.setWidthCallback(modelMinWidth.computedLength() || 0);
|
|
242
|
+
this.setWidthCallback?.(modelMinWidth.computedLength() || 0);
|
|
231
243
|
} else {
|
|
232
|
-
this.setWidthCallback(modelMaxWidth ? modelMaxWidth.computedLength() || 0 : 0);
|
|
244
|
+
this.setWidthCallback?.(modelMaxWidth ? modelMaxWidth.computedLength() || 0 : 0);
|
|
233
245
|
}
|
|
234
246
|
}
|
|
235
247
|
|
|
@@ -362,10 +374,14 @@ export class MediaQueryInspector extends UI.Widget.Widget<ShadowRoot> implements
|
|
|
362
374
|
override wasShown(): void {
|
|
363
375
|
super.wasShown();
|
|
364
376
|
this.scheduleMediaQueriesUpdate();
|
|
377
|
+
// TODO(crbug.com/407750803): Revisit once DeviceModeView is migrated.
|
|
365
378
|
this.performUpdate(); // Trigger a manual update eagerly, DeviceModeView needs to measure our height.
|
|
366
379
|
}
|
|
367
380
|
|
|
368
381
|
override performUpdate(): void {
|
|
382
|
+
if (!this.isShowing() || !this.getWidthCallback || !this.setWidthCallback) {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
369
385
|
const markers = Map.groupBy(this.buildMediaQueryMarkers(), marker => marker.model.section());
|
|
370
386
|
|
|
371
387
|
this.view(
|
|
@@ -299,23 +299,23 @@ export class ObjectEventListenerBar extends UI.TreeOutline.TreeElement {
|
|
|
299
299
|
properties.push(new ObjectUI.ObjectPropertiesSection.ObjectTreeNode(
|
|
300
300
|
runtimeModel.createRemotePropertyFromPrimitiveValue('useCapture', eventListener.useCapture()), undefined, {
|
|
301
301
|
readOnly: false,
|
|
302
|
-
propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED
|
|
302
|
+
propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
|
|
303
303
|
}));
|
|
304
304
|
properties.push(new ObjectUI.ObjectPropertiesSection.ObjectTreeNode(
|
|
305
305
|
runtimeModel.createRemotePropertyFromPrimitiveValue('passive', eventListener.passive()), undefined, {
|
|
306
306
|
readOnly: false,
|
|
307
|
-
propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED
|
|
307
|
+
propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
|
|
308
308
|
}));
|
|
309
309
|
properties.push(new ObjectUI.ObjectPropertiesSection.ObjectTreeNode(
|
|
310
310
|
runtimeModel.createRemotePropertyFromPrimitiveValue('once', eventListener.once()), undefined, {
|
|
311
311
|
readOnly: false,
|
|
312
|
-
propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED
|
|
312
|
+
propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
|
|
313
313
|
}));
|
|
314
314
|
if (typeof eventListener.handler() !== 'undefined') {
|
|
315
315
|
properties.push(new ObjectUI.ObjectPropertiesSection.ObjectTreeNode(
|
|
316
316
|
new SDK.RemoteObject.RemoteObjectProperty('handler', eventListener.handler()), undefined, {
|
|
317
317
|
readOnly: false,
|
|
318
|
-
propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED
|
|
318
|
+
propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
|
|
319
319
|
}));
|
|
320
320
|
}
|
|
321
321
|
ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement.populateWithProperties(
|