chrome-devtools-frontend 1.0.1376716 → 1.0.1380117
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/config/gni/devtools_grd_files.gni +15 -7
- package/config/gni/devtools_image_files.gni +2 -0
- package/front_end/Images/src/animation.svg +3 -0
- package/front_end/Images/src/brush-2.svg +3 -0
- package/front_end/core/common/SettingRegistration.ts +1 -1
- package/front_end/core/host/AidaClient.ts +1 -0
- package/front_end/core/host/InspectorFrontendHost.ts +4 -0
- package/front_end/core/i18n/ByteUtilities.test.ts +34 -0
- package/front_end/core/i18n/ByteUtilities.ts +65 -0
- package/front_end/core/i18n/NumberFormatter.ts +75 -0
- package/front_end/core/i18n/i18n.ts +4 -0
- package/front_end/core/i18n/time-utilities.test.ts +20 -2
- package/front_end/core/i18n/time-utilities.ts +125 -86
- package/front_end/core/platform/NumberUtilities.test.ts +3 -26
- package/front_end/core/platform/NumberUtilities.ts +0 -20
- package/front_end/core/root/Runtime.ts +6 -3
- package/front_end/core/sdk/CPUThrottlingManager.ts +4 -0
- package/front_end/core/sdk/CSSContainerQuery.test.ts +10 -16
- package/front_end/core/sdk/CSSContainerQuery.ts +3 -15
- package/front_end/core/sdk/CSSMatchedStyles.test.ts +4 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +5 -5
- package/front_end/core/sdk/CSSModel.ts +18 -0
- package/front_end/core/sdk/CSSPropertyParser.test.ts +16 -1
- package/front_end/core/sdk/CSSPropertyParser.ts +2 -2
- package/front_end/core/sdk/sdk-meta.ts +8 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +3 -3
- package/front_end/generated/ARIAProperties.js +4 -0
- package/front_end/generated/InspectorBackendCommands.js +8 -6
- package/front_end/generated/SupportedCSSProperties.js +17 -4
- package/front_end/generated/protocol-mapping.d.ts +15 -1
- package/front_end/generated/protocol-proxy-api.d.ts +14 -1
- package/front_end/generated/protocol.ts +26 -2
- package/front_end/models/extensions/ExtensionAPI.ts +9 -1
- package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +8 -21
- package/front_end/models/live-metrics/web-vitals-injected/{rollup.config.js → rollup.config.mjs} +1 -1
- package/front_end/models/persistence/EditFileSystemView.ts +19 -9
- package/front_end/models/persistence/WorkspaceSettingsTab.ts +50 -54
- package/front_end/models/persistence/editFileSystemView.css +35 -15
- package/front_end/models/persistence/workspaceSettingsTab.css +21 -87
- package/front_end/models/timeline_model/timeline_model.ts +0 -6
- package/front_end/models/trace/Processor.test.ts +18 -17
- package/front_end/models/trace/Processor.ts +10 -14
- package/front_end/models/trace/README.md +0 -1
- package/front_end/models/{timeline_model → trace/extras}/TimelineJSProfile.ts +19 -29
- package/front_end/models/{timeline_model/TimelineModelFilter.test.ts → trace/extras/TraceFilter.test.ts} +15 -17
- package/front_end/models/trace/extras/TraceFilter.ts +62 -0
- package/front_end/models/{timeline_model/TimelineProfileTree.test.ts → trace/extras/TraceTree.test.ts} +44 -43
- package/front_end/models/{timeline_model/TimelineProfileTree.ts → trace/extras/TraceTree.ts} +65 -59
- package/front_end/models/trace/extras/extras.ts +3 -0
- package/front_end/models/trace/handlers/AnimationHandler.ts +0 -8
- package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +1 -11
- package/front_end/models/trace/handlers/FramesHandler.test.ts +1 -6
- package/front_end/models/trace/handlers/FramesHandler.ts +1 -14
- package/front_end/models/trace/handlers/GPUHandler.test.ts +0 -2
- package/front_end/models/trace/handlers/GPUHandler.ts +1 -25
- package/front_end/models/trace/handlers/ImagePaintingHandler.ts +3 -0
- package/front_end/models/trace/handlers/InitiatorsHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/InitiatorsHandler.ts +0 -20
- package/front_end/models/trace/handlers/InvalidationsHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/InvalidationsHandler.ts +0 -18
- package/front_end/models/trace/handlers/LargestImagePaintHandler.test.ts +2 -2
- package/front_end/models/trace/handlers/LargestImagePaintHandler.ts +63 -3
- package/front_end/models/trace/handlers/LargestTextPaintHandler.ts +3 -0
- package/front_end/models/trace/handlers/LayerTreeHandler.test.ts +0 -2
- package/front_end/models/trace/handlers/LayerTreeHandler.ts +1 -18
- package/front_end/models/trace/handlers/LayoutShiftsHandler.test.ts +0 -3
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +1 -20
- package/front_end/models/trace/handlers/MemoryHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/MemoryHandler.ts +3 -0
- package/front_end/models/trace/handlers/MetaHandler.test.ts +1 -32
- package/front_end/models/trace/handlers/MetaHandler.ts +2 -30
- package/front_end/models/trace/handlers/NetworkRequestsHandler.test.ts +0 -26
- package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +4 -23
- package/front_end/models/trace/handlers/PageFramesHandler.ts +3 -0
- package/front_end/models/trace/handlers/RendererHandler.test.ts +0 -4
- package/front_end/models/trace/handlers/RendererHandler.ts +1 -24
- package/front_end/models/trace/handlers/SamplesHandler.test.ts +0 -5
- package/front_end/models/trace/handlers/SamplesHandler.ts +0 -26
- package/front_end/models/trace/handlers/ScreenshotsHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/SelectorStatsHandler.ts +3 -0
- package/front_end/models/trace/handlers/ServerTimingsHandler.ts +1 -16
- package/front_end/models/trace/handlers/Threads.test.ts +1 -2
- package/front_end/models/trace/handlers/UserInteractionsHandler.test.ts +4 -27
- package/front_end/models/trace/handlers/UserInteractionsHandler.ts +16 -25
- package/front_end/models/trace/handlers/UserTimingsHandler.ts +0 -17
- package/front_end/models/trace/handlers/WorkersHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/WorkersHandler.ts +0 -23
- package/front_end/models/trace/handlers/types.ts +1 -8
- package/front_end/models/trace/insights/{CumulativeLayoutShift.test.ts → CLSCulprits.test.ts} +21 -21
- package/front_end/models/trace/insights/{CumulativeLayoutShift.ts → CLSCulprits.ts} +24 -5
- package/front_end/models/trace/insights/Common.ts +5 -55
- package/front_end/models/trace/insights/DocumentLatency.test.ts +2 -2
- package/front_end/models/trace/insights/DocumentLatency.ts +26 -6
- package/front_end/models/trace/insights/FontDisplay.ts +24 -5
- package/front_end/models/trace/insights/InteractionToNextPaint.test.ts +1 -1
- package/front_end/models/trace/insights/InteractionToNextPaint.ts +26 -6
- package/front_end/models/trace/insights/LCPDiscovery.test.ts +58 -0
- package/front_end/models/trace/insights/LCPDiscovery.ts +101 -0
- package/front_end/models/trace/insights/{LargestContentfulPaint.test.ts → LCPPhases.test.ts} +6 -28
- package/front_end/models/trace/insights/{LargestContentfulPaint.ts → LCPPhases.ts} +37 -38
- package/front_end/models/trace/insights/{InsightRunners.ts → Models.ts} +4 -3
- package/front_end/models/trace/insights/RenderBlocking.test.ts +1 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +33 -28
- package/front_end/models/trace/insights/SlowCSSSelector.ts +26 -5
- package/front_end/models/trace/insights/{ThirdPartyWeb.test.ts → ThirdParties.test.ts} +3 -3
- package/front_end/models/trace/insights/{ThirdPartyWeb.ts → ThirdParties.ts} +24 -5
- package/front_end/models/trace/insights/Viewport.test.ts +1 -1
- package/front_end/models/trace/insights/Viewport.ts +27 -9
- package/front_end/models/trace/insights/insights.ts +1 -1
- package/front_end/models/trace/insights/types.ts +11 -9
- package/front_end/models/trace/types/TraceEvents.ts +51 -22
- package/front_end/panels/application/SharedStorageItemsView.test.ts +3 -3
- package/front_end/panels/application/SharedStorageItemsView.ts +5 -3
- package/front_end/panels/application/StorageView.ts +3 -3
- package/front_end/panels/application/components/StorageMetadataView.ts +1 -2
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +34 -31
- package/front_end/panels/coverage/CoverageView.ts +3 -3
- package/front_end/panels/elements/ComputedStyleModel.ts +9 -2
- package/front_end/panels/elements/ComputedStyleWidget.test.ts +72 -0
- package/front_end/panels/elements/ComputedStyleWidget.ts +12 -0
- package/front_end/panels/elements/ElementStatePaneWidget.test.ts +84 -30
- package/front_end/panels/elements/ElementStatePaneWidget.ts +42 -24
- package/front_end/panels/elements/ElementsTreeElement.ts +24 -11
- package/front_end/panels/elements/MetricsSidebarPane.ts +12 -7
- package/front_end/panels/elements/PropertyMatchers.ts +3 -0
- package/front_end/panels/elements/StylePropertiesSection.ts +15 -6
- package/front_end/panels/elements/StylePropertyTreeElement.test.ts +3 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -3
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +2 -2
- package/front_end/panels/explain/components/ConsoleInsight.ts +8 -18
- package/front_end/panels/freestyler/AiAgent.test.ts +58 -1
- package/front_end/panels/freestyler/AiAgent.ts +58 -3
- package/front_end/panels/freestyler/DrJonesFileAgent.test.ts +99 -23
- package/front_end/panels/freestyler/DrJonesFileAgent.ts +53 -20
- package/front_end/panels/freestyler/DrJonesNetworkAgent.test.ts +15 -7
- package/front_end/panels/freestyler/DrJonesNetworkAgent.ts +36 -15
- package/front_end/panels/freestyler/DrJonesPerformanceAgent.test.ts +6 -6
- package/front_end/panels/freestyler/DrJonesPerformanceAgent.ts +48 -8
- package/front_end/panels/freestyler/FreestylerAgent.test.ts +15 -14
- package/front_end/panels/freestyler/FreestylerAgent.ts +52 -8
- package/front_end/panels/freestyler/FreestylerPanel.test.ts +539 -39
- package/front_end/panels/freestyler/FreestylerPanel.ts +349 -215
- package/front_end/panels/freestyler/components/FreestylerChatUi.test.ts +126 -34
- package/front_end/panels/freestyler/components/FreestylerChatUi.ts +320 -268
- package/front_end/panels/freestyler/components/UserActionRow.ts +156 -47
- package/front_end/panels/freestyler/components/freestylerChatUi.css +69 -34
- package/front_end/panels/freestyler/components/userActionRow.css +40 -67
- package/front_end/panels/freestyler/freestyler-meta.ts +3 -11
- package/front_end/panels/issues/components/HideIssuesMenu.ts +2 -11
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +1 -2
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +5 -5
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +46 -0
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +26 -17
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +25 -19
- package/front_end/panels/network/BinaryResourceView.ts +6 -7
- package/front_end/panels/network/EventSourceMessagesView.ts +1 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +3 -3
- package/front_end/panels/network/NetworkLogView.ts +7 -8
- package/front_end/panels/network/RequestTimingView.test.ts +35 -1
- package/front_end/panels/network/RequestTimingView.ts +96 -0
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +2 -2
- package/front_end/panels/network/networkTimingTable.css +2 -1
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
- package/front_end/panels/profiler/HeapProfileView.ts +3 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +2 -2
- package/front_end/panels/profiler/HeapTimelineOverview.ts +12 -12
- package/front_end/panels/profiler/IsolateSelector.ts +3 -4
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +1 -1
- package/front_end/panels/profiler/ProfileSidebarTreeElement.ts +7 -6
- package/front_end/panels/profiler/ProfileView.ts +1 -1
- package/front_end/panels/recorder/components/RecordingView.ts +2 -2
- package/front_end/panels/recorder/injected/{rollup.config.js → rollup.config.mjs} +1 -1
- package/front_end/panels/recorder/recorderController.css +0 -4
- package/front_end/panels/security/CookieReportTreeElement.ts +1 -9
- package/front_end/panels/security/CookieReportView.ts +120 -0
- package/front_end/panels/security/SecurityPanel.ts +8 -2
- package/front_end/panels/security/cookieReportView.css +46 -0
- package/front_end/panels/security/sidebar.css +1 -2
- package/front_end/panels/sensors/LocationsSettingsTab.ts +26 -11
- package/front_end/panels/sensors/locationsSettingsTab.css +18 -18
- package/front_end/panels/settings/AISettingsTab.ts +6 -15
- package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +61 -56
- package/front_end/panels/settings/aiSettingsTab.css +3 -14
- package/front_end/panels/settings/components/SyncSection.ts +1 -2
- package/front_end/panels/settings/components/syncSection.css +0 -10
- package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +3 -1
- package/front_end/panels/settings/keybindsSettingsTab.css +7 -10
- package/front_end/panels/settings/settingsScreen.css +27 -125
- package/front_end/panels/sources/DebuggerPlugin.ts +9 -4
- package/front_end/panels/sources/NavigatorView.ts +11 -13
- package/front_end/panels/timeline/ActiveFilters.ts +3 -4
- package/front_end/panels/timeline/AnimationsTrackAppender.ts +1 -2
- package/front_end/panels/timeline/CountersGraph.ts +2 -4
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +7 -8
- package/front_end/panels/timeline/README.md +2 -1
- package/front_end/panels/timeline/TimelineController.ts +14 -4
- package/front_end/panels/timeline/TimelineEventOverview.ts +3 -4
- package/front_end/panels/timeline/TimelineFilters.ts +3 -4
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.test.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -10
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -2
- package/front_end/panels/timeline/TimelineFlameChartView.ts +21 -12
- package/front_end/panels/timeline/TimelineLoader.test.ts +1 -2
- package/front_end/panels/timeline/TimelineLoader.ts +3 -4
- package/front_end/panels/timeline/TimelineMiniMap.ts +10 -0
- package/front_end/panels/timeline/TimelinePanel.ts +20 -8
- package/front_end/panels/timeline/TimelineTreeView.test.ts +12 -13
- package/front_end/panels/timeline/TimelineTreeView.ts +35 -40
- package/front_end/panels/timeline/TimelineUIUtils.test.ts +2 -2
- package/front_end/panels/timeline/TimelineUIUtils.ts +12 -14
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +6 -7
- package/front_end/panels/timeline/components/LiveMetricsView.test.ts +3 -3
- package/front_end/panels/timeline/components/LiveMetricsView.ts +14 -26
- package/front_end/panels/timeline/components/MetricCard.test.ts +1 -1
- package/front_end/panels/timeline/components/MetricCard.ts +46 -0
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +3 -4
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.test.ts +2 -0
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +41 -36
- package/front_end/panels/timeline/components/insights/CLSCulprits.ts +19 -33
- package/front_end/panels/timeline/components/insights/DocumentLatency.ts +29 -40
- package/front_end/panels/timeline/components/insights/FontDisplay.ts +17 -23
- package/front_end/panels/timeline/components/insights/Helpers.ts +12 -16
- package/front_end/panels/timeline/components/insights/InteractionToNextPaint.ts +14 -26
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +25 -37
- package/front_end/panels/timeline/components/insights/LCPPhases.ts +20 -47
- package/front_end/panels/timeline/components/insights/RenderBlocking.ts +19 -28
- package/front_end/panels/timeline/components/insights/SidebarInsight.ts +1 -2
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +18 -31
- package/front_end/panels/timeline/components/insights/Table.ts +5 -3
- package/front_end/panels/timeline/components/insights/ThirdParties.ts +18 -25
- package/front_end/panels/timeline/components/insights/Viewport.ts +14 -25
- package/front_end/panels/timeline/components/liveMetricsView.css +5 -13
- package/front_end/panels/timeline/components/metricCard.css +11 -0
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -1
- package/front_end/panels/timeline/overlays/OverlaysImpl.test.ts +5 -5
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +13 -12
- package/front_end/panels/timeline/timelineFlameChartView.css +1 -1
- package/front_end/panels/timeline/utils/AICallTree.test.ts +105 -0
- package/front_end/panels/timeline/utils/AICallTree.ts +25 -24
- package/front_end/testing/EnvironmentHelpers.ts +5 -18
- package/front_end/testing/InsightHelpers.ts +4 -4
- package/front_end/testing/TraceHelpers.ts +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +2 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts +14 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js +16 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.d.ts +34 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.js +51 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.js +10 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.d.ts +14 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.js +57 -23
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.js +13 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.d.ts +15 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.js +55 -26
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts +0 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js +2 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js +9 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.js +0 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.d.ts +14 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.js +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +51 -10
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +215 -97
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +2 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts +14 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js +16 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts +34 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.js +51 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.js +10 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.d.ts +14 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.js +57 -23
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.js +13 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.d.ts +15 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.js +55 -26
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts +0 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js +1 -9
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.js +0 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.d.ts +14 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.js +15 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +51 -10
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +2 -3
- package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +21 -3
- package/front_end/third_party/puppeteer/package/src/api/Input.ts +57 -8
- package/front_end/third_party/puppeteer/package/src/bidi/ElementHandle.ts +9 -7
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Input.ts +72 -31
- package/front_end/third_party/puppeteer/package/src/cdp/ElementHandle.ts +14 -9
- package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +71 -26
- package/front_end/third_party/puppeteer/package/src/common/CallbackRegistry.ts +1 -15
- package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +8 -1
- package/front_end/third_party/puppeteer/package/src/common/Errors.ts +7 -0
- package/front_end/third_party/puppeteer/package/src/common/WaitTask.ts +9 -9
- package/front_end/third_party/puppeteer/package/src/environment.ts +1 -4
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/incremental-id-generator.ts +20 -0
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +1 -0
- package/front_end/ui/components/buttons/Button.test.ts +14 -0
- package/front_end/ui/components/buttons/Button.ts +27 -4
- package/front_end/ui/components/cards/card.css +7 -4
- package/front_end/ui/components/dialogs/Dialog.ts +2 -4
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +15 -13
- package/front_end/ui/components/dialogs/dialog.css +2 -6
- package/front_end/ui/components/dialogs/shortcutDialog.css +33 -41
- package/front_end/ui/components/docs/freestyler/basic.ts +6 -8
- package/front_end/ui/components/docs/freestyler/empty_state.ts +6 -8
- package/front_end/ui/components/docs/performance_panel/track_example.html +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.test.ts +39 -17
- package/front_end/ui/components/markdown_view/MarkdownView.ts +77 -14
- package/front_end/ui/components/markdown_view/markdownView.css +15 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +3 -2
- package/front_end/ui/legacy/ContextMenu.ts +2 -2
- package/front_end/ui/legacy/InplaceEditor.ts +18 -14
- package/front_end/ui/legacy/TabbedPane.ts +0 -14
- package/front_end/ui/legacy/UIUtils.ts +0 -7
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +7 -2
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +8 -4
- package/front_end/ui/legacy/components/data_grid/ViewportDataGrid.ts +20 -11
- package/front_end/ui/legacy/components/inline_editor/LinkSwatch.test.ts +19 -0
- package/front_end/ui/legacy/components/inline_editor/LinkSwatch.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +5 -22
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +129 -100
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +4 -2
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewCalculator.test.ts +9 -4
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewCalculator.ts +6 -6
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +22 -4
- package/front_end/ui/legacy/components/perf_ui/flameChart.css +0 -2
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.test.ts +49 -0
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +23 -46
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -1
- package/front_end/ui/legacy/components/utils/ImagePreview.ts +1 -1
- package/front_end/ui/legacy/textPrompt.css +1 -1
- package/front_end/ui/legacy/toolbar.css +4 -5
- package/front_end/ui/visual_logging/KnownContextValues.ts +174 -0
- package/front_end/ui/visual_logging/LoggingConfig.ts +6 -2
- package/package.json +7 -6
- package/scripts/build/ninja/bundle.gni +3 -3
- package/scripts/build/{rollup.config.js → rollup.config.mjs} +4 -4
- package/scripts/devtools_paths.py +8 -4
- package/scripts/eslint_rules/tests/check_test_definitions_test.js +8 -3
- package/scripts/tools/update_goldens_v2.py +1 -1
- package/front_end/models/timeline_model/TimelineModelFilter.ts +0 -61
- /package/front_end/Images/{rollup.config.js → rollup.config.mjs} +0 -0
@@ -2,9 +2,11 @@
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
|
+
import * as Host from '../../../core/host/host.js';
|
5
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
6
7
|
import * as Platform from '../../../core/platform/platform.js';
|
7
8
|
import * as CrUXManager from '../../../models/crux-manager/crux-manager.js';
|
9
|
+
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
8
10
|
import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
|
9
11
|
import * as LitHtml from '../../../ui/lit-html/lit-html.js';
|
10
12
|
|
@@ -121,6 +123,20 @@ const UIStrings = {
|
|
121
123
|
* @description Column header for table cell values representing a phase duration (in milliseconds) that was measured in the developers local environment.
|
122
124
|
*/
|
123
125
|
duration: 'Local duration (ms)',
|
126
|
+
/**
|
127
|
+
* @description Tooltip text for a link that goes to documentation explaining the Largest Contentful Paint (LCP) metric. "LCP" is an acronym and should not be translated.
|
128
|
+
*/
|
129
|
+
lcpHelpTooltip:
|
130
|
+
'LCP reports the render time of the largest image, text block, or video visible in the viewport. Click here to learn more about LCP.',
|
131
|
+
/**
|
132
|
+
* @description Tooltip text for a link that goes to documentation explaining the Cumulative Layout Shift (CLS) metric. "CLS" is an acronym and should not be translated.
|
133
|
+
*/
|
134
|
+
clsHelpTooltip: 'CLS measures the amount of unexpected shifted content. Click here to learn more about CLS.',
|
135
|
+
/**
|
136
|
+
* @description Tooltip text for a link that goes to documentation explaining the Interaction to Next Paint (INP) metric. "INP" is an acronym and should not be translated.
|
137
|
+
*/
|
138
|
+
inpHelpTooltip:
|
139
|
+
'INP measures the overall responsiveness to all click, tap, and keyboard interactions. Click here to learn more about INP.',
|
124
140
|
};
|
125
141
|
|
126
142
|
const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/MetricCard.ts', UIStrings);
|
@@ -291,6 +307,28 @@ export class MetricCard extends HTMLElement {
|
|
291
307
|
}
|
292
308
|
}
|
293
309
|
|
310
|
+
#getHelpLink(): Platform.DevToolsPath.UrlString {
|
311
|
+
switch (this.#data.metric) {
|
312
|
+
case 'LCP':
|
313
|
+
return 'https://web.dev/articles/lcp' as Platform.DevToolsPath.UrlString;
|
314
|
+
case 'CLS':
|
315
|
+
return 'https://web.dev/articles/cls' as Platform.DevToolsPath.UrlString;
|
316
|
+
case 'INP':
|
317
|
+
return 'https://web.dev/articles/inp' as Platform.DevToolsPath.UrlString;
|
318
|
+
}
|
319
|
+
}
|
320
|
+
|
321
|
+
#getHelpTooltip(): string {
|
322
|
+
switch (this.#data.metric) {
|
323
|
+
case 'LCP':
|
324
|
+
return i18nString(UIStrings.lcpHelpTooltip);
|
325
|
+
case 'CLS':
|
326
|
+
return i18nString(UIStrings.clsHelpTooltip);
|
327
|
+
case 'INP':
|
328
|
+
return i18nString(UIStrings.inpHelpTooltip);
|
329
|
+
}
|
330
|
+
}
|
331
|
+
|
294
332
|
#getLocalValue(): number|undefined {
|
295
333
|
const {localValue} = this.#data;
|
296
334
|
if (localValue === undefined) {
|
@@ -579,12 +617,20 @@ export class MetricCard extends HTMLElement {
|
|
579
617
|
|
580
618
|
#render = (): void => {
|
581
619
|
const fieldEnabled = CrUXManager.CrUXManager.instance().getConfigSetting().get().enabled;
|
620
|
+
const helpLink = this.#getHelpLink();
|
582
621
|
|
583
622
|
// clang-format off
|
584
623
|
const output = html`
|
585
624
|
<div class="metric-card">
|
586
625
|
<h3 class="title">
|
587
626
|
${this.#getTitle()}
|
627
|
+
<devtools-button
|
628
|
+
class="title-help"
|
629
|
+
title=${this.#getHelpTooltip()}
|
630
|
+
.iconName=${'help'}
|
631
|
+
.variant=${Buttons.Button.Variant.ICON}
|
632
|
+
@click=${() => Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(helpLink)}
|
633
|
+
></devtools-button>
|
588
634
|
</h3>
|
589
635
|
<div tabindex="0" class="metric-values-section"
|
590
636
|
@mouseenter=${() => this.#showTooltip(500)}
|
@@ -5,7 +5,7 @@
|
|
5
5
|
import '../../../ui/components/request_link_icon/request_link_icon.js';
|
6
6
|
|
7
7
|
import * as i18n from '../../../core/i18n/i18n.js';
|
8
|
-
import * as Platform from '../../../core/platform/platform.js';
|
8
|
+
import type * as Platform from '../../../core/platform/platform.js';
|
9
9
|
import type * as SDK from '../../../core/sdk/sdk.js';
|
10
10
|
import * as Helpers from '../../../models/trace/helpers/helpers.js';
|
11
11
|
import * as Trace from '../../../models/trace/trace.js';
|
@@ -223,8 +223,7 @@ export class NetworkRequestDetails extends HTMLElement {
|
|
223
223
|
lengthText += i18nString(UIStrings.FromServiceWorker);
|
224
224
|
}
|
225
225
|
if (this.#networkRequest.args.data.encodedDataLength || !lengthText) {
|
226
|
-
lengthText =
|
227
|
-
`${Platform.NumberUtilities.bytesToString(this.#networkRequest.args.data.encodedDataLength)}${lengthText}`;
|
226
|
+
lengthText = `${i18n.ByteUtilities.bytesToString(this.#networkRequest.args.data.encodedDataLength)}${lengthText}`;
|
228
227
|
}
|
229
228
|
return this.#renderRow(i18nString(UIStrings.encodedData), lengthText);
|
230
229
|
}
|
@@ -325,7 +324,7 @@ export class NetworkRequestDetails extends HTMLElement {
|
|
325
324
|
${this.#renderRow(i18nString(UIStrings.priority), NetworkRequestTooltip.renderPriorityValue(this.#networkRequest))}
|
326
325
|
${this.#renderRow(i18nString(UIStrings.mimeType), networkData.mimeType)}
|
327
326
|
${this.#renderEncodedDataLength()}
|
328
|
-
${this.#renderRow(i18nString(UIStrings.decodedBody),
|
327
|
+
${this.#renderRow(i18nString(UIStrings.decodedBody), i18n.ByteUtilities.bytesToString(this.#networkRequest.args.data.decodedBodyLength))}
|
329
328
|
${this.#renderBlockingRow()}
|
330
329
|
${this.#renderFromCache()}
|
331
330
|
</div>
|
@@ -96,6 +96,7 @@ describeWithEnvironment('SidebarSingleInsightSet', () => {
|
|
96
96
|
// Does not include "font display", which is experimental.
|
97
97
|
assert.deepEqual(userVisibleTitles, [
|
98
98
|
'LCP by phase',
|
99
|
+
'LCP request discovery',
|
99
100
|
'Layout shift culprits',
|
100
101
|
'Third parties',
|
101
102
|
]);
|
@@ -124,6 +125,7 @@ describeWithEnvironment('SidebarSingleInsightSet', () => {
|
|
124
125
|
// Does not include "font display", which is experimental.
|
125
126
|
assert.deepEqual(userVisibleTitles, [
|
126
127
|
'LCP by phase',
|
128
|
+
'LCP request discovery',
|
127
129
|
'Layout shift culprits',
|
128
130
|
'Font display',
|
129
131
|
'Third parties',
|
@@ -40,27 +40,27 @@ export interface SidebarSingleInsightSetData {
|
|
40
40
|
* "enable experimental performance insights" experiment. This is used to enable
|
41
41
|
* us to ship incrementally without turning insights on by default for all
|
42
42
|
* users. */
|
43
|
-
const EXPERIMENTAL_INSIGHTS: ReadonlySet<
|
44
|
-
|
43
|
+
const EXPERIMENTAL_INSIGHTS: ReadonlySet<string> = new Set([
|
44
|
+
'FontDisplay',
|
45
45
|
]);
|
46
46
|
|
47
47
|
/**
|
48
48
|
* Every insight (INCLUDING experimental ones)
|
49
|
-
* The order of
|
49
|
+
* The order of these properties is the order the insights will be shown in the sidebar.
|
50
50
|
* TODO(crbug.com/368135130): sort this in a smart way!
|
51
51
|
*/
|
52
|
-
const
|
53
|
-
Insights.InteractionToNextPaint.InteractionToNextPaint,
|
54
|
-
Insights.LCPPhases.LCPPhases,
|
55
|
-
Insights.LCPDiscovery.LCPDiscovery,
|
56
|
-
Insights.CLSCulprits.CLSCulprits,
|
57
|
-
Insights.RenderBlocking.
|
58
|
-
Insights.DocumentLatency.DocumentLatency,
|
59
|
-
Insights.FontDisplay.FontDisplay,
|
60
|
-
Insights.Viewport.Viewport,
|
61
|
-
Insights.ThirdParties.ThirdParties,
|
62
|
-
Insights.SlowCSSSelector.SlowCSSSelector,
|
63
|
-
|
52
|
+
const INSIGHT_NAME_TO_COMPONENT = {
|
53
|
+
InteractionToNextPaint: Insights.InteractionToNextPaint.InteractionToNextPaint,
|
54
|
+
LCPPhases: Insights.LCPPhases.LCPPhases,
|
55
|
+
LCPDiscovery: Insights.LCPDiscovery.LCPDiscovery,
|
56
|
+
CLSCulprits: Insights.CLSCulprits.CLSCulprits,
|
57
|
+
RenderBlocking: Insights.RenderBlocking.RenderBlocking,
|
58
|
+
DocumentLatency: Insights.DocumentLatency.DocumentLatency,
|
59
|
+
FontDisplay: Insights.FontDisplay.FontDisplay,
|
60
|
+
Viewport: Insights.Viewport.Viewport,
|
61
|
+
ThirdParties: Insights.ThirdParties.ThirdParties,
|
62
|
+
SlowCSSSelector: Insights.SlowCSSSelector.SlowCSSSelector,
|
63
|
+
};
|
64
64
|
|
65
65
|
export class SidebarSingleInsightSet extends HTMLElement {
|
66
66
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
@@ -135,7 +135,7 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
135
135
|
|
136
136
|
#getLCP(insightSetKey: string):
|
137
137
|
{value: Trace.Types.Timing.MicroSeconds, event: Trace.Types.Events.LargestContentfulPaintCandidate}|null {
|
138
|
-
const insight = Trace.Insights.Common.getInsight('
|
138
|
+
const insight = Trace.Insights.Common.getInsight('LCPPhases', this.#data.insights, insightSetKey);
|
139
139
|
if (!insight || !insight.lcpMs || !insight.lcpEvent) {
|
140
140
|
return null;
|
141
141
|
}
|
@@ -145,7 +145,7 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
145
145
|
}
|
146
146
|
|
147
147
|
#getCLS(insightSetKey: string): {value: number, worstShiftEvent: Trace.Types.Events.Event|null} {
|
148
|
-
const insight = Trace.Insights.Common.getInsight('
|
148
|
+
const insight = Trace.Insights.Common.getInsight('CLSCulprits', this.#data.insights, insightSetKey);
|
149
149
|
if (!insight) {
|
150
150
|
// Unlike the other metrics, there is still a value for this metric even with no data.
|
151
151
|
// This means this view will always display a CLS score.
|
@@ -193,37 +193,42 @@ export class SidebarSingleInsightSet extends HTMLElement {
|
|
193
193
|
`;
|
194
194
|
}
|
195
195
|
|
196
|
-
#
|
196
|
+
#renderInsights(
|
197
|
+
insightSets: Trace.Insights.Types.TraceInsightSets|null,
|
198
|
+
parsedTrace: Trace.Handlers.Types.ParsedTrace|null,
|
199
|
+
insightSetKey: string,
|
200
|
+
): LitHtml.TemplateResult {
|
197
201
|
const includeExperimental = Root.Runtime.experiments.isEnabled(
|
198
202
|
Root.Runtime.ExperimentName.TIMELINE_EXPERIMENTAL_INSIGHTS,
|
199
203
|
);
|
200
204
|
|
201
|
-
|
202
|
-
|
205
|
+
const models = insightSets?.get(insightSetKey)?.model;
|
206
|
+
if (!models) {
|
207
|
+
return html``;
|
203
208
|
}
|
204
209
|
|
205
|
-
|
206
|
-
|
210
|
+
const components: LitHtml.TemplateResult[] = [];
|
211
|
+
for (const [name, componentClass] of Object.entries(INSIGHT_NAME_TO_COMPONENT)) {
|
212
|
+
if (!includeExperimental && EXPERIMENTAL_INSIGHTS.has(name)) {
|
213
|
+
continue;
|
214
|
+
}
|
207
215
|
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
): LitHtml.TemplateResult {
|
213
|
-
const insightComponents = this.#insightsForRendering();
|
214
|
-
// clang-format off
|
215
|
-
return html`${insightComponents.map(component => {
|
216
|
-
return html`<div data-single-insight-wrapper>
|
217
|
-
<${component.litTagName}
|
218
|
-
.insights=${insights}
|
216
|
+
// clang-format off
|
217
|
+
const component = html`<div data-single-insight-wrapper>
|
218
|
+
<${componentClass.litTagName}
|
219
|
+
.model=${models[name as keyof typeof models]}
|
219
220
|
.parsedTrace=${parsedTrace}
|
220
221
|
.insightSetKey=${insightSetKey}
|
221
222
|
.activeInsight=${this.#data.activeInsight}
|
222
223
|
.activeCategory=${this.#data.activeCategory}>
|
223
|
-
</${
|
224
|
+
</${componentClass.litTagName}>
|
224
225
|
</div>`;
|
225
|
-
|
226
|
-
|
226
|
+
// clang-format on
|
227
|
+
|
228
|
+
components.push(component);
|
229
|
+
}
|
230
|
+
|
231
|
+
return html`${components}`;
|
227
232
|
}
|
228
233
|
|
229
234
|
#render(): void {
|
@@ -3,25 +3,18 @@
|
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
5
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
6
|
+
import type {CLSCulpritsInsightModel} from '../../../../models/trace/insights/CLSCulprits.js';
|
6
7
|
import * as Trace from '../../../../models/trace/trace.js';
|
7
8
|
import * as LitHtml from '../../../../ui/lit-html/lit-html.js';
|
8
9
|
import type * as Overlays from '../../overlays/overlays.js';
|
9
10
|
|
10
11
|
import {EventReferenceClick} from './EventRef.js';
|
11
|
-
import {
|
12
|
+
import {BaseInsightComponent, shouldRenderForCategory} from './Helpers.js';
|
12
13
|
import {Category} from './types.js';
|
13
14
|
|
14
15
|
const {html} = LitHtml;
|
15
16
|
|
16
17
|
const UIStrings = {
|
17
|
-
/** Title of an insight that provides details about why elements shift/move on the page. The causes for these shifts are referred to as culprits ("reasons"). */
|
18
|
-
title: 'Layout shift culprits',
|
19
|
-
/**
|
20
|
-
* @description Description of a DevTools insight that identifies the reasons that elements shift on the page.
|
21
|
-
* This is displayed after a user expands the section to see more. No character length limits.
|
22
|
-
*/
|
23
|
-
description:
|
24
|
-
'Layout shifts occur when elements move absent any user interaction. [Investigate the causes of layout shifts](https://web.dev/articles/optimize-cls), such as elements being added, removed, or their fonts changing as the page loads.',
|
25
18
|
/**
|
26
19
|
*@description Text indicating the worst layout shift cluster.
|
27
20
|
*/
|
@@ -59,19 +52,14 @@ const UIStrings = {
|
|
59
52
|
const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/CLSCulprits.ts', UIStrings);
|
60
53
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
61
54
|
|
62
|
-
export class CLSCulprits extends
|
55
|
+
export class CLSCulprits extends BaseInsightComponent<CLSCulpritsInsightModel> {
|
63
56
|
static override readonly litTagName = LitHtml.literal`devtools-performance-cls-culprits`;
|
64
57
|
override insightCategory: Category = Category.CLS;
|
65
58
|
override internalName: string = 'cls-culprits';
|
66
|
-
override userVisibleTitle: string = i18nString(UIStrings.title);
|
67
|
-
override description: string = i18nString(UIStrings.description);
|
68
59
|
|
69
60
|
override createOverlays(): Overlays.Overlays.TimelineOverlay[] {
|
70
|
-
const insight =
|
71
|
-
Trace.Insights.Common.getInsight('CumulativeLayoutShift', this.data.insights, this.data.insightSetKey);
|
72
|
-
|
73
61
|
const clustersByScore =
|
74
|
-
|
62
|
+
this.model?.clusters.toSorted((a, b) => b.clusterCumulativeScore - a.clusterCumulativeScore) ?? [];
|
75
63
|
const worstCluster = clustersByScore[0];
|
76
64
|
if (!worstCluster) {
|
77
65
|
return [];
|
@@ -98,8 +86,7 @@ export class CLSCulprits extends BaseInsight {
|
|
98
86
|
getTopCulprits(
|
99
87
|
cluster: Trace.Types.Events.SyntheticLayoutShiftCluster,
|
100
88
|
culpritsByShift:
|
101
|
-
Map<Trace.Types.Events.LayoutShift,
|
102
|
-
Trace.Insights.InsightRunners.CumulativeLayoutShift.LayoutShiftRootCausesData>): string[] {
|
89
|
+
Map<Trace.Types.Events.LayoutShift, Trace.Insights.Models.CLSCulprits.LayoutShiftRootCausesData>): string[] {
|
103
90
|
const MAX_TOP_CULPRITS = 3;
|
104
91
|
const causes: Array<string> = [];
|
105
92
|
if (causes.length === MAX_TOP_CULPRITS) {
|
@@ -140,8 +127,11 @@ export class CLSCulprits extends BaseInsight {
|
|
140
127
|
this.dispatchEvent(new EventReferenceClick(event));
|
141
128
|
}
|
142
129
|
|
143
|
-
#render(culprits: Array<string>, worstCluster: Trace.Types.Events.SyntheticLayoutShiftCluster):
|
144
|
-
|
130
|
+
#render(culprits: Array<string>, worstCluster: Trace.Types.Events.SyntheticLayoutShiftCluster): LitHtml.LitTemplate {
|
131
|
+
if (!this.model) {
|
132
|
+
return LitHtml.nothing;
|
133
|
+
}
|
134
|
+
|
145
135
|
const ts = Trace.Types.Timing.MicroSeconds(worstCluster.ts - (this.data.parsedTrace?.Meta.traceBounds.min ?? 0));
|
146
136
|
const clusterTs = i18n.TimeUtilities.formatMicroSecondsTime(ts);
|
147
137
|
|
@@ -150,8 +140,8 @@ export class CLSCulprits extends BaseInsight {
|
|
150
140
|
return html`
|
151
141
|
<div class="insights">
|
152
142
|
<devtools-performance-sidebar-insight .data=${{
|
153
|
-
title: this.
|
154
|
-
description: this.description,
|
143
|
+
title: this.model.title,
|
144
|
+
description: this.model.description,
|
155
145
|
internalName: this.internalName,
|
156
146
|
expanded: this.isActive(),
|
157
147
|
}}
|
@@ -171,25 +161,21 @@ export class CLSCulprits extends BaseInsight {
|
|
171
161
|
}
|
172
162
|
|
173
163
|
override getRelatedEvents(): Trace.Types.Events.Event[] {
|
174
|
-
|
175
|
-
Trace.Insights.Common.getInsight('CumulativeLayoutShift', this.data.insights, this.data.insightSetKey);
|
176
|
-
return insight?.relatedEvents ?? [];
|
164
|
+
return this.model?.relatedEvents ?? [];
|
177
165
|
}
|
178
166
|
|
179
167
|
override render(): void {
|
180
|
-
|
181
|
-
Trace.Insights.Common.getInsight('CumulativeLayoutShift', this.data.insights, this.data.insightSetKey);
|
182
|
-
if (!insight) {
|
168
|
+
if (!this.model) {
|
183
169
|
return;
|
184
170
|
}
|
185
171
|
|
186
|
-
const culpritsByShift =
|
187
|
-
const clusters =
|
188
|
-
if (!clusters.length || !
|
172
|
+
const culpritsByShift = this.model.shifts;
|
173
|
+
const clusters = this.model.clusters ?? [];
|
174
|
+
if (!clusters.length || !this.model.worstCluster) {
|
189
175
|
return;
|
190
176
|
}
|
191
177
|
|
192
|
-
const causes = this.getTopCulprits(
|
178
|
+
const causes = this.getTopCulprits(this.model.worstCluster, culpritsByShift);
|
193
179
|
|
194
180
|
const hasCulprits = causes.length > 0;
|
195
181
|
|
@@ -197,7 +183,7 @@ export class CLSCulprits extends BaseInsight {
|
|
197
183
|
activeCategory: this.data.activeCategory,
|
198
184
|
insightCategory: this.insightCategory,
|
199
185
|
});
|
200
|
-
const output = hasCulprits && matchesCategory ? this.#render(causes,
|
186
|
+
const output = hasCulprits && matchesCategory ? this.#render(causes, this.model.worstCluster) : LitHtml.nothing;
|
201
187
|
LitHtml.render(output, this.shadow, {host: this});
|
202
188
|
}
|
203
189
|
}
|
@@ -5,25 +5,17 @@
|
|
5
5
|
import '../../../../ui/components/icon_button/icon_button.js';
|
6
6
|
|
7
7
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
8
|
+
import type {DocumentLatencyInsightModel} from '../../../../models/trace/insights/DocumentLatency.js';
|
8
9
|
import * as Trace from '../../../../models/trace/trace.js';
|
9
10
|
import * as LitHtml from '../../../../ui/lit-html/lit-html.js';
|
10
11
|
import type * as Overlays from '../../overlays/overlays.js';
|
11
12
|
|
12
|
-
import {
|
13
|
+
import {BaseInsightComponent, shouldRenderForCategory} from './Helpers.js';
|
13
14
|
import {Category} from './types.js';
|
14
15
|
|
15
16
|
const {html} = LitHtml;
|
16
17
|
|
17
18
|
const UIStrings = {
|
18
|
-
/**
|
19
|
-
*@description Title of an insight that provides a breakdown for how long it took to download the main document.
|
20
|
-
*/
|
21
|
-
title: 'Document request latency',
|
22
|
-
/**
|
23
|
-
*@description Description of an insight that provides a breakdown for how long it took to download the main document.
|
24
|
-
*/
|
25
|
-
description:
|
26
|
-
'Your first network request is the most important. Reduce its latency by avoiding redirects, ensuring a fast server response, and enabling text compression.',
|
27
19
|
/**
|
28
20
|
* @description Text to tell the user that the document request does not have redirects.
|
29
21
|
*/
|
@@ -75,12 +67,10 @@ const UIStrings = {
|
|
75
67
|
const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/DocumentLatency.ts', UIStrings);
|
76
68
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
77
69
|
|
78
|
-
export class DocumentLatency extends
|
70
|
+
export class DocumentLatency extends BaseInsightComponent<DocumentLatencyInsightModel> {
|
79
71
|
static override readonly litTagName = LitHtml.literal`devtools-performance-document-latency`;
|
80
72
|
override insightCategory: Category = Category.ALL;
|
81
73
|
override internalName: string = 'document-latency';
|
82
|
-
override userVisibleTitle: string = i18nString(UIStrings.title);
|
83
|
-
override description: string = i18nString(UIStrings.description);
|
84
74
|
|
85
75
|
#check(didPass: boolean, good: string, bad: string): LitHtml.TemplateResult {
|
86
76
|
const icon = didPass ? 'check-circle' : 'clear';
|
@@ -98,17 +88,16 @@ export class DocumentLatency extends BaseInsight {
|
|
98
88
|
}
|
99
89
|
|
100
90
|
override createOverlays(): Overlays.Overlays.TimelineOverlay[] {
|
101
|
-
|
102
|
-
if (!insight?.data?.documentRequest) {
|
91
|
+
if (!this.model?.data?.documentRequest) {
|
103
92
|
return [];
|
104
93
|
}
|
105
94
|
|
106
95
|
const overlays: Overlays.Overlays.TimelineOverlay[] = [];
|
107
|
-
const event =
|
108
|
-
const redirectDurationMicro = Trace.Helpers.Timing.millisecondsToMicroseconds(
|
96
|
+
const event = this.model.data.documentRequest;
|
97
|
+
const redirectDurationMicro = Trace.Helpers.Timing.millisecondsToMicroseconds(this.model.data.redirectDuration);
|
109
98
|
|
110
99
|
const sections = [];
|
111
|
-
if (
|
100
|
+
if (this.model.data.redirectDuration) {
|
112
101
|
const bounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(
|
113
102
|
event.ts,
|
114
103
|
(event.ts + redirectDurationMicro) as Trace.Types.Timing.MicroSeconds,
|
@@ -116,8 +105,9 @@ export class DocumentLatency extends BaseInsight {
|
|
116
105
|
sections.push({bounds, label: i18nString(UIStrings.redirectsLabel), showDuration: true});
|
117
106
|
overlays.push({type: 'CANDY_STRIPED_TIME_RANGE', bounds, entry: event});
|
118
107
|
}
|
119
|
-
if (
|
120
|
-
const serverResponseTimeMicro =
|
108
|
+
if (this.model.data.serverResponseTooSlow) {
|
109
|
+
const serverResponseTimeMicro =
|
110
|
+
Trace.Helpers.Timing.millisecondsToMicroseconds(this.model.data.serverResponseTime);
|
121
111
|
// NOTE: NetworkRequestHandlers never makes a synthetic network request event if `timing` is missing.
|
122
112
|
const sendEnd = event.args.data.timing?.sendEnd ?? Trace.Types.Timing.MilliSeconds(0);
|
123
113
|
const sendEndMicro = Trace.Helpers.Timing.millisecondsToMicroseconds(sendEnd);
|
@@ -127,7 +117,7 @@ export class DocumentLatency extends BaseInsight {
|
|
127
117
|
);
|
128
118
|
sections.push({bounds, label: i18nString(UIStrings.serverResponseTimeLabel), showDuration: true});
|
129
119
|
}
|
130
|
-
if (
|
120
|
+
if (this.model.data.uncompressedResponseBytes) {
|
131
121
|
const bounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(
|
132
122
|
event.args.data.syntheticData.downloadStart,
|
133
123
|
(event.args.data.syntheticData.downloadStart + event.args.data.syntheticData.download) as
|
@@ -141,7 +131,7 @@ export class DocumentLatency extends BaseInsight {
|
|
141
131
|
overlays.push({
|
142
132
|
type: 'TIMESPAN_BREAKDOWN',
|
143
133
|
sections,
|
144
|
-
entry:
|
134
|
+
entry: this.model.data.documentRequest,
|
145
135
|
// Always render below because the document request is guaranteed to be
|
146
136
|
// the first request in the network track.
|
147
137
|
renderLocation: 'BELOW_EVENT',
|
@@ -149,14 +139,14 @@ export class DocumentLatency extends BaseInsight {
|
|
149
139
|
}
|
150
140
|
overlays.push({
|
151
141
|
type: 'ENTRY_SELECTED',
|
152
|
-
entry:
|
142
|
+
entry: this.model.data.documentRequest,
|
153
143
|
});
|
154
144
|
|
155
145
|
return overlays;
|
156
146
|
}
|
157
147
|
|
158
|
-
#renderInsight(
|
159
|
-
if (!
|
148
|
+
#renderInsight(): LitHtml.LitTemplate {
|
149
|
+
if (!this.model?.data) {
|
160
150
|
return LitHtml.nothing;
|
161
151
|
}
|
162
152
|
|
@@ -164,53 +154,52 @@ export class DocumentLatency extends BaseInsight {
|
|
164
154
|
return html`
|
165
155
|
<div class="insights">
|
166
156
|
<devtools-performance-sidebar-insight .data=${{
|
167
|
-
title: this.
|
168
|
-
description: this.description,
|
157
|
+
title: this.model.title,
|
158
|
+
description: this.model.description,
|
169
159
|
expanded: this.isActive(),
|
170
160
|
internalName: this.internalName,
|
171
|
-
estimatedSavingsTime:
|
172
|
-
estimatedSavingsBytes:
|
161
|
+
estimatedSavingsTime: this.model.metricSavings?.FCP,
|
162
|
+
estimatedSavingsBytes: this.model.data.uncompressedResponseBytes,
|
173
163
|
}}
|
174
164
|
@insighttoggleclick=${this.onSidebarClick}
|
175
165
|
>
|
176
166
|
<div slot="insight-content" class="insight-section">
|
177
167
|
<ul class="insight-results insight-icon-results">
|
178
168
|
<li class="insight-entry">
|
179
|
-
${this.#check(
|
169
|
+
${this.#check(this.model.data.redirectDuration === 0,
|
180
170
|
i18nString(UIStrings.passingRedirects), i18nString(UIStrings.failedRedirects))}
|
181
171
|
</li>
|
182
172
|
<li class="insight-entry">
|
183
|
-
${this.#check(!
|
173
|
+
${this.#check(!this.model.data.serverResponseTooSlow,
|
184
174
|
i18nString(UIStrings.passingServerResponseTime), i18nString(UIStrings.failedServerResponseTime))}
|
185
175
|
</li>
|
186
176
|
<li class="insight-entry">
|
187
|
-
${this.#check(
|
177
|
+
${this.#check(this.model.data.uncompressedResponseBytes === 0,
|
188
178
|
i18nString(UIStrings.passingTextCompression), i18nString(UIStrings.failedTextCompression))}
|
189
179
|
</li>
|
190
180
|
</ul>
|
191
181
|
</div>
|
192
182
|
</devtools-performance-sidebar-insight>
|
193
183
|
</div>`;
|
194
|
-
|
184
|
+
// clang-format on
|
195
185
|
}
|
196
186
|
|
197
187
|
override getRelatedEvents(): Trace.Types.Events.Event[] {
|
198
|
-
|
199
|
-
return insight?.relatedEvents ?? [];
|
188
|
+
return this.model?.relatedEvents ?? [];
|
200
189
|
}
|
201
190
|
|
202
191
|
override render(): void {
|
203
|
-
|
204
|
-
if (insight?.data === undefined) {
|
192
|
+
if (this.model?.data === undefined) {
|
205
193
|
return;
|
206
194
|
}
|
195
|
+
|
207
196
|
const matchesCategory = shouldRenderForCategory({
|
208
197
|
activeCategory: this.data.activeCategory,
|
209
198
|
insightCategory: this.insightCategory,
|
210
199
|
});
|
211
|
-
const hasFailure =
|
212
|
-
|
213
|
-
const output = (matchesCategory && hasFailure) ? this.#renderInsight(
|
200
|
+
const hasFailure = this.model?.data?.redirectDuration > 0 || this.model?.data?.serverResponseTooSlow ||
|
201
|
+
this.model.data.uncompressedResponseBytes > 0;
|
202
|
+
const output = (matchesCategory && hasFailure) ? this.#renderInsight() : LitHtml.nothing;
|
214
203
|
LitHtml.render(output, this.shadow, {host: this});
|
215
204
|
}
|
216
205
|
}
|
@@ -5,12 +5,13 @@
|
|
5
5
|
import './Table.js';
|
6
6
|
|
7
7
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
8
|
-
import
|
8
|
+
import type {FontDisplayInsightModel} from '../../../../models/trace/insights/FontDisplay.js';
|
9
|
+
import type * as Trace from '../../../../models/trace/trace.js';
|
9
10
|
import * as LitHtml from '../../../../ui/lit-html/lit-html.js';
|
10
11
|
import type * as Overlays from '../../overlays/overlays.js';
|
11
12
|
|
12
13
|
import {eventRef} from './EventRef.js';
|
13
|
-
import {
|
14
|
+
import {BaseInsightComponent, shouldRenderForCategory} from './Helpers.js';
|
14
15
|
import type * as SidebarInsight from './SidebarInsight.js';
|
15
16
|
import type {TableData} from './Table.js';
|
16
17
|
import {Category} from './types.js';
|
@@ -18,13 +19,6 @@ import {Category} from './types.js';
|
|
18
19
|
const {html} = LitHtml;
|
19
20
|
|
20
21
|
const UIStrings = {
|
21
|
-
/** Title of an insight that provides details about the fonts used on the page, and the value of their `font-display` properties. */
|
22
|
-
title: 'Font display',
|
23
|
-
/**
|
24
|
-
* @description Text to tell the user about the font-display CSS feature to help improve a the UX of a page.
|
25
|
-
*/
|
26
|
-
description:
|
27
|
-
'Consider setting [`font-display`](https://developer.chrome.com/blog/font-display) to `swap` or `optional` to ensure text is consistently visible. `swap` can be further optimized to mitigate layout shifts with [font metric overrides](https://developer.chrome.com/blog/font-fallbacks).',
|
28
22
|
/** Column for a font loaded by the page to render text. */
|
29
23
|
fontColumn: 'Font',
|
30
24
|
/** Column for the amount of time wasted. */
|
@@ -34,24 +28,21 @@ const UIStrings = {
|
|
34
28
|
const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/insights/FontDisplay.ts', UIStrings);
|
35
29
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
36
30
|
|
37
|
-
export class FontDisplay extends
|
31
|
+
export class FontDisplay extends BaseInsightComponent<FontDisplayInsightModel> {
|
38
32
|
static override readonly litTagName = LitHtml.literal`devtools-performance-font-display`;
|
39
33
|
override insightCategory = Category.INP;
|
40
34
|
override internalName: string = 'font-display';
|
41
|
-
override userVisibleTitle: string = i18nString(UIStrings.title);
|
42
|
-
override description: string = i18nString(UIStrings.description);
|
43
35
|
|
44
36
|
#overlayForRequest = new Map<Trace.Types.Events.SyntheticNetworkRequest, Overlays.Overlays.TimelineOverlay>();
|
45
37
|
|
46
38
|
override createOverlays(): Overlays.Overlays.TimelineOverlay[] {
|
47
39
|
this.#overlayForRequest.clear();
|
48
40
|
|
49
|
-
|
50
|
-
if (!insight) {
|
41
|
+
if (!this.model) {
|
51
42
|
return [];
|
52
43
|
}
|
53
44
|
|
54
|
-
for (const font of
|
45
|
+
for (const font of this.model.fonts) {
|
55
46
|
this.#overlayForRequest.set(font.request, {
|
56
47
|
type: 'ENTRY_OUTLINE',
|
57
48
|
entry: font.request,
|
@@ -62,13 +53,17 @@ export class FontDisplay extends BaseInsight {
|
|
62
53
|
return [...this.#overlayForRequest.values()];
|
63
54
|
}
|
64
55
|
|
65
|
-
#render(insight: Trace.Insights.Types.
|
56
|
+
#render(insight: Trace.Insights.Types.InsightModels['FontDisplay']): LitHtml.LitTemplate {
|
57
|
+
if (!this.model) {
|
58
|
+
return LitHtml.nothing;
|
59
|
+
}
|
60
|
+
|
66
61
|
// clang-format off
|
67
62
|
return html`
|
68
63
|
<div class="insights">
|
69
64
|
<devtools-performance-sidebar-insight .data=${{
|
70
|
-
title: this.
|
71
|
-
description: this.description,
|
65
|
+
title: this.model.title,
|
66
|
+
description: this.model.description,
|
72
67
|
expanded: this.isActive(),
|
73
68
|
internalName: this.internalName,
|
74
69
|
estimatedSavingsTime: insight.metricSavings?.FCP,
|
@@ -97,19 +92,18 @@ export class FontDisplay extends BaseInsight {
|
|
97
92
|
}
|
98
93
|
|
99
94
|
override getRelatedEvents(): Trace.Types.Events.Event[] {
|
100
|
-
|
101
|
-
return insight?.relatedEvents ?? [];
|
95
|
+
return this.model?.relatedEvents ?? [];
|
102
96
|
}
|
103
97
|
|
104
98
|
override render(): void {
|
105
|
-
const
|
106
|
-
const shouldShow =
|
99
|
+
const model = this.model;
|
100
|
+
const shouldShow = model && model.fonts.find(font => font.wastedTime);
|
107
101
|
|
108
102
|
const matchesCategory = shouldRenderForCategory({
|
109
103
|
activeCategory: this.data.activeCategory,
|
110
104
|
insightCategory: this.insightCategory,
|
111
105
|
});
|
112
|
-
const output = shouldShow && matchesCategory ? this.#render(
|
106
|
+
const output = shouldShow && matchesCategory ? this.#render(model) : LitHtml.nothing;
|
113
107
|
LitHtml.render(output, this.shadow, {host: this});
|
114
108
|
}
|
115
109
|
}
|