chrome-devtools-frontend 1.0.1512147 → 1.0.1513662
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/docs/cookbook/release_management.md +15 -13
- package/docs/get_the_code.md +114 -35
- package/front_end/Images/src/ai-explorer-badge.svg +114 -0
- package/front_end/Images/src/code-whisperer-badge.svg +166 -0
- package/front_end/Images/src/devtools-user-badge.svg +129 -0
- package/front_end/Images/src/dom-detective-badge.svg +136 -0
- package/front_end/Images/src/speedster-badge.svg +166 -0
- package/front_end/core/common/Color.ts +40 -44
- package/front_end/core/common/Console.ts +4 -4
- package/front_end/core/common/ParsedURL.ts +14 -14
- package/front_end/core/common/ResourceType.ts +20 -20
- package/front_end/core/common/SegmentedRange.ts +13 -14
- package/front_end/core/common/Settings.ts +4 -4
- package/front_end/core/common/StringOutputStream.ts +4 -4
- package/front_end/core/host/GdpClient.ts +76 -2
- package/front_end/core/host/InspectorFrontendHost.ts +4 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
- package/front_end/core/host/ResourceLoader.ts +2 -2
- package/front_end/core/host/UserMetrics.ts +0 -2
- package/front_end/core/i18n/NumberFormatter.ts +7 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +9 -9
- package/front_end/core/root/Runtime.ts +5 -2
- package/front_end/core/sdk/AccessibilityModel.ts +48 -48
- package/front_end/core/sdk/AnimationModel.ts +78 -79
- package/front_end/core/sdk/CPUProfilerModel.ts +5 -5
- package/front_end/core/sdk/CPUThrottlingManager.ts +17 -17
- package/front_end/core/sdk/CSSMatchedStyles.ts +44 -44
- package/front_end/core/sdk/CSSMedia.ts +22 -22
- package/front_end/core/sdk/CSSModel.ts +4 -4
- package/front_end/core/sdk/CSSProperty.ts +9 -9
- package/front_end/core/sdk/CSSPropertyParser.ts +1 -2
- package/front_end/core/sdk/CSSRule.ts +3 -3
- package/front_end/core/sdk/CSSStyleDeclaration.ts +27 -28
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +13 -13
- package/front_end/core/sdk/CategorizedBreakpoint.ts +4 -4
- package/front_end/core/sdk/ChildTargetManager.ts +6 -6
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +4 -4
- package/front_end/core/sdk/ConsoleModel.ts +24 -24
- package/front_end/core/sdk/Cookie.ts +16 -16
- package/front_end/core/sdk/CookieParser.ts +6 -6
- package/front_end/core/sdk/DOMDebuggerModel.ts +88 -89
- package/front_end/core/sdk/DOMModel.ts +113 -113
- package/front_end/core/sdk/DebuggerModel.ts +102 -103
- package/front_end/core/sdk/EmulationModel.ts +6 -6
- package/front_end/core/sdk/EventBreakpointsModel.ts +5 -5
- package/front_end/core/sdk/HeapProfilerModel.ts +5 -5
- package/front_end/core/sdk/IsolateManager.ts +26 -26
- package/front_end/core/sdk/LayerTreeBase.ts +29 -30
- package/front_end/core/sdk/OverlayModel.ts +6 -6
- package/front_end/core/sdk/Resource.ts +43 -43
- package/front_end/core/sdk/ResourceTreeModel.ts +58 -61
- package/front_end/core/sdk/RuntimeModel.ts +12 -13
- package/front_end/core/sdk/SDKModel.ts +3 -3
- package/front_end/core/sdk/Script.ts +17 -17
- package/front_end/core/sdk/SecurityOriginManager.ts +14 -14
- package/front_end/core/sdk/ServerTiming.ts +2 -2
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +15 -15
- package/front_end/core/sdk/ServiceWorkerManager.ts +19 -24
- package/front_end/core/sdk/SourceMap.ts +10 -10
- package/front_end/core/sdk/StorageKeyManager.ts +12 -12
- package/front_end/core/sdk/Target.ts +33 -34
- package/front_end/core/sdk/TargetManager.ts +20 -20
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +8 -8
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +7 -7
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +7 -7
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +24 -24
- package/front_end/entrypoints/main/GlobalAiButton.ts +3 -3
- package/front_end/entrypoints/main/MainImpl.ts +16 -14
- package/front_end/entrypoints/main/main-meta.ts +1 -2
- package/front_end/generated/InspectorBackendCommands.js +3 -2
- package/front_end/generated/SupportedCSSProperties.js +20 -0
- package/front_end/generated/protocol-mapping.d.ts +4 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/generated/protocol.ts +20 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +18 -35
- package/front_end/models/ai_assistance/ai_assistance.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +7 -6
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +246 -119
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +187 -73
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +106 -100
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +20 -27
- package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +151 -0
- package/front_end/models/badges/AiExplorerBadge.ts +21 -0
- package/front_end/models/badges/Badge.ts +10 -9
- package/front_end/models/badges/CodeWhispererBadge.ts +21 -0
- package/front_end/models/badges/DOMDetectiveBadge.ts +21 -0
- package/front_end/models/badges/SpeedsterBadge.ts +7 -2
- package/front_end/models/badges/StarterBadge.ts +6 -1
- package/front_end/models/badges/UserBadges.ts +61 -9
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +6 -6
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +18 -18
- package/front_end/models/bindings/FileUtils.ts +15 -15
- package/front_end/models/bindings/ResourceScriptMapping.ts +14 -14
- package/front_end/models/elements/ElementUpdateRecord.ts +11 -11
- package/front_end/models/emulation/DeviceModeModel.ts +123 -131
- package/front_end/models/emulation/EmulatedDevices.ts +22 -22
- package/front_end/models/extensions/ExtensionPanel.ts +24 -24
- package/front_end/models/extensions/ExtensionServer.ts +4 -4
- package/front_end/models/javascript_metadata/NativeFunctions.js +14 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +18 -19
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +13 -13
- package/front_end/models/trace/EventsSerializer.ts +5 -5
- package/front_end/models/trace/LanternComputationData.ts +10 -10
- package/front_end/models/trace/ModelImpl.ts +32 -54
- package/front_end/models/trace/Processor.ts +28 -30
- package/front_end/models/trace/extras/FilmStrip.ts +6 -6
- package/front_end/models/trace/extras/StackTraceForEvent.ts +22 -25
- package/front_end/models/trace/extras/ThirdParties.ts +16 -17
- package/front_end/models/trace/extras/TraceFilter.ts +1 -1
- package/front_end/models/trace/handlers/Threads.ts +10 -10
- package/front_end/models/trace/handlers/helpers.ts +9 -9
- package/front_end/models/trace/handlers/types.ts +3 -3
- package/front_end/models/trace/insights/CLSCulprits.ts +12 -14
- package/front_end/models/trace/insights/Cache.ts +8 -4
- package/front_end/models/trace/insights/DOMSize.ts +8 -5
- package/front_end/models/trace/insights/DocumentLatency.ts +2 -2
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +3 -3
- package/front_end/models/trace/insights/FontDisplay.ts +3 -4
- package/front_end/models/trace/insights/ForcedReflow.ts +3 -3
- package/front_end/models/trace/insights/INPBreakdown.ts +2 -2
- package/front_end/models/trace/insights/ImageDelivery.ts +11 -11
- package/front_end/models/trace/insights/LCPBreakdown.ts +4 -4
- package/front_end/models/trace/insights/LCPDiscovery.ts +4 -4
- package/front_end/models/trace/insights/LegacyJavaScript.ts +2 -2
- package/front_end/models/trace/insights/ModernHTTP.ts +4 -5
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +12 -12
- package/front_end/models/trace/insights/RenderBlocking.ts +9 -10
- package/front_end/models/trace/insights/SlowCSSSelector.ts +2 -2
- package/front_end/models/trace/insights/ThirdParties.ts +4 -5
- package/front_end/models/trace/insights/Viewport.ts +8 -5
- package/front_end/models/trace/insights/types.ts +1 -0
- package/front_end/models/trace/lantern/testing/MetricTestUtils.ts +10 -10
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +52 -52
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +8 -8
- package/front_end/panels/animation/AnimationTimeline.ts +5 -5
- package/front_end/panels/animation/AnimationUI.ts +22 -23
- package/front_end/panels/application/ApplicationPanelSidebar.ts +12 -12
- package/front_end/panels/application/DOMStorageModel.ts +23 -23
- package/front_end/panels/application/ExtensionStorageModel.ts +31 -31
- package/front_end/panels/application/IndexedDBModel.ts +1 -0
- package/front_end/panels/application/PreloadingTreeElement.ts +8 -8
- package/front_end/panels/application/ServiceWorkersView.ts +0 -53
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +2 -2
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -2
- package/front_end/panels/common/BadgeNotification.ts +140 -10
- package/front_end/panels/common/GdpSignUpDialog.ts +5 -0
- package/front_end/panels/common/badgeNotification.css +30 -9
- package/front_end/panels/console/ConsoleContextSelector.ts +9 -9
- package/front_end/panels/console/ConsolePrompt.ts +8 -5
- package/front_end/panels/console/ConsoleView.ts +13 -13
- package/front_end/panels/console/ConsoleViewport.ts +29 -29
- package/front_end/panels/coverage/CoverageModel.ts +22 -22
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -1
- package/front_end/panels/elements/ComputedStyleModel.ts +17 -18
- package/front_end/panels/elements/DOMPath.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +13 -13
- package/front_end/panels/elements/ElementsTreeElement.ts +30 -18
- package/front_end/panels/elements/ElementsTreeOutline.ts +44 -48
- package/front_end/panels/elements/ShortcutTreeElement.ts +4 -4
- package/front_end/panels/elements/StylePropertiesSection.ts +7 -4
- package/front_end/panels/elements/StylePropertyTreeElement.ts +54 -50
- package/front_end/panels/elements/StylesSidebarPane.ts +19 -19
- package/front_end/panels/emulation/DeviceModeToolbar.ts +7 -7
- package/front_end/panels/emulation/DeviceModeView.ts +6 -6
- package/front_end/panels/emulation/MediaQueryInspector.ts +18 -18
- package/front_end/panels/event_listeners/EventListenersView.ts +13 -14
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +3 -3
- package/front_end/panels/layer_viewer/LayerViewHost.ts +13 -13
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +9 -10
- package/front_end/panels/layer_viewer/TransformController.ts +34 -36
- package/front_end/panels/layers/LayerTreeModel.ts +41 -40
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +13 -13
- package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -7
- package/front_end/panels/media/PlayerMessagesView.ts +5 -5
- package/front_end/panels/media/TickingFlameChart.ts +24 -24
- package/front_end/panels/media/TickingFlameChartHelpers.ts +32 -32
- package/front_end/panels/network/NetworkItemView.ts +4 -4
- package/front_end/panels/network/NetworkLogViewColumns.ts +29 -29
- package/front_end/panels/network/NetworkPanel.ts +8 -5
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +10 -10
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +3 -3
- package/front_end/panels/profiler/HeapProfileView.ts +1 -1
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +3 -4
- package/front_end/panels/profiler/ProfileHeader.ts +25 -25
- package/front_end/panels/profiler/ProfileLauncherView.ts +5 -6
- package/front_end/panels/recorder/components/ReplaySection.ts +3 -1
- package/front_end/panels/security/OriginTreeElement.ts +8 -8
- package/front_end/panels/security/SecurityPanel.ts +5 -5
- package/front_end/panels/settings/SettingsScreen.ts +18 -18
- package/front_end/panels/settings/components/SyncSection.ts +26 -8
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +3 -0
- package/front_end/panels/sources/DebuggerPausedMessage.ts +8 -9
- package/front_end/panels/sources/NavigatorView.ts +43 -46
- package/front_end/panels/sources/SourcesPanel.ts +35 -35
- package/front_end/panels/sources/SourcesView.ts +13 -13
- package/front_end/panels/sources/TabbedEditorContainer.ts +19 -22
- package/front_end/panels/sources/UISourceCodeFrame.ts +4 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +34 -36
- package/front_end/panels/timeline/AnimationsTrackAppender.ts +3 -3
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +8 -8
- package/front_end/panels/timeline/CountersGraph.ts +16 -16
- package/front_end/panels/timeline/EntriesFilter.ts +4 -3
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +3 -3
- package/front_end/panels/timeline/GPUTrackAppender.ts +3 -3
- package/front_end/panels/timeline/Initiators.ts +10 -10
- package/front_end/panels/timeline/InteractionsTrackAppender.ts +5 -5
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +7 -7
- package/front_end/panels/timeline/ModificationsManager.ts +8 -15
- package/front_end/panels/timeline/TargetForEvent.ts +2 -2
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -1
- package/front_end/panels/timeline/ThreadAppender.ts +13 -13
- package/front_end/panels/timeline/TimelineDetailsView.ts +6 -14
- package/front_end/panels/timeline/TimelineEventOverview.ts +27 -26
- package/front_end/panels/timeline/TimelineFilters.ts +5 -5
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +54 -53
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +34 -34
- package/front_end/panels/timeline/TimelineFlameChartView.ts +18 -31
- package/front_end/panels/timeline/TimelineHistoryManager.ts +17 -18
- package/front_end/panels/timeline/TimelineMiniMap.ts +6 -6
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +6 -6
- package/front_end/panels/timeline/TimelinePanel.ts +73 -68
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +7 -5
- package/front_end/panels/timeline/TimelineTreeView.ts +10 -10
- package/front_end/panels/timeline/TimelineUIUtils.ts +47 -46
- package/front_end/panels/timeline/TimingsTrackAppender.ts +12 -12
- package/front_end/panels/timeline/TracingLayerTree.ts +43 -43
- package/front_end/panels/timeline/TrackConfigBanner.ts +6 -6
- package/front_end/panels/timeline/TrackConfiguration.ts +1 -1
- package/front_end/panels/timeline/components/DetailsView.ts +4 -4
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +12 -21
- package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -1
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +5 -5
- package/front_end/panels/timeline/components/Sidebar.ts +4 -14
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +13 -36
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +21 -19
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
- package/front_end/panels/timeline/components/insights/Cache.ts +4 -0
- package/front_end/panels/timeline/components/insights/DOMSize.ts +5 -1
- package/front_end/panels/timeline/components/insights/Helpers.ts +19 -0
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/panels/timeline/components/insights/Viewport.ts +4 -0
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
- package/front_end/panels/timeline/utils/AICallTree.ts +11 -11
- package/front_end/panels/timeline/utils/AIContext.ts +17 -19
- package/front_end/panels/timeline/utils/EntityMapper.ts +6 -5
- package/front_end/panels/timeline/utils/EntryName.ts +2 -2
- package/front_end/panels/timeline/utils/EntryNodes.ts +5 -5
- package/front_end/panels/timeline/utils/EntryStyles.ts +4 -4
- package/front_end/panels/timeline/utils/FreshRecording.ts +3 -3
- package/front_end/panels/timeline/utils/Helpers.ts +0 -18
- package/front_end/panels/timeline/utils/InsightAIContext.ts +6 -6
- package/front_end/panels/timeline/utils/SourceMapsResolver.ts +7 -7
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +1 -1
- package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
- package/front_end/third_party/json5/rebuild.sh +1 -1
- package/front_end/third_party/legacy-javascript/{update.sh → rebuild.sh} +1 -1
- package/front_end/third_party/lit/lib/decorators.d.ts +26 -9
- package/front_end/third_party/lit/lib/decorators.js +5 -5
- package/front_end/third_party/lit/lib/decorators.js.map +1 -1
- package/front_end/third_party/lit/lib/directive.js.map +1 -1
- package/front_end/third_party/lit/lib/directives.js +8 -13
- package/front_end/third_party/lit/lib/directives.js.map +1 -1
- package/front_end/third_party/lit/lib/lit.d.ts +26 -9
- package/front_end/third_party/lit/lib/lit.js +5 -5
- package/front_end/third_party/lit/lib/lit.js.map +1 -1
- package/front_end/third_party/lit/lib/static-html.js +2 -2
- package/front_end/third_party/lit/lib/static-html.js.map +1 -1
- package/front_end/third_party/lit/rebuild.sh +1 -1
- package/front_end/third_party/third-party-web/rebuild.sh +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +6 -7
- package/front_end/ui/legacy/ActionRegistration.ts +9 -9
- package/front_end/ui/legacy/DockController.ts +18 -18
- package/front_end/ui/legacy/FilterBar.ts +7 -7
- package/front_end/ui/legacy/Fragment.ts +4 -4
- package/front_end/ui/legacy/GlassPane.ts +12 -12
- package/front_end/ui/legacy/InspectorView.ts +5 -15
- package/front_end/ui/legacy/ListControl.ts +27 -27
- package/front_end/ui/legacy/ListWidget.ts +4 -4
- package/front_end/ui/legacy/PopoverHelper.ts +4 -4
- package/front_end/ui/legacy/ShortcutRegistry.ts +17 -17
- package/front_end/ui/legacy/TabbedPane.ts +74 -75
- package/front_end/ui/legacy/TextPrompt.ts +31 -31
- package/front_end/ui/legacy/Toolbar.ts +13 -14
- package/front_end/ui/legacy/ViewManager.ts +30 -31
- package/front_end/ui/legacy/Widget.ts +6 -6
- package/front_end/ui/legacy/XLink.ts +9 -9
- package/front_end/ui/legacy/ZoomManager.ts +9 -9
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +27 -27
- package/front_end/ui/legacy/components/color_picker/ContrastInfo.ts +30 -32
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +15 -15
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +64 -64
- package/front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +10 -11
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +12 -12
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +14 -14
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +8 -8
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -5
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +4 -4
- package/front_end/ui/legacy/filter.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +1 -1
- package/front_end/ui/legacy/softDropDownButton.css +1 -1
- package/front_end/ui/legacy/theme_support/ThemeSupport.ts +4 -4
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -2
- package/package.json +1 -1
- package/front_end/models/ai_assistance/data_formatters/Types.ts +0 -9
@@ -308,9 +308,9 @@ export class ResourceScriptFile extends Common.ObjectWrapper.ObjectWrapper<Resou
|
|
308
308
|
readonly uiSourceCode: Workspace.UISourceCode.UISourceCode;
|
309
309
|
readonly script: SDK.Script.Script|null;
|
310
310
|
#scriptSource?: string|null;
|
311
|
-
#
|
312
|
-
#
|
313
|
-
#
|
311
|
+
#isDivergingFromVM?: boolean;
|
312
|
+
#hasDivergedFromVM?: boolean;
|
313
|
+
#isMergingToVM?: boolean;
|
314
314
|
#updateMutex = new Common.Mutex.Mutex();
|
315
315
|
constructor(
|
316
316
|
resourceScriptMapping: ResourceScriptMapping, uiSourceCode: Workspace.UISourceCode.UISourceCode,
|
@@ -414,9 +414,9 @@ export class ResourceScriptFile extends Common.ObjectWrapper.ObjectWrapper<Resou
|
|
414
414
|
// Do not interleave "divergeFromVM" with "mergeToVM" calls.
|
415
415
|
const release = await this.#updateMutex.acquire();
|
416
416
|
const diverged = this.isDiverged();
|
417
|
-
if (diverged && !this.#
|
417
|
+
if (diverged && !this.#hasDivergedFromVM) {
|
418
418
|
await this.divergeFromVM();
|
419
|
-
} else if (!diverged && this.#
|
419
|
+
} else if (!diverged && this.#hasDivergedFromVM) {
|
420
420
|
await this.mergeToVM();
|
421
421
|
}
|
422
422
|
release();
|
@@ -424,34 +424,34 @@ export class ResourceScriptFile extends Common.ObjectWrapper.ObjectWrapper<Resou
|
|
424
424
|
|
425
425
|
private async divergeFromVM(): Promise<void> {
|
426
426
|
if (this.script) {
|
427
|
-
this.#
|
427
|
+
this.#isDivergingFromVM = true;
|
428
428
|
await this.#resourceScriptMapping.debuggerWorkspaceBinding.updateLocations(this.script);
|
429
|
-
this.#
|
430
|
-
this.#
|
429
|
+
this.#isDivergingFromVM = undefined;
|
430
|
+
this.#hasDivergedFromVM = true;
|
431
431
|
this.dispatchEventToListeners(ResourceScriptFile.Events.DID_DIVERGE_FROM_VM);
|
432
432
|
}
|
433
433
|
}
|
434
434
|
|
435
435
|
private async mergeToVM(): Promise<void> {
|
436
436
|
if (this.script) {
|
437
|
-
this.#
|
438
|
-
this.#
|
437
|
+
this.#hasDivergedFromVM = undefined;
|
438
|
+
this.#isMergingToVM = true;
|
439
439
|
await this.#resourceScriptMapping.debuggerWorkspaceBinding.updateLocations(this.script);
|
440
|
-
this.#
|
440
|
+
this.#isMergingToVM = undefined;
|
441
441
|
this.dispatchEventToListeners(ResourceScriptFile.Events.DID_MERGE_TO_VM);
|
442
442
|
}
|
443
443
|
}
|
444
444
|
|
445
445
|
hasDivergedFromVM(): boolean {
|
446
|
-
return Boolean(this.#
|
446
|
+
return Boolean(this.#hasDivergedFromVM);
|
447
447
|
}
|
448
448
|
|
449
449
|
isDivergingFromVM(): boolean {
|
450
|
-
return Boolean(this.#
|
450
|
+
return Boolean(this.#isDivergingFromVM);
|
451
451
|
}
|
452
452
|
|
453
453
|
isMergingToVM(): boolean {
|
454
|
-
return Boolean(this.#
|
454
|
+
return Boolean(this.#isMergingToVM);
|
455
455
|
}
|
456
456
|
|
457
457
|
checkMapping(): void {
|
@@ -37,9 +37,9 @@ import type * as SDK from '../../core/sdk/sdk.js';
|
|
37
37
|
export class ElementUpdateRecord {
|
38
38
|
private modifiedAttributes?: Set<string>;
|
39
39
|
private removedAttributes?: Set<string>;
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
#hasChangedChildren?: boolean;
|
41
|
+
#hasRemovedChildren?: boolean;
|
42
|
+
#charDataModified?: boolean;
|
43
43
|
|
44
44
|
attributeModified(attrName: string): void {
|
45
45
|
if (this.removedAttributes?.has(attrName)) {
|
@@ -62,20 +62,20 @@ export class ElementUpdateRecord {
|
|
62
62
|
}
|
63
63
|
|
64
64
|
nodeInserted(_node: SDK.DOMModel.DOMNode): void {
|
65
|
-
this
|
65
|
+
this.#hasChangedChildren = true;
|
66
66
|
}
|
67
67
|
|
68
68
|
nodeRemoved(_node: SDK.DOMModel.DOMNode): void {
|
69
|
-
this
|
70
|
-
this
|
69
|
+
this.#hasChangedChildren = true;
|
70
|
+
this.#hasRemovedChildren = true;
|
71
71
|
}
|
72
72
|
|
73
73
|
charDataModified(): void {
|
74
|
-
this
|
74
|
+
this.#charDataModified = true;
|
75
75
|
}
|
76
76
|
|
77
77
|
childrenModified(): void {
|
78
|
-
this
|
78
|
+
this.#hasChangedChildren = true;
|
79
79
|
}
|
80
80
|
|
81
81
|
isAttributeModified(attributeName: string): boolean {
|
@@ -88,14 +88,14 @@ export class ElementUpdateRecord {
|
|
88
88
|
}
|
89
89
|
|
90
90
|
isCharDataModified(): boolean {
|
91
|
-
return Boolean(this
|
91
|
+
return Boolean(this.#charDataModified);
|
92
92
|
}
|
93
93
|
|
94
94
|
hasChangedChildren(): boolean {
|
95
|
-
return Boolean(this
|
95
|
+
return Boolean(this.#hasChangedChildren);
|
96
96
|
}
|
97
97
|
|
98
98
|
hasRemovedChildren(): boolean {
|
99
|
-
return Boolean(this
|
99
|
+
return Boolean(this.#hasRemovedChildren);
|
100
100
|
}
|
101
101
|
}
|
@@ -88,50 +88,50 @@ let deviceModeModelInstance: DeviceModeModel|null;
|
|
88
88
|
|
89
89
|
export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
|
90
90
|
SDK.TargetManager.SDKModelObserver<SDK.EmulationModel.EmulationModel> {
|
91
|
-
#
|
92
|
-
#
|
91
|
+
#screenRect: Rect;
|
92
|
+
#visiblePageRect: Rect;
|
93
93
|
#availableSize: Geometry.Size;
|
94
94
|
#preferredSize: Geometry.Size;
|
95
95
|
#initialized: boolean;
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
readonly #
|
100
|
-
#
|
96
|
+
#appliedDeviceSize: Geometry.Size;
|
97
|
+
#appliedDeviceScaleFactor: number;
|
98
|
+
#appliedUserAgentType: UA;
|
99
|
+
readonly #scaleSetting: Common.Settings.Setting<number>;
|
100
|
+
#scale: number;
|
101
101
|
#widthSetting: Common.Settings.Setting<number>;
|
102
102
|
#heightSetting: Common.Settings.Setting<number>;
|
103
|
-
#
|
104
|
-
readonly #
|
105
|
-
readonly #
|
106
|
-
readonly #
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
110
|
-
#
|
103
|
+
#uaSetting: Common.Settings.Setting<UA>;
|
104
|
+
readonly #deviceScaleFactorSetting: Common.Settings.Setting<number>;
|
105
|
+
readonly #deviceOutlineSetting: Common.Settings.Setting<boolean>;
|
106
|
+
readonly #toolbarControlsEnabledSetting: Common.Settings.Setting<boolean>;
|
107
|
+
#type: Type;
|
108
|
+
#device: EmulatedDevice|null;
|
109
|
+
#mode: Mode|null;
|
110
|
+
#fitScale: number;
|
111
111
|
#touchEnabled: boolean;
|
112
112
|
#touchMobile: boolean;
|
113
113
|
#emulationModel: SDK.EmulationModel.EmulationModel|null;
|
114
114
|
#onModelAvailable: (() => void)|null;
|
115
|
-
#
|
115
|
+
#outlineRect?: Rect;
|
116
116
|
|
117
117
|
private constructor() {
|
118
118
|
super();
|
119
|
-
this.#
|
120
|
-
this.#
|
119
|
+
this.#screenRect = new Rect(0, 0, 1, 1);
|
120
|
+
this.#visiblePageRect = new Rect(0, 0, 1, 1);
|
121
121
|
this.#availableSize = new Geometry.Size(1, 1);
|
122
122
|
this.#preferredSize = new Geometry.Size(1, 1);
|
123
123
|
this.#initialized = false;
|
124
|
-
this.#
|
125
|
-
this.#
|
126
|
-
this.#
|
124
|
+
this.#appliedDeviceSize = new Geometry.Size(1, 1);
|
125
|
+
this.#appliedDeviceScaleFactor = window.devicePixelRatio;
|
126
|
+
this.#appliedUserAgentType = UA.DESKTOP;
|
127
127
|
|
128
|
-
this.#
|
128
|
+
this.#scaleSetting = Common.Settings.Settings.instance().createSetting('emulation.device-scale', 1);
|
129
129
|
// We've used to allow zero before.
|
130
|
-
if (!this.#
|
131
|
-
this.#
|
130
|
+
if (!this.#scaleSetting.get()) {
|
131
|
+
this.#scaleSetting.set(1);
|
132
132
|
}
|
133
|
-
this.#
|
134
|
-
this.#
|
133
|
+
this.#scaleSetting.addChangeListener(this.scaleSettingChanged, this);
|
134
|
+
this.#scale = 1;
|
135
135
|
|
136
136
|
this.#widthSetting = Common.Settings.Settings.instance().createSetting('emulation.device-width', 400);
|
137
137
|
if (this.#widthSetting.get() < MinDeviceSize) {
|
@@ -151,23 +151,22 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
151
151
|
}
|
152
152
|
this.#heightSetting.addChangeListener(this.heightSettingChanged, this);
|
153
153
|
|
154
|
-
this.#
|
155
|
-
this.#
|
156
|
-
this.#
|
154
|
+
this.#uaSetting = Common.Settings.Settings.instance().createSetting('emulation.device-ua', UA.MOBILE);
|
155
|
+
this.#uaSetting.addChangeListener(this.uaSettingChanged, this);
|
156
|
+
this.#deviceScaleFactorSetting =
|
157
157
|
Common.Settings.Settings.instance().createSetting('emulation.device-scale-factor', 0);
|
158
|
-
this.#
|
158
|
+
this.#deviceScaleFactorSetting.addChangeListener(this.deviceScaleFactorSettingChanged, this);
|
159
159
|
|
160
|
-
this.#
|
161
|
-
|
162
|
-
this.#deviceOutlineSettingInternal.addChangeListener(this.deviceOutlineSettingChanged, this);
|
160
|
+
this.#deviceOutlineSetting = Common.Settings.Settings.instance().moduleSetting('emulation.show-device-outline');
|
161
|
+
this.#deviceOutlineSetting.addChangeListener(this.deviceOutlineSettingChanged, this);
|
163
162
|
|
164
|
-
this.#
|
163
|
+
this.#toolbarControlsEnabledSetting = Common.Settings.Settings.instance().createSetting(
|
165
164
|
'emulation.toolbar-controls-enabled', true, Common.Settings.SettingStorageType.SESSION);
|
166
165
|
|
167
|
-
this.#
|
168
|
-
this.#
|
169
|
-
this.#
|
170
|
-
this.#
|
166
|
+
this.#type = Type.None;
|
167
|
+
this.#device = null;
|
168
|
+
this.#mode = null;
|
169
|
+
this.#fitScale = 1;
|
171
170
|
this.#touchEnabled = false;
|
172
171
|
this.#touchMobile = false;
|
173
172
|
|
@@ -267,7 +266,7 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
267
266
|
}
|
268
267
|
|
269
268
|
get scaleSettingInternal(): Common.Settings.Setting<number> {
|
270
|
-
return this.#
|
269
|
+
return this.#scaleSetting;
|
271
270
|
}
|
272
271
|
|
273
272
|
setAvailableSize(availableSize: Geometry.Size, preferredSize: Geometry.Size): void {
|
@@ -278,23 +277,22 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
278
277
|
}
|
279
278
|
|
280
279
|
emulate(type: Type, device: EmulatedDevice|null, mode: Mode|null, scale?: number): void {
|
281
|
-
const resetPageScaleFactor =
|
282
|
-
|
283
|
-
this.#typeInternal = type;
|
280
|
+
const resetPageScaleFactor = this.#type !== type || this.#device !== device || this.#mode !== mode;
|
281
|
+
this.#type = type;
|
284
282
|
|
285
283
|
if (type === Type.Device && device && mode) {
|
286
284
|
console.assert(Boolean(device) && Boolean(mode), 'Must pass device and mode for device emulation');
|
287
|
-
this.#
|
288
|
-
this.#
|
285
|
+
this.#mode = mode;
|
286
|
+
this.#device = device;
|
289
287
|
if (this.#initialized) {
|
290
288
|
const orientation = device.orientationByName(mode.orientation);
|
291
|
-
this.#
|
289
|
+
this.#scaleSetting.set(
|
292
290
|
scale ||
|
293
291
|
this.calculateFitScale(orientation.width, orientation.height, this.currentOutline(), this.currentInsets()));
|
294
292
|
}
|
295
293
|
} else {
|
296
|
-
this.#
|
297
|
-
this.#
|
294
|
+
this.#device = null;
|
295
|
+
this.#mode = null;
|
298
296
|
}
|
299
297
|
|
300
298
|
if (type !== Type.None) {
|
@@ -311,7 +309,7 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
311
309
|
|
312
310
|
setWidthAndScaleToFit(width: number): void {
|
313
311
|
width = Math.max(Math.min(width, MaxDeviceSize), 1);
|
314
|
-
this.#
|
312
|
+
this.#scaleSetting.set(this.calculateFitScale(width, this.#heightSetting.get()));
|
315
313
|
this.#widthSetting.set(width);
|
316
314
|
}
|
317
315
|
|
@@ -326,66 +324,65 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
326
324
|
|
327
325
|
setHeightAndScaleToFit(height: number): void {
|
328
326
|
height = Math.max(Math.min(height, MaxDeviceSize), 0);
|
329
|
-
this.#
|
327
|
+
this.#scaleSetting.set(this.calculateFitScale(this.#widthSetting.get(), height));
|
330
328
|
this.#heightSetting.set(height);
|
331
329
|
}
|
332
330
|
|
333
331
|
setScale(scale: number): void {
|
334
|
-
this.#
|
332
|
+
this.#scaleSetting.set(scale);
|
335
333
|
}
|
336
334
|
|
337
335
|
device(): EmulatedDevice|null {
|
338
|
-
return this.#
|
336
|
+
return this.#device;
|
339
337
|
}
|
340
338
|
|
341
339
|
mode(): Mode|null {
|
342
|
-
return this.#
|
340
|
+
return this.#mode;
|
343
341
|
}
|
344
342
|
|
345
343
|
type(): Type {
|
346
|
-
return this.#
|
344
|
+
return this.#type;
|
347
345
|
}
|
348
346
|
|
349
347
|
screenImage(): string {
|
350
|
-
return (this.#
|
348
|
+
return (this.#device && this.#mode) ? this.#device.modeImage(this.#mode) : '';
|
351
349
|
}
|
352
350
|
|
353
351
|
outlineImage(): string {
|
354
|
-
return (this.#
|
355
|
-
|
356
|
-
'';
|
352
|
+
return (this.#device && this.#mode && this.#deviceOutlineSetting.get()) ? this.#device.outlineImage(this.#mode) :
|
353
|
+
'';
|
357
354
|
}
|
358
355
|
|
359
356
|
outlineRect(): Rect|null {
|
360
|
-
return this.#
|
357
|
+
return this.#outlineRect || null;
|
361
358
|
}
|
362
359
|
|
363
360
|
screenRect(): Rect {
|
364
|
-
return this.#
|
361
|
+
return this.#screenRect;
|
365
362
|
}
|
366
363
|
|
367
364
|
visiblePageRect(): Rect {
|
368
|
-
return this.#
|
365
|
+
return this.#visiblePageRect;
|
369
366
|
}
|
370
367
|
|
371
368
|
scale(): number {
|
372
|
-
return this.#
|
369
|
+
return this.#scale;
|
373
370
|
}
|
374
371
|
|
375
372
|
fitScale(): number {
|
376
|
-
return this.#
|
373
|
+
return this.#fitScale;
|
377
374
|
}
|
378
375
|
|
379
376
|
appliedDeviceSize(): Geometry.Size {
|
380
|
-
return this.#
|
377
|
+
return this.#appliedDeviceSize;
|
381
378
|
}
|
382
379
|
|
383
380
|
appliedDeviceScaleFactor(): number {
|
384
|
-
return this.#
|
381
|
+
return this.#appliedDeviceScaleFactor;
|
385
382
|
}
|
386
383
|
|
387
384
|
appliedUserAgentType(): UA {
|
388
|
-
return this.#
|
385
|
+
return this.#appliedUserAgentType;
|
389
386
|
}
|
390
387
|
|
391
388
|
isFullHeight(): boolean {
|
@@ -393,13 +390,13 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
393
390
|
}
|
394
391
|
|
395
392
|
isMobile(): boolean {
|
396
|
-
switch (this.#
|
393
|
+
switch (this.#type) {
|
397
394
|
case Type.Device:
|
398
|
-
return this.#
|
395
|
+
return this.#device ? this.#device.mobile() : false;
|
399
396
|
case Type.None:
|
400
397
|
return false;
|
401
398
|
case Type.Responsive:
|
402
|
-
return this.#
|
399
|
+
return this.#uaSetting.get() === UA.MOBILE || this.#uaSetting.get() === UA.MOBILE_NO_TOUCH;
|
403
400
|
}
|
404
401
|
return false;
|
405
402
|
}
|
@@ -409,31 +406,31 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
409
406
|
}
|
410
407
|
|
411
408
|
scaleSetting(): Common.Settings.Setting<number> {
|
412
|
-
return this.#
|
409
|
+
return this.#scaleSetting;
|
413
410
|
}
|
414
411
|
|
415
412
|
uaSetting(): Common.Settings.Setting<UA> {
|
416
|
-
return this.#
|
413
|
+
return this.#uaSetting;
|
417
414
|
}
|
418
415
|
|
419
416
|
deviceScaleFactorSetting(): Common.Settings.Setting<number> {
|
420
|
-
return this.#
|
417
|
+
return this.#deviceScaleFactorSetting;
|
421
418
|
}
|
422
419
|
|
423
420
|
deviceOutlineSetting(): Common.Settings.Setting<boolean> {
|
424
|
-
return this.#
|
421
|
+
return this.#deviceOutlineSetting;
|
425
422
|
}
|
426
423
|
|
427
424
|
toolbarControlsEnabledSetting(): Common.Settings.Setting<boolean> {
|
428
|
-
return this.#
|
425
|
+
return this.#toolbarControlsEnabledSetting;
|
429
426
|
}
|
430
427
|
|
431
428
|
reset(): void {
|
432
|
-
this.#
|
433
|
-
this.#
|
429
|
+
this.#deviceScaleFactorSetting.set(0);
|
430
|
+
this.#scaleSetting.set(1);
|
434
431
|
this.setWidth(400);
|
435
432
|
this.setHeight(0);
|
436
|
-
this.#
|
433
|
+
this.#uaSetting.set(UA.MOBILE);
|
437
434
|
}
|
438
435
|
|
439
436
|
modelAdded(emulationModel: SDK.EmulationModel.EmulationModel): void {
|
@@ -499,37 +496,37 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
499
496
|
}
|
500
497
|
|
501
498
|
private preferredScaledWidth(): number {
|
502
|
-
return Math.floor(this.#preferredSize.width / (this.#
|
499
|
+
return Math.floor(this.#preferredSize.width / (this.#scaleSetting.get() || 1));
|
503
500
|
}
|
504
501
|
|
505
502
|
private preferredScaledHeight(): number {
|
506
|
-
return Math.floor(this.#preferredSize.height / (this.#
|
503
|
+
return Math.floor(this.#preferredSize.height / (this.#scaleSetting.get() || 1));
|
507
504
|
}
|
508
505
|
|
509
506
|
private currentOutline(): Insets {
|
510
507
|
let outline: Insets = new Insets(0, 0, 0, 0);
|
511
|
-
if (this.#
|
508
|
+
if (this.#type !== Type.Device || !this.#device || !this.#mode) {
|
512
509
|
return outline;
|
513
510
|
}
|
514
|
-
const orientation = this.#
|
515
|
-
if (this.#
|
511
|
+
const orientation = this.#device.orientationByName(this.#mode.orientation);
|
512
|
+
if (this.#deviceOutlineSetting.get()) {
|
516
513
|
outline = orientation.outlineInsets || outline;
|
517
514
|
}
|
518
515
|
return outline;
|
519
516
|
}
|
520
517
|
|
521
518
|
private currentInsets(): Insets {
|
522
|
-
if (this.#
|
519
|
+
if (this.#type !== Type.Device || !this.#mode) {
|
523
520
|
return new Insets(0, 0, 0, 0);
|
524
521
|
}
|
525
|
-
return this.#
|
522
|
+
return this.#mode.insets;
|
526
523
|
}
|
527
524
|
|
528
525
|
private getScreenOrientationType(): Protocol.Emulation.ScreenOrientationType {
|
529
|
-
if (!this.#
|
526
|
+
if (!this.#mode) {
|
530
527
|
throw new Error('Mode required to get orientation type.');
|
531
528
|
}
|
532
|
-
switch (this.#
|
529
|
+
switch (this.#mode.orientation) {
|
533
530
|
case VerticalSpanned:
|
534
531
|
case Vertical:
|
535
532
|
return Protocol.Emulation.ScreenOrientationType.PortraitPrimary;
|
@@ -549,30 +546,30 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
549
546
|
if (overlayModel) {
|
550
547
|
this.showHingeIfApplicable(overlayModel);
|
551
548
|
}
|
552
|
-
if (this.#
|
553
|
-
const orientation = this.#
|
549
|
+
if (this.#type === Type.Device && this.#device && this.#mode) {
|
550
|
+
const orientation = this.#device.orientationByName(this.#mode.orientation);
|
554
551
|
const outline = this.currentOutline();
|
555
552
|
const insets = this.currentInsets();
|
556
|
-
this.#
|
553
|
+
this.#fitScale = this.calculateFitScale(orientation.width, orientation.height, outline, insets);
|
557
554
|
if (mobile) {
|
558
|
-
this.#
|
555
|
+
this.#appliedUserAgentType = this.#device.touch() ? UA.MOBILE : UA.MOBILE_NO_TOUCH;
|
559
556
|
} else {
|
560
|
-
this.#
|
557
|
+
this.#appliedUserAgentType = this.#device.touch() ? UA.DESKTOP_TOUCH : UA.DESKTOP;
|
561
558
|
}
|
562
559
|
this.applyDeviceMetrics(
|
563
|
-
new Geometry.Size(orientation.width, orientation.height), insets, outline, this.#
|
564
|
-
this.#
|
565
|
-
this.applyUserAgent(this.#
|
566
|
-
this.applyTouch(this.#
|
567
|
-
} else if (this.#
|
568
|
-
this.#
|
569
|
-
this.#
|
560
|
+
new Geometry.Size(orientation.width, orientation.height), insets, outline, this.#scaleSetting.get(),
|
561
|
+
this.#device.deviceScaleFactor, mobile, this.getScreenOrientationType(), resetPageScaleFactor);
|
562
|
+
this.applyUserAgent(this.#device.userAgent, this.#device.userAgentMetadata);
|
563
|
+
this.applyTouch(this.#device.touch(), mobile);
|
564
|
+
} else if (this.#type === Type.None) {
|
565
|
+
this.#fitScale = this.calculateFitScale(this.#availableSize.width, this.#availableSize.height);
|
566
|
+
this.#appliedUserAgentType = UA.DESKTOP;
|
570
567
|
this.applyDeviceMetrics(
|
571
568
|
this.#availableSize, new Insets(0, 0, 0, 0), new Insets(0, 0, 0, 0), 1, 0, mobile, null,
|
572
569
|
resetPageScaleFactor);
|
573
570
|
this.applyUserAgent('', null);
|
574
571
|
this.applyTouch(false, false);
|
575
|
-
} else if (this.#
|
572
|
+
} else if (this.#type === Type.Responsive) {
|
576
573
|
let screenWidth = this.#widthSetting.get();
|
577
574
|
if (!screenWidth || screenWidth > this.preferredScaledWidth()) {
|
578
575
|
screenWidth = this.preferredScaledWidth();
|
@@ -582,23 +579,22 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
582
579
|
screenHeight = this.preferredScaledHeight();
|
583
580
|
}
|
584
581
|
const defaultDeviceScaleFactor = mobile ? defaultMobileScaleFactor : 0;
|
585
|
-
this.#
|
586
|
-
this.#
|
582
|
+
this.#fitScale = this.calculateFitScale(this.#widthSetting.get(), this.#heightSetting.get());
|
583
|
+
this.#appliedUserAgentType = this.#uaSetting.get();
|
587
584
|
this.applyDeviceMetrics(
|
588
585
|
new Geometry.Size(screenWidth, screenHeight), new Insets(0, 0, 0, 0), new Insets(0, 0, 0, 0),
|
589
|
-
this.#
|
590
|
-
mobile,
|
586
|
+
this.#scaleSetting.get(), this.#deviceScaleFactorSetting.get() || defaultDeviceScaleFactor, mobile,
|
591
587
|
screenHeight >= screenWidth ? Protocol.Emulation.ScreenOrientationType.PortraitPrimary :
|
592
588
|
Protocol.Emulation.ScreenOrientationType.LandscapePrimary,
|
593
589
|
resetPageScaleFactor);
|
594
590
|
this.applyUserAgent(mobile ? defaultMobileUserAgent : '', mobile ? defaultMobileUserAgentMetadata : null);
|
595
591
|
this.applyTouch(
|
596
|
-
this.#
|
597
|
-
this.#
|
592
|
+
this.#uaSetting.get() === UA.DESKTOP_TOUCH || this.#uaSetting.get() === UA.MOBILE,
|
593
|
+
this.#uaSetting.get() === UA.MOBILE);
|
598
594
|
}
|
599
595
|
|
600
596
|
if (overlayModel) {
|
601
|
-
overlayModel.setShowViewportSizeOnResize(this.#
|
597
|
+
overlayModel.setShowViewportSizeOnResize(this.#type === Type.None);
|
602
598
|
}
|
603
599
|
this.dispatchEventToListeners(Events.UPDATED);
|
604
600
|
}
|
@@ -631,7 +627,7 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
631
627
|
}
|
632
628
|
|
633
629
|
setSizeAndScaleToFit(width: number, height: number): void {
|
634
|
-
this.#
|
630
|
+
this.#scaleSetting.set(this.calculateFitScale(width, height));
|
635
631
|
this.setWidth(width);
|
636
632
|
this.setHeight(height);
|
637
633
|
}
|
@@ -655,20 +651,19 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
655
651
|
const screenOrientationAngle =
|
656
652
|
screenOrientation === Protocol.Emulation.ScreenOrientationType.LandscapePrimary ? 90 : 0;
|
657
653
|
|
658
|
-
this.#
|
659
|
-
this.#
|
660
|
-
this.#
|
654
|
+
this.#appliedDeviceSize = screenSize;
|
655
|
+
this.#appliedDeviceScaleFactor = deviceScaleFactor || window.devicePixelRatio;
|
656
|
+
this.#screenRect = new Rect(
|
661
657
|
Math.max(0, (this.#availableSize.width - screenSize.width * scale) / 2), outline.top * scale,
|
662
658
|
screenSize.width * scale, screenSize.height * scale);
|
663
|
-
this.#
|
664
|
-
this.#
|
665
|
-
(outline.left + screenSize.width + outline.right) * scale,
|
659
|
+
this.#outlineRect = new Rect(
|
660
|
+
this.#screenRect.left - outline.left * scale, 0, (outline.left + screenSize.width + outline.right) * scale,
|
666
661
|
(outline.top + screenSize.height + outline.bottom) * scale);
|
667
|
-
this.#
|
662
|
+
this.#visiblePageRect = new Rect(
|
668
663
|
positionX * scale, positionY * scale,
|
669
|
-
Math.min(pageWidth * scale, this.#availableSize.width - this.#
|
670
|
-
Math.min(pageHeight * scale, this.#availableSize.height - this.#
|
671
|
-
this.#
|
664
|
+
Math.min(pageWidth * scale, this.#availableSize.width - this.#screenRect.left - positionX * scale),
|
665
|
+
Math.min(pageHeight * scale, this.#availableSize.height - this.#screenRect.top - positionY * scale));
|
666
|
+
this.#scale = scale;
|
672
667
|
const displayFeature = this.getDisplayFeature();
|
673
668
|
if (!displayFeature) {
|
674
669
|
// When sending displayFeature, we cannot use the optimization below due to backend restrictions.
|
@@ -678,9 +673,8 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
678
673
|
pageWidth = 0;
|
679
674
|
pageHeight = 0;
|
680
675
|
}
|
681
|
-
if (this.#
|
682
|
-
|
683
|
-
Number.isInteger(pageHeight * scale)) {
|
676
|
+
if (this.#visiblePageRect.width === pageWidth * scale && this.#visiblePageRect.height === pageHeight * scale &&
|
677
|
+
Number.isInteger(pageWidth * scale) && Number.isInteger(pageHeight * scale)) {
|
684
678
|
// When we only have to apply scale, do not resize the page. This will speed things up and remove lag.
|
685
679
|
pageWidth = 0;
|
686
680
|
pageHeight = 0;
|
@@ -763,8 +757,8 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
763
757
|
mobile: false,
|
764
758
|
};
|
765
759
|
if (fullSize && this.#emulationModel) {
|
766
|
-
if (this.#
|
767
|
-
const orientation = this.#
|
760
|
+
if (this.#device && this.#mode) {
|
761
|
+
const orientation = this.#device.orientationByName(this.#mode.orientation);
|
768
762
|
deviceMetrics.width = orientation.width;
|
769
763
|
deviceMetrics.height = orientation.height;
|
770
764
|
const dispFeature = this.getDisplayFeature();
|
@@ -793,9 +787,7 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
793
787
|
}
|
794
788
|
|
795
789
|
private showHingeIfApplicable(overlayModel: SDK.OverlayModel.OverlayModel): void {
|
796
|
-
const orientation = (this.#
|
797
|
-
this.#deviceInternal.orientationByName(this.#modeInternal.orientation) :
|
798
|
-
null;
|
790
|
+
const orientation = (this.#device && this.#mode) ? this.#device.orientationByName(this.#mode.orientation) : null;
|
799
791
|
if (orientation?.hinge) {
|
800
792
|
overlayModel.showHingeForDualScreen(orientation.hinge);
|
801
793
|
return;
|
@@ -805,10 +797,10 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
805
797
|
}
|
806
798
|
|
807
799
|
private getDisplayFeatureOrientation(): Protocol.Emulation.DisplayFeatureOrientation {
|
808
|
-
if (!this.#
|
800
|
+
if (!this.#mode) {
|
809
801
|
throw new Error('Mode required to get display feature orientation.');
|
810
802
|
}
|
811
|
-
switch (this.#
|
803
|
+
switch (this.#mode.orientation) {
|
812
804
|
case VerticalSpanned:
|
813
805
|
case Vertical:
|
814
806
|
return Protocol.Emulation.DisplayFeatureOrientation.Vertical;
|
@@ -820,12 +812,12 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
820
812
|
}
|
821
813
|
|
822
814
|
private getDisplayFeature(): Protocol.Emulation.DisplayFeature|null {
|
823
|
-
if (!this.#
|
824
|
-
(this.#
|
815
|
+
if (!this.#device || !this.#mode ||
|
816
|
+
(this.#mode.orientation !== VerticalSpanned && this.#mode.orientation !== HorizontalSpanned)) {
|
825
817
|
return null;
|
826
818
|
}
|
827
819
|
|
828
|
-
const orientation = this.#
|
820
|
+
const orientation = this.#device.orientationByName(this.#mode.orientation);
|
829
821
|
if (!orientation?.hinge) {
|
830
822
|
return null;
|
831
823
|
}
|
@@ -833,8 +825,8 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
833
825
|
const hinge = orientation.hinge;
|
834
826
|
return {
|
835
827
|
orientation: this.getDisplayFeatureOrientation(),
|
836
|
-
offset: (this.#
|
837
|
-
maskLength: (this.#
|
828
|
+
offset: (this.#mode.orientation === VerticalSpanned) ? hinge.x : hinge.y,
|
829
|
+
maskLength: (this.#mode.orientation === VerticalSpanned) ? hinge.width : hinge.height,
|
838
830
|
};
|
839
831
|
}
|
840
832
|
}
|