chrome-devtools-frontend 1.0.1739869 → 1.0.1742811
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/rules/ui-and-widgets/ui-accessibility-and-semantic-html.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +44 -7
- package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-view-output-and-callback-contracts.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +1 -1
- package/.agents/skills/code-review/SKILL.md +23 -6
- package/.agents/skills/devtools-verification/SKILL.md +2 -1
- package/.agents/skills/migrate-chromium-test/SKILL.md +1 -0
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +27 -11
- package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +41 -23
- package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +12 -7
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +3 -0
- package/.agents/skills/ui-widgets/SKILL.md +22 -7
- package/.agents/skills/version-control/SKILL.md +10 -1
- package/.agents/skills/visual-regression-audit/SKILL.md +88 -0
- package/.gitallowed +2 -1
- package/.stylelintignore +1 -0
- package/.stylelintrc.json +2 -0
- package/AUTHORS +1 -0
- package/DIR_METADATA +2 -1
- package/PRESUBMIT_test.py +143 -0
- package/config/owner/INFRA_OWNERS +0 -1
- package/docs/contributing/infrastructure.md +2 -2
- package/docs/ui_engineering.md +14 -4
- package/eslint.config.mjs +1 -18
- package/front_end/application_tokens.css +0 -35
- package/front_end/core/host/AidaClient.ts +1 -1
- package/front_end/core/host/AidaClientTypes.ts +2 -0
- package/front_end/core/host/AidaErrors.ts +3 -3
- package/front_end/core/host/AidaGcaTranslation.ts +39 -0
- package/front_end/core/host/GcaClient.ts +32 -20
- package/front_end/core/host/GcaTypes.ts +4 -2
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
- package/front_end/core/i18n/DevToolsLocale.ts +0 -1
- package/front_end/core/sdk/DebuggerModel.ts +25 -13
- package/front_end/core/sdk/PreloadingModel.ts +2 -2
- package/front_end/core/sdk/RehydratingConnection.ts +59 -30
- package/front_end/core/sdk/StorageKeyManager.ts +0 -1
- package/front_end/core/sdk/Target.ts +6 -0
- package/front_end/core/sdk/TargetManager.ts +10 -4
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +12 -2
- package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +159 -52
- package/front_end/entrypoints/inspector_main/outermostTargetSelector.css +77 -25
- package/front_end/entrypoints/main/MainImpl.ts +32 -15
- package/front_end/models/ai_assistance/AiAgent2.ts +95 -46
- package/front_end/models/ai_assistance/AiConversation.ts +1 -1
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -2
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +3 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +5 -4
- package/front_end/models/ai_assistance/performance/AICallTree.ts +7 -9
- package/front_end/models/ai_assistance/performance/AIQueries.ts +4 -8
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +11 -1
- package/front_end/models/ai_assistance/skills/lighthouse.md +1 -0
- package/front_end/models/ai_assistance/skills/network.md +3 -4
- package/front_end/models/ai_assistance/skills/sources.md +1 -2
- package/front_end/models/ai_assistance/skills/styling.md +3 -4
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +11 -3
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +84 -23
- package/front_end/models/ai_assistance/tools/ListSources.ts +41 -13
- package/front_end/models/badges/Badge.ts +0 -1
- package/front_end/models/bindings/ResourceMapping.ts +1 -1
- package/front_end/models/bindings/ResourceScriptMapping.ts +1 -1
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -4
- package/front_end/models/breakpoints/RecurringPauseDetector.ts +140 -0
- package/front_end/models/breakpoints/breakpoints.ts +2 -1
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +2 -2
- package/front_end/models/persistence/Automapping.ts +0 -1
- package/front_end/models/trace/Processor.ts +16 -7
- package/front_end/models/trace/README.md +17 -1
- package/front_end/models/trace/extras/ThirdParties.ts +4 -6
- package/front_end/models/trace/extras/TraceTree.ts +69 -72
- package/front_end/models/trace/handlers/MetaHandler.ts +3 -0
- package/front_end/models/trace/handlers/types.ts +15 -0
- package/front_end/models/trace/helpers/Trace.ts +5 -3
- package/front_end/models/trace/lantern/simulation/Simulator.ts +4 -1
- package/front_end/models/web_mcp/WebMCPModel.ts +19 -9
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +30 -3
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +2 -4
- package/front_end/panels/ai_assistance/components/chatMessage.css +1 -22
- package/front_end/panels/ai_assistance/components/exploreWidget.css +1 -19
- package/front_end/panels/ai_assistance/components/optInChangeDialog.css +1 -1
- package/front_end/panels/ai_assistance/components/walkthroughView.css +0 -13
- package/front_end/panels/animation/AnimationGroupPreviewUI.ts +3 -2
- package/front_end/panels/animation/AnimationTimeline.ts +5 -3
- package/front_end/panels/animation/animationTimeline.css +10 -8
- package/front_end/panels/application/ApplicationPanelSidebar.ts +14 -11
- package/front_end/panels/application/ReportingApiView.ts +0 -1
- package/front_end/panels/application/SubAppsView.ts +0 -1
- package/front_end/panels/application/WebMCPTreeElement.ts +3 -6
- package/front_end/panels/application/WebMCPView.ts +30 -0
- package/front_end/panels/application/components/ReportsGrid.ts +0 -1
- package/front_end/panels/application/components/backForwardCacheView.css +0 -7
- package/front_end/panels/application/components/permissionsPolicySection.css +2 -2
- package/front_end/panels/application/components/protocolHandlersView.css +46 -39
- package/front_end/panels/application/components/trustTokensView.css +0 -4
- package/front_end/panels/application/cookieItemsView.css +0 -7
- package/front_end/panels/application/indexedDBViews.css +0 -6
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +0 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +0 -1
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -5
- package/front_end/panels/application/preloading/components/preloadingGrid.css +0 -9
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +2 -9
- package/front_end/panels/application/serviceWorkersView.css +5 -4
- package/front_end/panels/application/storageView.css +0 -5
- package/front_end/panels/application/webMCPView.css +17 -0
- package/front_end/panels/browser_debugger/ObjectEventListenersSidebarPane.ts +15 -20
- package/front_end/panels/changes/changesView.css +0 -5
- package/front_end/panels/common/ExtensionServer.ts +80 -10
- package/front_end/panels/console/ConsolePanel.ts +92 -18
- package/front_end/panels/console/consoleContextSelector.css +1 -8
- package/front_end/panels/console/consoleInsightTeaser.css +10 -17
- package/front_end/panels/console/consolePinPane.css +3 -1
- package/front_end/panels/console/consoleView.css +13 -17
- package/front_end/panels/coverage/coverageListView.css +0 -4
- package/front_end/panels/css_overview/cssOverviewCompletedView.css +0 -22
- package/front_end/panels/css_overview/cssOverviewStartView.css +0 -43
- package/front_end/panels/developer_resources/developerResourcesListView.css +0 -4
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +52 -45
- package/front_end/panels/elements/LayoutPane.ts +1 -3
- package/front_end/panels/elements/PropertiesWidget.ts +26 -8
- package/front_end/panels/elements/PropertyRenderer.ts +45 -21
- package/front_end/panels/elements/StandaloneStylesContainer.ts +6 -7
- package/front_end/panels/elements/StyleEditorWidget.ts +110 -63
- package/front_end/panels/elements/StylePropertiesSection.ts +14 -5
- package/front_end/panels/elements/StylePropertyTreeElement.ts +529 -518
- package/front_end/panels/elements/StylesContainer.ts +5 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +12 -15
- package/front_end/panels/elements/components/CSSVariableValueView.ts +17 -4
- package/front_end/panels/elements/components/StylePropertyEditor.ts +178 -140
- package/front_end/panels/elements/components/cssQuery.css +1 -1
- package/front_end/panels/elements/components/stylePropertyEditor.css +60 -56
- package/front_end/panels/elements/layoutPane.css +2 -2
- package/front_end/panels/elements/metricsSidebarPane.css +6 -7
- package/front_end/panels/elements/platformFontsWidget.css +1 -1
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +1 -6
- package/front_end/panels/elements/stylesSidebarPane.css +3 -4
- package/front_end/panels/emulation/deviceModeView.css +1 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +9 -2
- package/front_end/panels/event_listeners/eventListenersView.css +1 -1
- package/front_end/panels/explain/components/consoleInsight.css +1 -2
- package/front_end/panels/issues/issuesTree.css +6 -43
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +1 -1
- package/front_end/panels/layer_viewer/paintProfiler.css +4 -3
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +1 -6
- package/front_end/panels/lighthouse/lighthouseStartView.css +5 -16
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +0 -1
- package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +2 -2
- package/front_end/panels/linear_memory_inspector/components/linearMemoryViewer.css +2 -2
- package/front_end/panels/linear_memory_inspector/components/valueInterpreterSettings.css +1 -1
- package/front_end/panels/media/playerListView.css +1 -2
- package/front_end/panels/media/playerPropertiesView.css +1 -1
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +2 -2
- package/front_end/panels/network/NetworkLogView.ts +594 -580
- package/front_end/panels/network/RequestCookiesView.ts +0 -1
- package/front_end/panels/network/networkConfigView.css +1 -2
- package/front_end/panels/network/networkLogView.css +363 -364
- package/front_end/panels/network/networkPanel.css +1 -5
- package/front_end/panels/network/networkTimingTable.css +1 -1
- package/front_end/panels/network/networkWaterfallColumn.css +1 -1
- package/front_end/panels/network/requestConditionsDrawer.css +0 -4
- package/front_end/panels/network/requestCookiesView.css +7 -1
- package/front_end/panels/network/requestPayloadTree.css +0 -4
- package/front_end/panels/profiler/HeapProfileView.ts +1 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +0 -7
- package/front_end/panels/recorder/RecorderPanel.ts +1 -1
- package/front_end/panels/recorder/RecordingView.ts +10 -10
- package/front_end/panels/recorder/StepView.ts +5 -4
- package/front_end/panels/recorder/createRecordingView.css +1 -1
- package/front_end/panels/recorder/recorderPanel.css +0 -8
- package/front_end/panels/recorder/recordingListView.css +4 -4
- package/front_end/panels/recorder/recordingView.css +12 -20
- package/front_end/panels/recorder/stepEditor.css +4 -4
- package/front_end/panels/recorder/stepView.css +31 -9
- package/front_end/panels/recorder/timelineSection.css +4 -0
- package/front_end/panels/screencast/ScreencastApp.ts +0 -1
- package/front_end/panels/security/mainView.css +1 -1
- package/front_end/panels/security/originView.css +2 -2
- package/front_end/panels/sensors/SensorsView.ts +273 -346
- package/front_end/panels/settings/BackendLinkingSettingsTab.ts +0 -1
- package/front_end/panels/settings/backendLinkingSettingsTab.css +7 -7
- package/front_end/panels/settings/components/syncSection.css +0 -1
- package/front_end/panels/settings/workspaceSettingsTab.css +0 -5
- package/front_end/panels/sources/CSSPlugin.ts +177 -98
- package/front_end/panels/sources/DebuggerPausedMessage.ts +100 -27
- package/front_end/panels/sources/NavigatorView.ts +926 -946
- package/front_end/panels/sources/SourcesPanel.ts +9 -2
- package/front_end/panels/sources/breakpointsView.css +6 -29
- package/front_end/panels/sources/components/HeadersView.css +2 -2
- package/front_end/panels/sources/debuggerPausedMessage.css +7 -0
- package/front_end/panels/sources/navigatorTree.css +7 -2
- package/front_end/panels/sources/sourcesNavigator.css +0 -9
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +0 -10
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +3 -0
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +0 -10
- package/front_end/panels/timeline/ModificationsManager.ts +0 -1
- package/front_end/panels/timeline/ThreadAppender.ts +2 -6
- package/front_end/panels/timeline/TimelinePanel.ts +2 -2
- package/front_end/panels/timeline/TimelineTreeView.ts +38 -41
- package/front_end/panels/timeline/TimelineUIUtils.ts +8 -10
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +0 -2
- package/front_end/panels/timeline/components/fieldSettingsDialog.css +1 -6
- package/front_end/panels/timeline/components/insights/baseInsightComponent.css +0 -12
- package/front_end/panels/timeline/components/interactionBreakdown.css +1 -2
- package/front_end/panels/timeline/components/layoutShiftDetails.css +2 -9
- package/front_end/panels/timeline/components/liveMetricsView.css +0 -16
- package/front_end/panels/timeline/components/metricCard.css +1 -5
- package/front_end/panels/timeline/components/networkRequestDetails.css +3 -4
- package/front_end/panels/timeline/components/networkRequestTooltip.css +6 -4
- package/front_end/panels/timeline/components/sidebarAnnotationsTab.css +1 -1
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -2
- package/front_end/panels/timeline/timelineDetailsView.css +1 -12
- package/front_end/panels/timeline/timelineFlamechartPopover.css +0 -4
- package/front_end/panels/timeline/timelineMiniMap.css +1 -4
- package/front_end/panels/timeline/timelinePanel.css +0 -4
- package/front_end/panels/timeline/timelineStatusDialog.css +1 -1
- package/front_end/panels/timeline/timelineTreeView.css +0 -12
- package/front_end/panels/timeline/utils/EntryNodes.ts +1 -1
- package/front_end/panels/webauthn/webauthnPane.css +1 -7
- package/front_end/panels/whats_new/ReleaseNoteText.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/adorners/adorner.css +1 -1
- package/front_end/ui/components/buttons/button.css +0 -28
- package/front_end/ui/components/buttons/textButton.css +1 -45
- package/front_end/ui/components/input/checkbox.css +3 -3
- package/front_end/ui/components/issue_counter/issueLinkIcon.css +2 -2
- package/front_end/ui/components/menus/Menu.ts +14 -0
- package/front_end/ui/components/menus/menu.css +2 -14
- package/front_end/ui/components/menus/menuItem.css +0 -4
- package/front_end/ui/components/request_link_icon/requestLinkIcon.css +2 -2
- package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
- package/front_end/ui/components/survey_link/surveyLink.css +3 -3
- package/front_end/ui/components/switch/switch.css +3 -2
- package/front_end/ui/components/text_editor/theme.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +3 -3
- package/front_end/ui/components/tree_outline/treeOutline.css +0 -23
- package/front_end/ui/legacy/ContextMenu.ts +5 -5
- package/front_end/ui/legacy/SoftContextMenu.ts +24 -8
- package/front_end/ui/legacy/Toolbar.ts +1 -1
- package/front_end/ui/legacy/Treeoutline.ts +31 -78
- package/front_end/ui/legacy/UIUtils.ts +9 -17
- package/front_end/ui/legacy/checkboxTextLabel.css +2 -44
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +39 -27
- package/front_end/ui/legacy/components/color_picker/spectrum.css +2 -10
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +2 -6
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +34 -26
- package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +1 -0
- package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/swatchPopover.css +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +49 -1
- package/front_end/ui/legacy/components/object_ui/objectPopover.css +0 -4
- package/front_end/ui/legacy/components/perf_ui/chartViewport.css +1 -9
- package/front_end/ui/legacy/components/perf_ui/filmStripView.css +1 -1
- package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +2 -1
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +0 -5
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +6 -3
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +95 -1
- package/front_end/ui/legacy/filter.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +6 -28
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +1 -1
- package/front_end/ui/legacy/listWidget.css +1 -1
- package/front_end/ui/legacy/progressIndicator.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +6 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/front_end/ui/visual_logging/LoggingDriver.ts +4 -0
- package/front_end/ui/visual_logging/visual_logging.ts +1 -1
- package/inspector_overlay/common.ts +0 -3
- package/inspector_overlay/main.ts +1 -3
- package/inspector_overlay/tool_source_order.css +0 -4
- package/package.json +1 -1
- package/front_end/generated/SupportedCSSProperties.ts +0 -9705
|
@@ -159,7 +159,6 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
159
159
|
// clang-format off
|
|
160
160
|
render(html`
|
|
161
161
|
<style>${backendLinkingSettingsTabStyles}</style>
|
|
162
|
-
<style>${UI.inspectorCommonStyles}</style>
|
|
163
162
|
<div class="settings-card-container-wrapper" jslog=${VisualLogging.pane('backend-linking')}>
|
|
164
163
|
<div class="settings-card-container">
|
|
165
164
|
<devtools-card heading=${i18nString(UIStrings.rulesSectionHeading)}>
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
.description-text {
|
|
18
18
|
color: var(--sys-color-on-surface-subtle);
|
|
19
|
-
font-size: var(--sys-typescale-
|
|
20
|
-
line-height: var(--sys-typescale-
|
|
19
|
+
font-size: var(--sys-typescale-body4-size);
|
|
20
|
+
line-height: var(--sys-typescale-body4-line-height);
|
|
21
21
|
margin: 0 0 var(--sys-size-5);
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
grid-template-columns: max-content 1fr;
|
|
27
27
|
gap: var(--sys-size-2) var(--sys-size-6);
|
|
28
28
|
align-items: baseline;
|
|
29
|
-
font-size: var(--sys-typescale-
|
|
30
|
-
line-height: var(--sys-typescale-
|
|
29
|
+
font-size: var(--sys-typescale-body5-size);
|
|
30
|
+
line-height: var(--sys-typescale-body4-line-height);
|
|
31
31
|
margin: 0;
|
|
32
32
|
|
|
33
33
|
dd {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.column-header {
|
|
38
|
-
font-size: var(--sys-typescale-
|
|
38
|
+
font-size: var(--sys-typescale-body5-size);
|
|
39
39
|
font-weight: var(--ref-typeface-weight-medium);
|
|
40
40
|
border-bottom: 1px solid var(--sys-color-neutral-outline);
|
|
41
41
|
padding-bottom: var(--sys-size-2);
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
align-items: center;
|
|
73
73
|
gap: var(--sys-size-3);
|
|
74
74
|
color: var(--sys-color-on-surface-subtle);
|
|
75
|
-
font-size: var(--sys-typescale-
|
|
76
|
-
line-height: var(--sys-typescale-
|
|
75
|
+
font-size: var(--sys-typescale-body5-size);
|
|
76
|
+
line-height: var(--sys-typescale-body4-line-height);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Copyright 2021 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
|
-
|
|
4
|
+
|
|
5
|
+
import '../../ui/kit/kit.js';
|
|
5
6
|
|
|
6
7
|
import * as Common from '../../core/common/common.js';
|
|
7
8
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
@@ -13,16 +14,19 @@ import * as Bindings from '../../models/bindings/bindings.js';
|
|
|
13
14
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
14
15
|
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
15
16
|
import * as Geometry from '../../ui/geometry/geometry.js';
|
|
16
|
-
import
|
|
17
|
+
import type {Icon} from '../../ui/kit/kit.js';
|
|
17
18
|
import * as ColorPicker from '../../ui/legacy/components/color_picker/color_picker.js';
|
|
18
19
|
import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
19
20
|
import type * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
20
21
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
22
|
+
import {html, type LitTemplate, render} from '../../ui/lit/lit.js';
|
|
21
23
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
22
24
|
|
|
23
25
|
import {AddDebugInfoURLDialog} from './AddSourceMapURLDialog.js';
|
|
24
26
|
import {Plugin} from './Plugin.js';
|
|
25
27
|
|
|
28
|
+
const {widget} = UI.Widget;
|
|
29
|
+
|
|
26
30
|
// Plugin to add CSS completion, shortcuts, and color/curve swatches
|
|
27
31
|
// to editors with CSS content.
|
|
28
32
|
|
|
@@ -145,6 +149,28 @@ function findColorsAndCurves(
|
|
|
145
149
|
});
|
|
146
150
|
}
|
|
147
151
|
|
|
152
|
+
interface ColorSwatchViewInput {
|
|
153
|
+
color: Common.Color.Color;
|
|
154
|
+
text: string;
|
|
155
|
+
onColorChanged: (event: InlineEditor.ColorSwatch.ColorChangedEvent) => void;
|
|
156
|
+
onColorFormatChanged: (event: InlineEditor.ColorSwatch.ColorFormatChangedEvent) => void;
|
|
157
|
+
onClick: (event: Event) => void;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function renderColorSwatch(input: ColorSwatchViewInput, _output: undefined, target: DocumentFragment): void {
|
|
161
|
+
// clang-format off
|
|
162
|
+
render(
|
|
163
|
+
html`<devtools-color-swatch
|
|
164
|
+
.color=${input.color}
|
|
165
|
+
title=${i18nString(UIStrings.openColorPicker)}
|
|
166
|
+
@colorchanged=${input.onColorChanged}
|
|
167
|
+
@colorformatchanged=${input.onColorFormatChanged}
|
|
168
|
+
@swatchclick=${input.onClick}><span ?hidden=${true}>${input.text}</span></devtools-color-swatch>`,
|
|
169
|
+
target,
|
|
170
|
+
);
|
|
171
|
+
// clang-format on
|
|
172
|
+
}
|
|
173
|
+
|
|
148
174
|
class ColorSwatchWidget extends CodeMirror.WidgetType {
|
|
149
175
|
#text: string;
|
|
150
176
|
#color: Common.Color.Color;
|
|
@@ -162,36 +188,38 @@ class ColorSwatchWidget extends CodeMirror.WidgetType {
|
|
|
162
188
|
}
|
|
163
189
|
|
|
164
190
|
toDOM(view: CodeMirror.EditorView): HTMLElement {
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
const fragment = document.createDocumentFragment();
|
|
192
|
+
renderColorSwatch({
|
|
193
|
+
color: this.#color,
|
|
194
|
+
text: this.#text,
|
|
195
|
+
onColorChanged: (event: InlineEditor.ColorSwatch.ColorChangedEvent) => {
|
|
196
|
+
const insert = event.data.color.getAuthoredText() ?? event.data.color.asString();
|
|
197
|
+
view.dispatch({changes: {from: this.#from, to: this.#from + this.#text.length, insert}});
|
|
198
|
+
this.#text = insert;
|
|
199
|
+
this.#color = (event.currentTarget as InlineEditor.ColorSwatch.ColorSwatch).color as Common.Color.Color;
|
|
200
|
+
},
|
|
201
|
+
onColorFormatChanged: (event: InlineEditor.ColorSwatch.ColorFormatChangedEvent) => {
|
|
202
|
+
const insert = event.data.color.getAuthoredText() ?? event.data.color.asString();
|
|
203
|
+
view.dispatch({changes: {from: this.#from, to: this.#from + this.#text.length, insert}});
|
|
204
|
+
this.#text = insert;
|
|
205
|
+
this.#color = (event.currentTarget as InlineEditor.ColorSwatch.ColorSwatch).color as Common.Color.Color;
|
|
206
|
+
},
|
|
207
|
+
onClick: (event: Event) => {
|
|
208
|
+
event.consume(true);
|
|
209
|
+
const swatch = event.currentTarget as InlineEditor.ColorSwatch.ColorSwatch;
|
|
210
|
+
view.dispatch({
|
|
211
|
+
effects: setTooltip.of({
|
|
212
|
+
type: TooltipType.COLOR,
|
|
213
|
+
pos: view.posAtDOM(swatch),
|
|
214
|
+
text: this.#text,
|
|
215
|
+
swatch,
|
|
216
|
+
color: this.#color,
|
|
217
|
+
}),
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
undefined, fragment);
|
|
222
|
+
return fragment.firstElementChild as HTMLElement;
|
|
195
223
|
}
|
|
196
224
|
|
|
197
225
|
override ignoreEvent(): boolean {
|
|
@@ -199,6 +227,24 @@ class ColorSwatchWidget extends CodeMirror.WidgetType {
|
|
|
199
227
|
}
|
|
200
228
|
}
|
|
201
229
|
|
|
230
|
+
interface CurveSwatchViewInput {
|
|
231
|
+
onClick: (event: MouseEvent) => void;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function renderCurveSwatch(input: CurveSwatchViewInput, _output: undefined, target: DocumentFragment): void {
|
|
235
|
+
// clang-format off
|
|
236
|
+
render(
|
|
237
|
+
html`<devtools-icon
|
|
238
|
+
class="bezier-swatch-icon"
|
|
239
|
+
name="bezier-curve-filled"
|
|
240
|
+
title=${i18nString(UIStrings.openCubicBezierEditor)}
|
|
241
|
+
jslog=${VisualLogging.showStyleEditor('bezier')}
|
|
242
|
+
@click=${input.onClick}></devtools-icon>`,
|
|
243
|
+
target,
|
|
244
|
+
);
|
|
245
|
+
// clang-format on
|
|
246
|
+
}
|
|
247
|
+
|
|
202
248
|
class CurveSwatchWidget extends CodeMirror.WidgetType {
|
|
203
249
|
constructor(readonly curve: Geometry.CubicBezier, readonly text: string) {
|
|
204
250
|
super();
|
|
@@ -209,25 +255,24 @@ class CurveSwatchWidget extends CodeMirror.WidgetType {
|
|
|
209
255
|
}
|
|
210
256
|
|
|
211
257
|
toDOM(view: CodeMirror.EditorView): HTMLElement {
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return icon;
|
|
258
|
+
const fragment = document.createDocumentFragment();
|
|
259
|
+
renderCurveSwatch({
|
|
260
|
+
onClick: (event: MouseEvent) => {
|
|
261
|
+
event.consume(true);
|
|
262
|
+
const icon = event.currentTarget as Icon;
|
|
263
|
+
view.dispatch({
|
|
264
|
+
effects: setTooltip.of({
|
|
265
|
+
type: TooltipType.CURVE,
|
|
266
|
+
pos: view.posAtDOM(icon),
|
|
267
|
+
text: this.text,
|
|
268
|
+
swatch: icon,
|
|
269
|
+
curve: this.curve,
|
|
270
|
+
}),
|
|
271
|
+
});
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
undefined, fragment);
|
|
275
|
+
return fragment.firstElementChild as HTMLElement;
|
|
231
276
|
}
|
|
232
277
|
|
|
233
278
|
override ignoreEvent(): boolean {
|
|
@@ -254,66 +299,100 @@ type ActiveTooltip = {
|
|
|
254
299
|
swatch: Icon,
|
|
255
300
|
};
|
|
256
301
|
|
|
302
|
+
function renderSpectrum(
|
|
303
|
+
color: Common.Color.Color,
|
|
304
|
+
onColorChanged: (event: ColorPicker.Spectrum.ColorChangedEvent) => void,
|
|
305
|
+
onSizeChanged: () => void,
|
|
306
|
+
): LitTemplate {
|
|
307
|
+
// clang-format off
|
|
308
|
+
return html`<devtools-widget
|
|
309
|
+
${widget(ColorPicker.Spectrum.Spectrum, {color})}
|
|
310
|
+
@spectrumcolorchanged=${onColorChanged}
|
|
311
|
+
@sizechanged=${onSizeChanged}></devtools-widget>`;
|
|
312
|
+
// clang-format on
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function renderBezierEditor(
|
|
316
|
+
curve: Geometry.CubicBezier,
|
|
317
|
+
onBezierChanged: (event: InlineEditor.BezierEditor.BezierChangedEvent) => void,
|
|
318
|
+
): LitTemplate {
|
|
319
|
+
// clang-format off
|
|
320
|
+
return html`<devtools-widget
|
|
321
|
+
${widget(InlineEditor.BezierEditor.BezierEditor, {model: curve})}
|
|
322
|
+
@bezierchanged=${onBezierChanged}></devtools-widget>`;
|
|
323
|
+
// clang-format on
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
interface CSSTooltipViewInput {
|
|
327
|
+
active: ActiveTooltip;
|
|
328
|
+
onChange: (event: {data: string}) => void;
|
|
329
|
+
onSizeChanged: () => void;
|
|
330
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
331
|
+
onFocusOut: (event: FocusEvent) => void;
|
|
332
|
+
onMouseDown: (event: MouseEvent) => void;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
function renderCSSTooltip(input: CSSTooltipViewInput, _output: undefined, target: DocumentFragment): void {
|
|
336
|
+
// clang-format off
|
|
337
|
+
render(
|
|
338
|
+
html`<div
|
|
339
|
+
class="cm-tooltip-swatchEdit"
|
|
340
|
+
@keydown=${input.onKeyDown}
|
|
341
|
+
@focusout=${input.onFocusOut}
|
|
342
|
+
@mousedown=${input.onMouseDown}>${
|
|
343
|
+
input.active.type === TooltipType.COLOR
|
|
344
|
+
? renderSpectrum(input.active.color, input.onChange, input.onSizeChanged)
|
|
345
|
+
: renderBezierEditor(input.active.curve, input.onChange)
|
|
346
|
+
}</div>`,
|
|
347
|
+
target,
|
|
348
|
+
);
|
|
349
|
+
// clang-format on
|
|
350
|
+
}
|
|
351
|
+
|
|
257
352
|
function createCSSTooltip(active: ActiveTooltip): CodeMirror.Tooltip {
|
|
258
353
|
return {
|
|
259
354
|
pos: active.pos,
|
|
260
355
|
arrow: false,
|
|
261
356
|
create(view): CodeMirror.TooltipView {
|
|
262
357
|
let text = active.text;
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
spectrum.addEventListener(ColorPicker.Spectrum.Events.COLOR_CHANGED, handler);
|
|
268
|
-
};
|
|
269
|
-
spectrum.addEventListener(ColorPicker.Spectrum.Events.SIZE_CHANGED, () => view.requestMeasure());
|
|
270
|
-
spectrum.setColor(active.color);
|
|
271
|
-
widget = spectrum;
|
|
272
|
-
} else {
|
|
273
|
-
const spectrum = new InlineEditor.BezierEditor.BezierEditor(active.curve);
|
|
274
|
-
widget = spectrum;
|
|
275
|
-
addListener = handler => {
|
|
276
|
-
spectrum.addEventListener(InlineEditor.BezierEditor.Events.BEZIER_CHANGED, handler);
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
const dom = document.createElement('div');
|
|
280
|
-
dom.className = 'cm-tooltip-swatchEdit';
|
|
281
|
-
widget.markAsRoot();
|
|
282
|
-
widget.show(dom);
|
|
283
|
-
widget.showWidget();
|
|
284
|
-
widget.element.addEventListener('keydown', event => {
|
|
285
|
-
if (event.key === 'Escape') {
|
|
286
|
-
event.consume();
|
|
358
|
+
const fragment = document.createDocumentFragment();
|
|
359
|
+
renderCSSTooltip({
|
|
360
|
+
active,
|
|
361
|
+
onChange: (event: {data: string}) => {
|
|
287
362
|
view.dispatch({
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
{from: active.pos, to: active.pos + text.length, insert: active.text},
|
|
363
|
+
changes: {from: active.pos, to: active.pos + text.length, insert: event.data},
|
|
364
|
+
annotations: isSwatchEdit.of(true),
|
|
291
365
|
});
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
366
|
+
text = event.data;
|
|
367
|
+
},
|
|
368
|
+
onSizeChanged: () => view.requestMeasure(),
|
|
369
|
+
onKeyDown: (event: KeyboardEvent) => {
|
|
370
|
+
if (event.key === 'Escape') {
|
|
371
|
+
event.consume();
|
|
372
|
+
view.dispatch({
|
|
373
|
+
effects: setTooltip.of(null),
|
|
374
|
+
changes: text === active.text ? undefined :
|
|
375
|
+
{from: active.pos, to: active.pos + text.length, insert: active.text},
|
|
376
|
+
});
|
|
377
|
+
view.focus();
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
onFocusOut: (event: FocusEvent) => {
|
|
381
|
+
const dom = event.currentTarget as HTMLElement;
|
|
382
|
+
if (event.relatedTarget && !dom.contains(event.relatedTarget as Node)) {
|
|
383
|
+
view.dispatch({effects: setTooltip.of(null)});
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
onMouseDown: (event: MouseEvent) => event.consume(),
|
|
387
|
+
},
|
|
388
|
+
undefined, fragment);
|
|
389
|
+
const dom = fragment.firstElementChild as HTMLElement;
|
|
303
390
|
return {
|
|
304
391
|
dom,
|
|
305
392
|
resize: false,
|
|
306
393
|
offset: {x: -8, y: 0},
|
|
307
394
|
mount: () => {
|
|
308
|
-
|
|
309
|
-
widget.wasShown();
|
|
310
|
-
addListener((event: {data: string}) => {
|
|
311
|
-
view.dispatch({
|
|
312
|
-
changes: {from: active.pos, to: active.pos + text.length, insert: event.data},
|
|
313
|
-
annotations: isSwatchEdit.of(true),
|
|
314
|
-
});
|
|
315
|
-
text = event.data;
|
|
316
|
-
});
|
|
395
|
+
(dom.firstElementChild as HTMLElement)?.focus();
|
|
317
396
|
},
|
|
318
397
|
};
|
|
319
398
|
},
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import * as Common from '../../core/common/common.js';
|
|
5
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
7
|
import type * as Platform from '../../core/platform/platform.js';
|
|
7
8
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
9
|
import * as Protocol from '../../generated/protocol.js';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
10
|
+
import * as Bindings from '../../models/bindings/bindings.js';
|
|
11
|
+
import * as Breakpoints from '../../models/breakpoints/breakpoints.js';
|
|
12
|
+
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
11
13
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
12
14
|
import * as Lit from '../../ui/lit/lit.js';
|
|
13
15
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
@@ -112,25 +114,40 @@ const UIStrings = {
|
|
|
112
114
|
* @example {"script-src 'self'"} PH1
|
|
113
115
|
*/
|
|
114
116
|
scriptBlockedDueToContent: 'Script blocked due to Content Security Policy directive: {PH1}',
|
|
117
|
+
/**
|
|
118
|
+
* @description Button label in the Debugger paused banner of the Sources panel when execution repeatedly pauses at the same breakpoint. Clicking disables that breakpoint and resumes script execution.
|
|
119
|
+
*/
|
|
120
|
+
disableBreakpoint: 'Disable breakpoint',
|
|
121
|
+
/**
|
|
122
|
+
* @description Button label in the Debugger paused banner of the Sources panel when execution repeatedly pauses at the same location. Clicking adds a never-pause-here rule at the current line and resumes script execution.
|
|
123
|
+
*/
|
|
124
|
+
neverPauseHere: 'Never pause here',
|
|
125
|
+
/**
|
|
126
|
+
* @description Button label in the Debugger paused banner of the Sources panel when execution repeatedly pauses at the same location. Clicking deactivates all breakpoints and resumes script execution.
|
|
127
|
+
*/
|
|
128
|
+
deactivateAll: 'Deactivate all',
|
|
115
129
|
} as const;
|
|
116
130
|
const str_ = i18n.i18n.registerUIStrings('panels/sources/DebuggerPausedMessage.ts', UIStrings);
|
|
117
131
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
118
132
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
119
133
|
const i18nTemplate = Lit.i18nTemplate.bind(undefined, str_);
|
|
120
134
|
|
|
121
|
-
interface DOMBreakpointData {
|
|
135
|
+
export interface DOMBreakpointData {
|
|
122
136
|
type: Protocol.DOMDebugger.DOMBreakpointType;
|
|
123
137
|
node: SDK.DOMModel.DOMNode;
|
|
124
138
|
targetNode: SDK.DOMModel.DOMNode|null;
|
|
125
139
|
insertion: boolean;
|
|
126
140
|
}
|
|
127
141
|
|
|
128
|
-
interface ViewInput {
|
|
142
|
+
export interface ViewInput {
|
|
129
143
|
errorLike: boolean;
|
|
130
144
|
mainText: string;
|
|
131
145
|
subText?: string;
|
|
132
146
|
title?: string;
|
|
133
147
|
domBreakpointData?: DOMBreakpointData;
|
|
148
|
+
onDisableBreakpoint?: () => void;
|
|
149
|
+
onNeverPauseHere?: () => void;
|
|
150
|
+
onDeactivateBreakpointsAndResume?: () => void;
|
|
134
151
|
}
|
|
135
152
|
|
|
136
153
|
function domBreakpointSubtext(data: DOMBreakpointData): Lit.LitTemplate {
|
|
@@ -153,7 +170,7 @@ function domBreakpointSubtext(data: DOMBreakpointData): Lit.LitTemplate {
|
|
|
153
170
|
`;
|
|
154
171
|
}
|
|
155
172
|
|
|
156
|
-
const DEFAULT_VIEW = (input: ViewInput|null, _output: undefined, target: DocumentFragment): void => {
|
|
173
|
+
export const DEFAULT_VIEW = (input: ViewInput|null, _output: undefined, target: DocumentFragment): void => {
|
|
157
174
|
// clang-format off
|
|
158
175
|
render(html`
|
|
159
176
|
<style>${debuggerPausedMessageStyles}</style>
|
|
@@ -169,6 +186,32 @@ const DEFAULT_VIEW = (input: ViewInput|null, _output: undefined, target: Documen
|
|
|
169
186
|
${input.domBreakpointData ? domBreakpointSubtext(input.domBreakpointData) : input.subText}
|
|
170
187
|
</div>` : nothing}
|
|
171
188
|
</span>
|
|
189
|
+
${input.onDisableBreakpoint || input.onNeverPauseHere || input.onDeactivateBreakpointsAndResume ? html`
|
|
190
|
+
<div class="status-actions">
|
|
191
|
+
${input.onDisableBreakpoint ? html`
|
|
192
|
+
<devtools-button
|
|
193
|
+
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
194
|
+
.size=${Buttons.Button.Size.MICRO}
|
|
195
|
+
.jslogContext=${'disable-breakpoint'}
|
|
196
|
+
@click=${() => input.onDisableBreakpoint?.()}>
|
|
197
|
+
${i18nString(UIStrings.disableBreakpoint)}
|
|
198
|
+
</devtools-button>` : input.onNeverPauseHere ? html`
|
|
199
|
+
<devtools-button
|
|
200
|
+
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
201
|
+
.size=${Buttons.Button.Size.MICRO}
|
|
202
|
+
.jslogContext=${'never-pause-here'}
|
|
203
|
+
@click=${() => input.onNeverPauseHere?.()}>
|
|
204
|
+
${i18nString(UIStrings.neverPauseHere)}
|
|
205
|
+
</devtools-button>` : nothing}
|
|
206
|
+
${input.onDeactivateBreakpointsAndResume ? html`
|
|
207
|
+
<devtools-button
|
|
208
|
+
.variant=${Buttons.Button.Variant.TEXT}
|
|
209
|
+
.size=${Buttons.Button.Size.MICRO}
|
|
210
|
+
.jslogContext=${'debugger.toggle-breakpoints-active'}
|
|
211
|
+
@click=${() => input.onDeactivateBreakpointsAndResume?.()}>
|
|
212
|
+
${i18nString(UIStrings.deactivateAll)}
|
|
213
|
+
</devtools-button>` : nothing}
|
|
214
|
+
</div>` : nothing}
|
|
172
215
|
</div>` : nothing}
|
|
173
216
|
</div>`, target, {
|
|
174
217
|
container: {
|
|
@@ -179,21 +222,35 @@ const DEFAULT_VIEW = (input: ViewInput|null, _output: undefined, target: Documen
|
|
|
179
222
|
// clang-format on
|
|
180
223
|
};
|
|
181
224
|
|
|
182
|
-
type View = typeof DEFAULT_VIEW;
|
|
225
|
+
export type View = typeof DEFAULT_VIEW;
|
|
183
226
|
|
|
184
227
|
export class DebuggerPausedMessage extends UI.Widget.Widget<ShadowRoot> {
|
|
185
|
-
static override readonly INJECT: readonly[typeof SDK.EventBreakpointsModel.EventBreakpointsManager
|
|
186
|
-
|
|
228
|
+
static override readonly INJECT: readonly[typeof SDK.EventBreakpointsModel.EventBreakpointsManager,
|
|
229
|
+
typeof Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding,
|
|
230
|
+
typeof Breakpoints.BreakpointManager.BreakpointManager,
|
|
231
|
+
typeof Common.Settings.Settings,
|
|
232
|
+
] =
|
|
233
|
+
[
|
|
234
|
+
SDK.EventBreakpointsModel.EventBreakpointsManager,
|
|
235
|
+
Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding,
|
|
236
|
+
Breakpoints.BreakpointManager.BreakpointManager,
|
|
237
|
+
Common.Settings.Settings,
|
|
238
|
+
] as const;
|
|
187
239
|
|
|
188
240
|
#viewInput: ViewInput|null = null;
|
|
241
|
+
#renderGeneration = 0;
|
|
189
242
|
readonly #eventBreakpointsManager: SDK.EventBreakpointsModel.EventBreakpointsManager;
|
|
243
|
+
readonly #recurringPauseDetector: Breakpoints.RecurringPauseDetector.RecurringPauseDetector;
|
|
190
244
|
constructor(element: HTMLElement|undefined,
|
|
191
|
-
[eventBreakpointsManager
|
|
245
|
+
[eventBreakpointsManager, debuggerWorkspaceBinding, breakpointManager,
|
|
246
|
+
settings]: UI.Widget.WidgetDependencies<typeof DebuggerPausedMessage>,
|
|
192
247
|
private readonly view: View = DEFAULT_VIEW) {
|
|
193
248
|
super(element, {
|
|
194
249
|
useShadowDom: 'pure',
|
|
195
250
|
});
|
|
196
251
|
this.#eventBreakpointsManager = eventBreakpointsManager;
|
|
252
|
+
this.#recurringPauseDetector = new Breakpoints.RecurringPauseDetector.RecurringPauseDetector(
|
|
253
|
+
debuggerWorkspaceBinding, breakpointManager, settings);
|
|
197
254
|
}
|
|
198
255
|
|
|
199
256
|
private static descriptionWithoutStack(description: string): string {
|
|
@@ -258,11 +315,16 @@ export class DebuggerPausedMessage extends UI.Widget.Widget<ShadowRoot> {
|
|
|
258
315
|
return breakpoint?.name ?? '';
|
|
259
316
|
}
|
|
260
317
|
|
|
261
|
-
async render(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
318
|
+
async render(details: SDK.DebuggerModel.DebuggerPausedDetails|null,
|
|
319
|
+
debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding,
|
|
320
|
+
breakpointManager: Breakpoints.BreakpointManager.BreakpointManager): Promise<void> {
|
|
321
|
+
const generation = ++this.#renderGeneration;
|
|
322
|
+
const escapeActionsPromise = this.#recurringPauseDetector.onPaused(details);
|
|
265
323
|
if (!details) {
|
|
324
|
+
await escapeActionsPromise;
|
|
325
|
+
if (generation !== this.#renderGeneration) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
266
328
|
this.#viewInput = null;
|
|
267
329
|
this.requestUpdate();
|
|
268
330
|
return;
|
|
@@ -273,20 +335,21 @@ export class DebuggerPausedMessage extends UI.Widget.Widget<ShadowRoot> {
|
|
|
273
335
|
details.reason === Protocol.Debugger.PausedEventReason.Assert ||
|
|
274
336
|
details.reason === Protocol.Debugger.PausedEventReason.OOM;
|
|
275
337
|
|
|
338
|
+
let viewInput: ViewInput|null = null;
|
|
276
339
|
if (details.reason === Protocol.Debugger.PausedEventReason.DOM) {
|
|
277
|
-
|
|
340
|
+
viewInput = await DebuggerPausedMessage.createDOMBreakpointHitMessageDetails(details);
|
|
278
341
|
} else if (details.reason === Protocol.Debugger.PausedEventReason.EventListener) {
|
|
279
342
|
const eventNameForUI =
|
|
280
343
|
this.#findEventNameForUi(details.auxData as SDK.DebuggerModel.EventListenerPausedDetailsAuxData);
|
|
281
|
-
|
|
344
|
+
viewInput = {mainText: i18nString(UIStrings.pausedOnEventListener), subText: eventNameForUI, errorLike};
|
|
282
345
|
} else if (details.reason === Protocol.Debugger.PausedEventReason.XHR) {
|
|
283
346
|
const auxData = (details.auxData as PausedDetailsAuxData);
|
|
284
|
-
|
|
347
|
+
viewInput = {mainText: i18nString(UIStrings.pausedOnXhrOrFetch), subText: auxData.url || '', errorLike};
|
|
285
348
|
} else if (details.reason === Protocol.Debugger.PausedEventReason.Exception) {
|
|
286
349
|
const auxData = (details.auxData as PausedDetailsAuxData);
|
|
287
350
|
const description = auxData.description || auxData.value || '';
|
|
288
351
|
const descriptionWithoutStack = DebuggerPausedMessage.descriptionWithoutStack(description);
|
|
289
|
-
|
|
352
|
+
viewInput = {
|
|
290
353
|
mainText: i18nString(UIStrings.pausedOnException),
|
|
291
354
|
subText: descriptionWithoutStack,
|
|
292
355
|
title: description,
|
|
@@ -296,29 +359,29 @@ export class DebuggerPausedMessage extends UI.Widget.Widget<ShadowRoot> {
|
|
|
296
359
|
const auxData = (details.auxData as PausedDetailsAuxData);
|
|
297
360
|
const description = auxData.description || auxData.value || '';
|
|
298
361
|
const descriptionWithoutStack = DebuggerPausedMessage.descriptionWithoutStack(description);
|
|
299
|
-
|
|
362
|
+
viewInput = {
|
|
300
363
|
mainText: i18nString(UIStrings.pausedOnPromiseRejection),
|
|
301
364
|
subText: descriptionWithoutStack,
|
|
302
365
|
title: description,
|
|
303
366
|
errorLike,
|
|
304
367
|
};
|
|
305
368
|
} else if (details.reason === Protocol.Debugger.PausedEventReason.Assert) {
|
|
306
|
-
|
|
369
|
+
viewInput = {mainText: i18nString(UIStrings.pausedOnAssertion), errorLike};
|
|
307
370
|
} else if (details.reason === Protocol.Debugger.PausedEventReason.DebugCommand) {
|
|
308
|
-
|
|
371
|
+
viewInput = {mainText: i18nString(UIStrings.pausedOnDebuggedFunction), errorLike};
|
|
309
372
|
} else if (details.reason === Protocol.Debugger.PausedEventReason.OOM) {
|
|
310
|
-
|
|
311
|
-
} else if (
|
|
312
|
-
|
|
373
|
+
viewInput = {mainText: i18nString(UIStrings.pausedBeforePotentialOutofmemory), errorLike};
|
|
374
|
+
} else if (details.reason === Protocol.Debugger.PausedEventReason.CSPViolation &&
|
|
375
|
+
details.auxData?.['violationType']) {
|
|
313
376
|
const text = (details.auxData['violationType'] as string);
|
|
314
377
|
if (text === Protocol.DOMDebugger.CSPViolationType.TrustedtypeSinkViolation) {
|
|
315
|
-
|
|
378
|
+
viewInput = {
|
|
316
379
|
mainText: i18nString(UIStrings.pausedOnCspViolation),
|
|
317
380
|
subText: i18nString(UIStrings.trustedTypeSinkViolation),
|
|
318
381
|
errorLike,
|
|
319
382
|
};
|
|
320
383
|
} else if (text === Protocol.DOMDebugger.CSPViolationType.TrustedtypePolicyViolation) {
|
|
321
|
-
|
|
384
|
+
viewInput = {
|
|
322
385
|
mainText: i18nString(UIStrings.pausedOnCspViolation),
|
|
323
386
|
subText: i18nString(UIStrings.trustedTypePolicyViolation),
|
|
324
387
|
errorLike,
|
|
@@ -328,13 +391,23 @@ export class DebuggerPausedMessage extends UI.Widget.Widget<ShadowRoot> {
|
|
|
328
391
|
const uiLocation = await debuggerWorkspaceBinding.rawLocationToUILocation(details.callFrames[0].location());
|
|
329
392
|
const breakpoint = uiLocation ? breakpointManager.findBreakpoint(uiLocation) : null;
|
|
330
393
|
const defaultText = breakpoint ? i18nString(UIStrings.pausedOnBreakpoint) : i18nString(UIStrings.debuggerPaused);
|
|
331
|
-
|
|
394
|
+
viewInput = {mainText: defaultText, errorLike};
|
|
332
395
|
} else {
|
|
333
|
-
this.#viewInput = null;
|
|
334
396
|
console.warn(
|
|
335
397
|
'ScriptsPanel paused, but callFrames.length is zero.'); // TODO remove this once we understand this case better
|
|
336
398
|
}
|
|
337
399
|
|
|
400
|
+
const escapeActions = await escapeActionsPromise;
|
|
401
|
+
if (generation !== this.#renderGeneration) {
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
this.#viewInput = viewInput ? {
|
|
405
|
+
...viewInput,
|
|
406
|
+
onDisableBreakpoint: escapeActions.disableBreakpoint,
|
|
407
|
+
onNeverPauseHere: escapeActions.neverPauseHere,
|
|
408
|
+
onDeactivateBreakpointsAndResume: escapeActions.deactivateBreakpointsAndResume,
|
|
409
|
+
} :
|
|
410
|
+
null;
|
|
338
411
|
this.requestUpdate();
|
|
339
412
|
}
|
|
340
413
|
|