chrome-devtools-frontend 1.0.1512349 → 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/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 +38 -0
- 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/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 +15 -16
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +127 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +149 -26
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +9 -10
- package/front_end/models/badges/AiExplorerBadge.ts +21 -0
- package/front_end/models/badges/Badge.ts +3 -5
- package/front_end/models/badges/CodeWhispererBadge.ts +21 -0
- package/front_end/models/badges/DOMDetectiveBadge.ts +4 -3
- package/front_end/models/badges/SpeedsterBadge.ts +6 -4
- package/front_end/models/badges/StarterBadge.ts +4 -3
- package/front_end/models/badges/UserBadges.ts +29 -3
- 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 -41
- 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 +24 -4
- package/front_end/panels/common/GdpSignUpDialog.ts +5 -0
- package/front_end/panels/common/badgeNotification.css +26 -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 +18 -18
- package/front_end/panels/elements/ElementsTreeOutline.ts +41 -48
- package/front_end/panels/elements/ShortcutTreeElement.ts +4 -4
- package/front_end/panels/elements/StylePropertiesSection.ts +4 -4
- package/front_end/panels/elements/StylePropertyTreeElement.ts +49 -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 -12
- package/front_end/panels/settings/components/SyncSection.ts +20 -6
- 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 +52 -59
- 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 +43 -43
- 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/theme_support/ThemeSupport.ts +4 -4
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -2
- package/package.json +1 -1
@@ -113,12 +113,12 @@ function estimateSavingsWithGraphs(deferredIds: Set<string>, lanternContext: Lan
|
|
113
113
|
return Math.round(Math.max(estimateBeforeInline - estimateAfterInline, 0)) as Types.Timing.Milli;
|
114
114
|
}
|
115
115
|
|
116
|
-
function hasImageLCP(
|
117
|
-
return
|
116
|
+
function hasImageLCP(data: Handlers.Types.HandlerData, context: InsightSetContextWithNavigation): boolean {
|
117
|
+
return data.LargestImagePaint.lcpRequestByNavigationId.has(context.navigationId);
|
118
118
|
}
|
119
119
|
|
120
120
|
function computeSavings(
|
121
|
-
|
121
|
+
data: Handlers.Types.HandlerData, context: InsightSetContextWithNavigation,
|
122
122
|
renderBlockingRequests: Types.Events.SyntheticNetworkRequest[]):
|
123
123
|
Pick<RenderBlockingInsightModel, 'metricSavings'|'requestIdToWastedMs'>|undefined {
|
124
124
|
if (!context.lantern) {
|
@@ -155,7 +155,7 @@ function computeSavings(
|
|
155
155
|
metricSavings.FCP = estimateSavingsWithGraphs(deferredNodeIds, context.lantern);
|
156
156
|
|
157
157
|
// In most cases, render blocking resources only affect LCP if LCP isn't an image.
|
158
|
-
if (!hasImageLCP(
|
158
|
+
if (!hasImageLCP(data, context)) {
|
159
159
|
metricSavings.LCP = metricSavings.FCP;
|
160
160
|
}
|
161
161
|
}
|
@@ -176,14 +176,14 @@ function finalize(partialModel: PartialInsightModel<RenderBlockingInsightModel>)
|
|
176
176
|
}
|
177
177
|
|
178
178
|
export function generateInsight(
|
179
|
-
|
179
|
+
data: Handlers.Types.HandlerData, context: InsightSetContext): RenderBlockingInsightModel {
|
180
180
|
if (!context.navigation) {
|
181
181
|
return finalize({
|
182
182
|
renderBlockingRequests: [],
|
183
183
|
});
|
184
184
|
}
|
185
185
|
|
186
|
-
const firstPaintTs =
|
186
|
+
const firstPaintTs = data.PageLoadMetrics.metricScoresByFrameId.get(context.frameId)
|
187
187
|
?.get(context.navigationId)
|
188
188
|
?.get(Handlers.ModelHandlers.PageLoadMetrics.MetricName.FP)
|
189
189
|
?.event?.ts;
|
@@ -195,7 +195,7 @@ export function generateInsight(
|
|
195
195
|
}
|
196
196
|
|
197
197
|
let renderBlockingRequests: Types.Events.SyntheticNetworkRequest[] = [];
|
198
|
-
for (const req of
|
198
|
+
for (const req of data.NetworkRequests.byTime) {
|
199
199
|
if (req.args.data.frame !== context.frameId) {
|
200
200
|
continue;
|
201
201
|
}
|
@@ -223,14 +223,13 @@ export function generateInsight(
|
|
223
223
|
}
|
224
224
|
}
|
225
225
|
|
226
|
-
const navigation =
|
227
|
-
Helpers.Trace.getNavigationForTraceEvent(req, context.frameId, parsedTrace.Meta.navigationsByFrameId);
|
226
|
+
const navigation = Helpers.Trace.getNavigationForTraceEvent(req, context.frameId, data.Meta.navigationsByFrameId);
|
228
227
|
if (navigation === context.navigation) {
|
229
228
|
renderBlockingRequests.push(req);
|
230
229
|
}
|
231
230
|
}
|
232
231
|
|
233
|
-
const savings = computeSavings(
|
232
|
+
const savings = computeSavings(data, context, renderBlockingRequests);
|
234
233
|
|
235
234
|
// Sort by request duration for insights.
|
236
235
|
renderBlockingRequests = renderBlockingRequests.sort((a, b) => {
|
@@ -119,8 +119,8 @@ export function isSlowCSSSelectorInsight(model: InsightModel): model is SlowCSSS
|
|
119
119
|
}
|
120
120
|
|
121
121
|
export function generateInsight(
|
122
|
-
|
123
|
-
const selectorStatsData =
|
122
|
+
data: Handlers.Types.HandlerData, context: InsightSetContext): SlowCSSSelectorInsightModel {
|
123
|
+
const selectorStatsData = data.SelectorStats;
|
124
124
|
|
125
125
|
if (!selectorStatsData) {
|
126
126
|
throw new Error('no selector stats data');
|
@@ -78,13 +78,12 @@ export function isThirdPartyInsight(model: InsightModel): model is ThirdPartiesI
|
|
78
78
|
}
|
79
79
|
|
80
80
|
export function generateInsight(
|
81
|
-
|
82
|
-
const entitySummaries =
|
83
|
-
Extras.ThirdParties.summarizeByThirdParty(parsedTrace as Handlers.Types.ParsedTrace, context.bounds);
|
81
|
+
data: Handlers.Types.HandlerData, context: InsightSetContext): ThirdPartiesInsightModel {
|
82
|
+
const entitySummaries = Extras.ThirdParties.summarizeByThirdParty(data as Handlers.Types.HandlerData, context.bounds);
|
84
83
|
|
85
|
-
const firstPartyUrl = context.navigation?.args.data?.documentLoaderURL ??
|
84
|
+
const firstPartyUrl = context.navigation?.args.data?.documentLoaderURL ?? data.Meta.mainFrameURL;
|
86
85
|
const firstPartyEntity = ThirdPartyWeb.ThirdPartyWeb.getEntity(firstPartyUrl) ||
|
87
|
-
Handlers.Helpers.makeUpEntity(
|
86
|
+
Handlers.Helpers.makeUpEntity(data.Renderer.entityMappings.createdEntityCache, firstPartyUrl);
|
88
87
|
|
89
88
|
return finalize({
|
90
89
|
relatedEvents: getRelatedEvents(entitySummaries, firstPartyEntity),
|
@@ -52,9 +52,12 @@ function finalize(partialModel: PartialInsightModel<ViewportInsightModel>): View
|
|
52
52
|
};
|
53
53
|
}
|
54
54
|
|
55
|
-
export function
|
56
|
-
|
57
|
-
|
55
|
+
export function isViewportInsight(model: InsightModel): model is ViewportInsightModel {
|
56
|
+
return model.insightKey === InsightKeys.VIEWPORT;
|
57
|
+
}
|
58
|
+
|
59
|
+
export function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): ViewportInsightModel {
|
60
|
+
const viewportEvent = data.UserInteractions.parseMetaViewportEvents.find(event => {
|
58
61
|
if (event.args.data.frame !== context.frameId) {
|
59
62
|
return false;
|
60
63
|
}
|
@@ -62,7 +65,7 @@ export function generateInsight(
|
|
62
65
|
return Helpers.Timing.eventIsInBounds(event, context.bounds);
|
63
66
|
});
|
64
67
|
|
65
|
-
const compositorEvents =
|
68
|
+
const compositorEvents = data.UserInteractions.beginCommitCompositorFrameEvents.filter(event => {
|
66
69
|
if (event.args.frame !== context.frameId) {
|
67
70
|
return false;
|
68
71
|
}
|
@@ -88,7 +91,7 @@ export function generateInsight(
|
|
88
91
|
for (const event of compositorEvents) {
|
89
92
|
if (!event.args.is_mobile_optimized) {
|
90
93
|
// Grab all the pointer events with at least 50ms of input delay.
|
91
|
-
const longPointerInteractions = [...
|
94
|
+
const longPointerInteractions = [...data.UserInteractions.interactionsOverThreshold.values()].filter(
|
92
95
|
interaction => Handlers.ModelHandlers.UserInteractions.categoryOfInteraction(interaction) === 'POINTER' &&
|
93
96
|
interaction.inputDelay >= 50_000);
|
94
97
|
|
@@ -15,15 +15,15 @@ function toLanternTrace(traceEvents: readonly Trace.Types.Events.Event[]): Lante
|
|
15
15
|
};
|
16
16
|
}
|
17
17
|
|
18
|
-
async function
|
18
|
+
async function runTraceProcessor(context: Mocha.Suite|Mocha.Context, trace: Lantern.Types.Trace) {
|
19
19
|
TraceLoader.TraceLoader.setTestTimeout(context);
|
20
20
|
|
21
21
|
const processor = Trace.Processor.TraceProcessor.createWithAllHandlers();
|
22
22
|
await processor.parse(trace.traceEvents as Trace.Types.Events.Event[], {isCPUProfile: false, isFreshRecording: true});
|
23
|
-
if (!processor.
|
23
|
+
if (!processor.data) {
|
24
24
|
throw new Error('No data');
|
25
25
|
}
|
26
|
-
return processor.
|
26
|
+
return processor.data;
|
27
27
|
}
|
28
28
|
|
29
29
|
async function getComputationDataFromFixture(context: Mocha.Suite|Mocha.Context, {trace, settings, url}: {
|
@@ -35,28 +35,28 @@ async function getComputationDataFromFixture(context: Mocha.Suite|Mocha.Context,
|
|
35
35
|
if (!settings.throttlingMethod) {
|
36
36
|
settings.throttlingMethod = 'simulate';
|
37
37
|
}
|
38
|
-
const
|
39
|
-
const requests = Trace.LanternComputationData.createNetworkRequests(trace,
|
38
|
+
const data = await runTraceProcessor(context, trace);
|
39
|
+
const requests = Trace.LanternComputationData.createNetworkRequests(trace, data);
|
40
40
|
const networkAnalysis = Lantern.Core.NetworkAnalyzer.analyze(requests);
|
41
41
|
if (!networkAnalysis) {
|
42
42
|
throw new Error('no networkAnalysis');
|
43
43
|
}
|
44
44
|
|
45
|
-
const frameId =
|
46
|
-
const navigationId =
|
45
|
+
const frameId = data.Meta.mainFrameId;
|
46
|
+
const navigationId = data.Meta.mainFrameNavigations[0].args.data?.navigationId;
|
47
47
|
if (!navigationId) {
|
48
48
|
throw new Error('no navigation id found');
|
49
49
|
}
|
50
50
|
|
51
51
|
return {
|
52
52
|
simulator: Lantern.Simulation.Simulator.createSimulator({...settings, networkAnalysis}),
|
53
|
-
graph: Trace.LanternComputationData.createGraph(requests, trace,
|
54
|
-
processedNavigation: Trace.LanternComputationData.createProcessedNavigation(
|
53
|
+
graph: Trace.LanternComputationData.createGraph(requests, trace, data, url),
|
54
|
+
processedNavigation: Trace.LanternComputationData.createProcessedNavigation(data, frameId, navigationId),
|
55
55
|
};
|
56
56
|
}
|
57
57
|
|
58
58
|
export {
|
59
59
|
getComputationDataFromFixture,
|
60
|
-
runTrace,
|
60
|
+
runTraceProcessor as runTrace,
|
61
61
|
toLanternTrace,
|
62
62
|
};
|
@@ -434,96 +434,96 @@ export class AXBreadcrumbsPane extends AccessibilitySubPane {
|
|
434
434
|
const elementsToAXBreadcrumb = new WeakMap<Element, AXBreadcrumb>();
|
435
435
|
|
436
436
|
export class AXBreadcrumb {
|
437
|
-
|
438
|
-
|
439
|
-
|
437
|
+
readonly #axNode: SDK.AccessibilityModel.AccessibilityNode;
|
438
|
+
readonly #element: HTMLDivElement;
|
439
|
+
#nodeElement: HTMLDivElement;
|
440
440
|
private readonly nodeWrapper: HTMLDivElement;
|
441
441
|
private readonly selectionElement: HTMLDivElement;
|
442
442
|
private readonly childrenGroupElement: HTMLDivElement;
|
443
443
|
private readonly children: AXBreadcrumb[];
|
444
444
|
private hovered: boolean;
|
445
|
-
|
445
|
+
#preselected: boolean;
|
446
446
|
private parent: AXBreadcrumb|null;
|
447
|
-
|
447
|
+
#inspected: boolean;
|
448
448
|
expandLoggable = {};
|
449
449
|
constructor(axNode: SDK.AccessibilityModel.AccessibilityNode, depth: number, inspected: boolean) {
|
450
|
-
this
|
450
|
+
this.#axNode = axNode;
|
451
451
|
|
452
|
-
this
|
453
|
-
this.
|
454
|
-
this.
|
452
|
+
this.#element = document.createElement('div');
|
453
|
+
this.#element.classList.add('ax-breadcrumb');
|
454
|
+
this.#element.setAttribute(
|
455
455
|
'jslog',
|
456
456
|
`${VisualLogging.treeItem().track({click: true, keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Enter'})}`);
|
457
|
-
elementsToAXBreadcrumb.set(this
|
457
|
+
elementsToAXBreadcrumb.set(this.#element, this);
|
458
458
|
|
459
|
-
this
|
460
|
-
this.
|
461
|
-
UI.ARIAUtils.markAsTreeitem(this
|
462
|
-
this.
|
463
|
-
this.
|
459
|
+
this.#nodeElement = document.createElement('div');
|
460
|
+
this.#nodeElement.classList.add('ax-node');
|
461
|
+
UI.ARIAUtils.markAsTreeitem(this.#nodeElement);
|
462
|
+
this.#nodeElement.tabIndex = -1;
|
463
|
+
this.#element.appendChild(this.#nodeElement);
|
464
464
|
this.nodeWrapper = document.createElement('div');
|
465
465
|
this.nodeWrapper.classList.add('wrapper');
|
466
|
-
this.
|
466
|
+
this.#nodeElement.appendChild(this.nodeWrapper);
|
467
467
|
|
468
468
|
this.selectionElement = document.createElement('div');
|
469
469
|
this.selectionElement.classList.add('selection');
|
470
470
|
this.selectionElement.classList.add('fill');
|
471
|
-
this.
|
471
|
+
this.#nodeElement.appendChild(this.selectionElement);
|
472
472
|
|
473
473
|
this.childrenGroupElement = document.createElement('div');
|
474
474
|
this.childrenGroupElement.classList.add('children');
|
475
475
|
UI.ARIAUtils.markAsGroup(this.childrenGroupElement);
|
476
|
-
this.
|
476
|
+
this.#element.appendChild(this.childrenGroupElement);
|
477
477
|
|
478
478
|
this.children = [];
|
479
479
|
this.hovered = false;
|
480
|
-
this
|
480
|
+
this.#preselected = false;
|
481
481
|
this.parent = null;
|
482
482
|
|
483
|
-
this
|
484
|
-
this.
|
483
|
+
this.#inspected = inspected;
|
484
|
+
this.#nodeElement.classList.toggle('inspected', inspected);
|
485
485
|
|
486
|
-
this.
|
486
|
+
this.#nodeElement.style.paddingLeft = (16 * depth + 4) + 'px';
|
487
487
|
|
488
|
-
if (this.
|
488
|
+
if (this.#axNode.ignored()) {
|
489
489
|
this.appendIgnoredNodeElement();
|
490
490
|
} else {
|
491
|
-
this.appendRoleElement(this.
|
492
|
-
const axNodeName = this.
|
491
|
+
this.appendRoleElement(this.#axNode.role());
|
492
|
+
const axNodeName = this.#axNode.name();
|
493
493
|
if (axNodeName?.value) {
|
494
494
|
this.nodeWrapper.createChild('span', 'separator').textContent = '\xA0';
|
495
495
|
this.appendNameElement(axNodeName.value as string);
|
496
496
|
}
|
497
497
|
}
|
498
498
|
|
499
|
-
if (!this.
|
500
|
-
this.
|
501
|
-
UI.ARIAUtils.setExpanded(this
|
499
|
+
if (!this.#axNode.ignored() && this.#axNode.hasOnlyUnloadedChildren()) {
|
500
|
+
this.#nodeElement.classList.add('children-unloaded');
|
501
|
+
UI.ARIAUtils.setExpanded(this.#nodeElement, false);
|
502
502
|
VisualLogging.registerLoggable(
|
503
|
-
this.expandLoggable, `${VisualLogging.expand()}`, this
|
503
|
+
this.expandLoggable, `${VisualLogging.expand()}`, this.#element, new DOMRect(0, 0, 16, 16));
|
504
504
|
}
|
505
505
|
|
506
|
-
if (!this.
|
507
|
-
this.
|
506
|
+
if (!this.#axNode.isDOMNode()) {
|
507
|
+
this.#nodeElement.classList.add('no-dom-node');
|
508
508
|
}
|
509
509
|
}
|
510
510
|
|
511
511
|
element(): HTMLElement {
|
512
|
-
return this
|
512
|
+
return this.#element;
|
513
513
|
}
|
514
514
|
|
515
515
|
nodeElement(): HTMLElement {
|
516
|
-
return this
|
516
|
+
return this.#nodeElement;
|
517
517
|
}
|
518
518
|
|
519
519
|
appendChild(breadcrumb: AXBreadcrumb): void {
|
520
520
|
this.children.push(breadcrumb);
|
521
521
|
breadcrumb.setParent(this);
|
522
|
-
this.
|
523
|
-
UI.ARIAUtils.setExpanded(this
|
522
|
+
this.#nodeElement.classList.add('parent');
|
523
|
+
UI.ARIAUtils.setExpanded(this.#nodeElement, true);
|
524
524
|
this.childrenGroupElement.appendChild(breadcrumb.element());
|
525
525
|
VisualLogging.registerLoggable(
|
526
|
-
this.expandLoggable, `${VisualLogging.expand()}`, this
|
526
|
+
this.expandLoggable, `${VisualLogging.expand()}`, this.#element, new DOMRect(0, 0, 16, 16));
|
527
527
|
}
|
528
528
|
|
529
529
|
hasExpandedChildren(): number {
|
@@ -535,26 +535,26 @@ export class AXBreadcrumb {
|
|
535
535
|
}
|
536
536
|
|
537
537
|
preselected(): boolean {
|
538
|
-
return this
|
538
|
+
return this.#preselected;
|
539
539
|
}
|
540
540
|
|
541
541
|
setPreselected(preselected: boolean, selectedByUser: boolean): void {
|
542
|
-
if (this
|
542
|
+
if (this.#preselected === preselected) {
|
543
543
|
return;
|
544
544
|
}
|
545
|
-
this
|
546
|
-
this.
|
545
|
+
this.#preselected = preselected;
|
546
|
+
this.#nodeElement.classList.toggle('preselected', preselected);
|
547
547
|
if (preselected) {
|
548
|
-
this.
|
548
|
+
this.#nodeElement.tabIndex = 0;
|
549
549
|
} else {
|
550
|
-
this.
|
550
|
+
this.#nodeElement.tabIndex = -1;
|
551
551
|
}
|
552
|
-
if (this
|
552
|
+
if (this.#preselected) {
|
553
553
|
if (selectedByUser) {
|
554
|
-
this.
|
554
|
+
this.#nodeElement.focus();
|
555
555
|
}
|
556
|
-
if (!this
|
557
|
-
this.
|
556
|
+
if (!this.#inspected) {
|
557
|
+
this.#axNode.highlightDOMNode();
|
558
558
|
} else {
|
559
559
|
SDK.OverlayModel.OverlayModel.hideDOMNodeHighlight();
|
560
560
|
}
|
@@ -566,23 +566,23 @@ export class AXBreadcrumb {
|
|
566
566
|
return;
|
567
567
|
}
|
568
568
|
this.hovered = hovered;
|
569
|
-
this.
|
569
|
+
this.#nodeElement.classList.toggle('hovered', hovered);
|
570
570
|
if (this.hovered) {
|
571
|
-
this.
|
572
|
-
this.
|
571
|
+
this.#nodeElement.classList.toggle('hovered', true);
|
572
|
+
this.#axNode.highlightDOMNode();
|
573
573
|
}
|
574
574
|
}
|
575
575
|
|
576
576
|
axNode(): SDK.AccessibilityModel.AccessibilityNode {
|
577
|
-
return this
|
577
|
+
return this.#axNode;
|
578
578
|
}
|
579
579
|
|
580
580
|
inspected(): boolean {
|
581
|
-
return this
|
581
|
+
return this.#inspected;
|
582
582
|
}
|
583
583
|
|
584
584
|
isDOMNode(): boolean {
|
585
|
-
return this.
|
585
|
+
return this.#axNode.isDOMNode();
|
586
586
|
}
|
587
587
|
|
588
588
|
nextBreadcrumb(): AXBreadcrumb|null {
|
@@ -16,8 +16,8 @@ import {SourceOrderPane} from './SourceOrderView.js';
|
|
16
16
|
let accessibilitySidebarViewInstance: AccessibilitySidebarView;
|
17
17
|
|
18
18
|
export class AccessibilitySidebarView extends UI.ThrottledWidget.ThrottledWidget {
|
19
|
-
|
20
|
-
|
19
|
+
#node: SDK.DOMModel.DOMNode|null;
|
20
|
+
#axNode: SDK.AccessibilityModel.AccessibilityNode|null;
|
21
21
|
private skipNextPullNode: boolean;
|
22
22
|
private readonly sidebarPaneStack: UI.View.ViewLocation;
|
23
23
|
private readonly breadcrumbsSubPane: AXBreadcrumbsPane;
|
@@ -27,8 +27,8 @@ export class AccessibilitySidebarView extends UI.ThrottledWidget.ThrottledWidget
|
|
27
27
|
private constructor(throttlingTimeout?: number) {
|
28
28
|
super(false /* useShadowDom */, throttlingTimeout);
|
29
29
|
this.element.classList.add('accessibility-sidebar-view');
|
30
|
-
this
|
31
|
-
this
|
30
|
+
this.#node = null;
|
31
|
+
this.#axNode = null;
|
32
32
|
this.skipNextPullNode = false;
|
33
33
|
this.sidebarPaneStack = UI.ViewManager.ViewManager.instance().createStackLocation();
|
34
34
|
this.breadcrumbsSubPane = new AXBreadcrumbsPane(this);
|
@@ -55,16 +55,16 @@ export class AccessibilitySidebarView extends UI.ThrottledWidget.ThrottledWidget
|
|
55
55
|
}
|
56
56
|
|
57
57
|
node(): SDK.DOMModel.DOMNode|null {
|
58
|
-
return this
|
58
|
+
return this.#node;
|
59
59
|
}
|
60
60
|
|
61
61
|
axNode(): SDK.AccessibilityModel.AccessibilityNode|null {
|
62
|
-
return this
|
62
|
+
return this.#axNode;
|
63
63
|
}
|
64
64
|
|
65
65
|
setNode(node: SDK.DOMModel.DOMNode|null, fromAXTree?: boolean): void {
|
66
66
|
this.skipNextPullNode = Boolean(fromAXTree);
|
67
|
-
this
|
67
|
+
this.#node = node;
|
68
68
|
this.update();
|
69
69
|
}
|
70
70
|
|
@@ -73,7 +73,7 @@ export class AccessibilitySidebarView extends UI.ThrottledWidget.ThrottledWidget
|
|
73
73
|
return;
|
74
74
|
}
|
75
75
|
|
76
|
-
this
|
76
|
+
this.#axNode = axNode;
|
77
77
|
|
78
78
|
if (axNode.isDOMNode()) {
|
79
79
|
void this.sidebarPaneStack.showView(this.ariaSubPane, this.axNodeSubPane);
|
@@ -234,7 +234,7 @@ export class AnimationTimeline extends UI.Widget.VBox implements
|
|
234
234
|
#selectedGroup!: SDK.AnimationModel.AnimationGroup|null;
|
235
235
|
#renderQueue!: AnimationUI[];
|
236
236
|
#defaultDuration: number;
|
237
|
-
#
|
237
|
+
#duration: number;
|
238
238
|
#timelineControlsWidth: number;
|
239
239
|
readonly #nodesMap: Map<number, NodeUI>;
|
240
240
|
#uiAnimations: AnimationUI[];
|
@@ -298,7 +298,7 @@ export class AnimationTimeline extends UI.Widget.VBox implements
|
|
298
298
|
noEffectSelectedPlaceholder.show(timelineHint);
|
299
299
|
|
300
300
|
/** @constant */ this.#defaultDuration = 100;
|
301
|
-
this.#
|
301
|
+
this.#duration = this.#defaultDuration;
|
302
302
|
this.#nodesMap = new Map();
|
303
303
|
this.#uiAnimations = [];
|
304
304
|
this.#groupBuffer = [];
|
@@ -593,11 +593,11 @@ export class AnimationTimeline extends UI.Widget.VBox implements
|
|
593
593
|
}
|
594
594
|
|
595
595
|
duration(): number {
|
596
|
-
return this.#
|
596
|
+
return this.#duration;
|
597
597
|
}
|
598
598
|
|
599
599
|
setDuration(duration: number): void {
|
600
|
-
this.#
|
600
|
+
this.#duration = duration;
|
601
601
|
this.scheduleRedraw();
|
602
602
|
}
|
603
603
|
|
@@ -613,7 +613,7 @@ export class AnimationTimeline extends UI.Widget.VBox implements
|
|
613
613
|
this.#nodesMap.clear();
|
614
614
|
this.#animationsMap.clear();
|
615
615
|
this.#animationsContainer.removeChildren();
|
616
|
-
this.#
|
616
|
+
this.#duration = this.#defaultDuration;
|
617
617
|
this.#timelineScrubber.classList.add('hidden');
|
618
618
|
this.#gridHeader.classList.remove('scrubber-enabled');
|
619
619
|
this.#selectedGroup = null;
|
@@ -39,7 +39,7 @@ interface CachedElement {
|
|
39
39
|
}
|
40
40
|
|
41
41
|
export class AnimationUI {
|
42
|
-
#
|
42
|
+
#animation: SDK.AnimationModel.AnimationImpl;
|
43
43
|
#timeline: AnimationTimeline;
|
44
44
|
#keyframes?: SDK.AnimationModel.KeyframeStyle[];
|
45
45
|
#nameElement: HTMLElement;
|
@@ -58,10 +58,10 @@ export class AnimationUI {
|
|
58
58
|
#downMouseX?: number;
|
59
59
|
|
60
60
|
constructor(animation: SDK.AnimationModel.AnimationImpl, timeline: AnimationTimeline, parentElement: Element) {
|
61
|
-
this.#
|
61
|
+
this.#animation = animation;
|
62
62
|
this.#timeline = timeline;
|
63
63
|
|
64
|
-
const keyframesRule = this.#
|
64
|
+
const keyframesRule = this.#animation.source().keyframesRule();
|
65
65
|
if (keyframesRule) {
|
66
66
|
this.#keyframes = keyframesRule.keyframes();
|
67
67
|
if (animation.viewOrScrollTimeline() && animation.playbackRate() < 0) {
|
@@ -69,7 +69,7 @@ export class AnimationUI {
|
|
69
69
|
}
|
70
70
|
}
|
71
71
|
this.#nameElement = parentElement.createChild('div', 'animation-name');
|
72
|
-
this.#nameElement.textContent = this.#
|
72
|
+
this.#nameElement.textContent = this.#animation.name();
|
73
73
|
|
74
74
|
this.#svg = UI.UIUtils.createSVGChild(parentElement, 'svg', 'animation-ui');
|
75
75
|
this.#svg.setAttribute('height', Options.AnimationSVGHeight.toString());
|
@@ -78,7 +78,7 @@ export class AnimationUI {
|
|
78
78
|
this.#activeIntervalGroup = UI.UIUtils.createSVGChild(this.#svg, 'g');
|
79
79
|
this.#activeIntervalGroup.setAttribute('jslog', `${VisualLogging.animationClip().track({drag: true})}`);
|
80
80
|
|
81
|
-
if (!this.#
|
81
|
+
if (!this.#animation.viewOrScrollTimeline()) {
|
82
82
|
UI.UIUtils.installDragHandle(
|
83
83
|
this.#activeIntervalGroup, this.mouseDown.bind(this, Events.ANIMATION_DRAG, null), this.mouseMove.bind(this),
|
84
84
|
this.mouseUp.bind(this), '-webkit-grabbing', '-webkit-grab');
|
@@ -90,7 +90,7 @@ export class AnimationUI {
|
|
90
90
|
|
91
91
|
this.#movementInMs = 0;
|
92
92
|
this.#keyboardMovementRateMs = 50;
|
93
|
-
this.#color = AnimationUI.colorForAnimation(this.#
|
93
|
+
this.#color = AnimationUI.colorForAnimation(this.#animation);
|
94
94
|
}
|
95
95
|
|
96
96
|
static colorForAnimation(animation: SDK.AnimationModel.AnimationImpl): string {
|
@@ -110,7 +110,7 @@ export class AnimationUI {
|
|
110
110
|
}
|
111
111
|
|
112
112
|
animation(): SDK.AnimationModel.AnimationImpl {
|
113
|
-
return this.#
|
113
|
+
return this.#animation;
|
114
114
|
}
|
115
115
|
|
116
116
|
get nameElement(): HTMLElement {
|
@@ -152,7 +152,7 @@ export class AnimationUI {
|
|
152
152
|
this.#delayLine = this.createLine(parentElement, 'animation-delay-line');
|
153
153
|
this.#endDelayLine = this.createLine(parentElement, 'animation-delay-line');
|
154
154
|
}
|
155
|
-
const fill = this.#
|
155
|
+
const fill = this.#animation.source().fill();
|
156
156
|
this.#delayLine.classList.toggle('animation-fill', fill === 'backwards' || fill === 'both');
|
157
157
|
const margin = Options.AnimationMargin;
|
158
158
|
this.#delayLine.setAttribute('x1', margin.toString());
|
@@ -162,15 +162,14 @@ export class AnimationUI {
|
|
162
162
|
this.#endDelayLine.classList.toggle('animation-fill', forwardsFill);
|
163
163
|
const leftMargin = Math.min(
|
164
164
|
this.#timeline.width(),
|
165
|
-
(this.delayOrStartTime() + this.duration() * this.#
|
165
|
+
(this.delayOrStartTime() + this.duration() * this.#animation.source().iterations()) *
|
166
166
|
this.#timeline.pixelTimeRatio());
|
167
167
|
(this.#endDelayLine as HTMLElement).style.transform = 'translateX(' + leftMargin.toFixed(2) + 'px)';
|
168
168
|
this.#endDelayLine.setAttribute('x1', margin.toString());
|
169
169
|
this.#endDelayLine.setAttribute(
|
170
170
|
'x2',
|
171
|
-
forwardsFill ?
|
172
|
-
|
173
|
-
(this.#animationInternal.source().endDelay() * this.#timeline.pixelTimeRatio() + margin).toFixed(2));
|
171
|
+
forwardsFill ? (this.#timeline.width() - leftMargin + margin).toFixed(2) :
|
172
|
+
(this.#animation.source().endDelay() * this.#timeline.pixelTimeRatio() + margin).toFixed(2));
|
174
173
|
}
|
175
174
|
|
176
175
|
private drawPoint(iteration: number, parentElement: Element, x: number, keyframeIndex: number, attachEvents: boolean):
|
@@ -242,7 +241,7 @@ export class AnimationUI {
|
|
242
241
|
}
|
243
242
|
const group = cache[keyframeIndex];
|
244
243
|
group.tabIndex = 0;
|
245
|
-
UI.ARIAUtils.setLabel(group, i18nString(UIStrings.sSlider, {PH1: this.#
|
244
|
+
UI.ARIAUtils.setLabel(group, i18nString(UIStrings.sSlider, {PH1: this.#animation.name()}));
|
246
245
|
group.style.transform = 'translateX(' + leftDistance.toFixed(2) + 'px)';
|
247
246
|
|
248
247
|
if (easing === 'linear') {
|
@@ -279,7 +278,7 @@ export class AnimationUI {
|
|
279
278
|
this.#nameElement.style.width = (this.duration() * this.#timeline.pixelTimeRatio()).toFixed(2) + 'px';
|
280
279
|
this.drawDelayLine((this.#svg as HTMLElement));
|
281
280
|
|
282
|
-
if (this.#
|
281
|
+
if (this.#animation.type() === 'CSSTransition') {
|
283
282
|
this.renderTransition();
|
284
283
|
return;
|
285
284
|
}
|
@@ -293,9 +292,9 @@ export class AnimationUI {
|
|
293
292
|
// Some iterations are getting rendered in an invisible area if the delay is negative.
|
294
293
|
const invisibleAreaWidth =
|
295
294
|
this.delayOrStartTime() < 0 ? -this.delayOrStartTime() * this.#timeline.pixelTimeRatio() : 0;
|
296
|
-
for (iteration = 1; iteration < this.#
|
295
|
+
for (iteration = 1; iteration < this.#animation.source().iterations() &&
|
297
296
|
iterationWidth * (iteration - 1) < invisibleAreaWidth + this.#timeline.width() &&
|
298
|
-
(iterationWidth > 0 || this.#
|
297
|
+
(iterationWidth > 0 || this.#animation.source().iterations() !== Infinity);
|
299
298
|
iteration++) {
|
300
299
|
this.renderIteration(this.#tailGroup, iteration);
|
301
300
|
}
|
@@ -315,7 +314,7 @@ export class AnimationUI {
|
|
315
314
|
this.drawAnimationLine(0, activeIntervalGroup);
|
316
315
|
this.renderKeyframe(
|
317
316
|
0, 0, activeIntervalGroup, Options.AnimationMargin, this.duration() * this.#timeline.pixelTimeRatio(),
|
318
|
-
this.#
|
317
|
+
this.#animation.source().easing());
|
319
318
|
this.drawPoint(0, activeIntervalGroup, Options.AnimationMargin, 0, true);
|
320
319
|
this.drawPoint(
|
321
320
|
0, activeIntervalGroup, this.duration() * this.#timeline.pixelTimeRatio() + Options.AnimationMargin, -1, true);
|
@@ -355,7 +354,7 @@ export class AnimationUI {
|
|
355
354
|
}
|
356
355
|
|
357
356
|
private delayOrStartTime(): number {
|
358
|
-
let delay = this.#
|
357
|
+
let delay = this.#animation.delayOrStartTime();
|
359
358
|
if (this.#mouseEventType === Events.ANIMATION_DRAG || this.#mouseEventType === Events.START_ENDPOINT_MOVE) {
|
360
359
|
delay += this.#movementInMs;
|
361
360
|
}
|
@@ -363,7 +362,7 @@ export class AnimationUI {
|
|
363
362
|
}
|
364
363
|
|
365
364
|
private duration(): number {
|
366
|
-
let duration = this.#
|
365
|
+
let duration = this.#animation.iterationDuration();
|
367
366
|
if (this.#mouseEventType === Events.FINISH_ENDPOINT_MOVE) {
|
368
367
|
duration += this.#movementInMs;
|
369
368
|
} else if (this.#mouseEventType === Events.START_ENDPOINT_MOVE) {
|
@@ -380,7 +379,7 @@ export class AnimationUI {
|
|
380
379
|
let offset = this.#keyframes[i].offsetAsNumber();
|
381
380
|
if (this.#mouseEventType === Events.KEYFRAME_MOVE && i === this.#keyframeMoved) {
|
382
381
|
console.assert(i > 0 && i < this.#keyframes.length - 1, 'First and last keyframe cannot be moved');
|
383
|
-
offset += this.#movementInMs / this.#
|
382
|
+
offset += this.#movementInMs / this.#animation.iterationDuration();
|
384
383
|
offset = Math.max(offset, this.#keyframes[i - 1].offsetAsNumber());
|
385
384
|
offset = Math.min(offset, this.#keyframes[i + 1].offsetAsNumber());
|
386
385
|
}
|
@@ -436,7 +435,7 @@ export class AnimationUI {
|
|
436
435
|
this.#keyframes[this.#keyframeMoved].setOffset(this.offset(this.#keyframeMoved));
|
437
436
|
}
|
438
437
|
} else {
|
439
|
-
this.#
|
438
|
+
this.#animation.setTiming(this.duration(), this.delayOrStartTime());
|
440
439
|
}
|
441
440
|
|
442
441
|
this.#movementInMs = 0;
|
@@ -468,7 +467,7 @@ export class AnimationUI {
|
|
468
467
|
this.#keyframes[this.#keyframeMoved].setOffset(this.offset(this.#keyframeMoved));
|
469
468
|
}
|
470
469
|
} else {
|
471
|
-
this.#
|
470
|
+
this.#animation.setTiming(this.duration(), this.delayOrStartTime());
|
472
471
|
}
|
473
472
|
this.setMovementAndRedraw(0);
|
474
473
|
|
@@ -488,7 +487,7 @@ export class AnimationUI {
|
|
488
487
|
void contextMenu.show();
|
489
488
|
}
|
490
489
|
|
491
|
-
void this.#
|
490
|
+
void this.#animation.remoteObjectPromise().then(showContextMenu);
|
492
491
|
event.consume(true);
|
493
492
|
}
|
494
493
|
}
|