chrome-devtools-frontend 1.0.1675430 → 1.0.1676824
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/WATCHLISTS +0 -4
- package/front_end/core/common/Settings.ts +0 -66
- package/front_end/core/root/Runtime.ts +0 -5
- package/front_end/core/sdk/CSSMetadata.ts +5 -9
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +8 -28
- package/front_end/core/sdk/DebuggerModel.ts +50 -30
- package/front_end/core/sdk/ResourceTreeModel.ts +20 -1
- package/front_end/core/sdk/Script.ts +9 -53
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +213 -23
- package/front_end/entrypoints/main/MainImpl.ts +31 -0
- package/front_end/generated/InspectorBackendCommands.ts +3 -1
- package/front_end/generated/SupportedCSSProperties.ts +21 -4
- package/front_end/generated/protocol-mapping.d.ts +14 -0
- package/front_end/generated/protocol-proxy-api.d.ts +10 -0
- package/front_end/generated/protocol.ts +35 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +11 -0
- package/front_end/models/ai_assistance/AiConversation.ts +22 -5
- package/front_end/models/ai_assistance/README.md +52 -26
- package/front_end/models/ai_assistance/agents/AiAgent.ts +54 -8
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +7 -194
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +8 -87
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +16 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +124 -0
- package/front_end/models/ai_assistance/contexts/StorageContext.ts +111 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +69 -1
- package/front_end/models/ai_assistance/skills/README.md +63 -1
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +4 -0
- package/front_end/models/ai_assistance/skills/performance.md +8 -0
- package/front_end/models/ai_assistance/skills/sources.md +16 -0
- package/front_end/models/ai_assistance/skills/storage.md +31 -0
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +101 -0
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +83 -0
- package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +106 -0
- package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +104 -0
- package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +81 -0
- package/front_end/models/ai_assistance/tools/ListSources.ts +116 -0
- package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +90 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +22 -1
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +14 -0
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +4 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +8 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +3 -201
- package/front_end/models/bindings/SASSSourceMapping.ts +6 -0
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -49
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +27 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +10 -2
- package/front_end/models/issues_manager/descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/persistence/IsolatedFileSystem.ts +7 -8
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +2 -2
- package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
- package/front_end/models/persistence/persistence-meta.ts +9 -9
- package/front_end/models/trace/types/TraceEvents.ts +36 -0
- package/front_end/panels/accessibility/ARIAAttributesView.ts +3 -3
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +36 -36
- package/front_end/panels/accessibility/AccessibilityStrings.ts +168 -168
- package/front_end/panels/accessibility/SourceOrderView.ts +7 -7
- package/front_end/panels/accessibility/accessibility-meta.ts +2 -2
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +2 -3
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +27 -2
- package/front_end/panels/application/IndexedDBViews.ts +65 -63
- package/front_end/panels/application/WebMCPView.ts +16 -7
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +5 -5
- package/front_end/panels/common/BadgeNotification.ts +8 -8
- package/front_end/panels/common/ExtensionServer.ts +21 -1
- package/front_end/panels/common/GdpSignUpDialog.ts +16 -16
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +5 -6
- package/front_end/panels/common/PersistenceUtils.ts +2 -2
- package/front_end/panels/common/common.ts +0 -97
- package/front_end/panels/console/ConsoleInsightTeaser.ts +2 -2
- package/front_end/panels/console/ConsolePinPane.ts +2 -2
- package/front_end/panels/console/ConsoleView.ts +20 -19
- package/front_end/panels/elements/LayoutPane.ts +2 -8
- package/front_end/panels/event_listeners/EventListenersView.ts +8 -4
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +25 -14
- package/front_end/panels/media/PlayerMessagesView.ts +149 -68
- package/front_end/panels/network/NetworkPanel.ts +1 -1
- package/front_end/panels/network/RequestPayloadView.ts +1 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +0 -2
- package/front_end/panels/profiler/heapProfiler.css +0 -9
- package/front_end/panels/recorder/RecorderPanel.ts +2 -3
- package/front_end/panels/screencast/ScreencastView.ts +148 -138
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -2
- package/front_end/panels/sources/DebuggerPlugin.ts +9 -58
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +3 -8
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +4 -2
- package/front_end/panels/timeline/TimelineController.ts +36 -64
- package/front_end/panels/timeline/TimelinePanel.ts +11 -8
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -2
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -2
- package/front_end/panels/timeline/timelinePanel.css +0 -10
- package/front_end/panels/utils/utils.ts +7 -7
- package/front_end/services/tracing/PerformanceTracing.ts +5 -17
- package/front_end/third_party/chromium/README.chromium +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/package.json +2 -2
- package/front_end/third_party/codemirror.next/rebuild.sh +4 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +436 -10
- package/front_end/ui/comments/CommentManager.ts +640 -0
- package/front_end/ui/comments/CommentsOverlayWidget.ts +121 -0
- package/front_end/ui/comments/comments.ts +4 -0
- package/front_end/ui/comments/commentsOverlay.css +49 -0
- package/front_end/{panels/common → ui/components/dialogs}/FreDialog.ts +6 -6
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +96 -0
- package/front_end/ui/components/dialogs/dialogs.ts +4 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +3 -3
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionDisclaimer.ts +13 -13
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +7 -6
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionTeaser.ts +43 -46
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +22 -26
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationTeaser.ts +10 -10
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationUpgradeDialog.ts +5 -5
- package/front_end/ui/components/text_editor/text_editor.ts +4 -0
- package/front_end/ui/legacy/Toolbar.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +11 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +270 -162
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +5 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -16
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +5 -12
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +8 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -2
- package/front_end/ui/settings/SettingUIRegistration.ts +55 -6
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/mcp/mcp.ts +6 -1
- package/package.json +1 -1
- package/front_end/Images/toolbarResizerVertical.png +0 -0
- package/front_end/emulated_devices/MotoG4-landscape.svg +0 -155
- package/front_end/emulated_devices/MotoG4-portrait.svg +0 -155
- package/front_end/emulated_devices/Nexus5X-landscape.svg +0 -19
- package/front_end/emulated_devices/Nexus5X-portrait.svg +0 -19
- package/front_end/emulated_devices/Nexus6P-landscape.svg +0 -50
- package/front_end/emulated_devices/Nexus6P-portrait.svg +0 -54
- package/front_end/emulated_devices/google-nest-hub-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nest-hub-max-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/iPad-landscape.svg +0 -73
- package/front_end/emulated_devices/iPad-portrait.svg +0 -76
- package/front_end/emulated_devices/iPhone5-landscape.svg +0 -99
- package/front_end/emulated_devices/iPhone5-portrait.svg +0 -83
- package/front_end/emulated_devices/iPhone6-landscape.svg +0 -111
- package/front_end/emulated_devices/iPhone6-portrait.svg +0 -116
- package/front_end/emulated_devices/iPhone6Plus-landscape.svg +0 -118
- package/front_end/emulated_devices/iPhone6Plus-portrait.svg +0 -116
- package/front_end/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/README.md +0 -9
- package/front_end/emulated_devices/optimized/google-nest-hub-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nest-hub-max-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/optimized_images.gni +0 -53
- package/front_end/models/ai_assistance/agents/README.md +0 -136
- /package/front_end/{panels/common → ui/components/dialogs}/freDialog.css +0 -0
- /package/front_end/{panels/common/common.css → ui/components/dialogs/typeToAllowDialog.css} +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionDisclaimer.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationUpgradeDialog.css +0 -0
|
@@ -214,7 +214,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
214
214
|
if (el instanceof HTMLCanvasElement) {
|
|
215
215
|
output.focusCanvas = (): void => el.focus();
|
|
216
216
|
canvasElement = el;
|
|
217
|
-
|
|
217
|
+
repaintScreencastCanvas(el, input);
|
|
218
218
|
}
|
|
219
219
|
})}></canvas>
|
|
220
220
|
<div
|
|
@@ -225,7 +225,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
225
225
|
})}
|
|
226
226
|
${ref(el => {
|
|
227
227
|
if (el instanceof HTMLElement && canvasElement && input.elementTitleData?.visible && !el.classList.contains('hidden')) {
|
|
228
|
-
|
|
228
|
+
clampTooltipPosition(canvasElement, el, input.highlightModel);
|
|
229
229
|
}
|
|
230
230
|
})}>
|
|
231
231
|
<span class="screencast-tag-name">${input.elementTitleData?.tagName ?? nothing}</span>
|
|
@@ -239,6 +239,141 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
239
239
|
// clang-format on
|
|
240
240
|
};
|
|
241
241
|
|
|
242
|
+
function repaintScreencastCanvas(el: HTMLCanvasElement, input: CanvasRenderingInput): void {
|
|
243
|
+
const context = el.getContext('2d');
|
|
244
|
+
if (!context) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const model = input.highlightModel;
|
|
249
|
+
const config = input.highlightConfig;
|
|
250
|
+
|
|
251
|
+
const canvasWidth = el.getBoundingClientRect().width;
|
|
252
|
+
const canvasHeight = el.getBoundingClientRect().height;
|
|
253
|
+
el.width = window.devicePixelRatio * canvasWidth;
|
|
254
|
+
el.height = window.devicePixelRatio * canvasHeight;
|
|
255
|
+
|
|
256
|
+
context.save();
|
|
257
|
+
context.scale(window.devicePixelRatio, window.devicePixelRatio);
|
|
258
|
+
|
|
259
|
+
if (model && config) {
|
|
260
|
+
context.save();
|
|
261
|
+
const quads = [];
|
|
262
|
+
const isTransparent = (color: Protocol.DOM.RGBA): boolean => Boolean(color.a && color.a === 0);
|
|
263
|
+
if (model.content && config.contentColor && !isTransparent(config.contentColor)) {
|
|
264
|
+
quads.push({quad: model.content, color: config.contentColor});
|
|
265
|
+
}
|
|
266
|
+
if (model.padding && config.paddingColor && !isTransparent(config.paddingColor)) {
|
|
267
|
+
quads.push({quad: model.padding, color: config.paddingColor});
|
|
268
|
+
}
|
|
269
|
+
if (model.border && config.borderColor && !isTransparent(config.borderColor)) {
|
|
270
|
+
quads.push({quad: model.border, color: config.borderColor});
|
|
271
|
+
}
|
|
272
|
+
if (model.margin && config.marginColor && !isTransparent(config.marginColor)) {
|
|
273
|
+
quads.push({quad: model.margin, color: config.marginColor});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
for (let i = quads.length - 1; i > 0; --i) {
|
|
277
|
+
drawOutlinedQuadWithClip(context, quads[i].quad, quads[i - 1].quad, quads[i].color);
|
|
278
|
+
}
|
|
279
|
+
if (quads.length > 0) {
|
|
280
|
+
drawOutlinedQuad(context, quads[0].quad, quads[0].color);
|
|
281
|
+
}
|
|
282
|
+
context.globalCompositeOperation = 'destination-over';
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (input.screencastImage) {
|
|
286
|
+
context.drawImage(input.screencastImage, 0, input.screenOffsetTop * input.screenZoom,
|
|
287
|
+
input.screencastImage.naturalWidth * input.imageZoom,
|
|
288
|
+
input.screencastImage.naturalHeight * input.imageZoom);
|
|
289
|
+
}
|
|
290
|
+
context.restore();
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function cssColor(color: Protocol.DOM.RGBA): string {
|
|
294
|
+
if (!color) {
|
|
295
|
+
return 'transparent';
|
|
296
|
+
}
|
|
297
|
+
return Common.Color.Legacy.fromRGBA([color.r, color.g, color.b, color.a !== undefined ? color.a : 1])
|
|
298
|
+
.asString(Common.Color.Format.RGBA) ||
|
|
299
|
+
'';
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function quadToPath(context: CanvasRenderingContext2D, quad: Protocol.DOM.Quad): CanvasRenderingContext2D {
|
|
303
|
+
context.beginPath();
|
|
304
|
+
context.moveTo(quad[0], quad[1]);
|
|
305
|
+
context.lineTo(quad[2], quad[3]);
|
|
306
|
+
context.lineTo(quad[4], quad[5]);
|
|
307
|
+
context.lineTo(quad[6], quad[7]);
|
|
308
|
+
context.closePath();
|
|
309
|
+
return context;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function drawOutlinedQuad(context: CanvasRenderingContext2D, quad: Protocol.DOM.Quad,
|
|
313
|
+
fillColor: Protocol.DOM.RGBA): void {
|
|
314
|
+
context.save();
|
|
315
|
+
context.lineWidth = 2;
|
|
316
|
+
quadToPath(context, quad).clip();
|
|
317
|
+
context.fillStyle = cssColor(fillColor);
|
|
318
|
+
context.fill();
|
|
319
|
+
context.restore();
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function drawOutlinedQuadWithClip(context: CanvasRenderingContext2D, quad: Protocol.DOM.Quad,
|
|
323
|
+
clipQuad: Protocol.DOM.Quad, fillColor: Protocol.DOM.RGBA): void {
|
|
324
|
+
context.fillStyle = cssColor(fillColor);
|
|
325
|
+
context.save();
|
|
326
|
+
context.lineWidth = 0;
|
|
327
|
+
quadToPath(context, quad).fill();
|
|
328
|
+
context.globalCompositeOperation = 'destination-out';
|
|
329
|
+
context.fillStyle = 'red';
|
|
330
|
+
quadToPath(context, clipQuad).fill();
|
|
331
|
+
context.restore();
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function clampTooltipPosition(canvas: HTMLCanvasElement, titleElement: HTMLElement,
|
|
335
|
+
model?: Protocol.DOM.BoxModel|null): void {
|
|
336
|
+
if (!model) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
const canvasWidth = canvas.getBoundingClientRect().width;
|
|
340
|
+
const canvasHeight = canvas.getBoundingClientRect().height;
|
|
341
|
+
const titleWidth = titleElement.offsetWidth;
|
|
342
|
+
const titleHeight = titleElement.offsetHeight;
|
|
343
|
+
|
|
344
|
+
const anchorTop = model.margin[1];
|
|
345
|
+
const anchorBottom = model.margin[7];
|
|
346
|
+
|
|
347
|
+
const arrowHeight = 7;
|
|
348
|
+
let arrowDirection: 'up'|'down'|undefined;
|
|
349
|
+
|
|
350
|
+
let boxX = Math.max(2, model.margin[0]);
|
|
351
|
+
if (boxX + titleWidth > canvasWidth) {
|
|
352
|
+
boxX = canvasWidth - titleWidth - 2;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
let boxY;
|
|
356
|
+
if (anchorTop > canvasHeight) {
|
|
357
|
+
boxY = canvasHeight - titleHeight - arrowHeight;
|
|
358
|
+
arrowDirection = 'down';
|
|
359
|
+
} else if (anchorBottom < 0) {
|
|
360
|
+
boxY = arrowHeight;
|
|
361
|
+
arrowDirection = 'up';
|
|
362
|
+
} else if (anchorBottom + titleHeight + arrowHeight < canvasHeight) {
|
|
363
|
+
boxY = anchorBottom + arrowHeight - 4;
|
|
364
|
+
arrowDirection = 'up';
|
|
365
|
+
} else if (anchorTop - titleHeight - arrowHeight > 0) {
|
|
366
|
+
boxY = anchorTop - titleHeight - arrowHeight + 3;
|
|
367
|
+
arrowDirection = 'down';
|
|
368
|
+
} else {
|
|
369
|
+
boxY = arrowHeight;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
titleElement.style.top = `${boxY}px`;
|
|
373
|
+
titleElement.style.left = `${boxX}px`;
|
|
374
|
+
titleElement.classList.toggle('arrow-up', arrowDirection === 'up');
|
|
375
|
+
titleElement.classList.toggle('arrow-down', arrowDirection === 'down');
|
|
376
|
+
}
|
|
242
377
|
export class ScreencastView extends UI.Widget.Widget implements SDK.OverlayModel.Highlighter {
|
|
243
378
|
readonly #view: View;
|
|
244
379
|
#viewOutput: ViewOutput;
|
|
@@ -373,6 +508,8 @@ export class ScreencastView extends UI.Widget.Widget implements SDK.OverlayModel
|
|
|
373
508
|
this.requestNavigationHistoryEvent, this);
|
|
374
509
|
this.resourceTreeModel.removeEventListener(SDK.ResourceTreeModel.Events.CachedResourcesLoaded,
|
|
375
510
|
this.requestNavigationHistoryEvent, this);
|
|
511
|
+
this.resourceTreeModel.removeEventListener(SDK.ResourceTreeModel.Events.FrameNavigatedWithinDocument,
|
|
512
|
+
this.onFrameNavigated, this);
|
|
376
513
|
}
|
|
377
514
|
}
|
|
378
515
|
|
|
@@ -653,98 +790,6 @@ export class ScreencastView extends UI.Widget.Widget implements SDK.OverlayModel
|
|
|
653
790
|
return model;
|
|
654
791
|
}
|
|
655
792
|
|
|
656
|
-
static repaintScreencastCanvas(el: HTMLCanvasElement, input: CanvasRenderingInput): void {
|
|
657
|
-
const context = el.getContext('2d');
|
|
658
|
-
if (!context) {
|
|
659
|
-
return;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
const model = input.highlightModel;
|
|
663
|
-
const config = input.highlightConfig;
|
|
664
|
-
|
|
665
|
-
const canvasWidth = el.getBoundingClientRect().width;
|
|
666
|
-
const canvasHeight = el.getBoundingClientRect().height;
|
|
667
|
-
el.width = window.devicePixelRatio * canvasWidth;
|
|
668
|
-
el.height = window.devicePixelRatio * canvasHeight;
|
|
669
|
-
|
|
670
|
-
context.save();
|
|
671
|
-
context.scale(window.devicePixelRatio, window.devicePixelRatio);
|
|
672
|
-
|
|
673
|
-
if (model && config) {
|
|
674
|
-
context.save();
|
|
675
|
-
const quads = [];
|
|
676
|
-
const isTransparent = (color: Protocol.DOM.RGBA): boolean => Boolean(color.a && color.a === 0);
|
|
677
|
-
if (model.content && config.contentColor && !isTransparent(config.contentColor)) {
|
|
678
|
-
quads.push({quad: model.content, color: config.contentColor});
|
|
679
|
-
}
|
|
680
|
-
if (model.padding && config.paddingColor && !isTransparent(config.paddingColor)) {
|
|
681
|
-
quads.push({quad: model.padding, color: config.paddingColor});
|
|
682
|
-
}
|
|
683
|
-
if (model.border && config.borderColor && !isTransparent(config.borderColor)) {
|
|
684
|
-
quads.push({quad: model.border, color: config.borderColor});
|
|
685
|
-
}
|
|
686
|
-
if (model.margin && config.marginColor && !isTransparent(config.marginColor)) {
|
|
687
|
-
quads.push({quad: model.margin, color: config.marginColor});
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
for (let i = quads.length - 1; i > 0; --i) {
|
|
691
|
-
ScreencastView.drawOutlinedQuadWithClip(context, quads[i].quad, quads[i - 1].quad, quads[i].color);
|
|
692
|
-
}
|
|
693
|
-
if (quads.length > 0) {
|
|
694
|
-
ScreencastView.drawOutlinedQuad(context, quads[0].quad, quads[0].color);
|
|
695
|
-
}
|
|
696
|
-
context.globalCompositeOperation = 'destination-over';
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
if (input.screencastImage) {
|
|
700
|
-
context.drawImage(input.screencastImage, 0, input.screenOffsetTop * input.screenZoom,
|
|
701
|
-
input.screencastImage.naturalWidth * input.imageZoom,
|
|
702
|
-
input.screencastImage.naturalHeight * input.imageZoom);
|
|
703
|
-
}
|
|
704
|
-
context.restore();
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
private static cssColor(color: Protocol.DOM.RGBA): string {
|
|
708
|
-
if (!color) {
|
|
709
|
-
return 'transparent';
|
|
710
|
-
}
|
|
711
|
-
return Common.Color.Legacy.fromRGBA([color.r, color.g, color.b, color.a !== undefined ? color.a : 1])
|
|
712
|
-
.asString(Common.Color.Format.RGBA) ||
|
|
713
|
-
'';
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
private static quadToPath(context: CanvasRenderingContext2D, quad: Protocol.DOM.Quad): CanvasRenderingContext2D {
|
|
717
|
-
context.beginPath();
|
|
718
|
-
context.moveTo(quad[0], quad[1]);
|
|
719
|
-
context.lineTo(quad[2], quad[3]);
|
|
720
|
-
context.lineTo(quad[4], quad[5]);
|
|
721
|
-
context.lineTo(quad[6], quad[7]);
|
|
722
|
-
context.closePath();
|
|
723
|
-
return context;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
private static drawOutlinedQuad(context: CanvasRenderingContext2D, quad: Protocol.DOM.Quad,
|
|
727
|
-
fillColor: Protocol.DOM.RGBA): void {
|
|
728
|
-
context.save();
|
|
729
|
-
context.lineWidth = 2;
|
|
730
|
-
ScreencastView.quadToPath(context, quad).clip();
|
|
731
|
-
context.fillStyle = ScreencastView.cssColor(fillColor);
|
|
732
|
-
context.fill();
|
|
733
|
-
context.restore();
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
private static drawOutlinedQuadWithClip(context: CanvasRenderingContext2D, quad: Protocol.DOM.Quad,
|
|
737
|
-
clipQuad: Protocol.DOM.Quad, fillColor: Protocol.DOM.RGBA): void {
|
|
738
|
-
context.fillStyle = ScreencastView.cssColor(fillColor);
|
|
739
|
-
context.save();
|
|
740
|
-
context.lineWidth = 0;
|
|
741
|
-
ScreencastView.quadToPath(context, quad).fill();
|
|
742
|
-
context.globalCompositeOperation = 'destination-out';
|
|
743
|
-
context.fillStyle = 'red';
|
|
744
|
-
ScreencastView.quadToPath(context, clipQuad).fill();
|
|
745
|
-
context.restore();
|
|
746
|
-
}
|
|
747
|
-
|
|
748
793
|
private drawElementTitle(): void {
|
|
749
794
|
if (!this.node) {
|
|
750
795
|
if (this.#elementTitleData.visible) {
|
|
@@ -773,50 +818,6 @@ export class ScreencastView extends UI.Widget.Widget implements SDK.OverlayModel
|
|
|
773
818
|
}
|
|
774
819
|
}
|
|
775
820
|
|
|
776
|
-
static clampTooltipPosition(canvas: HTMLCanvasElement, titleElement: HTMLElement,
|
|
777
|
-
model?: Protocol.DOM.BoxModel|null): void {
|
|
778
|
-
if (!model) {
|
|
779
|
-
return;
|
|
780
|
-
}
|
|
781
|
-
const canvasWidth = canvas.getBoundingClientRect().width;
|
|
782
|
-
const canvasHeight = canvas.getBoundingClientRect().height;
|
|
783
|
-
const titleWidth = titleElement.offsetWidth;
|
|
784
|
-
const titleHeight = titleElement.offsetHeight;
|
|
785
|
-
|
|
786
|
-
const anchorTop = model.margin[1];
|
|
787
|
-
const anchorBottom = model.margin[7];
|
|
788
|
-
|
|
789
|
-
const arrowHeight = 7;
|
|
790
|
-
let arrowDirection: 'up'|'down'|undefined;
|
|
791
|
-
|
|
792
|
-
let boxX = Math.max(2, model.margin[0]);
|
|
793
|
-
if (boxX + titleWidth > canvasWidth) {
|
|
794
|
-
boxX = canvasWidth - titleWidth - 2;
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
let boxY;
|
|
798
|
-
if (anchorTop > canvasHeight) {
|
|
799
|
-
boxY = canvasHeight - titleHeight - arrowHeight;
|
|
800
|
-
arrowDirection = 'down';
|
|
801
|
-
} else if (anchorBottom < 0) {
|
|
802
|
-
boxY = arrowHeight;
|
|
803
|
-
arrowDirection = 'up';
|
|
804
|
-
} else if (anchorBottom + titleHeight + arrowHeight < canvasHeight) {
|
|
805
|
-
boxY = anchorBottom + arrowHeight - 4;
|
|
806
|
-
arrowDirection = 'up';
|
|
807
|
-
} else if (anchorTop - titleHeight - arrowHeight > 0) {
|
|
808
|
-
boxY = anchorTop - titleHeight - arrowHeight + 3;
|
|
809
|
-
arrowDirection = 'down';
|
|
810
|
-
} else {
|
|
811
|
-
boxY = arrowHeight;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
titleElement.style.top = `${boxY}px`;
|
|
815
|
-
titleElement.style.left = `${boxX}px`;
|
|
816
|
-
titleElement.classList.toggle('arrow-up', arrowDirection === 'up');
|
|
817
|
-
titleElement.classList.toggle('arrow-down', arrowDirection === 'down');
|
|
818
|
-
}
|
|
819
|
-
|
|
820
821
|
private viewportDimensions(): {width: number, height: number} {
|
|
821
822
|
const gutterSize = 30;
|
|
822
823
|
const bordersSize = BORDERS_SIZE;
|
|
@@ -848,6 +849,8 @@ export class ScreencastView extends UI.Widget.Widget implements SDK.OverlayModel
|
|
|
848
849
|
this.requestNavigationHistoryEvent, this);
|
|
849
850
|
this.resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.CachedResourcesLoaded,
|
|
850
851
|
this.requestNavigationHistoryEvent, this);
|
|
852
|
+
this.resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.FrameNavigatedWithinDocument,
|
|
853
|
+
this.onFrameNavigated, this);
|
|
851
854
|
}
|
|
852
855
|
}
|
|
853
856
|
|
|
@@ -904,6 +907,13 @@ export class ScreencastView extends UI.Widget.Widget implements SDK.OverlayModel
|
|
|
904
907
|
void this.requestNavigationHistory();
|
|
905
908
|
}
|
|
906
909
|
|
|
910
|
+
private onFrameNavigated(event: Common.EventTarget.EventTargetEvent<SDK.ResourceTreeModel.ResourceTreeFrame>): void {
|
|
911
|
+
const frame = event.data;
|
|
912
|
+
if (frame.isOutermostFrame()) {
|
|
913
|
+
this.requestNavigationHistoryEvent();
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
|
|
907
917
|
private async requestNavigationHistory(): Promise<void> {
|
|
908
918
|
const history = this.resourceTreeModel ? await this.resourceTreeModel.navigationHistory() : null;
|
|
909
919
|
if (!history) {
|
|
@@ -20,7 +20,7 @@ const CITATIONS_TOOLTIP_ID = 'sources-ai-code-completion-citations-tooltip';
|
|
|
20
20
|
|
|
21
21
|
export class AiCodeCompletionPlugin extends Plugin {
|
|
22
22
|
#editor?: TextEditor.TextEditor.TextEditor;
|
|
23
|
-
#aiCodeCompletionDisclaimer?:
|
|
23
|
+
#aiCodeCompletionDisclaimer?: TextEditor.AiCodeCompletionDisclaimer.AiCodeCompletionDisclaimer;
|
|
24
24
|
#aiCodeCompletionDisclaimerContainer = document.createElement('div');
|
|
25
25
|
#aiCodeCompletionDisclaimerToolbarItem = new UI.Toolbar.ToolbarItem(this.#aiCodeCompletionDisclaimerContainer);
|
|
26
26
|
#aiCodeCompletionCitationsToolbar?: PanelCommon.AiCodeCompletionSummaryToolbar.AiCodeCompletionSummaryToolbar;
|
|
@@ -103,7 +103,7 @@ export class AiCodeCompletionPlugin extends Plugin {
|
|
|
103
103
|
if (this.#aiCodeCompletionDisclaimer) {
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
this.#aiCodeCompletionDisclaimer = new
|
|
106
|
+
this.#aiCodeCompletionDisclaimer = new TextEditor.AiCodeCompletionDisclaimer.AiCodeCompletionDisclaimer();
|
|
107
107
|
this.#aiCodeCompletionDisclaimer.disclaimerTooltipId = DISCLAIMER_TOOLTIP_ID;
|
|
108
108
|
this.#aiCodeCompletionDisclaimer.spinnerTooltipId = SPINNER_TOOLTIP_ID;
|
|
109
109
|
this.#aiCodeCompletionDisclaimer.disclaimerTextVariant = 'sources';
|
|
@@ -260,9 +260,6 @@ export class DebuggerPlugin extends Plugin {
|
|
|
260
260
|
|
|
261
261
|
this.ignoreListInfobar = null;
|
|
262
262
|
this.showIgnoreListInfobarIfNeeded();
|
|
263
|
-
for (const scriptFile of this.scriptFileForDebuggerModel.values()) {
|
|
264
|
-
scriptFile.checkMapping();
|
|
265
|
-
}
|
|
266
263
|
}
|
|
267
264
|
|
|
268
265
|
override editorExtension(): CodeMirror.Extension {
|
|
@@ -586,26 +583,12 @@ export class DebuggerPlugin extends Plugin {
|
|
|
586
583
|
}
|
|
587
584
|
|
|
588
585
|
private workingCopyChanged(): void {
|
|
589
|
-
|
|
590
|
-
this.setMuted(this.uiSourceCode.isDirty());
|
|
591
|
-
}
|
|
586
|
+
this.setMuted(this.uiSourceCode.isDirty());
|
|
592
587
|
}
|
|
593
588
|
|
|
594
589
|
private workingCopyCommitted(): void {
|
|
595
590
|
this.scriptsPanel.updateLastModificationTime();
|
|
596
|
-
|
|
597
|
-
this.setMuted(false);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
private didMergeToVM(): void {
|
|
602
|
-
if (this.consistentScripts()) {
|
|
603
|
-
this.setMuted(false);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
private didDivergeFromVM(): void {
|
|
608
|
-
this.setMuted(true);
|
|
591
|
+
this.setMuted(false);
|
|
609
592
|
}
|
|
610
593
|
|
|
611
594
|
private setMuted(value: boolean): void {
|
|
@@ -622,15 +605,6 @@ export class DebuggerPlugin extends Plugin {
|
|
|
622
605
|
}
|
|
623
606
|
}
|
|
624
607
|
|
|
625
|
-
private consistentScripts(): boolean {
|
|
626
|
-
for (const scriptFile of this.scriptFileForDebuggerModel.values()) {
|
|
627
|
-
if (scriptFile.hasDivergedFromVM() || scriptFile.isMergingToVM()) {
|
|
628
|
-
return false;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
return true;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
608
|
private isIdentifier(tokenType: string): boolean {
|
|
635
609
|
return tokenType === 'VariableName' || tokenType === 'VariableDefinition' || tokenType === 'PropertyName' ||
|
|
636
610
|
tokenType === 'PropertyDefinition';
|
|
@@ -1333,11 +1307,6 @@ export class DebuggerPlugin extends Plugin {
|
|
|
1333
1307
|
if (uiLocation.uiSourceCode !== this.uiSourceCode || this.muted) {
|
|
1334
1308
|
return;
|
|
1335
1309
|
}
|
|
1336
|
-
for (const scriptFile of this.scriptFileForDebuggerModel.values()) {
|
|
1337
|
-
if (scriptFile.isDivergingFromVM() || scriptFile.isMergingToVM()) {
|
|
1338
|
-
return;
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
1310
|
// These tend to arrive in bursts, so debounce them
|
|
1342
1311
|
window.clearTimeout(this.refreshBreakpointsTimeout);
|
|
1343
1312
|
this.refreshBreakpointsTimeout = window.setTimeout(() => this.refreshBreakpoints(), 50);
|
|
@@ -1411,28 +1380,13 @@ export class DebuggerPlugin extends Plugin {
|
|
|
1411
1380
|
}
|
|
1412
1381
|
|
|
1413
1382
|
private updateScriptFile(debuggerModel: SDK.DebuggerModel.DebuggerModel): void {
|
|
1414
|
-
|
|
1383
|
+
this.scriptFileForDebuggerModel.delete(debuggerModel);
|
|
1415
1384
|
const newScriptFile = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().scriptFile(
|
|
1416
1385
|
this.uiSourceCode, debuggerModel);
|
|
1417
|
-
this.scriptFileForDebuggerModel.delete(debuggerModel);
|
|
1418
|
-
if (oldScriptFile) {
|
|
1419
|
-
oldScriptFile.removeEventListener(
|
|
1420
|
-
Bindings.ResourceScriptMapping.ResourceScriptFile.Events.DID_MERGE_TO_VM, this.didMergeToVM, this);
|
|
1421
|
-
oldScriptFile.removeEventListener(
|
|
1422
|
-
Bindings.ResourceScriptMapping.ResourceScriptFile.Events.DID_DIVERGE_FROM_VM, this.didDivergeFromVM, this);
|
|
1423
|
-
if (this.muted && !this.uiSourceCode.isDirty() && this.consistentScripts()) {
|
|
1424
|
-
this.setMuted(false);
|
|
1425
|
-
}
|
|
1426
|
-
}
|
|
1427
1386
|
if (!newScriptFile) {
|
|
1428
1387
|
return;
|
|
1429
1388
|
}
|
|
1430
1389
|
this.scriptFileForDebuggerModel.set(debuggerModel, newScriptFile);
|
|
1431
|
-
newScriptFile.addEventListener(
|
|
1432
|
-
Bindings.ResourceScriptMapping.ResourceScriptFile.Events.DID_MERGE_TO_VM, this.didMergeToVM, this);
|
|
1433
|
-
newScriptFile.addEventListener(
|
|
1434
|
-
Bindings.ResourceScriptMapping.ResourceScriptFile.Events.DID_DIVERGE_FROM_VM, this.didDivergeFromVM, this);
|
|
1435
|
-
newScriptFile.checkMapping();
|
|
1436
1390
|
|
|
1437
1391
|
void newScriptFile.missingSymbolFiles().then(resources => {
|
|
1438
1392
|
if (resources) {
|
|
@@ -1714,12 +1668,6 @@ export class DebuggerPlugin extends Plugin {
|
|
|
1714
1668
|
if (this.sourceMapInfobar) {
|
|
1715
1669
|
this.sourceMapInfobar.dispose();
|
|
1716
1670
|
}
|
|
1717
|
-
for (const script of this.scriptFileForDebuggerModel.values()) {
|
|
1718
|
-
script.removeEventListener(
|
|
1719
|
-
Bindings.ResourceScriptMapping.ResourceScriptFile.Events.DID_MERGE_TO_VM, this.didMergeToVM, this);
|
|
1720
|
-
script.removeEventListener(
|
|
1721
|
-
Bindings.ResourceScriptMapping.ResourceScriptFile.Events.DID_DIVERGE_FROM_VM, this.didDivergeFromVM, this);
|
|
1722
|
-
}
|
|
1723
1671
|
this.scriptFileForDebuggerModel.clear();
|
|
1724
1672
|
|
|
1725
1673
|
this.popoverHelper?.hidePopover();
|
|
@@ -2024,9 +1972,12 @@ class ValueDecoration extends CodeMirror.WidgetType {
|
|
|
2024
1972
|
/* eslint-disable-next-line @devtools/no-lit-render-outside-of-view */
|
|
2025
1973
|
render(formatter.renderObjectPreview(value.preview), nameValuePair.createChild('span'));
|
|
2026
1974
|
} else {
|
|
2027
|
-
const propertyValue =
|
|
2028
|
-
value, /* wasThrown */ false, /* showPreview */ false);
|
|
2029
|
-
|
|
1975
|
+
const propertyValue =
|
|
1976
|
+
ObjectUI.ObjectPropertiesSection.renderPropertyValue(value, /* wasThrown */ false, /* showPreview */ false);
|
|
1977
|
+
const fragment = document.createDocumentFragment();
|
|
1978
|
+
/* eslint-disable-next-line @devtools/no-lit-render-outside-of-view */
|
|
1979
|
+
render(propertyValue, fragment);
|
|
1980
|
+
nameValuePair.appendChild(fragment);
|
|
2030
1981
|
}
|
|
2031
1982
|
}
|
|
2032
1983
|
return widget;
|
|
@@ -89,7 +89,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
89
89
|
scope: SDK.DebuggerModel.ScopeChainEntry,
|
|
90
90
|
objectTree: ObjectUI.ObjectPropertiesSection.ObjectTree,
|
|
91
91
|
}): TemplateResult => {
|
|
92
|
-
let emptyPlaceholder: Common.UIString.LocalizedString|
|
|
92
|
+
let emptyPlaceholder: Common.UIString.LocalizedString|undefined;
|
|
93
93
|
if (scope.type() === Protocol.Debugger.ScopeType.Local || scope.type() === Protocol.Debugger.ScopeType.Closure) {
|
|
94
94
|
emptyPlaceholder = i18nString(UIStrings.noVariables);
|
|
95
95
|
}
|
|
@@ -171,9 +171,8 @@ export class UISourceCodeFrame extends Common.ObjectWrapper
|
|
|
171
171
|
this.installMessageAndDecorationListeners();
|
|
172
172
|
this.updateStyle();
|
|
173
173
|
// Show pretty-print toggle if file type is formattable.
|
|
174
|
-
// For editable JavaScript files, the toggle is hidden
|
|
175
|
-
//
|
|
176
|
-
// because they don't have this issue (fixes issue 378870233).
|
|
174
|
+
// For editable JavaScript files, the toggle is hidden. For non-JS files (JSON, CSS), the toggle can be shown
|
|
175
|
+
// (fixes issue 378870233).
|
|
177
176
|
const isFormattable = FormatterActions.FORMATTABLE_MEDIA_TYPES.includes(this.contentType);
|
|
178
177
|
const isEditable = Persistence.Persistence.PersistenceImpl.instance().hasEditableContent(this.#uiSourceCode);
|
|
179
178
|
// Check if the MIME type is JavaScript (not the resource type, which can be wrong for file system files)
|
|
@@ -231,11 +230,7 @@ export class UISourceCodeFrame extends Common.ObjectWrapper
|
|
|
231
230
|
Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance().active()) {
|
|
232
231
|
return true;
|
|
233
232
|
}
|
|
234
|
-
|
|
235
|
-
if (this.pretty && this.#uiSourceCode.contentType().hasScripts()) {
|
|
236
|
-
return false;
|
|
237
|
-
}
|
|
238
|
-
return this.#uiSourceCode.contentType() !== Common.ResourceType.resourceTypes.Document;
|
|
233
|
+
return this.#uiSourceCode.contentType().isStyleSheet();
|
|
239
234
|
}
|
|
240
235
|
|
|
241
236
|
private onNetworkPersistenceChanged(): void {
|
|
@@ -195,8 +195,10 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
195
195
|
class="watch-expression-error value"
|
|
196
196
|
title=${ifDefined(e.exceptionDetails?.exception?.description)}
|
|
197
197
|
>${i18nString(UIStrings.notAvailable)}</span>`
|
|
198
|
-
: ObjectUI.ObjectPropertiesSection.
|
|
199
|
-
e.result.object, Boolean(e.exceptionDetails), false /* showPreview */, input.linkifier
|
|
198
|
+
: ObjectUI.ObjectPropertiesSection.renderPropertyValue(
|
|
199
|
+
e.result.object, Boolean(e.exceptionDetails), false /* showPreview */, input.linkifier,
|
|
200
|
+
false /* isSyntheticProperty */, undefined /* variableName */,
|
|
201
|
+
undefined /* includeNullOrUndefined */, /* useCustomPreview */ true)}
|
|
200
202
|
</div>
|
|
201
203
|
</div>
|
|
202
204
|
</devtools-prompt>
|