chrome-devtools-frontend 1.0.1730971 → 1.0.1732697
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/get_the_code.md +1 -73
- package/front_end/Tests.js +15 -0
- package/front_end/core/host/AidaClient.ts +47 -3
- package/front_end/core/host/AidaClientTypes.ts +27 -3
- package/front_end/core/host/AidaGcaTranslation.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +8 -3
- package/front_end/core/sdk/NetworkManager.ts +2 -1
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +2 -2
- package/front_end/generated/Deprecation.ts +0 -8
- package/front_end/generated/InspectorBackendCommands.ts +2 -1
- package/front_end/generated/SupportedCSSProperties.ts +2 -2
- package/front_end/generated/protocol.ts +9 -0
- package/front_end/models/ai-utils/debug.ts +127 -22
- package/front_end/models/ai_assistance/README.md +1 -1
- package/front_end/models/ai_assistance/agents/AiAgent.ts +10 -5
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +4 -3
- package/front_end/models/ai_assistance/contexts/LighthouseContext.snapshot.txt +9 -2
- package/front_end/models/ai_assistance/contexts/LighthouseContext.ts +4 -3
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +97 -11
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +92 -43
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +26 -26
- package/front_end/models/ai_assistance/skills/styling.md +4 -2
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +31 -36
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -1
- package/front_end/models/ai_code_completion/ai_code_completion.ts +11 -2
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -1
- package/front_end/models/ai_code_generation/ai_code_generation.ts +11 -2
- package/front_end/models/bindings/CompilerScriptMapping.ts +0 -1
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +0 -1
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -1
- package/front_end/models/har/HARFormat.ts +1 -0
- package/front_end/models/har/Importer.ts +7 -1
- package/front_end/models/har/Log.snapshot.txt +2 -0
- package/front_end/models/har/Log.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.ts +0 -4
- package/front_end/models/trace/LanternComputationData.ts +4 -0
- package/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +126 -1
- package/front_end/models/trace/lantern/types/Lantern.ts +3 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +33 -1
- package/front_end/panels/ai_assistance/ExternalHandler.ts +1 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -0
- package/front_end/panels/ai_assistance/components/PermissionPrompt.ts +4 -4
- package/front_end/panels/ai_assistance/components/chatInput.css +1 -1
- package/front_end/panels/ai_assistance/components/chatMessage.css +3 -4
- package/front_end/panels/ai_assistance/components/exploreWidget.css +3 -3
- package/front_end/panels/animation/animationTimeline.css +11 -9
- package/front_end/panels/application/IndexedDBViews.ts +2 -2
- package/front_end/panels/application/PrivateVerificationTokensView.ts +217 -9
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
- package/front_end/panels/application/ServiceWorkersView.ts +1 -1
- package/front_end/panels/application/StorageView.ts +1 -1
- package/front_end/panels/application/appManifestView.css +0 -6
- package/front_end/panels/application/backgroundServiceView.css +0 -21
- package/front_end/panels/application/components/backForwardCacheView.css +1 -9
- package/front_end/panels/application/components/endpointsGrid.css +1 -1
- package/front_end/panels/application/components/permissionsPolicySection.css +1 -1
- package/front_end/panels/application/components/reportsGrid.css +1 -1
- package/front_end/panels/application/components/serviceWorkerRouterView.css +2 -2
- package/front_end/panels/application/components/trustTokensView.css +1 -1
- package/front_end/panels/application/cookieItemsView.css +0 -1
- package/front_end/panels/application/frameDetailsReportView.css +0 -10
- package/front_end/panels/application/indexedDBViews.css +0 -10
- package/front_end/panels/application/privateVerificationTokensView.css +12 -0
- package/front_end/panels/application/resourcesPanel.css +0 -23
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +7 -7
- package/front_end/panels/application/serviceWorkersView.css +4 -3
- package/front_end/panels/changes/CombinedDiffView.ts +1 -1
- package/front_end/panels/comments/CommentsPane.ts +7 -11
- package/front_end/panels/common/CommentThreadWidget.ts +11 -3
- package/front_end/panels/common/CommentsOverlayWidget.ts +337 -117
- package/front_end/panels/console/consoleContextSelector.css +1 -1
- package/front_end/panels/console/consolePinPane.css +1 -1
- package/front_end/panels/console/consolePrompt.css +4 -2
- package/front_end/panels/console/consoleView.css +5 -3
- package/front_end/panels/coverage/CoverageView.ts +0 -1
- package/front_end/panels/coverage/coverageView.css +4 -3
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +0 -1
- package/front_end/panels/elements/AccessibilityTreeView.ts +1 -1
- package/front_end/panels/elements/CSSValueTraceView.ts +2 -4
- package/front_end/panels/elements/ComputedStyleWidget.ts +8 -19
- package/front_end/panels/elements/DOMTreeContextMenu.ts +1 -1
- package/front_end/panels/elements/DOMTreeWidget.ts +14 -0
- package/front_end/panels/elements/MetricsSidebarPane.ts +1 -1
- package/front_end/panels/elements/PlatformFontsWidget.ts +0 -1
- package/front_end/panels/elements/PropertiesWidget.ts +1 -1
- package/front_end/panels/elements/PropertyRenderer.ts +7 -27
- package/front_end/panels/elements/StylePropertyTreeElement.ts +61 -72
- package/front_end/panels/elements/StylesSidebarPane.ts +2 -0
- package/front_end/panels/elements/WebCustomData.ts +1 -1
- package/front_end/panels/elements/components/cssHintDetailsView.css +1 -1
- package/front_end/panels/elements/components/cssVariableValueView.css +3 -1
- package/front_end/panels/elements/components/elementsBreadcrumbs.css +1 -1
- package/front_end/panels/elements/components/elementsTreeExpandButton.css +3 -2
- package/front_end/panels/elements/components/stylePropertyEditor.css +2 -2
- package/front_end/panels/elements/layoutPane.css +1 -1
- package/front_end/panels/elements/metricsSidebarPane.css +6 -6
- package/front_end/panels/elements/platformFontsWidget.css +1 -1
- package/front_end/panels/elements/propertiesWidget.css +0 -5
- package/front_end/panels/elements/stylesSidebarPane.css +1 -1
- package/front_end/panels/emulation/DeviceModeView.ts +4 -3
- package/front_end/panels/emulation/deviceModeView.css +9 -10
- package/front_end/panels/event_listeners/eventListenersView.css +5 -5
- package/front_end/panels/explain/components/consoleInsight.css +5 -20
- package/front_end/panels/issues/issuesTree.css +11 -10
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +4 -2
- package/front_end/panels/layer_viewer/TransformController.ts +106 -54
- package/front_end/panels/layer_viewer/layerTreeOutline.css +1 -1
- package/front_end/panels/lighthouse/lighthousePanel.css +5 -8
- package/front_end/panels/lighthouse/lighthouseStartView.css +1 -2
- package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +4 -4
- package/front_end/panels/linear_memory_inspector/components/valueInterpreterDisplay.css +1 -1
- package/front_end/panels/media/EventTimelineView.ts +1 -4
- package/front_end/panels/media/TickingFlameChart.ts +3 -2
- package/front_end/panels/media/playerListView.css +14 -7
- package/front_end/panels/media/playerMessagesView.css +11 -7
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -7
- package/front_end/panels/network/NetworkConfigView.ts +1 -1
- package/front_end/panels/network/NetworkWaterfallColumn.ts +92 -55
- package/front_end/panels/network/binaryResourceView.css +0 -7
- package/front_end/panels/network/networkConfigView.css +3 -3
- package/front_end/panels/network/networkLogView.css +5 -11
- package/front_end/panels/network/networkManageCustomHeadersView.css +1 -1
- package/front_end/panels/network/networkTimingTable.css +6 -6
- package/front_end/panels/network/requestConditionsDrawer.css +1 -24
- package/front_end/panels/network/requestPayloadView.css +1 -1
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
- package/front_end/panels/performance_monitor/performanceMonitor.css +2 -2
- package/front_end/panels/profiler/ModuleUIStrings.ts +12 -0
- package/front_end/panels/protocol_monitor/JSONEditor.css +4 -3
- package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
- package/front_end/panels/protocol_monitor/protocolMonitor.css +1 -1
- package/front_end/panels/recorder/createRecordingView.css +2 -2
- package/front_end/panels/recorder/extensionView.css +1 -1
- package/front_end/panels/recorder/recorderPanel.css +3 -3
- package/front_end/panels/recorder/recordingListView.css +1 -1
- package/front_end/panels/recorder/stepEditor.css +2 -2
- package/front_end/panels/recorder/stepView.css +0 -31
- package/front_end/panels/recorder/timelineSection.css +1 -1
- package/front_end/panels/screencast/screencastView.css +3 -2
- package/front_end/panels/search/searchView.css +4 -3
- package/front_end/panels/security/SecurityPanelSidebar.ts +0 -1
- package/front_end/panels/security/mainView.css +2 -2
- package/front_end/panels/security/originView.css +1 -5
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +2 -1
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +1 -2
- package/front_end/panels/sources/breakpointsView.css +3 -4
- package/front_end/panels/sources/tabbedEditorContainer.css +1 -1
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +4 -3
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +30 -10
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +1 -1
- package/front_end/panels/timeline/components/OriginMap.ts +1 -1
- package/front_end/panels/timeline/components/fieldSettingsDialog.css +1 -1
- package/front_end/panels/timeline/components/metricCard.css +1 -1
- package/front_end/panels/timeline/components/networkRequestDetails.css +0 -1
- package/front_end/panels/timeline/components/networkRequestTooltip.css +4 -4
- package/front_end/panels/timeline/components/relatedInsightChips.css +1 -1
- package/front_end/panels/timeline/timelineFlameChartView.css +4 -4
- package/front_end/panels/timeline/timelineFlamechartPopover.css +3 -3
- package/front_end/panels/timeline/timelineHistoryManager.css +1 -1
- package/front_end/panels/timeline/timelineMiniMap.css +3 -2
- package/front_end/panels/timeline/timelineStatusDialog.css +1 -1
- package/front_end/panels/web_audio/webAudio.css +0 -20
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +166 -8
- package/front_end/ui/comments/CommentOverlayManager.ts +17 -2
- package/front_end/ui/components/buttons/button.css +0 -1
- package/front_end/ui/components/diff_view/diffView.css +2 -2
- package/front_end/ui/components/markdown_view/codeBlock.css +3 -3
- package/front_end/ui/components/markdown_view/markdownView.css +3 -3
- package/front_end/ui/components/menus/Menu.ts +1 -1
- package/front_end/ui/components/menus/menuItem.css +1 -1
- package/front_end/ui/components/panel_feedback/panelFeedback.css +5 -4
- package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +1 -1
- package/front_end/ui/components/report_view/reportValue.css +5 -2
- package/front_end/ui/components/suggestion_input/suggestionInput.css +6 -6
- package/front_end/ui/legacy/ContextMenu.ts +3 -0
- package/front_end/ui/legacy/GlassPane.ts +3 -3
- package/front_end/ui/legacy/SoftContextMenu.ts +7 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +2 -0
- package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +7 -6
- package/front_end/ui/legacy/components/inline_editor/colorSwatch.css +1 -2
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +3 -3
- package/front_end/ui/legacy/components/perf_ui/chartViewport.css +1 -1
- package/front_end/ui/legacy/components/perf_ui/filmStripView.css +1 -1
- package/front_end/ui/legacy/components/perf_ui/flameChart.css +12 -9
- package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +11 -7
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +3 -4
- package/front_end/ui/legacy/components/source_frame/imageView.css +4 -4
- package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
- package/front_end/ui/legacy/components/utils/jsUtils.css +2 -1
- package/front_end/ui/legacy/dropTarget.css +1 -1
- package/front_end/ui/legacy/filter.css +4 -3
- package/front_end/ui/legacy/inspectorCommon.css +16 -48
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +1 -1
- package/front_end/ui/legacy/progressIndicator.css +1 -2
- package/front_end/ui/legacy/reportView.css +4 -1
- package/front_end/ui/legacy/searchableView.css +1 -1
- package/front_end/ui/legacy/suggestBox.css +2 -1
- package/front_end/ui/legacy/tabbedPane.css +7 -4
- package/front_end/ui/legacy/toolbar.css +2 -1
- package/front_end/ui/legacy/treeoutline.css +6 -5
- package/front_end/ui/legacy/viewContainers.css +3 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +15 -0
- package/inspector_overlay/highlight_anchor.ts +8 -11
- package/package.json +1 -1
- package/front_end/models/ai_code_completion/debug.ts +0 -33
- package/front_end/models/ai_code_generation/debug.ts +0 -33
|
@@ -103,7 +103,9 @@
|
|
|
103
103
|
position: relative;
|
|
104
104
|
padding: var(--sys-size-1) var(--sys-size-10) var(--sys-size-1) 0;
|
|
105
105
|
margin-left: var(--sys-size-11);
|
|
106
|
-
|
|
106
|
+
/* 16px (--sys-size-8) single-line content/medium-icon box
|
|
107
|
+
* + 2 * 1px (--sys-size-1) top & bottom padding */
|
|
108
|
+
min-height: calc(var(--sys-size-8) + 2 * var(--sys-size-1));
|
|
107
109
|
flex: auto;
|
|
108
110
|
display: flex;
|
|
109
111
|
align-items: flex-end;
|
|
@@ -117,7 +119,7 @@
|
|
|
117
119
|
color: var(--sys-color-token-subtle);
|
|
118
120
|
user-select: none;
|
|
119
121
|
flex: none;
|
|
120
|
-
margin-right:
|
|
122
|
+
margin-right: var(--sys-size-3);
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
.message-level-icon,
|
|
@@ -200,7 +202,7 @@
|
|
|
200
202
|
display: flex;
|
|
201
203
|
flex-direction: column;
|
|
202
204
|
margin: var(--sys-size-3);
|
|
203
|
-
border-radius:
|
|
205
|
+
border-radius: var(--sys-shape-corner-extra-small);
|
|
204
206
|
|
|
205
207
|
/* Console ANSI color */
|
|
206
208
|
--console-color-black: #000;
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
.coverage-toolbar-summary {
|
|
22
22
|
background-color: var(--sys-color-cdt-base-container);
|
|
23
23
|
border-top: var(--sys-size-1) solid var(--sys-color-divider);
|
|
24
|
-
padding-left:
|
|
25
|
-
|
|
24
|
+
padding-left: var(--sys-size-3);
|
|
25
|
+
/* 20px footer bar (--sys-size-9) minus 1px top border (--sys-size-1). */
|
|
26
|
+
flex: 0 0 calc(var(--sys-size-9) - var(--sys-size-1));
|
|
26
27
|
display: flex;
|
|
27
|
-
padding-right:
|
|
28
|
+
padding-right: var(--sys-size-3);
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
.coverage-toolbar-summary .coverage-message {
|
|
@@ -585,7 +585,6 @@ export class CSSOverviewCompletedView extends UI.Widget.VBox {
|
|
|
585
585
|
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
586
586
|
super(element);
|
|
587
587
|
this.#view = view;
|
|
588
|
-
this.registerRequiredCSS(cssOverviewCompletedViewStyles);
|
|
589
588
|
this.#linkifier = new Components.Linkifier.Linkifier(/* maxLinkLength */ 20, /* useLinkDecorator */ true);
|
|
590
589
|
this.#viewMap = new Map();
|
|
591
590
|
this.#data = null;
|
|
@@ -115,6 +115,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
115
115
|
|
|
116
116
|
// clang-format off
|
|
117
117
|
render(html`
|
|
118
|
+
<style>${accessibilityTreeViewStyles}</style>
|
|
118
119
|
<div class="accessibility-tree-view-container" jslog=${VisualLogging.tree('full-accessibility')} @copy=${onCopy}>
|
|
119
120
|
<devtools-tree-outline .data=${treeData}
|
|
120
121
|
@itemselected=${onItemSelected}
|
|
@@ -139,7 +140,6 @@ export class AccessibilityTreeView extends UI.Widget.VBox implements
|
|
|
139
140
|
frameManager: SDK.FrameManager.FrameManager = SDK.FrameManager.FrameManager.instance()) {
|
|
140
141
|
super();
|
|
141
142
|
this.#view = view;
|
|
142
|
-
this.registerRequiredCSS(accessibilityTreeViewStyles);
|
|
143
143
|
this.#frameManager = frameManager;
|
|
144
144
|
|
|
145
145
|
SDK.TargetManager.TargetManager.instance().observeModels(SDK.AccessibilityModel.AccessibilityModel, this,
|
|
@@ -42,6 +42,8 @@ function defaultView(input: ViewInput, output: undefined, target: HTMLElement):
|
|
|
42
42
|
// clang-format off
|
|
43
43
|
render(
|
|
44
44
|
html`
|
|
45
|
+
<style>${cssValueTraceViewStyles}</style>
|
|
46
|
+
<style>${stylePropertiesTreeOutlineStyles}</style>
|
|
45
47
|
<div role=dialog class="css-value-trace monospace" @keydown=${onKeyDown}>
|
|
46
48
|
${substitutions.map(line => html`
|
|
47
49
|
<span class="trace-line-icon" aria-label="is equal to">\u21b3</span>
|
|
@@ -111,10 +113,6 @@ export class CSSValueTraceView extends UI.Widget.VBox {
|
|
|
111
113
|
|
|
112
114
|
constructor(element?: HTMLElement, view: View = defaultView) {
|
|
113
115
|
super(element, {useShadowDom: true});
|
|
114
|
-
this.registerRequiredCSS(
|
|
115
|
-
cssValueTraceViewStyles,
|
|
116
|
-
stylePropertiesTreeOutlineStyles,
|
|
117
|
-
);
|
|
118
116
|
this.#view = view;
|
|
119
117
|
this.requestUpdate();
|
|
120
118
|
}
|
|
@@ -43,7 +43,7 @@ import * as TreeOutline from '../../ui/components/tree_outline/tree_outline.js';
|
|
|
43
43
|
import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
44
44
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
45
45
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
46
|
-
import
|
|
46
|
+
import {html, type LitTemplate, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
|
|
47
47
|
|
|
48
48
|
import * as ElementsComponents from './components/components.js';
|
|
49
49
|
import computedStyleWidgetStyles from './computedStyleWidget.css.js';
|
|
@@ -52,7 +52,6 @@ import {categorizePropertyName, type Category, DefaultCategoryOrder} from './Pro
|
|
|
52
52
|
import {Renderer, rendererBase, type RenderingContext, StringRenderer, URLRenderer} from './PropertyRenderer.js';
|
|
53
53
|
import {StylePropertiesSection} from './StylePropertiesSection.js';
|
|
54
54
|
|
|
55
|
-
const {html, render} = Lit;
|
|
56
55
|
const {bindToSetting} = UI.UIUtils;
|
|
57
56
|
const {widget} = UI.Widget;
|
|
58
57
|
|
|
@@ -129,7 +128,7 @@ const createPropertyElement =
|
|
|
129
128
|
(node: SDK.DOMModel.DOMNode, cache: Map<string, {name: Element, value: Element}>, propertyName: string,
|
|
130
129
|
propertyValue: string, traceable: boolean, inherited: boolean,
|
|
131
130
|
activeProperty: SDK.CSSProperty.CSSProperty|undefined, onContextMenu: ((event: Event) => void),
|
|
132
|
-
category?: Category):
|
|
131
|
+
category?: Category): TemplateResult => {
|
|
133
132
|
const {name, value} = renderPropertyContents(node, cache, propertyName, propertyValue, category);
|
|
134
133
|
// clang-format off
|
|
135
134
|
return html`<devtools-widget
|
|
@@ -191,26 +190,17 @@ const createTraceElement =
|
|
|
191
190
|
// clang-format off
|
|
192
191
|
class ColorRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.ColorMatch) {
|
|
193
192
|
// clang-format on
|
|
194
|
-
override render(match: SDK.CSSPropertyParserMatchers.ColorMatch, context: RenderingContext):
|
|
193
|
+
override render(match: SDK.CSSPropertyParserMatchers.ColorMatch, context: RenderingContext): LitTemplate {
|
|
195
194
|
const color = Common.Color.parse(match.text);
|
|
196
195
|
if (!color) {
|
|
197
|
-
return
|
|
196
|
+
return html`${match.text}`;
|
|
198
197
|
}
|
|
199
198
|
|
|
200
199
|
const swatch = new InlineEditor.ColorSwatch.ColorSwatch();
|
|
201
200
|
swatch.setReadonly(true);
|
|
202
201
|
swatch.renderColor(color);
|
|
203
|
-
const valueElement = document.createElement('span');
|
|
204
|
-
valueElement.textContent = match.text;
|
|
205
|
-
|
|
206
|
-
swatch.addEventListener(
|
|
207
|
-
InlineEditor.ColorSwatch.ColorChangedEvent.eventName, (event: InlineEditor.ColorSwatch.ColorChangedEvent) => {
|
|
208
|
-
const {data: {color}} = event;
|
|
209
|
-
valueElement.textContent = color.getAuthoredText() ?? color.asString();
|
|
210
|
-
});
|
|
211
|
-
|
|
212
202
|
context.addControl('color', swatch);
|
|
213
|
-
return
|
|
203
|
+
return html`${swatch}<span>${match.text}</span>`;
|
|
214
204
|
}
|
|
215
205
|
|
|
216
206
|
matcher(): SDK.CSSPropertyParserMatchers.ColorMatcher {
|
|
@@ -290,7 +280,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
290
280
|
>${i18nString(UIStrings.group)}</devtools-checkbox>
|
|
291
281
|
</devtools-toolbar>
|
|
292
282
|
</div>
|
|
293
|
-
` :
|
|
283
|
+
` : nothing}
|
|
294
284
|
${input.computedStylesTree}
|
|
295
285
|
${!input.hasMatches ? html`<div class="gray-info-message">${i18nString(UIStrings.noMatchingProperty)}</div>` : ''}
|
|
296
286
|
`, target);
|
|
@@ -632,9 +622,8 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
632
622
|
propertyTraces: Map<string, SDK.CSSProperty.CSSProperty[]>,
|
|
633
623
|
domNode: SDK.DOMModel.DOMNode,
|
|
634
624
|
matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
635
|
-
):
|
|
636
|
-
|
|
637
|
-
state: {isExpanded: boolean}) => Lit.TemplateResult {
|
|
625
|
+
): (node: TreeOutline.TreeOutlineUtils.TreeNode<ComputedStyleData>,
|
|
626
|
+
state: {isExpanded: boolean}) => TemplateResult {
|
|
638
627
|
return node => {
|
|
639
628
|
const data = node.treeNodeData;
|
|
640
629
|
if (data.tag === 'property') {
|
|
@@ -551,6 +551,6 @@ export async function showContextMenu(
|
|
|
551
551
|
ElementsPanel.instance().populateAdornerSettingsContextMenu(contextMenu);
|
|
552
552
|
|
|
553
553
|
contextMenu.appendApplicableItems(domNode);
|
|
554
|
-
|
|
554
|
+
await contextMenu.show();
|
|
555
555
|
return contextMenu;
|
|
556
556
|
}
|
|
@@ -1546,10 +1546,24 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
1546
1546
|
}
|
|
1547
1547
|
if (expanded) {
|
|
1548
1548
|
this.#expandedNodes.add(node);
|
|
1549
|
+
// Children that are not collapsible (e.g. the document element) render
|
|
1550
|
+
// without an expand arrow, so their children must be fetched eagerly.
|
|
1551
|
+
const expandNotCollapsibleChildren = (): void => {
|
|
1552
|
+
for (const child of node.children() ?? []) {
|
|
1553
|
+
// Check the Set directly instead of isNodeExpanded(), because
|
|
1554
|
+
// isNodeExpanded() always returns true for non-collapsible nodes.
|
|
1555
|
+
if (isNotCollapsible(child) && !this.#expandedNodes.has(child)) {
|
|
1556
|
+
this.setNodeExpanded(child, true);
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
};
|
|
1549
1560
|
if (!node.children() && (node.childNodeCount() || node.isIframe() || node.nodeType() === Node.DOCUMENT_NODE)) {
|
|
1550
1561
|
void node.getChildNodes(() => {
|
|
1562
|
+
expandNotCollapsibleChildren();
|
|
1551
1563
|
this.performUpdate();
|
|
1552
1564
|
});
|
|
1565
|
+
} else {
|
|
1566
|
+
expandNotCollapsibleChildren();
|
|
1553
1567
|
}
|
|
1554
1568
|
this.onElementExpanded();
|
|
1555
1569
|
} else {
|
|
@@ -175,6 +175,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
175
175
|
}
|
|
176
176
|
// clang-format off
|
|
177
177
|
render(html`
|
|
178
|
+
<style>${metricsSidebarPaneStyles}</style>
|
|
178
179
|
<div class="metrics ${!node ? 'collapsed' : ''}" @mouseover=${(e: Event) => { e.consume(); onHighlightNode(true, 'all'); }}
|
|
179
180
|
@mouseleave=${(e: Event) => { e.consume(); onHighlightNode(false, 'all'); }}>
|
|
180
181
|
${previousBox}
|
|
@@ -195,7 +196,6 @@ export class MetricsSidebarPane extends ElementsSidebarPane<ShadowRoot> {
|
|
|
195
196
|
|
|
196
197
|
constructor(computedStyleModel: ComputedStyle.ComputedStyleModel.ComputedStyleModel, view: View = DEFAULT_VIEW) {
|
|
197
198
|
super(computedStyleModel, {useShadowDom: 'pure'});
|
|
198
|
-
this.registerRequiredCSS(metricsSidebarPaneStyles);
|
|
199
199
|
|
|
200
200
|
this.originalPropertyData = null;
|
|
201
201
|
this.previousPropertyDataCandidate = null;
|
|
@@ -84,7 +84,6 @@ export class PlatformFontsWidget extends UI.Widget.VBox {
|
|
|
84
84
|
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
85
85
|
super(element, {useShadowDom: true});
|
|
86
86
|
this.#view = view;
|
|
87
|
-
this.registerRequiredCSS(platformFontsWidgetStyles);
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
get sharedModel(): ComputedStyle.ComputedStyleModel.ComputedStyleModel|null {
|
|
@@ -85,6 +85,7 @@ type View = (input: PropertiesWidgetInput, output: undefined, target: HTMLElemen
|
|
|
85
85
|
export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
86
86
|
// clang-format off
|
|
87
87
|
render(html`
|
|
88
|
+
<style>${propertiesWidgetStyles}</style>
|
|
88
89
|
<div jslog=${VisualLogging.pane('element-properties').track({resize: true})}>
|
|
89
90
|
<div class="hbox properties-widget-toolbar">
|
|
90
91
|
<devtools-toolbar class="styles-pane-toolbar" role="presentation">
|
|
@@ -140,7 +141,6 @@ export class PropertiesWidget extends UI.Widget.VBox {
|
|
|
140
141
|
|
|
141
142
|
constructor(view: View = DEFAULT_VIEW) {
|
|
142
143
|
super({useShadowDom: true});
|
|
143
|
-
this.registerRequiredCSS(propertiesWidgetStyles);
|
|
144
144
|
|
|
145
145
|
this.showAllPropertiesSetting = getShowAllPropertiesSetting();
|
|
146
146
|
this.showAllPropertiesSetting.addChangeListener(this.onFilterChanged.bind(this));
|
|
@@ -55,7 +55,7 @@ export type RendererBase<MatchT extends SDK.CSSPropertyParser.Match> = abstract
|
|
|
55
55
|
|
|
56
56
|
export interface MatchRenderer<MatchT extends SDK.CSSPropertyParser.Match> {
|
|
57
57
|
readonly matchType: Platform.Constructor.Constructor<MatchT>;
|
|
58
|
-
render(match: MatchT, context: RenderingContext):
|
|
58
|
+
render(match: MatchT, context: RenderingContext): LitTemplate;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// A mixin to automatically expose the match type on specific renrerers
|
|
@@ -64,7 +64,7 @@ export function rendererBase<MatchT extends SDK.CSSPropertyParser.Match>(
|
|
|
64
64
|
matchT: Platform.Constructor.Constructor<MatchT>): RendererBase<MatchT> {
|
|
65
65
|
abstract class RendererBaseClass implements MatchRenderer<MatchT> {
|
|
66
66
|
readonly matchType = matchT;
|
|
67
|
-
render(_match: MatchT, _context: RenderingContext):
|
|
67
|
+
render(_match: MatchT, _context: RenderingContext): LitTemplate {
|
|
68
68
|
return nothing;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -365,19 +365,11 @@ export class TracingContext {
|
|
|
365
365
|
|
|
366
366
|
// After rendering the arguments of a function call, the TracingContext produced by TracingContext#evaluation need to
|
|
367
367
|
// be passed here to determine whether the "current" function call should be evaluated or not. If so, the
|
|
368
|
-
// evaluation callback is run. The callback
|
|
369
|
-
// optionally
|
|
370
|
-
// in-place placeholder update succeeded).
|
|
368
|
+
// evaluation callback is run. The callback should return synchronously a template as placeholder to be
|
|
369
|
+
// rendered immediately and optionally a callback for asynchronous updates of the template.
|
|
371
370
|
applyEvaluation(children: TracingContext[],
|
|
372
|
-
evaluation: () => {
|
|
373
|
-
|
|
374
|
-
evaluation: () => ({placeholder: LitTemplate, asyncEvalCallback?: () => Promise<boolean>} |
|
|
375
|
-
{template: LitTemplate, asyncEvalCallback?: () => Promise<LitTemplate|null>})):
|
|
376
|
-
LitTemplate|null;
|
|
377
|
-
applyEvaluation(children: TracingContext[],
|
|
378
|
-
evaluation: () => ({placeholder: Node[] | LitTemplate, asyncEvalCallback?: () => Promise<boolean>} |
|
|
379
|
-
{template: LitTemplate, asyncEvalCallback?: () => Promise<LitTemplate|null>})):
|
|
380
|
-
Node[]|LitTemplate|null {
|
|
371
|
+
evaluation: () => {template: LitTemplate, asyncEvalCallback?: () => Promise<LitTemplate|null>}):
|
|
372
|
+
LitTemplate|null {
|
|
381
373
|
if (this.#evaluationCount === 0 || children.some(child => child.#appliedEvaluations >= this.#evaluationCount)) {
|
|
382
374
|
this.#setHasMoreEvaluations(true);
|
|
383
375
|
children.forEach(child => this.#asyncEvalCallbacks.push(...child.#asyncEvalCallbacks));
|
|
@@ -386,10 +378,6 @@ export class TracingContext {
|
|
|
386
378
|
this.#setAppliedEvaluations(children.map(child => child.#appliedEvaluations).reduce((a, b) => Math.max(a, b), 0) +
|
|
387
379
|
1);
|
|
388
380
|
const result = evaluation();
|
|
389
|
-
if ('placeholder' in result) {
|
|
390
|
-
this.#asyncEvalCallbacks.push(result.asyncEvalCallback);
|
|
391
|
-
return result.placeholder;
|
|
392
|
-
}
|
|
393
381
|
if (!result.asyncEvalCallback) {
|
|
394
382
|
this.#asyncEvalCallbacks.push(result.asyncEvalCallback);
|
|
395
383
|
return result.template;
|
|
@@ -714,13 +702,6 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
|
|
|
714
702
|
return {nodes: html`${nodes}`, cssControls};
|
|
715
703
|
}
|
|
716
704
|
|
|
717
|
-
static renderInto(nodeOrNodes: CodeMirror.SyntaxNode|CodeMirror.SyntaxNode[], context: RenderingContext,
|
|
718
|
-
parent: HTMLElement|DocumentFragment): {nodes: LitTemplate, cssControls: CSSControlMap} {
|
|
719
|
-
const {nodes, cssControls} = this.render(nodeOrNodes, context);
|
|
720
|
-
render(nodes, parent);
|
|
721
|
-
return {nodes, cssControls};
|
|
722
|
-
}
|
|
723
|
-
|
|
724
705
|
renderedMatchForTest(_nodes: LitTemplate, _match: SDK.CSSPropertyParser.Match): void {
|
|
725
706
|
}
|
|
726
707
|
|
|
@@ -730,8 +711,7 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
|
|
|
730
711
|
this.#context.renderers.get(match.constructor as Platform.Constructor.Constructor<SDK.CSSPropertyParser.Match>);
|
|
731
712
|
if (renderer || match instanceof SDK.CSSPropertyParserMatchers.TextMatch) {
|
|
732
713
|
const rendered = renderer?.render(match, this.#context) ?? html`<span>${match.text}</span>`;
|
|
733
|
-
const output =
|
|
734
|
-
highlight(this.#context.tracing?.highlighting, match, Array.isArray(rendered) ? html`${rendered}` : rendered);
|
|
714
|
+
const output = highlight(this.#context.tracing?.highlighting, match, rendered);
|
|
735
715
|
this.renderedMatchForTest(output, match);
|
|
736
716
|
if (this.#output.some(t => t !== nothing)) {
|
|
737
717
|
const spacing = precedingSpace(node, this.#context.ast, this.#matchedResult);
|