chrome-devtools-frontend 1.0.1652307 → 1.0.1656291
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/fixing-skipped-tests/SKILL.md +32 -0
- package/.agents/skills/migrate-chromium-test/SKILL.md +144 -0
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +116 -0
- package/.agents/skills/ui-eng-vision-logic-consolidator/SKILL.md +82 -0
- package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +123 -0
- package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +125 -0
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +75 -0
- package/AUTHORS +1 -0
- package/config/owner/COMMON_OWNERS +0 -4
- package/docs/get_the_code.md +1 -2
- package/docs/playbook.md +1 -1
- package/docs/ui_engineering.md +3 -1
- package/eslint.config.mjs +0 -5
- package/front_end/Tests.js +1 -0
- package/front_end/core/common/Settings.ts +47 -30
- package/front_end/core/sdk/CPUThrottlingManager.ts +23 -167
- package/front_end/core/sdk/CSSMetadata.ts +23 -0
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +8 -4
- package/front_end/core/sdk/ConsoleModel.ts +13 -11
- package/front_end/core/sdk/DOMDebuggerModel.ts +11 -5
- package/front_end/core/sdk/DOMModel.ts +4 -0
- package/front_end/core/sdk/EmulationModel.ts +4 -0
- package/front_end/core/sdk/EventBreakpointsModel.ts +9 -5
- package/front_end/core/sdk/IsolateManager.ts +6 -6
- package/front_end/core/sdk/ResourceTreeModel.ts +8 -5
- package/front_end/core/sdk/TargetManager.ts +17 -0
- package/front_end/entrypoints/devtools_app/devtools_app.ts +0 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +459 -74
- package/front_end/entrypoints/main/MainImpl.ts +12 -42
- package/front_end/foundation/Universe.ts +116 -3
- package/front_end/generated/InspectorBackendCommands.ts +11 -6
- package/front_end/generated/SupportedCSSProperties.js +124 -34
- package/front_end/generated/protocol-mapping.d.ts +8 -0
- package/front_end/generated/protocol-proxy-api.d.ts +15 -0
- package/front_end/generated/protocol.ts +94 -1
- package/front_end/models/ai_assistance/AiConversation.ts +2 -7
- package/front_end/models/ai_assistance/README.md +4 -3
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +13 -320
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -358
- package/front_end/models/ai_assistance/ai_assistance.ts +6 -8
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +295 -0
- package/front_end/models/ai_assistance/contexts/RequestContext.snapshot.txt +0 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +0 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +10 -10
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +12 -11
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -14
- package/front_end/models/ai_assistance/skills/accessibility.md +4 -2
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +142 -0
- package/front_end/models/ai_assistance/tools/GetStyles.ts +1 -1
- package/front_end/models/ai_assistance/tools/README.md +21 -1
- package/front_end/models/ai_assistance/tools/{ResolveLighthousePath.ts → ResolveDevtoolsNodePath.ts} +18 -17
- package/front_end/models/ai_assistance/tools/Tool.ts +6 -1
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -2
- package/front_end/models/autofill_manager/AutofillManager.ts +6 -15
- package/front_end/models/bindings/NetworkProject.ts +4 -8
- package/front_end/models/breakpoints/BreakpointManager.ts +9 -9
- package/front_end/models/emulation/DeviceModeModel.ts +24 -0
- package/front_end/models/emulation/EmulatedDevices.ts +108 -0
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +36 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +8 -0
- package/front_end/models/issues_manager/IssuesManager.ts +10 -6
- package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +4 -5
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/live-metrics/LiveMetrics.ts +6 -6
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +5 -5
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +3 -3
- package/front_end/models/logs/LogManager.ts +25 -10
- package/front_end/models/logs/NetworkLog.ts +24 -19
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +14 -13
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +26 -14
- package/front_end/models/persistence/IsolatedFileSystem.ts +9 -11
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +22 -11
- package/front_end/models/persistence/NetworkPersistenceManager.ts +73 -44
- package/front_end/models/persistence/PersistenceImpl.ts +4 -5
- package/front_end/models/project_settings/ProjectSettingsModel.ts +12 -11
- package/front_end/models/trace/EntityMapper.ts +1 -1
- package/front_end/models/trace/handlers/ScreenshotsHandler.ts +14 -59
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +12 -38
- package/front_end/panels/ai_assistance/ExportConversation.ts +4 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/application/DeviceBoundSessionsView.ts +15 -3
- package/front_end/panels/application/FrameDetailsView.ts +2 -1
- package/front_end/panels/application/IndexedDBViews.ts +38 -36
- package/front_end/panels/application/ServiceWorkersView.ts +23 -16
- package/front_end/panels/application/components/AdsView.ts +4 -0
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/autofill/autofill-meta.ts +3 -2
- package/front_end/panels/common/CPUThrottlingOption.ts +142 -0
- package/front_end/panels/common/ThrottlingUtils.ts +9 -4
- package/front_end/panels/common/common.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +45 -0
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +26 -15
- package/front_end/panels/elements/AccessibilityTreeView.ts +12 -9
- package/front_end/panels/elements/ElementsPanel.ts +0 -74
- package/front_end/panels/elements/ElementsTreeOutline.ts +5 -4
- package/front_end/panels/emulation/DeviceModeToolbar.ts +46 -45
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +118 -68
- package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
- package/front_end/panels/layer_viewer/layerTreeOutline.css +20 -13
- package/front_end/panels/layers/LayersPanel.ts +1 -1
- package/front_end/panels/mobile_throttling/CalibrationController.ts +6 -5
- package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +40 -13
- package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +13 -17
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +79 -30
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -0
- package/front_end/panels/network/LinkPreloadGenerator.ts +101 -0
- package/front_end/panels/network/NetworkLogView.ts +28 -9
- package/front_end/panels/network/NetworkPanel.ts +1 -63
- package/front_end/panels/network/RequestInitiatorView.ts +29 -4
- package/front_end/panels/network/components/HeaderSectionRow.css +9 -7
- package/front_end/panels/network/components/HeaderSectionRow.ts +20 -1
- package/front_end/panels/network/components/RequestHeaderSection.css +5 -3
- package/front_end/panels/network/components/RequestHeaderSection.ts +1 -2
- package/front_end/panels/network/components/RequestHeadersView.css +1 -1
- package/front_end/panels/network/network.ts +2 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +121 -33
- package/front_end/panels/profiler/ModuleUIStrings.ts +4 -0
- package/front_end/panels/security/SecurityPanel.ts +36 -23
- package/front_end/panels/settings/SettingsScreen.ts +18 -103
- package/front_end/panels/settings/settings-meta.ts +0 -24
- package/front_end/panels/timeline/TimelineController.ts +3 -2
- package/front_end/panels/timeline/TimelineHistoryManager.ts +38 -37
- package/front_end/panels/timeline/TimelinePanel.ts +52 -11
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +20 -18
- package/front_end/panels/timeline/components/LiveMetricsView.ts +38 -38
- package/front_end/panels/timeline/components/MetricCard.ts +18 -18
- package/front_end/panels/timeline/components/liveMetricsView.css +6 -6
- package/front_end/panels/timeline/components/metricCard.css +4 -4
- package/front_end/panels/timeline/timelineFlamechartPopover.css +2 -0
- package/front_end/panels/utils/utils.ts +25 -24
- package/front_end/panels/whats_new/ReleaseNoteText.ts +3 -3
- package/front_end/panels/whats_new/resources/WNDT.md +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +34 -55
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +96 -83
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +10 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +23 -13
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +4 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Input.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +3 -41
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +34 -55
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +13 -1
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +2 -3
- package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +3 -2
- package/front_end/third_party/puppeteer/package/src/api/Realm.ts +1 -2
- package/front_end/third_party/puppeteer/package/src/api/Target.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +1 -2
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/bidi/core/Realm.ts +1 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +13 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +24 -13
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/LifecycleWatcher.ts +1 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +7 -76
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +1 -4
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +5 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/util/httpUtils.ts +5 -5
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +3 -0
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +0 -7
- package/front_end/ui/helpers/OpenInNewTab.ts +15 -7
- package/front_end/ui/legacy/InspectorDrawerView.ts +7 -5
- package/front_end/ui/legacy/ListWidget.ts +12 -0
- package/front_end/ui/legacy/SplitWidget.ts +12 -11
- package/front_end/ui/legacy/TabbedPane.ts +1 -108
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +192 -139
- package/front_end/ui/legacy/components/data_grid/DataGridExporter.ts +89 -0
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +10 -0
- package/front_end/ui/legacy/components/data_grid/data_grid.ts +3 -1
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +8 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +110 -17
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +89 -40
- package/front_end/ui/legacy/treeoutline.css +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/package.json +4 -3
- package/front_end/Images/navigationControls.png +0 -0
- package/front_end/Images/navigationControls_2x.png +0 -0
- package/front_end/Images/popoverArrows.png +0 -0
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -746
- package/front_end/entrypoints/greendev_floaty/floaty.css +0 -301
- package/front_end/entrypoints/greendev_floaty/floaty.html +0 -38
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -415
- package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +0 -834
- package/front_end/models/ai_assistance/agents/GreenDevAgentAntigravityCliSocketClient.ts +0 -53
- package/front_end/models/ai_assistance/agents/GreenDevAgentGeminiCliSocketClient.ts +0 -117
- package/front_end/models/annotations/AnnotationRepository.ts +0 -238
- package/front_end/models/annotations/AnnotationType.ts +0 -10
- package/front_end/models/annotations/README.md +0 -7
- package/front_end/models/annotations/annotations.ts +0 -6
- package/front_end/models/greendev/Prototypes.ts +0 -68
- package/front_end/models/greendev/README.md +0 -5
- package/front_end/models/greendev/greendev.ts +0 -5
- package/front_end/panels/common/Annotation.ts +0 -184
- package/front_end/panels/common/AnnotationManager.ts +0 -208
- package/front_end/panels/common/annotation.css +0 -40
- package/front_end/panels/greendev/GreenDevPanel.css +0 -282
- package/front_end/panels/greendev/GreenDevPanel.ts +0 -364
- package/front_end/panels/greendev/GreenDevShared.ts +0 -13
- package/front_end/panels/greendev/greendev-meta.ts +0 -52
- package/front_end/panels/greendev/greendev.ts +0 -9
|
@@ -7,8 +7,8 @@ import * as Common from '../../core/common/common.js';
|
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
8
|
import * as Platform from '../../core/platform/platform.js';
|
|
9
9
|
import * as Trace from '../../models/trace/trace.js';
|
|
10
|
-
import {createIcon} from '../../ui/kit/kit.js';
|
|
11
10
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
11
|
+
import {html, type LitTemplate, render} from '../../ui/lit/lit.js';
|
|
12
12
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
13
13
|
|
|
14
14
|
import {
|
|
@@ -361,39 +361,43 @@ export class TimelineHistoryManager {
|
|
|
361
361
|
};
|
|
362
362
|
parsedTraceIndexToPerformancePreviewData.set(parsedTraceIndex, data);
|
|
363
363
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
364
|
+
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
365
|
+
render(html`
|
|
366
|
+
${this.#renderTextDetails(parsedTrace.metadata, domain)}
|
|
367
|
+
<div class="hbox">
|
|
368
|
+
${this.#renderScreenshotThumbnail(filmStrip)}
|
|
369
|
+
${this.#buildOverview(parsedTrace)}
|
|
370
|
+
</div>
|
|
371
|
+
`,
|
|
372
|
+
preview, {host: this});
|
|
373
|
+
|
|
368
374
|
return data.preview;
|
|
369
375
|
}
|
|
370
376
|
|
|
371
|
-
#
|
|
372
|
-
|
|
373
|
-
container.classList.add('text-details');
|
|
374
|
-
container.classList.add('hbox');
|
|
375
|
-
const nameSpan = container.createChild('span', 'name');
|
|
376
|
-
nameSpan.textContent = title;
|
|
377
|
-
UI.ARIAUtils.setLabel(nameSpan, title);
|
|
378
|
-
|
|
377
|
+
#renderTextDetails(metadata: Trace.Types.File.MetaData|null, title: string): LitTemplate {
|
|
378
|
+
let metadataText = '';
|
|
379
379
|
if (metadata) {
|
|
380
380
|
const parts = [
|
|
381
381
|
metadata.emulatedDeviceTitle,
|
|
382
382
|
metadata.cpuThrottling ? i18nString(UIStrings.dSlowdown, {PH1: metadata.cpuThrottling}) : undefined,
|
|
383
383
|
metadata.networkThrottling,
|
|
384
384
|
].filter(Boolean);
|
|
385
|
-
|
|
385
|
+
metadataText = listFormatter.format(parts as string[]);
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
-
return
|
|
388
|
+
return html`
|
|
389
|
+
<div class="text-details hbox">
|
|
390
|
+
<span class="name">${title}</span>
|
|
391
|
+
${metadataText ? html`<span class="metadata">${metadataText}</span>` : ''}
|
|
392
|
+
</div>
|
|
393
|
+
`;
|
|
389
394
|
}
|
|
390
395
|
|
|
391
|
-
#
|
|
392
|
-
const container = document.createElement('div');
|
|
393
|
-
container.classList.add('screenshot-thumb');
|
|
396
|
+
#renderScreenshotThumbnail(filmStrip: Trace.Extras.FilmStrip.Data|null): LitTemplate {
|
|
394
397
|
const thumbnailAspectRatio = 3 / 2;
|
|
395
|
-
|
|
396
|
-
|
|
398
|
+
const width = this.totalHeight * thumbnailAspectRatio + 'px';
|
|
399
|
+
const height = this.totalHeight + 'px';
|
|
400
|
+
const container = html`<div class="screenshot-thumb" style="width: ${width}; height: ${height}"></div>`;
|
|
397
401
|
if (!filmStrip) {
|
|
398
402
|
return container;
|
|
399
403
|
}
|
|
@@ -403,12 +407,11 @@ export class TimelineHistoryManager {
|
|
|
403
407
|
}
|
|
404
408
|
// TODO(paulirish): Adopt Util.ImageCache
|
|
405
409
|
const uri = Trace.Handlers.ModelHandlers.Screenshots.screenshotImageDataUri(lastFrame.screenshotEvent);
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
return container;
|
|
410
|
+
return html`
|
|
411
|
+
<div class="screenshot-thumb" style="width: ${width}; height: ${height}">
|
|
412
|
+
<img src=${uri}>
|
|
413
|
+
</div>
|
|
414
|
+
`;
|
|
412
415
|
}
|
|
413
416
|
|
|
414
417
|
#buildOverview(parsedTrace: Trace.TraceModel.ParsedTrace): Element {
|
|
@@ -582,14 +585,14 @@ export class DropDown implements UI.ListControl.ListDelegate<number> {
|
|
|
582
585
|
|
|
583
586
|
div.style.width = `${previewWidth}px`;
|
|
584
587
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
588
|
+
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
589
|
+
render(html`
|
|
590
|
+
<devtools-icon class="back-arrow" title=${
|
|
591
|
+
i18nString(UIStrings.backButtonTooltip)} name="arrow-back"></devtools-icon>
|
|
592
|
+
<span>${this.#landingPageTitle}</span>
|
|
593
|
+
`,
|
|
594
|
+
div, {host: this});
|
|
589
595
|
|
|
590
|
-
const text = document.createElement('span');
|
|
591
|
-
text.innerText = this.#landingPageTitle;
|
|
592
|
-
div.appendChild(text);
|
|
593
596
|
return div;
|
|
594
597
|
}
|
|
595
598
|
|
|
@@ -619,14 +622,11 @@ export class DropDown implements UI.ListControl.ListDelegate<number> {
|
|
|
619
622
|
}
|
|
620
623
|
|
|
621
624
|
export class ToolbarButton extends UI.Toolbar.ToolbarItem {
|
|
622
|
-
private contentElement: HTMLElement;
|
|
623
|
-
|
|
624
625
|
constructor(action: UI.ActionRegistration.Action) {
|
|
625
626
|
const element = document.createElement('button');
|
|
626
627
|
element.classList.add('history-dropdown-button');
|
|
627
628
|
element.setAttribute('jslog', `${VisualLogging.dropDown('history')}`);
|
|
628
629
|
super(element);
|
|
629
|
-
this.contentElement = this.element.createChild('span', 'content');
|
|
630
630
|
this.element.addEventListener('click', () => void action.execute(), false);
|
|
631
631
|
this.setEnabled(action.enabled());
|
|
632
632
|
action.addEventListener(UI.ActionRegistration.Events.ENABLED, event => this.setEnabled(event.data));
|
|
@@ -634,6 +634,7 @@ export class ToolbarButton extends UI.Toolbar.ToolbarItem {
|
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
setText(text: string): void {
|
|
637
|
-
|
|
637
|
+
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
638
|
+
render(html`<span class="content">${text}</span>`, this.element, {host: this});
|
|
638
639
|
}
|
|
639
640
|
}
|
|
@@ -316,6 +316,9 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
316
316
|
|
|
317
317
|
let timelinePanelInstance: TimelinePanel|undefined;
|
|
318
318
|
|
|
319
|
+
// Total time to wait for source maps to load before giving up so trace processing can proceed.
|
|
320
|
+
const SOURCE_MAP_LOAD_TIMEOUT_MS = 5000;
|
|
321
|
+
|
|
319
322
|
/**
|
|
320
323
|
* Represents the states that the timeline panel can be in.
|
|
321
324
|
* If you need to change the panel's view, use the {@link TimelinePanel.#changeView} method.
|
|
@@ -2149,14 +2152,21 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
2149
2152
|
// Annotation Overlays.
|
|
2150
2153
|
currentManager?.addEventListener(AnnotationModifiedEvent.eventName, this.#onAnnotationModifiedEventBound);
|
|
2151
2154
|
|
|
2152
|
-
// To calculate the activity we might want to zoom in, we use the top-most main-thread track
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2155
|
+
// To calculate the activity we might want to zoom in, we use the top-most main-thread track.
|
|
2156
|
+
// If the trace has an active breadcrumb that is not the initial full trace breadcrumb, we do
|
|
2157
|
+
// not zoom in, but keep the window at the active breadcrumb bounds.
|
|
2158
|
+
const breadcrumbs = currentManager?.getTimelineBreadcrumbs();
|
|
2159
|
+
const hasActiveBreadcrumb = breadcrumbs ? breadcrumbs.activeBreadcrumb !== breadcrumbs.initialBreadcrumb : false;
|
|
2160
|
+
if (!hasActiveBreadcrumb) {
|
|
2161
|
+
const topMostMainThreadAppender =
|
|
2162
|
+
this.flameChart.getMainDataProvider().compatibilityTracksAppenderInstance().threadAppenders().at(0);
|
|
2163
|
+
const zoomWindow = calculateAutoZoomWindow(
|
|
2164
|
+
parsedTrace.data.Meta.traceBounds,
|
|
2165
|
+
topMostMainThreadAppender?.getEntries(),
|
|
2166
|
+
);
|
|
2167
|
+
if (zoomWindow) {
|
|
2168
|
+
TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(zoomWindow);
|
|
2169
|
+
}
|
|
2160
2170
|
}
|
|
2161
2171
|
|
|
2162
2172
|
// Add overlays for annotations loaded from the trace file
|
|
@@ -2642,12 +2652,19 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
2642
2652
|
};
|
|
2643
2653
|
|
|
2644
2654
|
metadata.sourceMaps = [];
|
|
2655
|
+
await this.#handleSourceMapPromise(parsedTrace, handleScript);
|
|
2656
|
+
}
|
|
2645
2657
|
|
|
2658
|
+
async #handleSourceMapPromise(parsedTrace: Trace.TraceModel.ParsedTrace,
|
|
2659
|
+
handleScript: (script: Trace.Handlers.ModelHandlers.Scripts.Script) => Promise<void>):
|
|
2660
|
+
Promise<void> {
|
|
2646
2661
|
const promises = [];
|
|
2647
2662
|
for (const script of parsedTrace?.data.Scripts.scripts.values() ?? []) {
|
|
2648
2663
|
promises.push(handleScript(script));
|
|
2649
2664
|
}
|
|
2650
|
-
|
|
2665
|
+
|
|
2666
|
+
const timeout = new Promise<void>(resolve => setTimeout(resolve, SOURCE_MAP_LOAD_TIMEOUT_MS));
|
|
2667
|
+
await Promise.race([Promise.allSettled(promises), timeout]);
|
|
2651
2668
|
}
|
|
2652
2669
|
|
|
2653
2670
|
#createSourceMapResolver(isFreshRecording: boolean, metadata: Trace.Types.File.MetaData|null):
|
|
@@ -2681,7 +2698,8 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
2681
2698
|
return await debuggerModel.sourceMapManager().sourceMapForClientPromise(script);
|
|
2682
2699
|
}
|
|
2683
2700
|
|
|
2684
|
-
|
|
2701
|
+
async function resolveSourceMap(params: Trace.Types.Configuration.ResolveSourceMapParams):
|
|
2702
|
+
Promise<SDK.SourceMap.SourceMap|null> {
|
|
2685
2703
|
const {scriptId, scriptUrl, sourceUrl, sourceMapUrl, frame, cachedRawSourceMap} = params;
|
|
2686
2704
|
|
|
2687
2705
|
if (cachedRawSourceMap) {
|
|
@@ -2738,7 +2756,13 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
2738
2756
|
const payload = await SDK.SourceMapManager.tryLoadSourceMap(
|
|
2739
2757
|
TimelinePanel.instance().#resourceLoader, sourceMapUrl, initiator);
|
|
2740
2758
|
return payload ? new SDK.SourceMap.SourceMap(sourceUrl, sourceMapUrl, payload) : null;
|
|
2741
|
-
}
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
const timeout = new Promise<null>(resolve => setTimeout(() => resolve(null), SOURCE_MAP_LOAD_TIMEOUT_MS));
|
|
2762
|
+
return function resolveSourceMapWithTimeout(params: Trace.Types.Configuration.ResolveSourceMapParams):
|
|
2763
|
+
Promise<SDK.SourceMap.SourceMap|null> {
|
|
2764
|
+
return Promise.race([resolveSourceMap(params), timeout]);
|
|
2765
|
+
};
|
|
2742
2766
|
}
|
|
2743
2767
|
|
|
2744
2768
|
async #retainResourceContentsForEnhancedTrace(
|
|
@@ -3206,3 +3230,20 @@ export interface EventTypes {
|
|
|
3206
3230
|
[Events.IS_VIEWING_TRACE]: boolean;
|
|
3207
3231
|
[Events.RECORDING_COMPLETED]: {traceIndex: number}|{errorText: string};
|
|
3208
3232
|
}
|
|
3233
|
+
|
|
3234
|
+
/**
|
|
3235
|
+
* Calculates the window to auto-zoom into when a trace is loaded.
|
|
3236
|
+
* We only auto-zoom to the main thread activity if there is no active breadcrumb,
|
|
3237
|
+
* as we want to preserve the active breadcrumb's window if one exists.
|
|
3238
|
+
*
|
|
3239
|
+
* @returns the window to zoom into, or null if no auto-zoom should be applied.
|
|
3240
|
+
*/
|
|
3241
|
+
export function calculateAutoZoomWindow(
|
|
3242
|
+
traceBounds: Trace.Types.Timing.TraceWindowMicro,
|
|
3243
|
+
topMostMainThreadAppenderEntries: readonly Trace.Types.Events.Event[]|undefined,
|
|
3244
|
+
): Trace.Types.Timing.TraceWindowMicro|null {
|
|
3245
|
+
if (!topMostMainThreadAppenderEntries || topMostMainThreadAppenderEntries.length === 0) {
|
|
3246
|
+
return null;
|
|
3247
|
+
}
|
|
3248
|
+
return Trace.Extras.MainThreadActivity.calculateWindow(traceBounds, topMostMainThreadAppenderEntries);
|
|
3249
|
+
}
|
|
@@ -12,6 +12,7 @@ import type * as Menus from '../../../ui/components/menus/menus.js';
|
|
|
12
12
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
13
13
|
import * as Lit from '../../../ui/lit/lit.js';
|
|
14
14
|
import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
|
|
15
|
+
import * as PanelsCommon from '../../common/common.js';
|
|
15
16
|
import * as MobileThrottling from '../../mobile_throttling/mobile_throttling.js';
|
|
16
17
|
|
|
17
18
|
import cpuThrottlingSelectorStyles from './cpuThrottlingSelector.css.js';
|
|
@@ -57,22 +58,22 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
57
58
|
|
|
58
59
|
interface CPUThrottlingGroup {
|
|
59
60
|
name: string;
|
|
60
|
-
items:
|
|
61
|
+
items: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption[];
|
|
61
62
|
showCustomAddOption?: boolean;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
interface ViewInput {
|
|
65
|
-
recommendedOption:
|
|
66
|
-
currentOption:
|
|
66
|
+
recommendedOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption|null;
|
|
67
|
+
currentOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption;
|
|
67
68
|
groups: CPUThrottlingGroup[];
|
|
68
|
-
throttling:
|
|
69
|
+
throttling: PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling;
|
|
69
70
|
onMenuItemSelected: (event: Menus.SelectMenu.SelectMenuItemSelectedEvent) => void;
|
|
70
71
|
onCalibrateClick: () => void;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLElement): void => {
|
|
74
75
|
let recommendedInfoEl;
|
|
75
|
-
if (input.recommendedOption && input.currentOption ===
|
|
76
|
+
if (input.recommendedOption && input.currentOption === PanelsCommon.CPUThrottlingOption.NoThrottlingOption) {
|
|
76
77
|
recommendedInfoEl = html`<devtools-icon
|
|
77
78
|
title=${i18nString(UIStrings.recommendedThrottlingReason)}
|
|
78
79
|
name=info></devtools-icon>`;
|
|
@@ -134,31 +135,32 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
|
|
|
134
135
|
type View = typeof DEFAULT_VIEW;
|
|
135
136
|
|
|
136
137
|
export class CPUThrottlingSelector extends UI.Widget.Widget {
|
|
137
|
-
#currentOption:
|
|
138
|
-
#recommendedOption:
|
|
138
|
+
#currentOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption;
|
|
139
|
+
#recommendedOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption|null = null;
|
|
139
140
|
#groups: CPUThrottlingGroup[] = [];
|
|
140
|
-
#calibratedThrottlingSetting: Common.Settings.Setting<
|
|
141
|
+
#calibratedThrottlingSetting: Common.Settings.Setting<PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling>;
|
|
141
142
|
readonly #view: View;
|
|
143
|
+
readonly #cpuThrottlingManager = SDK.CPUThrottlingManager.CPUThrottlingManager.instance();
|
|
142
144
|
|
|
143
145
|
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
144
146
|
super(element);
|
|
145
|
-
this.#currentOption =
|
|
147
|
+
this.#currentOption = MobileThrottling.ThrottlingManager.throttlingManager().cpuThrottlingOption();
|
|
146
148
|
this.#calibratedThrottlingSetting =
|
|
147
|
-
Common.Settings.Settings.instance().createSetting<
|
|
149
|
+
Common.Settings.Settings.instance().createSetting<PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling>(
|
|
148
150
|
'calibrated-cpu-throttling', {}, Common.Settings.SettingStorageType.GLOBAL);
|
|
149
151
|
this.#resetGroups();
|
|
150
152
|
this.#view = view;
|
|
151
153
|
}
|
|
152
154
|
|
|
153
|
-
set recommendedOption(recommendedOption:
|
|
155
|
+
set recommendedOption(recommendedOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption|null) {
|
|
154
156
|
this.#recommendedOption = recommendedOption;
|
|
155
157
|
this.requestUpdate();
|
|
156
158
|
}
|
|
157
159
|
|
|
158
160
|
override wasShown(): void {
|
|
159
161
|
super.wasShown();
|
|
160
|
-
SDK.CPUThrottlingManager.
|
|
161
|
-
|
|
162
|
+
this.#cpuThrottlingManager.addEventListener(SDK.CPUThrottlingManager.Events.RATE_CHANGED, this.#onOptionChange,
|
|
163
|
+
this);
|
|
162
164
|
this.#calibratedThrottlingSetting.addChangeListener(this.#onCalibratedSettingChanged, this);
|
|
163
165
|
this.#onOptionChange();
|
|
164
166
|
}
|
|
@@ -166,12 +168,12 @@ export class CPUThrottlingSelector extends UI.Widget.Widget {
|
|
|
166
168
|
override willHide(): void {
|
|
167
169
|
super.willHide();
|
|
168
170
|
this.#calibratedThrottlingSetting.removeChangeListener(this.#onCalibratedSettingChanged, this);
|
|
169
|
-
SDK.CPUThrottlingManager.
|
|
170
|
-
|
|
171
|
+
this.#cpuThrottlingManager.removeEventListener(SDK.CPUThrottlingManager.Events.RATE_CHANGED, this.#onOptionChange,
|
|
172
|
+
this);
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
#onOptionChange(): void {
|
|
174
|
-
this.#currentOption =
|
|
176
|
+
this.#currentOption = MobileThrottling.ThrottlingManager.throttlingManager().cpuThrottlingOption();
|
|
175
177
|
|
|
176
178
|
this.requestUpdate();
|
|
177
179
|
}
|
|
@@ -185,9 +187,9 @@ export class CPUThrottlingSelector extends UI.Widget.Widget {
|
|
|
185
187
|
let option;
|
|
186
188
|
if (typeof event.itemValue === 'string') {
|
|
187
189
|
if (event.itemValue === 'low-tier-mobile') {
|
|
188
|
-
option =
|
|
190
|
+
option = PanelsCommon.CPUThrottlingOption.CalibratedLowTierMobileThrottlingOption;
|
|
189
191
|
} else if (event.itemValue === 'mid-tier-mobile') {
|
|
190
|
-
option =
|
|
192
|
+
option = PanelsCommon.CPUThrottlingOption.CalibratedMidTierMobileThrottlingOption;
|
|
191
193
|
}
|
|
192
194
|
} else {
|
|
193
195
|
const rate = Number(event.itemValue);
|
|
@@ -236,31 +236,31 @@ const UIStrings = {
|
|
|
236
236
|
*/
|
|
237
237
|
clearCurrentLog: 'Clear the current log',
|
|
238
238
|
/**
|
|
239
|
-
* @description Title for a page load
|
|
239
|
+
* @description Title for a page load subpart that measures the time between when the page load starts and the time when the first byte of the initial document is downloaded.
|
|
240
240
|
*/
|
|
241
241
|
timeToFirstByte: 'Time to first byte',
|
|
242
242
|
/**
|
|
243
|
-
* @description Title for a page load
|
|
243
|
+
* @description Title for a page load subpart that measures the time between when the first byte of the initial document is downloaded and when the request for the largest image content starts.
|
|
244
244
|
*/
|
|
245
245
|
resourceLoadDelay: 'Resource load delay',
|
|
246
246
|
/**
|
|
247
|
-
* @description Title for a page load
|
|
247
|
+
* @description Title for a page load subpart that measures the time between when the request for the largest image content starts and when it finishes.
|
|
248
248
|
*/
|
|
249
249
|
resourceLoadDuration: 'Resource load duration',
|
|
250
250
|
/**
|
|
251
|
-
* @description Title for a page load
|
|
251
|
+
* @description Title for a page load subpart that measures the time between when the request for the largest image content finishes and when the largest image element is rendered on the page.
|
|
252
252
|
*/
|
|
253
253
|
elementRenderDelay: 'Element render delay',
|
|
254
254
|
/**
|
|
255
|
-
* @description Title for a
|
|
255
|
+
* @description Title for a subpart during a user interaction that measures the time between when the interaction starts and when the browser starts running interaction handlers.
|
|
256
256
|
*/
|
|
257
257
|
inputDelay: 'Input delay',
|
|
258
258
|
/**
|
|
259
|
-
* @description Title for a
|
|
259
|
+
* @description Title for a subpart during a user interaction that measures the time between when the browser starts running interaction handlers and when the browser finishes running interaction handlers.
|
|
260
260
|
*/
|
|
261
261
|
processingDuration: 'Processing duration',
|
|
262
262
|
/**
|
|
263
|
-
* @description Title for a
|
|
263
|
+
* @description Title for a subpart during a user interaction that measures the time between when the browser finishes running interaction handlers and when the browser renders the next visual frame that shows the result of the interaction.
|
|
264
264
|
*/
|
|
265
265
|
presentationDelay: 'Presentation delay',
|
|
266
266
|
/**
|
|
@@ -276,11 +276,11 @@ const UIStrings = {
|
|
|
276
276
|
*/
|
|
277
277
|
showClsCluster: 'Go to worst layout shift cluster.',
|
|
278
278
|
/**
|
|
279
|
-
* @description Column header for table cell values representing the
|
|
279
|
+
* @description Column header for table cell values representing the subpart/component/stage/section of a larger duration.
|
|
280
280
|
*/
|
|
281
|
-
|
|
281
|
+
subpart: 'Subpart',
|
|
282
282
|
/**
|
|
283
|
-
* @description Column header for table cell values representing a
|
|
283
|
+
* @description Column header for table cell values representing a subpart duration (in milliseconds) that was measured in the developers local environment.
|
|
284
284
|
*/
|
|
285
285
|
duration: 'Local duration (ms)',
|
|
286
286
|
/**
|
|
@@ -328,7 +328,7 @@ export interface ViewOutput {
|
|
|
328
328
|
|
|
329
329
|
export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement|DocumentFragment) => void;
|
|
330
330
|
|
|
331
|
-
function
|
|
331
|
+
function getLcpFieldSubparts(cruxManager: CrUXManager.CrUXManager): LiveMetrics.LcpValue['subparts']|null {
|
|
332
332
|
const ttfb =
|
|
333
333
|
cruxManager.getSelectedFieldMetricData('largest_contentful_paint_image_time_to_first_byte')?.percentiles?.p75;
|
|
334
334
|
const loadDelay =
|
|
@@ -484,9 +484,9 @@ function renderLcpCard(input: ViewInput): Lit.LitTemplate {
|
|
|
484
484
|
const fieldData = input.cruxManager.getSelectedFieldMetricData('largest_contentful_paint');
|
|
485
485
|
const nodeLink =
|
|
486
486
|
input.lcpValue?.nodeRef && PanelsCommon.DOMLinkifier.Linkifier.instance().linkify(input.lcpValue?.nodeRef);
|
|
487
|
-
const
|
|
487
|
+
const subparts = input.lcpValue?.subparts;
|
|
488
488
|
|
|
489
|
-
const
|
|
489
|
+
const fieldSubparts = getLcpFieldSubparts(input.cruxManager);
|
|
490
490
|
|
|
491
491
|
// clang-format off
|
|
492
492
|
return html`
|
|
@@ -496,11 +496,11 @@ function renderLcpCard(input: ViewInput): Lit.LitTemplate {
|
|
|
496
496
|
fieldValue: fieldData?.percentiles?.p75,
|
|
497
497
|
histogram: fieldData?.histogram,
|
|
498
498
|
warnings: input.lcpValue?.warnings,
|
|
499
|
-
|
|
500
|
-
[i18nString(UIStrings.timeToFirstByte),
|
|
501
|
-
[i18nString(UIStrings.resourceLoadDelay),
|
|
502
|
-
[i18nString(UIStrings.resourceLoadDuration),
|
|
503
|
-
[i18nString(UIStrings.elementRenderDelay),
|
|
499
|
+
subparts: subparts && [
|
|
500
|
+
[i18nString(UIStrings.timeToFirstByte), subparts.timeToFirstByte, fieldSubparts?.timeToFirstByte],
|
|
501
|
+
[i18nString(UIStrings.resourceLoadDelay), subparts.resourceLoadDelay, fieldSubparts?.resourceLoadDelay],
|
|
502
|
+
[i18nString(UIStrings.resourceLoadDuration), subparts.resourceLoadTime, fieldSubparts?.resourceLoadTime],
|
|
503
|
+
[i18nString(UIStrings.elementRenderDelay), subparts.elementRenderDelay, fieldSubparts?.elementRenderDelay],
|
|
504
504
|
],
|
|
505
505
|
})}>
|
|
506
506
|
${nodeLink ? html`
|
|
@@ -551,7 +551,7 @@ function renderClsCard(input: ViewInput): Lit.LitTemplate {
|
|
|
551
551
|
|
|
552
552
|
function renderInpCard(input: ViewInput): Lit.LitTemplate {
|
|
553
553
|
const fieldData = input.cruxManager.getSelectedFieldMetricData('interaction_to_next_paint');
|
|
554
|
-
const
|
|
554
|
+
const subparts = input.inpValue?.subparts;
|
|
555
555
|
const interaction = input.inpValue && input.interactions.get(input.inpValue.interactionId);
|
|
556
556
|
|
|
557
557
|
// clang-format off
|
|
@@ -562,10 +562,10 @@ function renderInpCard(input: ViewInput): Lit.LitTemplate {
|
|
|
562
562
|
fieldValue: fieldData?.percentiles?.p75,
|
|
563
563
|
histogram: fieldData?.histogram,
|
|
564
564
|
warnings: input.inpValue?.warnings,
|
|
565
|
-
|
|
566
|
-
[i18nString(UIStrings.inputDelay),
|
|
567
|
-
[i18nString(UIStrings.processingDuration),
|
|
568
|
-
[i18nString(UIStrings.presentationDelay),
|
|
565
|
+
subparts: subparts && [
|
|
566
|
+
[i18nString(UIStrings.inputDelay), subparts.inputDelay],
|
|
567
|
+
[i18nString(UIStrings.processingDuration), subparts.processingDuration],
|
|
568
|
+
[i18nString(UIStrings.presentationDelay), subparts.presentationDelay],
|
|
569
569
|
],
|
|
570
570
|
})}>
|
|
571
571
|
${interaction ? html`
|
|
@@ -873,30 +873,30 @@ function renderInteractionsLog(input: ViewInput, output: ViewOutput): Lit.LitTem
|
|
|
873
873
|
></devtools-icon>` : nothing}
|
|
874
874
|
<span class="interaction-duration">${metricValue}</span>
|
|
875
875
|
</summary>
|
|
876
|
-
<div class="
|
|
877
|
-
<div class="
|
|
878
|
-
<div role="columnheader">${i18nString(UIStrings.
|
|
876
|
+
<div class="subpart-table" role="table">
|
|
877
|
+
<div class="subpart-table-row subpart-table-header-row" role="row">
|
|
878
|
+
<div role="columnheader">${i18nString(UIStrings.subpart)}</div>
|
|
879
879
|
<div role="columnheader">
|
|
880
880
|
${interaction.longAnimationFrameTimings.length ? html`
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
881
|
+
<button
|
|
882
|
+
class="log-extra-details-button"
|
|
883
|
+
title=${i18nString(UIStrings.logToConsole)}
|
|
884
|
+
@click=${() => input.logExtraInteractionDetails(interaction)}
|
|
885
|
+
>${i18nString(UIStrings.duration)}</button>
|
|
886
|
+
` : i18nString(UIStrings.duration)}
|
|
887
887
|
</div>
|
|
888
888
|
</div>
|
|
889
|
-
<div class="
|
|
889
|
+
<div class="subpart-table-row" role="row">
|
|
890
890
|
<div role="cell">${i18nString(UIStrings.inputDelay)}</div>
|
|
891
|
-
<div role="cell">${Math.round(interaction.
|
|
891
|
+
<div role="cell">${Math.round(interaction.subparts.inputDelay)}</div>
|
|
892
892
|
</div>
|
|
893
|
-
<div class="
|
|
893
|
+
<div class="subpart-table-row" role="row">
|
|
894
894
|
<div role="cell">${i18nString(UIStrings.processingDuration)}</div>
|
|
895
|
-
<div role="cell">${Math.round(interaction.
|
|
895
|
+
<div role="cell">${Math.round(interaction.subparts.processingDuration)}</div>
|
|
896
896
|
</div>
|
|
897
|
-
<div class="
|
|
897
|
+
<div class="subpart-table-row" role="row">
|
|
898
898
|
<div role="cell">${i18nString(UIStrings.presentationDelay)}</div>
|
|
899
|
-
<div role="cell">${Math.round(interaction.
|
|
899
|
+
<div role="cell">${Math.round(interaction.subparts.presentationDelay)}</div>
|
|
900
900
|
</div>
|
|
901
901
|
</div>
|
|
902
902
|
</details>
|
|
@@ -123,9 +123,9 @@ const UIStrings = {
|
|
|
123
123
|
*/
|
|
124
124
|
recDynamicContentCLS: 'Dynamic content can influence what layout shifts happen.',
|
|
125
125
|
/**
|
|
126
|
-
* @description Column header for table cell values representing the
|
|
126
|
+
* @description Column header for table cell values representing the subpart/component/stage/section of a larger duration.
|
|
127
127
|
*/
|
|
128
|
-
|
|
128
|
+
subpart: 'Subpart',
|
|
129
129
|
/**
|
|
130
130
|
* @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.
|
|
131
131
|
*/
|
|
@@ -145,7 +145,7 @@ const UIStrings = {
|
|
|
145
145
|
const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/MetricCard.ts', UIStrings);
|
|
146
146
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
147
147
|
|
|
148
|
-
export type
|
|
148
|
+
export type SubpartTable = Array<[string, Trace.Types.Timing.Milli, Trace.Types.Timing.Milli?]>;
|
|
149
149
|
|
|
150
150
|
export interface MetricCardData {
|
|
151
151
|
metric: 'LCP'|'CLS'|'INP';
|
|
@@ -153,7 +153,7 @@ export interface MetricCardData {
|
|
|
153
153
|
fieldValue?: number|string;
|
|
154
154
|
histogram?: CrUXManager.MetricResponse['histogram'];
|
|
155
155
|
tooltipContainer?: HTMLElement;
|
|
156
|
-
|
|
156
|
+
subparts?: SubpartTable;
|
|
157
157
|
warnings?: string[];
|
|
158
158
|
}
|
|
159
159
|
|
|
@@ -566,30 +566,30 @@ export class MetricCard extends HTMLElement {
|
|
|
566
566
|
// clang-format on
|
|
567
567
|
}
|
|
568
568
|
|
|
569
|
-
#
|
|
570
|
-
const hasFieldData =
|
|
569
|
+
#renderSubpartTable(subparts: SubpartTable): Lit.LitTemplate {
|
|
570
|
+
const hasFieldData = subparts.every(subpart => subpart[2] !== undefined);
|
|
571
571
|
|
|
572
572
|
// clang-format off
|
|
573
573
|
return html`
|
|
574
574
|
<hr class="divider">
|
|
575
|
-
<div class="
|
|
576
|
-
<div class="
|
|
577
|
-
<div role="columnheader" style="grid-column: 1">${i18nString(UIStrings.
|
|
578
|
-
<div role="columnheader" class="
|
|
575
|
+
<div class="subpart-table" role="table">
|
|
576
|
+
<div class="subpart-table-row subpart-table-header-row" role="row">
|
|
577
|
+
<div role="columnheader" style="grid-column: 1">${i18nString(UIStrings.subpart)}</div>
|
|
578
|
+
<div role="columnheader" class="subpart-table-value" style="grid-column: 2">${i18nString(UIStrings.localValue)}</div>
|
|
579
579
|
${hasFieldData ? html`
|
|
580
580
|
<div
|
|
581
581
|
role="columnheader"
|
|
582
|
-
class="
|
|
582
|
+
class="subpart-table-value"
|
|
583
583
|
style="grid-column: 3"
|
|
584
584
|
title=${i18nString(UIStrings.field75thPercentile)}>${i18nString(UIStrings.fieldP75)}</div>
|
|
585
585
|
` : nothing}
|
|
586
586
|
</div>
|
|
587
|
-
${
|
|
588
|
-
<div class="
|
|
589
|
-
<div role="cell">${
|
|
590
|
-
<div role="cell" class="
|
|
591
|
-
${
|
|
592
|
-
<div role="cell" class="
|
|
587
|
+
${subparts.map(subpart => html`
|
|
588
|
+
<div class="subpart-table-row" role="row">
|
|
589
|
+
<div role="cell">${subpart[0]}</div>
|
|
590
|
+
<div role="cell" class="subpart-table-value">${i18n.TimeUtilities.preciseMillisToString(subpart[1])}</div>
|
|
591
|
+
${subpart[2] !== undefined ? html`
|
|
592
|
+
<div role="cell" class="subpart-table-value">${i18n.TimeUtilities.preciseMillisToString(subpart[2])}</div>
|
|
593
593
|
` : nothing}
|
|
594
594
|
</div>
|
|
595
595
|
`)}
|
|
@@ -659,7 +659,7 @@ export class MetricCard extends HTMLElement {
|
|
|
659
659
|
${this.#renderDetailedCompareString()}
|
|
660
660
|
<hr class="divider">
|
|
661
661
|
${this.#renderFieldHistogram()}
|
|
662
|
-
${localValue && this.#data.
|
|
662
|
+
${localValue && this.#data.subparts ? this.#renderSubpartTable(this.#data.subparts) : nothing}
|
|
663
663
|
</div>
|
|
664
664
|
</div>
|
|
665
665
|
</div>
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
.interaction {
|
|
178
|
-
--
|
|
178
|
+
--subpart-table-margin: 120px;
|
|
179
179
|
--details-indicator-width: 18px;
|
|
180
180
|
|
|
181
181
|
summary {
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
|
|
201
201
|
.interaction-type {
|
|
202
202
|
font-weight: var(--ref-typeface-weight-medium);
|
|
203
|
-
width: calc(var(--
|
|
203
|
+
width: calc(var(--subpart-table-margin) - var(--details-indicator-width));
|
|
204
204
|
flex-shrink: 0;
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -344,18 +344,18 @@ devtools-link {
|
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
-
.
|
|
347
|
+
.subpart-table {
|
|
348
348
|
border-top: 1px solid var(--sys-color-divider);
|
|
349
349
|
padding: 7px 4px;
|
|
350
|
-
margin-left: var(--
|
|
350
|
+
margin-left: var(--subpart-table-margin);
|
|
351
351
|
}
|
|
352
352
|
|
|
353
|
-
.
|
|
353
|
+
.subpart-table-row {
|
|
354
354
|
display: flex;
|
|
355
355
|
justify-content: space-between;
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
-
.
|
|
358
|
+
.subpart-table-header-row {
|
|
359
359
|
font-weight: var(--ref-typeface-weight-medium);
|
|
360
360
|
margin-bottom: 4px;
|
|
361
361
|
}
|