chrome-devtools-frontend 1.0.1695017 → 1.0.1696961
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/eslint.config.mjs +4 -1
- package/front_end/core/common/Base64.ts +14 -4
- package/front_end/core/common/Gzip.ts +1 -1
- package/front_end/core/common/Object.ts +0 -1
- package/front_end/core/platform/Size.ts +43 -0
- package/front_end/core/platform/api/HostRuntime.ts +14 -0
- package/front_end/core/platform/browser/HostRuntime.ts +66 -0
- package/front_end/core/platform/node/HostRuntime.ts +12 -3
- package/front_end/core/platform/platform.ts +1 -0
- package/front_end/core/sdk/AccessibilityModel.ts +2 -2
- package/front_end/core/sdk/CSSMatchedStyles.ts +2 -0
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +29 -0
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +2 -2
- package/front_end/core/sdk/ConsoleModel.ts +3 -3
- package/front_end/core/sdk/DOMModel.ts +10 -6
- package/front_end/core/sdk/DebuggerModel.ts +6 -0
- package/front_end/core/sdk/NetworkRequest.ts +19 -19
- package/front_end/core/sdk/RuntimeModel.ts +5 -0
- package/front_end/core/sdk/Script.ts +2 -2
- package/front_end/core/sdk/ServerTiming.ts +6 -6
- package/front_end/core/sdk/SourceMap.ts +112 -14
- package/front_end/core/sdk/SourceMapRangeMappings.ts +43 -0
- package/front_end/core/sdk/SourceMapScopeChainEntry.ts +15 -10
- package/front_end/core/sdk/SourceMapScopesInfo.ts +92 -10
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +1 -1
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +6 -6
- package/front_end/entrypoints/main/MainImpl.ts +1 -1
- package/front_end/generated/InspectorBackendCommands.ts +6 -3
- package/front_end/generated/protocol-mapping.d.ts +7 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/generated/protocol.ts +36 -3
- package/front_end/models/ai_assistance/AiAgent2.ts +27 -27
- package/front_end/models/ai_assistance/agents/AiAgent.ts +4 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/contexts/AccessibilityContext.ts +1 -0
- package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +5 -4
- package/front_end/models/ai_assistance/contexts/FileContext.ts +1 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +1 -0
- package/front_end/models/ai_assistance/contexts/RequestContext.ts +1 -0
- package/front_end/models/ai_assistance/contexts/StorageContext.ts +1 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +5 -5
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +5 -8
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +4 -8
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +7 -5
- package/front_end/models/ai_assistance/tools/GetStyles.ts +10 -6
- package/front_end/models/ai_assistance/tools/ListSources.ts +26 -7
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +5 -10
- package/front_end/models/ai_assistance/tools/Tool.ts +8 -1
- package/front_end/models/bindings/FileUtils.ts +18 -40
- package/front_end/models/bindings/TempFile.ts +5 -12
- package/front_end/models/comment_manager/CommentManager.ts +30 -6
- package/front_end/models/crux-manager/CrUXManager.ts +8 -5
- package/front_end/models/emulation/DeviceModeModel.ts +55 -105
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +1 -1
- package/front_end/models/issues_manager/CookieIssue.ts +1 -1
- package/front_end/models/issues_manager/DeprecationIssue.ts +2 -2
- package/front_end/models/javascript_metadata/NativeFunctions.ts +1 -5
- package/front_end/models/live-metrics/LiveMetrics.ts +1 -1
- package/front_end/models/persistence/IsolatedFileSystem.ts +16 -23
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -1
- package/front_end/models/trace/insights/INPBreakdown.ts +1 -1
- package/front_end/models/trace/insights/ImageDelivery.ts +3 -3
- package/front_end/models/trace/insights/LCPDiscovery.ts +2 -2
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +3 -3
- package/front_end/models/trace/insights/Viewport.ts +1 -1
- package/front_end/models/trace/types/Overlays.ts +2 -2
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +2 -2
- package/front_end/panels/accessibility/AccessibilitySubPane.ts +0 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +74 -18
- package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +14 -3
- package/front_end/panels/ai_assistance/components/ChatInput.ts +1 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +1 -1
- package/front_end/panels/animation/AnimationUI.ts +1 -1
- package/front_end/panels/application/AppManifestView.ts +9 -11
- package/front_end/panels/application/ApplicationPanelSidebar.ts +9 -9
- package/front_end/panels/application/BackgroundServiceView.ts +1 -1
- package/front_end/panels/application/CookieItemsView.ts +1 -1
- package/front_end/panels/application/DOMStorageItemsView.ts +1 -1
- package/front_end/panels/application/DeviceBoundSessionsView.ts +2 -2
- package/front_end/panels/application/FrameDetailsView.ts +5 -5
- package/front_end/panels/application/IndexedDBViews.ts +2 -2
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -2
- package/front_end/panels/application/ReportingApiView.ts +1 -1
- package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +1 -1
- package/front_end/panels/application/ServiceWorkersView.ts +1 -1
- package/front_end/panels/application/StorageBucketsTreeElement.ts +1 -1
- package/front_end/panels/application/WebMCPView.ts +1 -1
- package/front_end/panels/application/components/AdsView.ts +136 -7
- package/front_end/panels/application/components/BackForwardCacheStrings.ts +116 -117
- package/front_end/panels/application/components/BackForwardCacheView.ts +7 -7
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +2 -2
- package/front_end/panels/application/components/PermissionsPolicySection.ts +2 -2
- package/front_end/panels/application/components/ProtocolHandlersView.ts +1 -1
- package/front_end/panels/application/components/ReportsGrid.ts +1 -1
- package/front_end/panels/application/components/StorageMetadataView.ts +1 -1
- package/front_end/panels/application/components/TrustTokensView.ts +3 -3
- package/front_end/panels/application/components/adScriptsTable.css +22 -0
- package/front_end/panels/application/preloading/PreloadingView.ts +20 -22
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +9 -9
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +31 -33
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +23 -23
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +4 -4
- package/front_end/panels/application/preloading/components/PreloadingString.ts +161 -161
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -6
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +8 -8
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +32 -32
- package/front_end/panels/application/resourcesPanel.css +17 -17
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +1 -1
- package/front_end/panels/changes/ChangesView.ts +1 -1
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +1 -1
- package/front_end/panels/common/CPUThrottlingOption.ts +0 -1
- package/front_end/panels/common/GdpSignUpDialog.ts +3 -4
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +1 -1
- package/front_end/panels/console/ConsolePinPane.ts +0 -1
- package/front_end/panels/console/ConsoleView.ts +2 -3
- package/front_end/panels/console/ConsoleViewMessage.ts +2 -3
- package/front_end/panels/coverage/CoverageListView.ts +6 -6
- package/front_end/panels/coverage/CoverageView.ts +7 -7
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +10 -10
- package/front_end/panels/elements/ElementsPanel.ts +3 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/elements/LayoutPane.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +85 -2
- package/front_end/panels/elements/StylesSidebarPane.ts +3 -3
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +2 -1
- package/front_end/panels/emulation/DeviceModeView.ts +1 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +57 -89
- package/front_end/panels/explain/components/ConsoleInsight.ts +4 -4
- package/front_end/panels/issues/AffectedPartitioningBlobURLView.ts +3 -3
- package/front_end/panels/issues/IssuesPane.ts +1 -1
- package/front_end/panels/layer_viewer/Layers3DView.ts +4 -4
- package/front_end/panels/layers/LayerTreeModel.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +4 -4
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +10 -10
- package/front_end/panels/lighthouse/LighthouseTimespanView.ts +2 -2
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +1 -1
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +1 -1
- package/front_end/panels/media/MainView.ts +2 -2
- package/front_end/panels/mobile_throttling/CalibrationController.ts +4 -1
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +10 -0
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +3 -3
- package/front_end/panels/network/NetworkConfigView.ts +26 -16
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/network/NetworkLogView.ts +4 -5
- package/front_end/panels/network/NetworkPanel.ts +1 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +3 -3
- package/front_end/panels/network/RequestCookiesView.ts +2 -2
- package/front_end/panels/network/RequestPayloadView.ts +0 -2
- package/front_end/panels/network/RequestTimingView.ts +1 -1
- package/front_end/panels/network/ResourceChunkView.ts +1 -1
- package/front_end/panels/network/components/HeaderSectionRow.ts +2 -2
- package/front_end/panels/network/components/RequestHeaderSection.ts +1 -1
- package/front_end/panels/network/components/RequestTrustTokensView.ts +7 -7
- package/front_end/panels/network/components/ResponseHeaderSection.ts +3 -4
- package/front_end/panels/network/network-meta.ts +1 -1
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +10 -10
- package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
- package/front_end/panels/profiler/IsolateSelector.ts +4 -4
- package/front_end/panels/profiler/ModuleUIStrings.ts +1 -1
- package/front_end/panels/profiler/ProfilesPanel.ts +2 -3
- package/front_end/panels/recorder/RecorderPanel.ts +1 -1
- package/front_end/panels/search/SearchView.ts +6 -6
- package/front_end/panels/security/SecurityModel.ts +4 -4
- package/front_end/panels/security/SecurityPanel.ts +83 -54
- package/front_end/panels/security/SecurityPanelSidebar.ts +41 -5
- package/front_end/panels/security/sidebar.css +9 -10
- package/front_end/panels/sensors/SensorsView.ts +1 -1
- package/front_end/panels/settings/AISettingsTab.ts +9 -9
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
- package/front_end/panels/settings/KeybindsSettingsTab.ts +2 -2
- package/front_end/panels/settings/SettingsScreen.ts +156 -109
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/settings/components/SyncSection.ts +3 -3
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +13 -13
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +1 -1
- package/front_end/panels/sources/CSSPlugin.ts +3 -3
- package/front_end/panels/sources/DebuggerPlugin.ts +4 -4
- package/front_end/panels/sources/NavigatorView.ts +3 -3
- package/front_end/panels/sources/OutlineQuickOpen.ts +1 -1
- package/front_end/panels/sources/PersistenceActions.ts +2 -2
- package/front_end/panels/sources/SourcesNavigator.ts +5 -5
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +0 -1
- package/front_end/panels/sources/components/HeadersView.ts +1 -1
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +1 -1
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +1 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +0 -1
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +2 -2
- package/front_end/panels/timeline/components/FieldSettingsDialog.ts +4 -4
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +7 -7
- package/front_end/panels/timeline/components/MetricCard.ts +3 -3
- package/front_end/panels/timeline/components/MetricCompareStrings.ts +12 -14
- package/front_end/panels/timeline/components/OriginMap.ts +3 -3
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +4 -4
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +6 -0
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +1 -1
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +3 -1
- package/front_end/panels/timeline/timelineMiniMap.css +9 -9
- package/front_end/panels/timeline/timelineStatusDialog.css +9 -9
- package/front_end/panels/web_audio/WebAudioView.ts +1 -1
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +114 -3
- package/front_end/ui/comments/CommentOverlayManager.ts +95 -16
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +1 -1
- package/front_end/ui/components/markdown_view/codeBlock.css +3 -8
- package/front_end/ui/components/markdown_view/markdownView.css +2 -7
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +2 -2
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +4 -4
- package/front_end/ui/components/text_editor/AiCodeGenerationTeaser.ts +3 -3
- package/front_end/{models → ui}/geometry/GeometryImpl.ts +4 -40
- package/front_end/ui/legacy/GlassPane.ts +1 -1
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +2 -2
- package/front_end/ui/legacy/SoftDropDown.ts +1 -1
- package/front_end/ui/legacy/SplitWidget.ts +1 -1
- package/front_end/ui/legacy/SuggestBox.ts +1 -1
- package/front_end/ui/legacy/TabbedPane.ts +1 -1
- package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
- package/front_end/ui/legacy/Treeoutline.ts +5 -1
- package/front_end/ui/legacy/UIUtils.ts +1 -1
- package/front_end/ui/legacy/Widget.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingModel.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingUI.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/BezierUI.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/CSSAngleUtils.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/PositionAreaEditor.ts +204 -17
- package/front_end/ui/legacy/components/inline_editor/positionAreaEditor.css +6 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +7 -9
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +12 -0
- package/package.json +7 -4
- /package/front_end/{models → ui}/geometry/geometry.ts +0 -0
|
@@ -7,6 +7,7 @@ import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.j
|
|
|
7
7
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
8
8
|
|
|
9
9
|
export type EditorAnchorSignature = CommentManager.CommentManager.EditorAnchorSignature;
|
|
10
|
+
export type TimelineAnchorSignature = CommentManager.CommentManager.TimelineAnchorSignature;
|
|
10
11
|
export type CommentAnchorSignature = CommentManager.CommentManager.CommentAnchorSignature;
|
|
11
12
|
export type CommentThread = CommentManager.CommentManager.CommentThread;
|
|
12
13
|
|
|
@@ -67,6 +68,101 @@ export function getEditorFilePath(element: Element): string|undefined {
|
|
|
67
68
|
return element.getAttribute('data-file-path') ?? undefined;
|
|
68
69
|
}
|
|
69
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Determines whether an anchor is backed by a tracked DOM element.
|
|
73
|
+
*
|
|
74
|
+
* Canvas-rendered anchors (such as Performance panel timeline entries) do not have
|
|
75
|
+
* individual DOM nodes and manage their own overlays in canvas coordinates.
|
|
76
|
+
* These anchors return false and bypass DOM-level node caching, rematching,
|
|
77
|
+
* and IntersectionObserver tracking.
|
|
78
|
+
*
|
|
79
|
+
* @param anchor The comment anchor signature to check.
|
|
80
|
+
* @returns True if the anchor corresponds to a DOM-tracked element; otherwise false.
|
|
81
|
+
*/
|
|
82
|
+
export function isDomTrackedAnchor(anchor: CommentAnchorSignature): boolean {
|
|
83
|
+
return !anchor.timeline;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Result returned by a {@link CustomAnchorResolver} representing an anchor
|
|
88
|
+
* within a specialized or canvas-rendered view.
|
|
89
|
+
*/
|
|
90
|
+
export interface CustomAnchorResult {
|
|
91
|
+
/** The anchor signature representing the commented item. */
|
|
92
|
+
anchor: CommentAnchorSignature;
|
|
93
|
+
/** The DOM element acting as the visual host (e.g. the canvas element). */
|
|
94
|
+
anchorElement?: Element;
|
|
95
|
+
/** Optional bounding box within the page for the hover or highlight overlay. */
|
|
96
|
+
highlightRect?: {top: number, left: number, width: number, height: number, visible?: boolean};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Extension point allowing views that render custom content (such as canvas-based
|
|
101
|
+
* flame charts) to provide custom anchor resolution for comments without direct DOM nodes.
|
|
102
|
+
*/
|
|
103
|
+
export interface CustomAnchorResolver {
|
|
104
|
+
/**
|
|
105
|
+
* Determines whether this resolver can handle anchors for the target element.
|
|
106
|
+
*
|
|
107
|
+
* @param element The element currently hovered or clicked.
|
|
108
|
+
* @returns True if this resolver manages anchors within the given element.
|
|
109
|
+
*/
|
|
110
|
+
matches(element: Element): boolean;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Resolves an anchor signature and highlight bounds for a point within the element.
|
|
114
|
+
*
|
|
115
|
+
* @param element The target element matched by this resolver.
|
|
116
|
+
* @param options Pointer coordinates and a flag indicating if resolution is for a hover preview.
|
|
117
|
+
* @returns The resolved anchor result, or null if no anchor is present at the specified location.
|
|
118
|
+
*/
|
|
119
|
+
resolve(element: Element, options?: {clientX: number, clientY: number, forHover?: boolean}): CustomAnchorResult|null;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const customAnchorResolvers = new Set<CustomAnchorResolver>();
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Registers a custom anchor resolver. Usually called when a view becomes visible
|
|
126
|
+
* (e.g. inside `wasShown()`).
|
|
127
|
+
*
|
|
128
|
+
* @param resolver The custom anchor resolver to register.
|
|
129
|
+
*/
|
|
130
|
+
export function registerCustomAnchorResolver(resolver: CustomAnchorResolver): void {
|
|
131
|
+
customAnchorResolvers.add(resolver);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Unregisters a custom anchor resolver. Usually called when a view hides
|
|
136
|
+
* (e.g. inside `willHide()`).
|
|
137
|
+
*
|
|
138
|
+
* @param resolver The custom anchor resolver to unregister.
|
|
139
|
+
*/
|
|
140
|
+
export function unregisterCustomAnchorResolver(resolver: CustomAnchorResolver): void {
|
|
141
|
+
customAnchorResolvers.delete(resolver);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Clears all registered custom anchor resolvers. Test-only helper.
|
|
146
|
+
*/
|
|
147
|
+
export function clearCustomAnchorResolversForTest(): void {
|
|
148
|
+
customAnchorResolvers.clear();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Finds the first registered custom anchor resolver that matches the given element.
|
|
153
|
+
*
|
|
154
|
+
* @param element The element to check.
|
|
155
|
+
* @returns The matching resolver, or null if no resolver matches.
|
|
156
|
+
*/
|
|
157
|
+
export function getCustomAnchorResolverForElement(element: Element): CustomAnchorResolver|null {
|
|
158
|
+
for (const resolver of customAnchorResolvers) {
|
|
159
|
+
if (resolver.matches(element)) {
|
|
160
|
+
return resolver;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
|
|
70
166
|
/**
|
|
71
167
|
* Checks whether an element contains non-empty text content (after trimming whitespace),
|
|
72
168
|
* including text from any nested shadow roots.
|
|
@@ -183,10 +279,19 @@ function resolveCodeMirrorLineInfo(element: Element): CodeMirrorLineInfo|null {
|
|
|
183
279
|
* @param element The source DOM element to resolve.
|
|
184
280
|
* @returns The resolved semantic anchor Element, or null if unresolvable/empty/excluded.
|
|
185
281
|
*/
|
|
186
|
-
export function resolveCommentAnchorElement(
|
|
282
|
+
export function resolveCommentAnchorElement(
|
|
283
|
+
element: Element, options?: {clientX: number, clientY: number, forHover?: boolean}): Element|null {
|
|
187
284
|
if (isTabTitle(element)) {
|
|
188
285
|
return null;
|
|
189
286
|
}
|
|
287
|
+
const customResolver = getCustomAnchorResolverForElement(element);
|
|
288
|
+
if (customResolver) {
|
|
289
|
+
const result = customResolver.resolve(element, options);
|
|
290
|
+
if (!result) {
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
293
|
+
return result.anchorElement ?? element;
|
|
294
|
+
}
|
|
190
295
|
// CodeMirror internal lines, gutters, and content live inside .cm-editor.
|
|
191
296
|
// We only allow commenting on non-empty lines within the editor; the whole editor
|
|
192
297
|
// container is never a valid comment target.
|
|
@@ -326,8 +431,14 @@ function checkCodeMirrorLineMatch(editor: Element, editorLineNumber: number, tex
|
|
|
326
431
|
* @returns The resolved CommentAnchorSignature, or null if unresolvable.
|
|
327
432
|
*/
|
|
328
433
|
export function resolveCommentAnchor(
|
|
329
|
-
element: Element, root: Document|Element = element.ownerDocument || document
|
|
330
|
-
|
|
434
|
+
element: Element, root: Document|Element = element.ownerDocument || document,
|
|
435
|
+
options?: {clientX: number, clientY: number, forHover?: boolean}): CommentAnchorSignature|null {
|
|
436
|
+
const customResolver = getCustomAnchorResolverForElement(element);
|
|
437
|
+
if (customResolver) {
|
|
438
|
+
const result = customResolver.resolve(element, options);
|
|
439
|
+
return result ? result.anchor : null;
|
|
440
|
+
}
|
|
441
|
+
const target = resolveCommentAnchorElement(element, options);
|
|
331
442
|
if (!target) {
|
|
332
443
|
return null;
|
|
333
444
|
}
|
|
@@ -6,10 +6,14 @@ import * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import * as CommentManager from '../../models/comment_manager/comment_manager.js';
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
+
type CommentAnchorSignature,
|
|
9
10
|
type CommentThread,
|
|
10
11
|
computeVisibleRect,
|
|
12
|
+
type CustomAnchorResolver,
|
|
11
13
|
deepQuerySelectorAll,
|
|
14
|
+
getCustomAnchorResolverForElement,
|
|
12
15
|
getEditorFilePath,
|
|
16
|
+
isDomTrackedAnchor,
|
|
13
17
|
rematchCommentAnchor,
|
|
14
18
|
resolveCommentAnchor,
|
|
15
19
|
resolveCommentAnchorElement,
|
|
@@ -212,31 +216,51 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
212
216
|
return this.#highlightRects;
|
|
213
217
|
}
|
|
214
218
|
|
|
215
|
-
handleElementClick(
|
|
219
|
+
handleElementClick(
|
|
220
|
+
element: Element,
|
|
221
|
+
commentText = 'New comment',
|
|
222
|
+
options?: {clientX: number, clientY: number},
|
|
223
|
+
): CommentThread|null {
|
|
216
224
|
if (!this.isCommentMode()) {
|
|
217
225
|
return null;
|
|
218
226
|
}
|
|
219
|
-
return this.createComment(element, commentText, 'DEVELOPER');
|
|
227
|
+
return this.createComment(element, commentText, 'DEVELOPER', undefined, options);
|
|
220
228
|
}
|
|
221
229
|
|
|
222
230
|
createComment(
|
|
223
231
|
element: Element,
|
|
224
232
|
text: string,
|
|
225
233
|
author: 'DEVELOPER'|'AGENT' = 'DEVELOPER',
|
|
226
|
-
changes?:
|
|
234
|
+
changes?: CommentManager.CommentManager.ChangeRecord[],
|
|
235
|
+
options?: {clientX: number, clientY: number},
|
|
227
236
|
): CommentThread|null {
|
|
228
|
-
|
|
229
|
-
|
|
237
|
+
let anchorEl: Element|null = null;
|
|
238
|
+
let anchor: CommentAnchorSignature|null = null;
|
|
239
|
+
const customResolver = getCustomAnchorResolverForElement(element);
|
|
240
|
+
if (customResolver) {
|
|
241
|
+
const result = customResolver.resolve(element, options);
|
|
242
|
+
if (result) {
|
|
243
|
+
anchor = result.anchor;
|
|
244
|
+
anchorEl = result.anchorElement ?? element;
|
|
245
|
+
}
|
|
246
|
+
} else {
|
|
247
|
+
anchorEl = resolveCommentAnchorElement(element, options);
|
|
248
|
+
anchor = resolveCommentAnchor(element, undefined, options);
|
|
249
|
+
}
|
|
230
250
|
if (!anchor || !anchorEl) {
|
|
231
251
|
return null;
|
|
232
252
|
}
|
|
233
253
|
|
|
234
254
|
const thread = this.#commentManager.createCommentThread(anchor, text, author, changes);
|
|
235
|
-
|
|
255
|
+
// Non-DOM anchors (e.g. canvas-rendered timeline entries) manage their own overlays
|
|
256
|
+
// and do not have individual backing DOM nodes to cache or observe.
|
|
257
|
+
if (isDomTrackedAnchor(anchor)) {
|
|
258
|
+
this.#liveNodeCache.set(thread, anchorEl);
|
|
236
259
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
260
|
+
const observer = this.#getIntersectionObserver();
|
|
261
|
+
observer.observe(anchorEl);
|
|
262
|
+
this.#observedThreads.add(anchorEl);
|
|
263
|
+
}
|
|
240
264
|
|
|
241
265
|
this.#updatePositions();
|
|
242
266
|
return thread;
|
|
@@ -287,6 +311,10 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
287
311
|
const newElements = new Set<Element>();
|
|
288
312
|
|
|
289
313
|
for (const thread of this.#commentManager.getCommentThreads()) {
|
|
314
|
+
// Non-DOM anchors do not track DOM nodes and should not be rematched here.
|
|
315
|
+
if (!isDomTrackedAnchor(thread.anchor)) {
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
290
318
|
const oldEl = this.#liveNodeCache.get(thread);
|
|
291
319
|
if (oldEl) {
|
|
292
320
|
oldElements.add(oldEl);
|
|
@@ -324,6 +352,10 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
324
352
|
const elementPinCounts = new Map<Element, number>();
|
|
325
353
|
|
|
326
354
|
for (const thread of this.#commentManager.getCommentThreads()) {
|
|
355
|
+
// Non-DOM anchors have their positions managed by their respective panels.
|
|
356
|
+
if (!isDomTrackedAnchor(thread.anchor)) {
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
327
359
|
const el = this.#liveNodeCache.get(thread) || null;
|
|
328
360
|
if (!el || !el.isConnected) {
|
|
329
361
|
continue;
|
|
@@ -424,6 +456,9 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
424
456
|
this.#removeResizeObserver();
|
|
425
457
|
this.#removeMutationObserver();
|
|
426
458
|
this.#clearHover();
|
|
459
|
+
this.#intersectionObserver?.disconnect();
|
|
460
|
+
this.#intersectionObserver = undefined;
|
|
461
|
+
this.#observedThreads = new WeakSet();
|
|
427
462
|
}
|
|
428
463
|
|
|
429
464
|
/**
|
|
@@ -448,7 +483,9 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
448
483
|
if (!(target instanceof Element)) {
|
|
449
484
|
return;
|
|
450
485
|
}
|
|
451
|
-
const
|
|
486
|
+
const mouseEvent = event as MouseEvent;
|
|
487
|
+
const options = {clientX: mouseEvent.clientX, clientY: mouseEvent.clientY};
|
|
488
|
+
const thread = this.handleElementClick(target, defaultText, options);
|
|
452
489
|
if (thread) {
|
|
453
490
|
event.consume(true);
|
|
454
491
|
}
|
|
@@ -463,7 +500,9 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
463
500
|
if (!(target instanceof Element)) {
|
|
464
501
|
return;
|
|
465
502
|
}
|
|
466
|
-
const
|
|
503
|
+
const mouseEvent = event as MouseEvent;
|
|
504
|
+
const options = {clientX: mouseEvent.clientX, clientY: mouseEvent.clientY};
|
|
505
|
+
const anchorEl = resolveCommentAnchorElement(target, options);
|
|
467
506
|
if (anchorEl) {
|
|
468
507
|
event.consume(true);
|
|
469
508
|
}
|
|
@@ -481,7 +520,14 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
481
520
|
return;
|
|
482
521
|
}
|
|
483
522
|
const isLeaveEvent = event.type === 'mouseout' || event.type === 'mouseleave' || event.type === 'pointerout';
|
|
484
|
-
const
|
|
523
|
+
const customResolver = getCustomAnchorResolverForElement(target);
|
|
524
|
+
if (customResolver) {
|
|
525
|
+
this.#handleCustomHover(target, event, customResolver);
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
const mouseEvent = event as MouseEvent;
|
|
529
|
+
const options = {clientX: mouseEvent.clientX, clientY: mouseEvent.clientY};
|
|
530
|
+
const anchorEl = resolveCommentAnchorElement(target, options);
|
|
485
531
|
if (isLeaveEvent) {
|
|
486
532
|
const relatedTarget = (event as MouseEvent | PointerEvent).relatedTarget;
|
|
487
533
|
if (anchorEl && relatedTarget instanceof Node && anchorEl.isSelfOrAncestor(relatedTarget)) {
|
|
@@ -551,6 +597,43 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
551
597
|
}
|
|
552
598
|
}
|
|
553
599
|
|
|
600
|
+
/**
|
|
601
|
+
* Handles hover events for elements managed by a {@link CustomAnchorResolver}
|
|
602
|
+
* (e.g. canvas-rendered flame charts where individual items lack backing DOM nodes).
|
|
603
|
+
* Uses coordinate hit-testing to highlight specific entries rather than the entire element.
|
|
604
|
+
*/
|
|
605
|
+
#handleCustomHover(target: Element, event: Event, customResolver: CustomAnchorResolver): void {
|
|
606
|
+
const isLeaveEvent = event.type === 'mouseout' || event.type === 'mouseleave' || event.type === 'pointerout';
|
|
607
|
+
if (isLeaveEvent) {
|
|
608
|
+
this.#clearHover();
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
const mouseEvent = event as MouseEvent;
|
|
613
|
+
const result = customResolver.resolve(
|
|
614
|
+
target,
|
|
615
|
+
{clientX: mouseEvent.clientX, clientY: mouseEvent.clientY, forHover: true},
|
|
616
|
+
);
|
|
617
|
+
if (result) {
|
|
618
|
+
if (result.highlightRect && result.highlightRect.visible !== false) {
|
|
619
|
+
this.#setHoverHighlight({
|
|
620
|
+
top: result.highlightRect.top,
|
|
621
|
+
left: result.highlightRect.left,
|
|
622
|
+
width: result.highlightRect.width,
|
|
623
|
+
height: result.highlightRect.height,
|
|
624
|
+
visible: result.highlightRect.visible ?? true,
|
|
625
|
+
});
|
|
626
|
+
} else {
|
|
627
|
+
this.#setHoverHighlight(null);
|
|
628
|
+
}
|
|
629
|
+
this.#setHoverCursor(result.anchorElement ?? target);
|
|
630
|
+
event.consume(true);
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
this.#clearHover();
|
|
635
|
+
}
|
|
636
|
+
|
|
554
637
|
/**
|
|
555
638
|
* Registers a capturing scroll listener on the window or target container.
|
|
556
639
|
*
|
|
@@ -678,12 +761,8 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
678
761
|
clear(): void {
|
|
679
762
|
this.#commentManager.clear();
|
|
680
763
|
this.stop();
|
|
681
|
-
this.#intersectionObserver?.disconnect();
|
|
682
|
-
this.#intersectionObserver = undefined;
|
|
683
|
-
this.#observedThreads = new WeakSet();
|
|
684
764
|
this.#pinPositions = [];
|
|
685
765
|
this.#highlightRects = [];
|
|
686
|
-
this.#clearHover();
|
|
687
766
|
this.#updatePositions();
|
|
688
767
|
}
|
|
689
768
|
}
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
import * as Host from '../../../core/host/host.js';
|
|
8
8
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
9
9
|
import type * as Platform from '../../../core/platform/platform.js';
|
|
10
|
-
import * as Geometry from '../../../models/geometry/geometry.js';
|
|
11
10
|
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
12
11
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
12
|
+
import * as Geometry from '../../geometry/geometry.js';
|
|
13
13
|
|
|
14
14
|
import typeToAllowDialogStyles from './typeToAllowDialog.css.js';
|
|
15
15
|
|
|
@@ -17,11 +17,6 @@
|
|
|
17
17
|
This can be changed from outside by targeting `devtools-code-block` element.
|
|
18
18
|
*/
|
|
19
19
|
--code-block-max-code-height: none;
|
|
20
|
-
/**
|
|
21
|
-
Adjusts the background color of the code block element.
|
|
22
|
-
This can be changed from outside by targeting `devtools-code-block` element.
|
|
23
|
-
*/
|
|
24
|
-
--code-block-background-color: var(--sys-color-surface2);
|
|
25
20
|
}
|
|
26
21
|
|
|
27
22
|
.codeblock {
|
|
@@ -31,7 +26,7 @@
|
|
|
31
26
|
|
|
32
27
|
.codeblock .editor-wrapper {
|
|
33
28
|
color: var(--sys-color-on-surface);
|
|
34
|
-
background: var(--code-block-background-color); /* stylelint-disable-line plugin/use_theme_colors */
|
|
29
|
+
background: var(--code-block-background-color, var(--sys-color-surface2)); /* stylelint-disable-line plugin/use_theme_colors */
|
|
35
30
|
padding: 10px 5px 0;
|
|
36
31
|
border-bottom-left-radius: var(--sys-shape-corner-extra-small);
|
|
37
32
|
border-bottom-right-radius: var(--sys-shape-corner-extra-small);
|
|
@@ -110,7 +105,7 @@
|
|
|
110
105
|
.notice {
|
|
111
106
|
margin-top: var(--sys-size-2);
|
|
112
107
|
padding: var(--sys-size-4) var(--sys-size-5);
|
|
113
|
-
background-color: var(--code-block-background-color); /* stylelint-disable-line plugin/use_theme_colors */
|
|
108
|
+
background-color: var(--code-block-background-color, var(--sys-color-surface2)); /* stylelint-disable-line plugin/use_theme_colors */
|
|
114
109
|
border-radius: var(--sys-shape-corner-extra-small);
|
|
115
110
|
|
|
116
111
|
.link {
|
|
@@ -125,5 +120,5 @@
|
|
|
125
120
|
justify-content: center;
|
|
126
121
|
align-items: center;
|
|
127
122
|
padding: var(--sys-size-4) 0;
|
|
128
|
-
background-color: var(--code-block-background-color); /* stylelint-disable-line plugin/use_theme_colors */
|
|
123
|
+
background-color: var(--code-block-background-color, var(--sys-color-surface2)); /* stylelint-disable-line plugin/use_theme_colors */
|
|
129
124
|
}
|
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
* Use of this source code is governed by a BSD-style license that can be
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
:host {
|
|
8
|
-
--code-background-color: var(--sys-color-surface4);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
6
|
@keyframes typing {
|
|
12
7
|
from { width: 0; }
|
|
13
8
|
to { width: 100%; }
|
|
@@ -101,9 +96,9 @@ devtools-code-block.animating {
|
|
|
101
96
|
font-size: var(--sys-typescale-monospace-size);
|
|
102
97
|
user-select: text;
|
|
103
98
|
cursor: text;
|
|
104
|
-
/* This is
|
|
99
|
+
/* This is using design tokens when the --code-bacground-color is not provided from outside, e.g. in comments */
|
|
105
100
|
/* stylelint-disable-next-line plugin/use_theme_colors */
|
|
106
|
-
background-color: var(--code-background-color);
|
|
101
|
+
background-color: var(--code-background-color, var(--sys-color-surface4));
|
|
107
102
|
border-radius: var(--sys-size-2);
|
|
108
103
|
padding: var(--sys-size-1) 3px;
|
|
109
104
|
}
|
|
@@ -16,11 +16,11 @@ const UIStrings = {
|
|
|
16
16
|
/**
|
|
17
17
|
* @description Introduction sentence to convey the feature is being actively worked on and we are looking for feedback.
|
|
18
18
|
*/
|
|
19
|
-
previewText: 'Our team is actively working on this feature and we would love to know what you think
|
|
19
|
+
previewText: 'Our team is actively working on this feature and we would love to know what you think',
|
|
20
20
|
/**
|
|
21
21
|
* @description Link text the user can click to provide feedback to the team.
|
|
22
22
|
*/
|
|
23
|
-
previewTextFeedbackLink: 'Send us your feedback
|
|
23
|
+
previewTextFeedbackLink: 'Send us your feedback',
|
|
24
24
|
/**
|
|
25
25
|
* @description Title of the UI section that shows the user that this feature is in preview. Used as the main heading. Not a verb.
|
|
26
26
|
*/
|
|
@@ -25,7 +25,7 @@ const UIStrings = {
|
|
|
25
25
|
/**
|
|
26
26
|
* @description Link text the user can click to provide feedback to the team.
|
|
27
27
|
*/
|
|
28
|
-
previewTextFeedbackLink: 'Send us your feedback
|
|
28
|
+
previewTextFeedbackLink: 'Send us your feedback',
|
|
29
29
|
/**
|
|
30
30
|
* @description Link text the user can click to provide feedback to the team.
|
|
31
31
|
*/
|
|
@@ -29,7 +29,7 @@ const UIStrings = {
|
|
|
29
29
|
/**
|
|
30
30
|
* @description Title for a link to show a request that is unavailable because the request couldn't be resolved.
|
|
31
31
|
*/
|
|
32
|
-
requestUnavailableInTheNetwork: 'Request unavailable in the Network panel. Try reloading the inspected page',
|
|
32
|
+
requestUnavailableInTheNetwork: 'Request unavailable in the Network panel. Try reloading the inspected page.',
|
|
33
33
|
/**
|
|
34
34
|
* @description Label for the shortened URL displayed in a link to show a request in the Network panel.
|
|
35
35
|
*/
|
|
@@ -43,7 +43,7 @@ const UIStringsNotTranslate = {
|
|
|
43
43
|
/**
|
|
44
44
|
* @description Text for teaser to turn on code suggestions.
|
|
45
45
|
*/
|
|
46
|
-
toTurnOnCodeSuggestions: 'to turn on code suggestions
|
|
46
|
+
toTurnOnCodeSuggestions: 'to turn on code suggestions',
|
|
47
47
|
/**
|
|
48
48
|
* @description Text for snackbar notification on dismissing the teaser.
|
|
49
49
|
*/
|
|
@@ -74,12 +74,12 @@ const UIStringsNotTranslate = {
|
|
|
74
74
|
* @description Code generation disclaimer item text for the fre dialog.
|
|
75
75
|
*/
|
|
76
76
|
freDisclaimerDescribeCodeInComment:
|
|
77
|
-
'In Console or Sources, describe the code you need in a comment, then press ctrl+i to generate it
|
|
77
|
+
'In Console or Sources, describe the code you need in a comment, then press ctrl+i to generate it',
|
|
78
78
|
/**
|
|
79
79
|
* @description Code generation disclaimer item text for the fre dialog.
|
|
80
80
|
*/
|
|
81
81
|
freDisclaimerDescribeCodeInCommentForMacOs:
|
|
82
|
-
'In Console or Sources, describe the code you need in a comment, then press cmd+i to generate it
|
|
82
|
+
'In Console or Sources, describe the code you need in a comment, then press cmd+i to generate it',
|
|
83
83
|
/**
|
|
84
84
|
* @description Privacy disclaimer item text for the fre dialog.
|
|
85
85
|
*/
|
|
@@ -101,7 +101,7 @@ const UIStringsNotTranslate = {
|
|
|
101
101
|
/**
|
|
102
102
|
*@description Text for ARIA label for the teaser.
|
|
103
103
|
*/
|
|
104
|
-
toDisableCodeSuggestions: 'to disable code suggestions
|
|
104
|
+
toDisableCodeSuggestions: 'to disable code suggestions',
|
|
105
105
|
} as const;
|
|
106
106
|
|
|
107
107
|
const lockedString = i18n.i18n.lockedString;
|
|
@@ -31,15 +31,15 @@ const UIStringsNotTranslate = {
|
|
|
31
31
|
/**
|
|
32
32
|
* @description Text for teaser to learn how data is being used.
|
|
33
33
|
*/
|
|
34
|
-
toLearnHowYourDataIsBeingUsed: 'to learn how your data is being used
|
|
34
|
+
toLearnHowYourDataIsBeingUsed: 'to learn how your data is being used',
|
|
35
35
|
/**
|
|
36
36
|
* @description Aria label for teaser to generate code.
|
|
37
37
|
*/
|
|
38
|
-
pressCtrlPeriodToLearnHowYourDataIsBeingUsed: 'Press ctrl . (period) to learn how your data is being used
|
|
38
|
+
pressCtrlPeriodToLearnHowYourDataIsBeingUsed: 'Press ctrl . (period) to learn how your data is being used',
|
|
39
39
|
/**
|
|
40
40
|
* @description Aria label for teaser to generate code in Mac.
|
|
41
41
|
*/
|
|
42
|
-
pressCmdPeriodToLearnHowYourDataIsBeingUsed: 'Press cmd . (period) to learn how your data is being used
|
|
42
|
+
pressCmdPeriodToLearnHowYourDataIsBeingUsed: 'Press cmd . (period) to learn how your data is being used',
|
|
43
43
|
/**
|
|
44
44
|
* @description Text for teaser when generating suggestion.
|
|
45
45
|
*/
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
// Copyright 2013 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
+
import * as Platform from '../../core/platform/platform.js';
|
|
4
5
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
5
6
|
|
|
7
|
+
export const Size: typeof Platform.Size = Platform.Size;
|
|
8
|
+
export type Size = Platform.Size;
|
|
9
|
+
|
|
6
10
|
const EPS = 1e-5;
|
|
7
11
|
|
|
8
12
|
export class Vector {
|
|
@@ -322,46 +326,6 @@ export const boundsForTransformedPoints = function(matrix: DOMMatrix, points: nu
|
|
|
322
326
|
return aggregateBounds;
|
|
323
327
|
};
|
|
324
328
|
|
|
325
|
-
export class Size {
|
|
326
|
-
width: number;
|
|
327
|
-
height: number;
|
|
328
|
-
constructor(width: number, height: number) {
|
|
329
|
-
this.width = width;
|
|
330
|
-
this.height = height;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
clipTo(size?: Size|null): Size {
|
|
334
|
-
if (!size) {
|
|
335
|
-
return this;
|
|
336
|
-
}
|
|
337
|
-
return new Size(Math.min(this.width, size.width), Math.min(this.height, size.height));
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
scale(scale: number): Size {
|
|
341
|
-
return new Size(this.width * scale, this.height * scale);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
isEqual(size: Size|null): boolean {
|
|
345
|
-
return size !== null && this.width === size.width && this.height === size.height;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
widthToMax(size: number|Size): Size {
|
|
349
|
-
return new Size(Math.max(this.width, (typeof size === 'number' ? size : size.width)), this.height);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
addWidth(size: number|Size): Size {
|
|
353
|
-
return new Size(this.width + (typeof size === 'number' ? size : size.width), this.height);
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
heightToMax(size: number|Size): Size {
|
|
357
|
-
return new Size(this.width, Math.max(this.height, (typeof size === 'number' ? size : size.height)));
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
addHeight(size: number|Size): Size {
|
|
361
|
-
return new Size(this.width, this.height + (typeof size === 'number' ? size : size.height));
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
329
|
export class Constraints {
|
|
366
330
|
minimum: Size;
|
|
367
331
|
preferred: Size;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
|
-
import type * as Geometry from '
|
|
5
|
+
import type * as Geometry from '../geometry/geometry.js';
|
|
6
6
|
|
|
7
7
|
import glassPaneStyles from './glassPane.css.js';
|
|
8
8
|
import {deepElementFromEvent, measuredScrollbarWidth} from './UIUtils.js';
|
|
@@ -22,7 +22,7 @@ const UIStrings = {
|
|
|
22
22
|
* @description Text in a dialog stating the reason why the remote debugging connection was closed.
|
|
23
23
|
* @example {target_closed} PH1
|
|
24
24
|
*/
|
|
25
|
-
connectionClosedReason: 'Reason: {PH1}
|
|
25
|
+
connectionClosedReason: 'Reason: {PH1}',
|
|
26
26
|
/**
|
|
27
27
|
* @description Instructions in a dialog on how to reconnect remote debugging by reopening DevTools.
|
|
28
28
|
* "Remote debugging" here means that DevTools on a PC is inspecting a website running on an actual mobile device
|
|
@@ -30,7 +30,7 @@ const UIStrings = {
|
|
|
30
30
|
* "Reconnect when ready" refers to the state of the mobile device: the developer first has to put the mobile
|
|
31
31
|
* device back in a state where it can be inspected before DevTools can reconnect to it.
|
|
32
32
|
*/
|
|
33
|
-
reconnectWhenReadyByReopening: 'Reconnect when ready by reopening DevTools
|
|
33
|
+
reconnectWhenReadyByReopening: 'Reconnect when ready by reopening DevTools',
|
|
34
34
|
/**
|
|
35
35
|
* @description Button text to reconnect DevTools when remote debugging is terminated.
|
|
36
36
|
* "Remote debugging" here means that DevTools on a PC is inspecting a website running on an actual mobile device
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import type * as Common from '../../core/common/common.js';
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
|
-
import * as Geometry from '
|
|
8
|
+
import * as Geometry from '../geometry/geometry.js';
|
|
9
9
|
import {createIcon} from '../kit/kit.js';
|
|
10
10
|
import * as VisualLogging from '../visual_logging/visual_logging.js';
|
|
11
11
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import * as Common from '../../core/common/common.js';
|
|
8
8
|
import * as Platform from '../../core/platform/platform.js';
|
|
9
|
-
import * as Geometry from '
|
|
9
|
+
import * as Geometry from '../geometry/geometry.js';
|
|
10
10
|
import * as VisualLogging from '../visual_logging/visual_logging.js';
|
|
11
11
|
|
|
12
12
|
import * as ARIAUtils from './ARIAUtils.js';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
8
|
import * as Platform from '../../core/platform/platform.js';
|
|
9
9
|
import type * as TextUtils from '../../core/text_utils/text_utils.js';
|
|
10
|
-
import * as Geometry from '
|
|
10
|
+
import * as Geometry from '../geometry/geometry.js';
|
|
11
11
|
import * as VisualLogging from '../visual_logging/visual_logging.js';
|
|
12
12
|
|
|
13
13
|
import * as ARIAUtils from './ARIAUtils.js';
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
import * as Common from '../../core/common/common.js';
|
|
8
8
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
9
9
|
import * as Platform from '../../core/platform/platform.js';
|
|
10
|
-
import * as Geometry from '../../models/geometry/geometry.js';
|
|
11
10
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
12
11
|
import {type LitTemplate, render} from '../../ui/lit/lit.js';
|
|
13
12
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
13
|
+
import * as Geometry from '../geometry/geometry.js';
|
|
14
14
|
import {createIcon, Icon} from '../kit/kit.js';
|
|
15
15
|
|
|
16
16
|
import * as ARIAUtils from './ARIAUtils.js';
|
|
@@ -12,11 +12,11 @@ const UIStrings = {
|
|
|
12
12
|
/**
|
|
13
13
|
* @description Message shown when the inspected page crashes and DevTools is disconnected.
|
|
14
14
|
*/
|
|
15
|
-
devtoolsWasDisconnectedFromThe: 'DevTools was disconnected from the page
|
|
15
|
+
devtoolsWasDisconnectedFromThe: 'DevTools was disconnected from the page',
|
|
16
16
|
/**
|
|
17
17
|
* @description Message explaining that DevTools will reconnect once the page is reloaded.
|
|
18
18
|
*/
|
|
19
|
-
oncePageIsReloadedDevtoolsWill: 'Once page is reloaded, DevTools will automatically reconnect
|
|
19
|
+
oncePageIsReloadedDevtoolsWill: 'Once page is reloaded, DevTools will automatically reconnect',
|
|
20
20
|
} as const;
|
|
21
21
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/TargetCrashedScreen.ts', UIStrings);
|
|
22
22
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|