chrome-devtools-frontend 1.0.1512147 → 1.0.1513662
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/cookbook/release_management.md +15 -13
- package/docs/get_the_code.md +114 -35
- package/front_end/Images/src/ai-explorer-badge.svg +114 -0
- package/front_end/Images/src/code-whisperer-badge.svg +166 -0
- package/front_end/Images/src/devtools-user-badge.svg +129 -0
- package/front_end/Images/src/dom-detective-badge.svg +136 -0
- package/front_end/Images/src/speedster-badge.svg +166 -0
- package/front_end/core/common/Color.ts +40 -44
- package/front_end/core/common/Console.ts +4 -4
- package/front_end/core/common/ParsedURL.ts +14 -14
- package/front_end/core/common/ResourceType.ts +20 -20
- package/front_end/core/common/SegmentedRange.ts +13 -14
- package/front_end/core/common/Settings.ts +4 -4
- package/front_end/core/common/StringOutputStream.ts +4 -4
- package/front_end/core/host/GdpClient.ts +76 -2
- package/front_end/core/host/InspectorFrontendHost.ts +4 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
- package/front_end/core/host/ResourceLoader.ts +2 -2
- package/front_end/core/host/UserMetrics.ts +0 -2
- package/front_end/core/i18n/NumberFormatter.ts +7 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +9 -9
- package/front_end/core/root/Runtime.ts +5 -2
- package/front_end/core/sdk/AccessibilityModel.ts +48 -48
- package/front_end/core/sdk/AnimationModel.ts +78 -79
- package/front_end/core/sdk/CPUProfilerModel.ts +5 -5
- package/front_end/core/sdk/CPUThrottlingManager.ts +17 -17
- package/front_end/core/sdk/CSSMatchedStyles.ts +44 -44
- package/front_end/core/sdk/CSSMedia.ts +22 -22
- package/front_end/core/sdk/CSSModel.ts +4 -4
- package/front_end/core/sdk/CSSProperty.ts +9 -9
- package/front_end/core/sdk/CSSPropertyParser.ts +1 -2
- package/front_end/core/sdk/CSSRule.ts +3 -3
- package/front_end/core/sdk/CSSStyleDeclaration.ts +27 -28
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +13 -13
- package/front_end/core/sdk/CategorizedBreakpoint.ts +4 -4
- package/front_end/core/sdk/ChildTargetManager.ts +6 -6
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +4 -4
- package/front_end/core/sdk/ConsoleModel.ts +24 -24
- package/front_end/core/sdk/Cookie.ts +16 -16
- package/front_end/core/sdk/CookieParser.ts +6 -6
- package/front_end/core/sdk/DOMDebuggerModel.ts +88 -89
- package/front_end/core/sdk/DOMModel.ts +113 -113
- package/front_end/core/sdk/DebuggerModel.ts +102 -103
- package/front_end/core/sdk/EmulationModel.ts +6 -6
- package/front_end/core/sdk/EventBreakpointsModel.ts +5 -5
- package/front_end/core/sdk/HeapProfilerModel.ts +5 -5
- package/front_end/core/sdk/IsolateManager.ts +26 -26
- package/front_end/core/sdk/LayerTreeBase.ts +29 -30
- package/front_end/core/sdk/OverlayModel.ts +6 -6
- package/front_end/core/sdk/Resource.ts +43 -43
- package/front_end/core/sdk/ResourceTreeModel.ts +58 -61
- package/front_end/core/sdk/RuntimeModel.ts +12 -13
- package/front_end/core/sdk/SDKModel.ts +3 -3
- package/front_end/core/sdk/Script.ts +17 -17
- package/front_end/core/sdk/SecurityOriginManager.ts +14 -14
- package/front_end/core/sdk/ServerTiming.ts +2 -2
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +15 -15
- package/front_end/core/sdk/ServiceWorkerManager.ts +19 -24
- package/front_end/core/sdk/SourceMap.ts +10 -10
- package/front_end/core/sdk/StorageKeyManager.ts +12 -12
- package/front_end/core/sdk/Target.ts +33 -34
- package/front_end/core/sdk/TargetManager.ts +20 -20
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +8 -8
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +7 -7
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +7 -7
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +24 -24
- package/front_end/entrypoints/main/GlobalAiButton.ts +3 -3
- package/front_end/entrypoints/main/MainImpl.ts +16 -14
- package/front_end/entrypoints/main/main-meta.ts +1 -2
- package/front_end/generated/InspectorBackendCommands.js +3 -2
- package/front_end/generated/SupportedCSSProperties.js +20 -0
- package/front_end/generated/protocol-mapping.d.ts +4 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/generated/protocol.ts +20 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +18 -35
- package/front_end/models/ai_assistance/ai_assistance.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +7 -6
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +246 -119
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +187 -73
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +106 -100
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +20 -27
- package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +151 -0
- package/front_end/models/badges/AiExplorerBadge.ts +21 -0
- package/front_end/models/badges/Badge.ts +10 -9
- package/front_end/models/badges/CodeWhispererBadge.ts +21 -0
- package/front_end/models/badges/DOMDetectiveBadge.ts +21 -0
- package/front_end/models/badges/SpeedsterBadge.ts +7 -2
- package/front_end/models/badges/StarterBadge.ts +6 -1
- package/front_end/models/badges/UserBadges.ts +61 -9
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +6 -6
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +18 -18
- package/front_end/models/bindings/FileUtils.ts +15 -15
- package/front_end/models/bindings/ResourceScriptMapping.ts +14 -14
- package/front_end/models/elements/ElementUpdateRecord.ts +11 -11
- package/front_end/models/emulation/DeviceModeModel.ts +123 -131
- package/front_end/models/emulation/EmulatedDevices.ts +22 -22
- package/front_end/models/extensions/ExtensionPanel.ts +24 -24
- package/front_end/models/extensions/ExtensionServer.ts +4 -4
- package/front_end/models/javascript_metadata/NativeFunctions.js +14 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +18 -19
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +13 -13
- package/front_end/models/trace/EventsSerializer.ts +5 -5
- package/front_end/models/trace/LanternComputationData.ts +10 -10
- package/front_end/models/trace/ModelImpl.ts +32 -54
- package/front_end/models/trace/Processor.ts +28 -30
- package/front_end/models/trace/extras/FilmStrip.ts +6 -6
- package/front_end/models/trace/extras/StackTraceForEvent.ts +22 -25
- package/front_end/models/trace/extras/ThirdParties.ts +16 -17
- package/front_end/models/trace/extras/TraceFilter.ts +1 -1
- package/front_end/models/trace/handlers/Threads.ts +10 -10
- package/front_end/models/trace/handlers/helpers.ts +9 -9
- package/front_end/models/trace/handlers/types.ts +3 -3
- package/front_end/models/trace/insights/CLSCulprits.ts +12 -14
- package/front_end/models/trace/insights/Cache.ts +8 -4
- package/front_end/models/trace/insights/DOMSize.ts +8 -5
- package/front_end/models/trace/insights/DocumentLatency.ts +2 -2
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +3 -3
- package/front_end/models/trace/insights/FontDisplay.ts +3 -4
- package/front_end/models/trace/insights/ForcedReflow.ts +3 -3
- package/front_end/models/trace/insights/INPBreakdown.ts +2 -2
- package/front_end/models/trace/insights/ImageDelivery.ts +11 -11
- package/front_end/models/trace/insights/LCPBreakdown.ts +4 -4
- package/front_end/models/trace/insights/LCPDiscovery.ts +4 -4
- package/front_end/models/trace/insights/LegacyJavaScript.ts +2 -2
- package/front_end/models/trace/insights/ModernHTTP.ts +4 -5
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +12 -12
- package/front_end/models/trace/insights/RenderBlocking.ts +9 -10
- package/front_end/models/trace/insights/SlowCSSSelector.ts +2 -2
- package/front_end/models/trace/insights/ThirdParties.ts +4 -5
- package/front_end/models/trace/insights/Viewport.ts +8 -5
- package/front_end/models/trace/insights/types.ts +1 -0
- package/front_end/models/trace/lantern/testing/MetricTestUtils.ts +10 -10
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +52 -52
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +8 -8
- package/front_end/panels/animation/AnimationTimeline.ts +5 -5
- package/front_end/panels/animation/AnimationUI.ts +22 -23
- package/front_end/panels/application/ApplicationPanelSidebar.ts +12 -12
- package/front_end/panels/application/DOMStorageModel.ts +23 -23
- package/front_end/panels/application/ExtensionStorageModel.ts +31 -31
- package/front_end/panels/application/IndexedDBModel.ts +1 -0
- package/front_end/panels/application/PreloadingTreeElement.ts +8 -8
- package/front_end/panels/application/ServiceWorkersView.ts +0 -53
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +2 -2
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -2
- package/front_end/panels/common/BadgeNotification.ts +140 -10
- package/front_end/panels/common/GdpSignUpDialog.ts +5 -0
- package/front_end/panels/common/badgeNotification.css +30 -9
- package/front_end/panels/console/ConsoleContextSelector.ts +9 -9
- package/front_end/panels/console/ConsolePrompt.ts +8 -5
- package/front_end/panels/console/ConsoleView.ts +13 -13
- package/front_end/panels/console/ConsoleViewport.ts +29 -29
- package/front_end/panels/coverage/CoverageModel.ts +22 -22
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -1
- package/front_end/panels/elements/ComputedStyleModel.ts +17 -18
- package/front_end/panels/elements/DOMPath.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +13 -13
- package/front_end/panels/elements/ElementsTreeElement.ts +30 -18
- package/front_end/panels/elements/ElementsTreeOutline.ts +44 -48
- package/front_end/panels/elements/ShortcutTreeElement.ts +4 -4
- package/front_end/panels/elements/StylePropertiesSection.ts +7 -4
- package/front_end/panels/elements/StylePropertyTreeElement.ts +54 -50
- package/front_end/panels/elements/StylesSidebarPane.ts +19 -19
- package/front_end/panels/emulation/DeviceModeToolbar.ts +7 -7
- package/front_end/panels/emulation/DeviceModeView.ts +6 -6
- package/front_end/panels/emulation/MediaQueryInspector.ts +18 -18
- package/front_end/panels/event_listeners/EventListenersView.ts +13 -14
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +3 -3
- package/front_end/panels/layer_viewer/LayerViewHost.ts +13 -13
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +9 -10
- package/front_end/panels/layer_viewer/TransformController.ts +34 -36
- package/front_end/panels/layers/LayerTreeModel.ts +41 -40
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +13 -13
- package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -7
- package/front_end/panels/media/PlayerMessagesView.ts +5 -5
- package/front_end/panels/media/TickingFlameChart.ts +24 -24
- package/front_end/panels/media/TickingFlameChartHelpers.ts +32 -32
- package/front_end/panels/network/NetworkItemView.ts +4 -4
- package/front_end/panels/network/NetworkLogViewColumns.ts +29 -29
- package/front_end/panels/network/NetworkPanel.ts +8 -5
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +10 -10
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +3 -3
- package/front_end/panels/profiler/HeapProfileView.ts +1 -1
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +3 -4
- package/front_end/panels/profiler/ProfileHeader.ts +25 -25
- package/front_end/panels/profiler/ProfileLauncherView.ts +5 -6
- package/front_end/panels/recorder/components/ReplaySection.ts +3 -1
- package/front_end/panels/security/OriginTreeElement.ts +8 -8
- package/front_end/panels/security/SecurityPanel.ts +5 -5
- package/front_end/panels/settings/SettingsScreen.ts +18 -18
- package/front_end/panels/settings/components/SyncSection.ts +26 -8
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +3 -0
- package/front_end/panels/sources/DebuggerPausedMessage.ts +8 -9
- package/front_end/panels/sources/NavigatorView.ts +43 -46
- package/front_end/panels/sources/SourcesPanel.ts +35 -35
- package/front_end/panels/sources/SourcesView.ts +13 -13
- package/front_end/panels/sources/TabbedEditorContainer.ts +19 -22
- package/front_end/panels/sources/UISourceCodeFrame.ts +4 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +34 -36
- package/front_end/panels/timeline/AnimationsTrackAppender.ts +3 -3
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +8 -8
- package/front_end/panels/timeline/CountersGraph.ts +16 -16
- package/front_end/panels/timeline/EntriesFilter.ts +4 -3
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +3 -3
- package/front_end/panels/timeline/GPUTrackAppender.ts +3 -3
- package/front_end/panels/timeline/Initiators.ts +10 -10
- package/front_end/panels/timeline/InteractionsTrackAppender.ts +5 -5
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +7 -7
- package/front_end/panels/timeline/ModificationsManager.ts +8 -15
- package/front_end/panels/timeline/TargetForEvent.ts +2 -2
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -1
- package/front_end/panels/timeline/ThreadAppender.ts +13 -13
- package/front_end/panels/timeline/TimelineDetailsView.ts +6 -14
- package/front_end/panels/timeline/TimelineEventOverview.ts +27 -26
- package/front_end/panels/timeline/TimelineFilters.ts +5 -5
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +54 -53
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +34 -34
- package/front_end/panels/timeline/TimelineFlameChartView.ts +18 -31
- package/front_end/panels/timeline/TimelineHistoryManager.ts +17 -18
- package/front_end/panels/timeline/TimelineMiniMap.ts +6 -6
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +6 -6
- package/front_end/panels/timeline/TimelinePanel.ts +73 -68
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +7 -5
- package/front_end/panels/timeline/TimelineTreeView.ts +10 -10
- package/front_end/panels/timeline/TimelineUIUtils.ts +47 -46
- package/front_end/panels/timeline/TimingsTrackAppender.ts +12 -12
- package/front_end/panels/timeline/TracingLayerTree.ts +43 -43
- package/front_end/panels/timeline/TrackConfigBanner.ts +6 -6
- package/front_end/panels/timeline/TrackConfiguration.ts +1 -1
- package/front_end/panels/timeline/components/DetailsView.ts +4 -4
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +12 -21
- package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -1
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +5 -5
- package/front_end/panels/timeline/components/Sidebar.ts +4 -14
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +13 -36
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +21 -19
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
- package/front_end/panels/timeline/components/insights/Cache.ts +4 -0
- package/front_end/panels/timeline/components/insights/DOMSize.ts +5 -1
- package/front_end/panels/timeline/components/insights/Helpers.ts +19 -0
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/panels/timeline/components/insights/Viewport.ts +4 -0
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
- package/front_end/panels/timeline/utils/AICallTree.ts +11 -11
- package/front_end/panels/timeline/utils/AIContext.ts +17 -19
- package/front_end/panels/timeline/utils/EntityMapper.ts +6 -5
- package/front_end/panels/timeline/utils/EntryName.ts +2 -2
- package/front_end/panels/timeline/utils/EntryNodes.ts +5 -5
- package/front_end/panels/timeline/utils/EntryStyles.ts +4 -4
- package/front_end/panels/timeline/utils/FreshRecording.ts +3 -3
- package/front_end/panels/timeline/utils/Helpers.ts +0 -18
- package/front_end/panels/timeline/utils/InsightAIContext.ts +6 -6
- package/front_end/panels/timeline/utils/SourceMapsResolver.ts +7 -7
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +1 -1
- package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
- package/front_end/third_party/json5/rebuild.sh +1 -1
- package/front_end/third_party/legacy-javascript/{update.sh → rebuild.sh} +1 -1
- package/front_end/third_party/lit/lib/decorators.d.ts +26 -9
- package/front_end/third_party/lit/lib/decorators.js +5 -5
- package/front_end/third_party/lit/lib/decorators.js.map +1 -1
- package/front_end/third_party/lit/lib/directive.js.map +1 -1
- package/front_end/third_party/lit/lib/directives.js +8 -13
- package/front_end/third_party/lit/lib/directives.js.map +1 -1
- package/front_end/third_party/lit/lib/lit.d.ts +26 -9
- package/front_end/third_party/lit/lib/lit.js +5 -5
- package/front_end/third_party/lit/lib/lit.js.map +1 -1
- package/front_end/third_party/lit/lib/static-html.js +2 -2
- package/front_end/third_party/lit/lib/static-html.js.map +1 -1
- package/front_end/third_party/lit/rebuild.sh +1 -1
- package/front_end/third_party/third-party-web/rebuild.sh +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +6 -7
- package/front_end/ui/legacy/ActionRegistration.ts +9 -9
- package/front_end/ui/legacy/DockController.ts +18 -18
- package/front_end/ui/legacy/FilterBar.ts +7 -7
- package/front_end/ui/legacy/Fragment.ts +4 -4
- package/front_end/ui/legacy/GlassPane.ts +12 -12
- package/front_end/ui/legacy/InspectorView.ts +5 -15
- package/front_end/ui/legacy/ListControl.ts +27 -27
- package/front_end/ui/legacy/ListWidget.ts +4 -4
- package/front_end/ui/legacy/PopoverHelper.ts +4 -4
- package/front_end/ui/legacy/ShortcutRegistry.ts +17 -17
- package/front_end/ui/legacy/TabbedPane.ts +74 -75
- package/front_end/ui/legacy/TextPrompt.ts +31 -31
- package/front_end/ui/legacy/Toolbar.ts +13 -14
- package/front_end/ui/legacy/ViewManager.ts +30 -31
- package/front_end/ui/legacy/Widget.ts +6 -6
- package/front_end/ui/legacy/XLink.ts +9 -9
- package/front_end/ui/legacy/ZoomManager.ts +9 -9
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +27 -27
- package/front_end/ui/legacy/components/color_picker/ContrastInfo.ts +30 -32
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +15 -15
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +64 -64
- package/front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +10 -11
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +12 -12
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +14 -14
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +8 -8
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -5
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +4 -4
- package/front_end/ui/legacy/filter.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +1 -1
- package/front_end/ui/legacy/softDropDownButton.css +1 -1
- package/front_end/ui/legacy/theme_support/ThemeSupport.ts +4 -4
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -2
- package/package.json +1 -1
- package/front_end/models/ai_assistance/data_formatters/Types.ts +0 -9
@@ -1952,25 +1952,21 @@ export class Nickname extends ShortFormatColorBase {
|
|
1952
1952
|
|
1953
1953
|
export class Legacy implements Color {
|
1954
1954
|
readonly #rawParams: Color3D;
|
1955
|
-
#
|
1955
|
+
#rgba: Color4D;
|
1956
1956
|
readonly #authoredText: string|null;
|
1957
|
-
#
|
1957
|
+
#format: LegacyColor;
|
1958
1958
|
readonly channels: [ColorChannel, ColorChannel, ColorChannel, ColorChannel] =
|
1959
1959
|
[ColorChannel.R, ColorChannel.G, ColorChannel.B, ColorChannel.ALPHA];
|
1960
1960
|
|
1961
1961
|
static readonly #conversions: ColorConversions<Legacy> = {
|
1962
|
-
[Format.HEX]: (self: Legacy) => new Legacy(self.#
|
1963
|
-
[Format.HEXA]: (self: Legacy) => new Legacy(self.#
|
1964
|
-
[Format.RGB]: (self: Legacy) => new Legacy(self.#
|
1965
|
-
[Format.RGBA]: (self: Legacy) => new Legacy(self.#
|
1966
|
-
[Format.HSL]: (self: Legacy) =>
|
1967
|
-
|
1968
|
-
[Format.
|
1969
|
-
|
1970
|
-
[Format.HWB]: (self: Legacy) =>
|
1971
|
-
new HWB(...rgbToHwb([self.#rgbaInternal[0], self.#rgbaInternal[1], self.#rgbaInternal[2]]), self.alpha),
|
1972
|
-
[Format.HWBA]: (self: Legacy) =>
|
1973
|
-
new HWB(...rgbToHwb([self.#rgbaInternal[0], self.#rgbaInternal[1], self.#rgbaInternal[2]]), self.alpha),
|
1962
|
+
[Format.HEX]: (self: Legacy) => new Legacy(self.#rgba, Format.HEX),
|
1963
|
+
[Format.HEXA]: (self: Legacy) => new Legacy(self.#rgba, Format.HEXA),
|
1964
|
+
[Format.RGB]: (self: Legacy) => new Legacy(self.#rgba, Format.RGB),
|
1965
|
+
[Format.RGBA]: (self: Legacy) => new Legacy(self.#rgba, Format.RGBA),
|
1966
|
+
[Format.HSL]: (self: Legacy) => new HSL(...rgbToHsl([self.#rgba[0], self.#rgba[1], self.#rgba[2]]), self.alpha),
|
1967
|
+
[Format.HSLA]: (self: Legacy) => new HSL(...rgbToHsl([self.#rgba[0], self.#rgba[1], self.#rgba[2]]), self.alpha),
|
1968
|
+
[Format.HWB]: (self: Legacy) => new HWB(...rgbToHwb([self.#rgba[0], self.#rgba[1], self.#rgba[2]]), self.alpha),
|
1969
|
+
[Format.HWBA]: (self: Legacy) => new HWB(...rgbToHwb([self.#rgba[0], self.#rgba[1], self.#rgba[2]]), self.alpha),
|
1974
1970
|
[Format.LCH]: (self: Legacy) =>
|
1975
1971
|
new LCH(...ColorConverter.labToLch(...ColorConverter.xyzd50ToLab(...self.#toXyzd50())), self.alpha),
|
1976
1972
|
[Format.OKLCH]: (self: Legacy) => new Oklch(...ColorConverter.xyzd50ToOklch(...self.#toXyzd50()), self.alpha),
|
@@ -1997,7 +1993,7 @@ export class Legacy implements Color {
|
|
1997
1993
|
};
|
1998
1994
|
|
1999
1995
|
#toXyzd50(): Color3D {
|
2000
|
-
const [r, g, b] = this.#
|
1996
|
+
const [r, g, b] = this.#rgba;
|
2001
1997
|
return ColorConverter.srgbToXyzd50(r, g, b);
|
2002
1998
|
}
|
2003
1999
|
|
@@ -2005,7 +2001,7 @@ export class Legacy implements Color {
|
|
2005
2001
|
switch (this.format()) {
|
2006
2002
|
case Format.HEXA:
|
2007
2003
|
case Format.RGBA:
|
2008
|
-
return this.#
|
2004
|
+
return this.#rgba[3];
|
2009
2005
|
default:
|
2010
2006
|
return null;
|
2011
2007
|
}
|
@@ -2022,7 +2018,7 @@ export class Legacy implements Color {
|
|
2022
2018
|
|
2023
2019
|
shortHex(): ShortHex|null {
|
2024
2020
|
for (let i = 0; i < 4; ++i) {
|
2025
|
-
const c = Math.round(this.#
|
2021
|
+
const c = Math.round(this.#rgba[i] * 255);
|
2026
2022
|
// Check if the two digits of each are identical: #aabbcc => #abc
|
2027
2023
|
if (c % 0x11) {
|
2028
2024
|
return null;
|
@@ -2033,10 +2029,10 @@ export class Legacy implements Color {
|
|
2033
2029
|
|
2034
2030
|
constructor(rgba: Color3D|Color4DOr3D, format: LegacyColor, authoredText?: string) {
|
2035
2031
|
this.#authoredText = authoredText || null;
|
2036
|
-
this.#
|
2032
|
+
this.#format = format;
|
2037
2033
|
this.#rawParams = [rgba[0], rgba[1], rgba[2]];
|
2038
2034
|
|
2039
|
-
this.#
|
2035
|
+
this.#rgba = [
|
2040
2036
|
clamp(rgba[0], {min: 0, max: 1}),
|
2041
2037
|
clamp(rgba[1], {min: 0, max: 1}),
|
2042
2038
|
clamp(rgba[2], {min: 0, max: 1}),
|
@@ -2099,11 +2095,11 @@ export class Legacy implements Color {
|
|
2099
2095
|
}
|
2100
2096
|
|
2101
2097
|
format(): LegacyColor {
|
2102
|
-
return this.#
|
2098
|
+
return this.#format;
|
2103
2099
|
}
|
2104
2100
|
|
2105
2101
|
hasAlpha(): boolean {
|
2106
|
-
return this.#
|
2102
|
+
return this.#rgba[3] !== 1;
|
2107
2103
|
}
|
2108
2104
|
|
2109
2105
|
detectHEXFormat(): Format {
|
@@ -2115,11 +2111,11 @@ export class Legacy implements Color {
|
|
2115
2111
|
if (format) {
|
2116
2112
|
return this.as(format).asString();
|
2117
2113
|
}
|
2118
|
-
return this.#stringify(format, this.#
|
2114
|
+
return this.#stringify(format, this.#rgba[0], this.#rgba[1], this.#rgba[2]);
|
2119
2115
|
}
|
2120
2116
|
#stringify(format: LegacyColor|undefined, r: number, g: number, b: number): string {
|
2121
2117
|
if (!format) {
|
2122
|
-
format = this.#
|
2118
|
+
format = this.#format;
|
2123
2119
|
}
|
2124
2120
|
|
2125
2121
|
function toHexValue(value: number): string {
|
@@ -2132,7 +2128,7 @@ export class Legacy implements Color {
|
|
2132
2128
|
case Format.RGBA: {
|
2133
2129
|
const start = Platform.StringUtilities.sprintf('rgb(%d %d %d', toRgbValue(r), toRgbValue(g), toRgbValue(b));
|
2134
2130
|
if (this.hasAlpha()) {
|
2135
|
-
return start + Platform.StringUtilities.sprintf(' / %d%)', Math.round(this.#
|
2131
|
+
return start + Platform.StringUtilities.sprintf(' / %d%)', Math.round(this.#rgba[3] * 100));
|
2136
2132
|
}
|
2137
2133
|
return start + ')';
|
2138
2134
|
}
|
@@ -2140,7 +2136,7 @@ export class Legacy implements Color {
|
|
2140
2136
|
case Format.HEXA: {
|
2141
2137
|
if (this.hasAlpha()) {
|
2142
2138
|
return Platform.StringUtilities
|
2143
|
-
.sprintf('#%s%s%s%s', toHexValue(r), toHexValue(g), toHexValue(b), toHexValue(this.#
|
2139
|
+
.sprintf('#%s%s%s%s', toHexValue(r), toHexValue(g), toHexValue(b), toHexValue(this.#rgba[3]))
|
2144
2140
|
.toLowerCase();
|
2145
2141
|
}
|
2146
2142
|
return Platform.StringUtilities.sprintf('#%s%s%s', toHexValue(r), toHexValue(g), toHexValue(b)).toLowerCase();
|
@@ -2162,20 +2158,20 @@ export class Legacy implements Color {
|
|
2162
2158
|
}
|
2163
2159
|
isGamutClipped(): boolean {
|
2164
2160
|
return !equals(
|
2165
|
-
this.#rawParams.map(toRgbValue),
|
2166
|
-
|
2161
|
+
this.#rawParams.map(toRgbValue), [this.#rgba[0], this.#rgba[1], this.#rgba[2]].map(toRgbValue),
|
2162
|
+
WIDE_RANGE_EPSILON);
|
2167
2163
|
}
|
2168
2164
|
|
2169
2165
|
rgba(): Color4D {
|
2170
|
-
return [...this.#
|
2166
|
+
return [...this.#rgba];
|
2171
2167
|
}
|
2172
2168
|
|
2173
2169
|
canonicalRGBA(): Color4D {
|
2174
2170
|
const rgba = new Array(4);
|
2175
2171
|
for (let i = 0; i < 3; ++i) {
|
2176
|
-
rgba[i] = Math.round(this.#
|
2172
|
+
rgba[i] = Math.round(this.#rgba[i] * 255);
|
2177
2173
|
}
|
2178
|
-
rgba[3] = this.#
|
2174
|
+
rgba[3] = this.#rgba[3];
|
2179
2175
|
return rgba as Color4D;
|
2180
2176
|
}
|
2181
2177
|
|
@@ -2200,10 +2196,10 @@ export class Legacy implements Color {
|
|
2200
2196
|
|
2201
2197
|
invert(): Legacy {
|
2202
2198
|
const rgba: Color4D = [0, 0, 0, 0];
|
2203
|
-
rgba[0] = 1 - this.#
|
2204
|
-
rgba[1] = 1 - this.#
|
2205
|
-
rgba[2] = 1 - this.#
|
2206
|
-
rgba[3] = this.#
|
2199
|
+
rgba[0] = 1 - this.#rgba[0];
|
2200
|
+
rgba[1] = 1 - this.#rgba[1];
|
2201
|
+
rgba[2] = 1 - this.#rgba[2];
|
2202
|
+
rgba[3] = this.#rgba[3];
|
2207
2203
|
return new Legacy(rgba, Format.RGBA);
|
2208
2204
|
}
|
2209
2205
|
|
@@ -2212,38 +2208,38 @@ export class Legacy implements Color {
|
|
2212
2208
|
* Note: We override with an alpha of 50% to enhance the dimming effect.
|
2213
2209
|
*/
|
2214
2210
|
grayscale(): Legacy {
|
2215
|
-
const [r, g, b] = this.#
|
2211
|
+
const [r, g, b] = this.#rgba;
|
2216
2212
|
const gray = r * 0.299 + g * 0.587 + b * 0.114;
|
2217
2213
|
return new Legacy([gray, gray, gray, 0.5], Format.RGBA);
|
2218
2214
|
}
|
2219
2215
|
|
2220
2216
|
setAlpha(alpha: number): Legacy {
|
2221
|
-
const rgba: Color4D = [...this.#
|
2217
|
+
const rgba: Color4D = [...this.#rgba];
|
2222
2218
|
rgba[3] = alpha;
|
2223
2219
|
return new Legacy(rgba, Format.RGBA);
|
2224
2220
|
}
|
2225
2221
|
|
2226
2222
|
blendWith(fgColor: Legacy): Legacy {
|
2227
|
-
const rgba: Color4D = blendColors(fgColor.#
|
2223
|
+
const rgba: Color4D = blendColors(fgColor.#rgba, this.#rgba);
|
2228
2224
|
return new Legacy(rgba, Format.RGBA);
|
2229
2225
|
}
|
2230
2226
|
|
2231
2227
|
blendWithAlpha(alpha: number): Legacy {
|
2232
|
-
const rgba: Color4D = [...this.#
|
2228
|
+
const rgba: Color4D = [...this.#rgba];
|
2233
2229
|
rgba[3] *= alpha;
|
2234
2230
|
return new Legacy(rgba, Format.RGBA);
|
2235
2231
|
}
|
2236
2232
|
|
2237
2233
|
setFormat(format: LegacyColor): void {
|
2238
|
-
this.#
|
2234
|
+
this.#format = format;
|
2239
2235
|
}
|
2240
2236
|
|
2241
2237
|
equal(other: Color): boolean {
|
2242
|
-
const legacy = other.as(this.#
|
2243
|
-
return equals(toRgbValue(this.#
|
2244
|
-
equals(toRgbValue(this.#
|
2245
|
-
equals(toRgbValue(this.#
|
2246
|
-
equals(this.#
|
2238
|
+
const legacy = other.as(this.#format);
|
2239
|
+
return equals(toRgbValue(this.#rgba[0]), toRgbValue(legacy.#rgba[0]), WIDE_RANGE_EPSILON) &&
|
2240
|
+
equals(toRgbValue(this.#rgba[1]), toRgbValue(legacy.#rgba[1]), WIDE_RANGE_EPSILON) &&
|
2241
|
+
equals(toRgbValue(this.#rgba[2]), toRgbValue(legacy.#rgba[2]), WIDE_RANGE_EPSILON) &&
|
2242
|
+
equals(this.#rgba[3], legacy.#rgba[3]);
|
2247
2243
|
}
|
2248
2244
|
}
|
2249
2245
|
|
@@ -8,13 +8,13 @@ import {reveal} from './Revealer.js';
|
|
8
8
|
let consoleInstance: Console|undefined;
|
9
9
|
|
10
10
|
export class Console extends ObjectWrapper<EventTypes> {
|
11
|
-
readonly #
|
11
|
+
readonly #messages: Message[];
|
12
12
|
/**
|
13
13
|
* Instantiable via the instance() factory below.
|
14
14
|
*/
|
15
15
|
constructor() {
|
16
16
|
super();
|
17
|
-
this.#
|
17
|
+
this.#messages = [];
|
18
18
|
}
|
19
19
|
|
20
20
|
static instance(opts?: {forceNew: boolean}): Console {
|
@@ -39,7 +39,7 @@ export class Console extends ObjectWrapper<EventTypes> {
|
|
39
39
|
*/
|
40
40
|
addMessage(text: string, level = MessageLevel.INFO, show = false, source?: FrontendMessageSource): void {
|
41
41
|
const message = new Message(text, level, Date.now(), show, source);
|
42
|
-
this.#
|
42
|
+
this.#messages.push(message);
|
43
43
|
this.dispatchEventToListeners(Events.MESSAGE_ADDED, message);
|
44
44
|
}
|
45
45
|
|
@@ -62,7 +62,7 @@ export class Console extends ObjectWrapper<EventTypes> {
|
|
62
62
|
}
|
63
63
|
|
64
64
|
messages(): Message[] {
|
65
|
-
return this.#
|
65
|
+
return this.#messages;
|
66
66
|
}
|
67
67
|
|
68
68
|
show(): void {
|
@@ -95,8 +95,8 @@ export class ParsedURL {
|
|
95
95
|
folderPathComponents: string;
|
96
96
|
lastPathComponent: string;
|
97
97
|
readonly blobInnerScheme: string|undefined;
|
98
|
-
#
|
99
|
-
#
|
98
|
+
#displayName?: string;
|
99
|
+
#dataURLDisplayName?: string;
|
100
100
|
|
101
101
|
constructor(url: string) {
|
102
102
|
this.isValid = false;
|
@@ -494,8 +494,8 @@ export class ParsedURL {
|
|
494
494
|
}
|
495
495
|
|
496
496
|
get displayName(): string {
|
497
|
-
if (this.#
|
498
|
-
return this.#
|
497
|
+
if (this.#displayName) {
|
498
|
+
return this.#displayName;
|
499
499
|
}
|
500
500
|
|
501
501
|
if (this.isDataURL()) {
|
@@ -508,25 +508,25 @@ export class ParsedURL {
|
|
508
508
|
return this.url;
|
509
509
|
}
|
510
510
|
|
511
|
-
this.#
|
512
|
-
if (!this.#
|
513
|
-
this.#
|
511
|
+
this.#displayName = this.lastPathComponent;
|
512
|
+
if (!this.#displayName) {
|
513
|
+
this.#displayName = (this.host || '') + '/';
|
514
514
|
}
|
515
|
-
if (this.#
|
516
|
-
this.#
|
515
|
+
if (this.#displayName === '/') {
|
516
|
+
this.#displayName = this.url;
|
517
517
|
}
|
518
|
-
return this.#
|
518
|
+
return this.#displayName;
|
519
519
|
}
|
520
520
|
|
521
521
|
dataURLDisplayName(): string {
|
522
|
-
if (this.#
|
523
|
-
return this.#
|
522
|
+
if (this.#dataURLDisplayName) {
|
523
|
+
return this.#dataURLDisplayName;
|
524
524
|
}
|
525
525
|
if (!this.isDataURL()) {
|
526
526
|
return '';
|
527
527
|
}
|
528
|
-
this.#
|
529
|
-
return this.#
|
528
|
+
this.#dataURLDisplayName = Platform.StringUtilities.trimEndWithMaxLength(this.url, 20);
|
529
|
+
return this.#dataURLDisplayName;
|
530
530
|
}
|
531
531
|
|
532
532
|
isAboutBlank(): boolean {
|
@@ -159,17 +159,17 @@ const str_ = i18n.i18n.registerUIStrings('core/common/ResourceType.ts', UIString
|
|
159
159
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
160
160
|
|
161
161
|
export class ResourceType {
|
162
|
-
readonly #
|
163
|
-
readonly #
|
164
|
-
readonly #
|
165
|
-
readonly #
|
162
|
+
readonly #name: string;
|
163
|
+
readonly #title: () => Platform.UIString.LocalizedString;
|
164
|
+
readonly #category: ResourceCategory;
|
165
|
+
readonly #isTextType: boolean;
|
166
166
|
|
167
167
|
constructor(
|
168
168
|
name: string, title: () => Platform.UIString.LocalizedString, category: ResourceCategory, isTextType: boolean) {
|
169
|
-
this.#
|
170
|
-
this.#
|
171
|
-
this.#
|
172
|
-
this.#
|
169
|
+
this.#name = name;
|
170
|
+
this.#title = title;
|
171
|
+
this.#category = category;
|
172
|
+
this.#isTextType = isTextType;
|
173
173
|
}
|
174
174
|
|
175
175
|
static fromMimeType(mimeType: string|null): ResourceType {
|
@@ -286,23 +286,23 @@ export class ResourceType {
|
|
286
286
|
}
|
287
287
|
|
288
288
|
name(): string {
|
289
|
-
return this.#
|
289
|
+
return this.#name;
|
290
290
|
}
|
291
291
|
|
292
292
|
title(): string {
|
293
|
-
return this.#
|
293
|
+
return this.#title();
|
294
294
|
}
|
295
295
|
|
296
296
|
category(): ResourceCategory {
|
297
|
-
return this.#
|
297
|
+
return this.#category;
|
298
298
|
}
|
299
299
|
|
300
300
|
isTextType(): boolean {
|
301
|
-
return this.#
|
301
|
+
return this.#isTextType;
|
302
302
|
}
|
303
303
|
|
304
304
|
isScript(): boolean {
|
305
|
-
return this.#
|
305
|
+
return this.#name === 'script' || this.#name === 'sm-script';
|
306
306
|
}
|
307
307
|
|
308
308
|
hasScripts(): boolean {
|
@@ -310,7 +310,7 @@ export class ResourceType {
|
|
310
310
|
}
|
311
311
|
|
312
312
|
isStyleSheet(): boolean {
|
313
|
-
return this.#
|
313
|
+
return this.#name === 'stylesheet' || this.#name === 'sm-stylesheet';
|
314
314
|
}
|
315
315
|
|
316
316
|
hasStyleSheets(): boolean {
|
@@ -318,7 +318,7 @@ export class ResourceType {
|
|
318
318
|
}
|
319
319
|
|
320
320
|
isDocument(): boolean {
|
321
|
-
return this.#
|
321
|
+
return this.#name === 'document';
|
322
322
|
}
|
323
323
|
|
324
324
|
isDocumentOrScriptOrStyleSheet(): boolean {
|
@@ -326,23 +326,23 @@ export class ResourceType {
|
|
326
326
|
}
|
327
327
|
|
328
328
|
isFont(): boolean {
|
329
|
-
return this.#
|
329
|
+
return this.#name === 'font';
|
330
330
|
}
|
331
331
|
|
332
332
|
isImage(): boolean {
|
333
|
-
return this.#
|
333
|
+
return this.#name === 'image';
|
334
334
|
}
|
335
335
|
|
336
336
|
isFromSourceMap(): boolean {
|
337
|
-
return this.#
|
337
|
+
return this.#name.startsWith('sm-');
|
338
338
|
}
|
339
339
|
|
340
340
|
isWebbundle(): boolean {
|
341
|
-
return this.#
|
341
|
+
return this.#name === 'webbundle';
|
342
342
|
}
|
343
343
|
|
344
344
|
toString(): string {
|
345
|
-
return this.#
|
345
|
+
return this.#name;
|
346
346
|
}
|
347
347
|
|
348
348
|
canonicalMimeType(): string {
|
@@ -24,56 +24,55 @@ export class Segment<T> {
|
|
24
24
|
}
|
25
25
|
|
26
26
|
export class SegmentedRange<T> {
|
27
|
-
#
|
27
|
+
#segments: Array<Segment<T>>;
|
28
28
|
readonly #mergeCallback: ((arg0: Segment<T>, arg1: Segment<T>) => Segment<T>| null)|undefined;
|
29
29
|
|
30
30
|
constructor(mergeCallback?: ((arg0: Segment<T>, arg1: Segment<T>) => Segment<T>| null)) {
|
31
|
-
this.#
|
31
|
+
this.#segments = [];
|
32
32
|
this.#mergeCallback = mergeCallback;
|
33
33
|
}
|
34
34
|
|
35
35
|
append(newSegment: Segment<T>): void {
|
36
36
|
// 1. Find the proper insertion point for new segment
|
37
|
-
let startIndex =
|
38
|
-
Platform.ArrayUtilities.lowerBound(this.#segmentsInternal, newSegment, (a, b) => a.begin - b.begin);
|
37
|
+
let startIndex = Platform.ArrayUtilities.lowerBound(this.#segments, newSegment, (a, b) => a.begin - b.begin);
|
39
38
|
let endIndex = startIndex;
|
40
39
|
let merged: (Segment<T>|null)|null = null;
|
41
40
|
if (startIndex > 0) {
|
42
41
|
// 2. Try mering the preceding segment
|
43
|
-
const precedingSegment = this.#
|
42
|
+
const precedingSegment = this.#segments[startIndex - 1];
|
44
43
|
merged = this.tryMerge(precedingSegment, newSegment);
|
45
44
|
if (merged) {
|
46
45
|
--startIndex;
|
47
46
|
newSegment = merged;
|
48
|
-
} else if (this.#
|
47
|
+
} else if (this.#segments[startIndex - 1].end >= newSegment.begin) {
|
49
48
|
// 2a. If merge failed and segments overlap, adjust preceding segment.
|
50
49
|
// If an old segment entirely contains new one, split it in two.
|
51
50
|
if (newSegment.end < precedingSegment.end) {
|
52
|
-
this.#
|
51
|
+
this.#segments.splice(
|
53
52
|
startIndex, 0, new Segment<T>(newSegment.end, precedingSegment.end, precedingSegment.data));
|
54
53
|
}
|
55
54
|
precedingSegment.end = newSegment.begin;
|
56
55
|
}
|
57
56
|
}
|
58
57
|
// 3. Consume all segments that are entirely covered by the new one.
|
59
|
-
while (endIndex < this.#
|
58
|
+
while (endIndex < this.#segments.length && this.#segments[endIndex].end <= newSegment.end) {
|
60
59
|
++endIndex;
|
61
60
|
}
|
62
61
|
// 4. Merge or adjust the succeeding segment if it overlaps.
|
63
|
-
if (endIndex < this.#
|
64
|
-
merged = this.tryMerge(newSegment, this.#
|
62
|
+
if (endIndex < this.#segments.length) {
|
63
|
+
merged = this.tryMerge(newSegment, this.#segments[endIndex]);
|
65
64
|
if (merged) {
|
66
65
|
endIndex++;
|
67
66
|
newSegment = merged;
|
68
|
-
} else if (newSegment.intersects(this.#
|
69
|
-
this.#
|
67
|
+
} else if (newSegment.intersects(this.#segments[endIndex])) {
|
68
|
+
this.#segments[endIndex].begin = newSegment.end;
|
70
69
|
}
|
71
70
|
}
|
72
|
-
this.#
|
71
|
+
this.#segments.splice(startIndex, endIndex - startIndex, newSegment);
|
73
72
|
}
|
74
73
|
|
75
74
|
segments(): Array<Segment<T>> {
|
76
|
-
return this.#
|
75
|
+
return this.#segments;
|
77
76
|
}
|
78
77
|
|
79
78
|
private tryMerge(first: Segment<T>, second: Segment<T>): Segment<T>|null {
|
@@ -354,7 +354,7 @@ export class Deprecation {
|
|
354
354
|
|
355
355
|
export class Setting<V> {
|
356
356
|
#titleFunction?: () => Platform.UIString.LocalizedString;
|
357
|
-
#
|
357
|
+
#title!: Platform.UIString.LocalizedString;
|
358
358
|
#registration: SettingRegistration|null = null;
|
359
359
|
#requiresUserAction?: boolean;
|
360
360
|
#value?: V;
|
@@ -387,8 +387,8 @@ export class Setting<V> {
|
|
387
387
|
}
|
388
388
|
|
389
389
|
title(): Platform.UIString.LocalizedString {
|
390
|
-
if (this.#
|
391
|
-
return this.#
|
390
|
+
if (this.#title) {
|
391
|
+
return this.#title;
|
392
392
|
}
|
393
393
|
if (this.#titleFunction) {
|
394
394
|
return this.#titleFunction();
|
@@ -403,7 +403,7 @@ export class Setting<V> {
|
|
403
403
|
}
|
404
404
|
|
405
405
|
setTitle(title: Platform.UIString.LocalizedString): void {
|
406
|
-
this.#
|
406
|
+
this.#title = title;
|
407
407
|
}
|
408
408
|
|
409
409
|
setRequiresUserAction(requiresUserAction: boolean): void {
|
@@ -8,19 +8,19 @@ export interface OutputStream {
|
|
8
8
|
}
|
9
9
|
|
10
10
|
export class StringOutputStream implements OutputStream {
|
11
|
-
#
|
11
|
+
#data: string;
|
12
12
|
constructor() {
|
13
|
-
this.#
|
13
|
+
this.#data = '';
|
14
14
|
}
|
15
15
|
|
16
16
|
async write(chunk: string): Promise<void> {
|
17
|
-
this.#
|
17
|
+
this.#data += chunk;
|
18
18
|
}
|
19
19
|
|
20
20
|
async close(): Promise<void> {
|
21
21
|
}
|
22
22
|
|
23
23
|
data(): string {
|
24
|
-
return this.#
|
24
|
+
return this.#data;
|
25
25
|
}
|
26
26
|
}
|
@@ -37,6 +37,25 @@ interface CheckElibigilityResponse {
|
|
37
37
|
createProfile: EligibilityStatus;
|
38
38
|
}
|
39
39
|
|
40
|
+
interface BatchGetAwardsResponse {
|
41
|
+
awards?: Award[];
|
42
|
+
}
|
43
|
+
|
44
|
+
export interface Award {
|
45
|
+
name: string;
|
46
|
+
badge: {
|
47
|
+
title: string,
|
48
|
+
description: string,
|
49
|
+
imageUri: string,
|
50
|
+
deletableByUser: boolean,
|
51
|
+
};
|
52
|
+
title: string;
|
53
|
+
description: string;
|
54
|
+
imageUri: string;
|
55
|
+
createTime: string;
|
56
|
+
awardingUri: string;
|
57
|
+
}
|
58
|
+
|
40
59
|
export interface Profile {
|
41
60
|
// Resource name of the profile.
|
42
61
|
// Format: profiles/{obfuscated_profile_id}
|
@@ -49,6 +68,18 @@ export interface Profile {
|
|
49
68
|
};
|
50
69
|
}
|
51
70
|
|
71
|
+
// The `batchGet` awards endpoint returns badge names with an
|
72
|
+
// obfuscated user ID (e.g., `profiles/12345/awards/badge-name`).
|
73
|
+
// This function normalizes them to use `me` instead of the ID
|
74
|
+
// (e.g., `profiles/me/awards/badge-path`) to match the format
|
75
|
+
// used for client-side requests.
|
76
|
+
function normalizeBadgeName(name: string): string {
|
77
|
+
return name.replace(/profiles\/[^/]+\/awards\//, 'profiles/me/awards/');
|
78
|
+
}
|
79
|
+
|
80
|
+
// TODO(crbug.com/441679275): Update once the API is enabled for prod.
|
81
|
+
export const GOOGLE_DEVELOPER_PROGRAM_PROFILE_LINK = 'https://developers.devsite.corp.google.com/profile/u/me';
|
82
|
+
|
52
83
|
async function makeHttpRequest<R extends object>(request: DispatchHttpRequestRequest): Promise<R|null> {
|
53
84
|
if (!Root.Runtime.hostConfig.devToolsGdpProfiles?.enabled) {
|
54
85
|
return null;
|
@@ -113,18 +144,61 @@ export class GdpClient {
|
|
113
144
|
return await this.#cachedEligibilityPromise;
|
114
145
|
}
|
115
146
|
|
147
|
+
/**
|
148
|
+
* @returns null if the request fails, the awarded badge names otherwise.
|
149
|
+
*/
|
150
|
+
async getAwardedBadgeNames({names}: {names: string[]}): Promise<Set<string>|null> {
|
151
|
+
const result = await makeHttpRequest<BatchGetAwardsResponse>({
|
152
|
+
service: SERVICE_NAME,
|
153
|
+
path: '/v1beta1/profiles/me/awards:batchGet',
|
154
|
+
method: 'GET',
|
155
|
+
queryParams: {
|
156
|
+
allowMissing: 'true',
|
157
|
+
names,
|
158
|
+
}
|
159
|
+
});
|
160
|
+
|
161
|
+
if (!result) {
|
162
|
+
return null;
|
163
|
+
}
|
164
|
+
|
165
|
+
return new Set(result.awards?.map(award => normalizeBadgeName(award.name)) ?? []);
|
166
|
+
}
|
167
|
+
|
116
168
|
async isEligibleToCreateProfile(): Promise<boolean> {
|
117
169
|
return (await this.checkEligibility())?.createProfile === EligibilityStatus.ELIGIBLE;
|
118
170
|
}
|
119
171
|
|
120
|
-
createProfile({user, emailPreference}: {user: string, emailPreference: EmailPreference}):
|
121
|
-
|
172
|
+
async createProfile({user, emailPreference}: {user: string, emailPreference: EmailPreference}):
|
173
|
+
Promise<Profile|null> {
|
174
|
+
const result = await makeHttpRequest<Profile>({
|
122
175
|
service: SERVICE_NAME,
|
123
176
|
path: '/v1beta1/profiles',
|
124
177
|
method: 'POST',
|
125
178
|
body: JSON.stringify({
|
126
179
|
user,
|
127
180
|
newsletter_email: emailPreference,
|
181
|
+
}),
|
182
|
+
});
|
183
|
+
if (result) {
|
184
|
+
this.#clearCache();
|
185
|
+
}
|
186
|
+
return result;
|
187
|
+
}
|
188
|
+
|
189
|
+
#clearCache(): void {
|
190
|
+
this.#cachedProfilePromise = undefined;
|
191
|
+
this.#cachedEligibilityPromise = undefined;
|
192
|
+
}
|
193
|
+
|
194
|
+
createAward({name}: {name: string}): Promise<Award|null> {
|
195
|
+
return makeHttpRequest({
|
196
|
+
service: SERVICE_NAME,
|
197
|
+
path: '/v1beta1/profiles/me/awards',
|
198
|
+
method: 'POST',
|
199
|
+
body: JSON.stringify({
|
200
|
+
awardingUri: 'devtools://devtools',
|
201
|
+
name,
|
128
202
|
})
|
129
203
|
});
|
130
204
|
}
|
@@ -423,7 +423,10 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
|
|
423
423
|
},
|
424
424
|
devToolsIpProtectionPanelInDevTools: {
|
425
425
|
enabled: false,
|
426
|
-
}
|
426
|
+
},
|
427
|
+
devToolsFlexibleLayout: {
|
428
|
+
verticalDrawerEnabled: true,
|
429
|
+
},
|
427
430
|
};
|
428
431
|
if ('hostConfigForTesting' in globalThis) {
|
429
432
|
const {hostConfigForTesting} = (globalThis as unknown as {hostConfigForTesting: Root.Runtime.HostConfig});
|
@@ -257,11 +257,13 @@ export type DispatchHttpRequestRequest = {
|
|
257
257
|
service: string,
|
258
258
|
path: string,
|
259
259
|
method: 'GET',
|
260
|
+
queryParams?: Record<string, string|string[]>,
|
260
261
|
body?: never,
|
261
262
|
}|{
|
262
263
|
service: string,
|
263
264
|
path: string,
|
264
265
|
method: 'POST',
|
266
|
+
queryParams?: Record<string, string|string[]>,
|
265
267
|
// A JSON string containing the request body.
|
266
268
|
body?: string,
|
267
269
|
};
|