chrome-devtools-frontend 1.0.1571573 → 1.0.1573331
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/front_end/Images/geminiInDevTools.png +0 -0
- package/front_end/Images/geminiInDevTools_2x.png +0 -0
- package/front_end/Images/src/database-off.svg +1 -0
- package/front_end/Images/src/lock-person.svg +1 -1
- package/front_end/core/common/Debouncer.ts +10 -1
- package/front_end/core/common/SettingRegistration.ts +1 -1
- package/front_end/core/host/AidaClient.ts +8 -0
- package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -6
- package/front_end/core/host/UserMetrics.ts +0 -30
- package/front_end/core/root/ExperimentNames.ts +30 -0
- package/front_end/core/root/Runtime.ts +12 -27
- package/front_end/core/root/root.ts +2 -0
- package/front_end/core/sdk/CSSModel.ts +36 -13
- package/front_end/core/sdk/CSSProperty.ts +1 -1
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +9 -0
- package/front_end/core/sdk/CookieModel.ts +2 -1
- package/front_end/core/sdk/DOMModel.ts +1 -1
- package/front_end/core/sdk/DebuggerModel.ts +1 -1
- package/front_end/core/sdk/IsolateManager.ts +0 -7
- package/front_end/core/sdk/OverlayModel.ts +1 -1
- package/front_end/core/sdk/SourceMap.ts +1 -1
- package/front_end/devtools_compatibility.js +0 -6
- package/front_end/entrypoints/main/MainImpl.ts +34 -25
- package/front_end/entrypoints/main/main-meta.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.js +4 -8
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +0 -180
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +7 -7
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +4 -4
- package/front_end/models/ai_assistance/ai_assistance.ts +0 -2
- package/front_end/models/breakpoints/BreakpointManager.ts +3 -3
- package/front_end/models/issues_manager/ContrastCheckTrigger.ts +2 -2
- package/front_end/models/source_map_scopes/NamesResolver.ts +1 -1
- package/front_end/models/trace/EventsSerializer.ts +5 -1
- package/front_end/models/trace/types/TraceEvents.ts +4 -0
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -1
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +8 -63
- package/front_end/panels/ai_assistance/PatchWidget.ts +3 -4
- package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +1 -1
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +0 -16
- package/front_end/panels/ai_assistance/ai_assistance.ts +0 -1
- package/front_end/panels/ai_assistance/components/ChatView.ts +123 -108
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +1 -145
- package/front_end/panels/application/AppManifestView.ts +5 -5
- package/front_end/panels/application/DeviceBoundSessionsModel.ts +55 -4
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +46 -1
- package/front_end/panels/application/FrameDetailsView.ts +10 -10
- package/front_end/panels/application/components/BackForwardCacheView.ts +6 -8
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +4 -3
- package/front_end/panels/application/components/ProtocolHandlersView.ts +5 -6
- package/front_end/panels/application/components/ReportsGrid.ts +8 -9
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +5 -4
- package/front_end/panels/application/components/TrustTokensView.ts +4 -6
- package/front_end/panels/application/preloading/PreloadingView.ts +9 -8
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +237 -230
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +3 -2
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +6 -10
- package/front_end/panels/application/resourcesSidebar.css +8 -0
- package/front_end/panels/autofill/AutofillView.ts +4 -3
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +1 -1
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +1 -1
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +35 -4
- package/front_end/panels/common/AiCodeGenerationUpgradeDialog.ts +2 -2
- package/front_end/panels/common/BadgeNotification.ts +18 -14
- package/front_end/panels/common/GdpSignUpDialog.ts +5 -6
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +192 -0
- package/front_end/panels/common/aiCodeGenerationTeaser.css +16 -1
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/common/geminiRebrandPromoDialog.css +47 -0
- package/front_end/panels/console/ConsoleInsightTeaser.ts +3 -3
- package/front_end/panels/console/ErrorStackParser.ts +11 -16
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewModel.ts +1 -1
- package/front_end/panels/elements/ComputedStyleModel.ts +7 -54
- package/front_end/panels/elements/ElementsPanel.ts +33 -6
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +16 -8
- package/front_end/panels/elements/StylePropertyTreeElement.ts +67 -32
- package/front_end/panels/elements/StylesSidebarPane.ts +28 -11
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +3 -2
- package/front_end/panels/elements/components/CSSPropertyDocsView.ts +3 -2
- package/front_end/panels/elements/elements-meta.ts +1 -1
- package/front_end/panels/explain/components/ConsoleInsight.ts +7 -7
- package/front_end/panels/issues/IssueView.ts +6 -6
- package/front_end/panels/network/RequestConditionsDrawer.ts +8 -7
- package/front_end/panels/network/RequestCookiesView.ts +3 -4
- package/front_end/panels/network/RequestTimingView.ts +3 -8
- package/front_end/panels/network/components/HeaderSectionRow.ts +3 -2
- package/front_end/panels/network/components/RequestHeaderSection.ts +3 -1
- package/front_end/panels/network/components/RequestHeadersView.ts +2 -2
- package/front_end/panels/profiler/HeapProfileView.ts +3 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
- package/front_end/panels/profiler/IsolateSelector.ts +1 -2
- package/front_end/panels/profiler/profiler-meta.ts +3 -3
- package/front_end/panels/protocol_monitor/protocol_monitor-meta.ts +1 -1
- package/front_end/panels/recorder/RecorderController.ts +4 -9
- package/front_end/panels/recorder/components/CreateRecordingView.ts +6 -6
- package/front_end/panels/recorder/components/RecordingView.ts +0 -38
- package/front_end/panels/recorder/components/ReplaySection.ts +0 -14
- package/front_end/panels/recorder/components/StepEditor.ts +2 -40
- package/front_end/panels/recorder/recorderController.css +3 -3
- package/front_end/panels/security/CookieReportView.ts +17 -17
- package/front_end/panels/security/cookieControlsView.css +1 -1
- package/front_end/panels/security/cookieReportView.css +1 -1
- package/front_end/panels/settings/AISettingsTab.ts +8 -10
- package/front_end/panels/settings/components/SyncSection.ts +1 -1
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +4 -12
- package/front_end/panels/settings/settings-meta.ts +1 -1
- package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +1 -1
- package/front_end/panels/sources/NavigatorView.ts +4 -4
- package/front_end/panels/sources/SourcesPanel.ts +5 -4
- package/front_end/panels/sources/components/HeadersView.ts +2 -2
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +3 -2
- package/front_end/panels/timeline/ThreadAppender.ts +2 -1
- package/front_end/panels/timeline/TimelineController.ts +3 -3
- package/front_end/panels/timeline/TimelinePanel.ts +6 -4
- package/front_end/panels/timeline/TimelineUIUtils.ts +2 -2
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +4 -4
- package/front_end/panels/timeline/components/FieldSettingsDialog.ts +13 -6
- package/front_end/panels/timeline/components/LiveMetricsView.ts +13 -9
- package/front_end/panels/timeline/components/exportTraceOptions.css +1 -1
- package/front_end/panels/timeline/components/fieldSettingsDialog.css +1 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -19
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +3 -4
- package/front_end/panels/timeline/components/insights/baseInsightComponent.css +0 -5
- package/front_end/panels/timeline/components/liveMetricsView.css +1 -1
- package/front_end/panels/whats_new/ReleaseNoteView.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/buttons/button.css +4 -0
- package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +5 -5
- package/front_end/ui/components/panel_feedback/previewToggle.css +2 -2
- package/front_end/ui/components/text_editor/AiCodeGenerationParser.ts +27 -8
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +36 -6
- package/front_end/ui/components/text_editor/AutocompleteHistory.ts +33 -1
- package/front_end/ui/legacy/ActionRegistration.ts +1 -1
- package/front_end/ui/legacy/ContextMenu.ts +2 -2
- package/front_end/ui/legacy/EmptyWidget.ts +3 -3
- package/front_end/ui/legacy/LinkContextMenuProvider.ts +42 -0
- package/front_end/ui/legacy/ViewRegistration.ts +1 -1
- package/front_end/ui/legacy/XLink.ts +0 -27
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/ContrastOverlay.ts +4 -4
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +2 -2
- package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +2 -1
- package/front_end/ui/legacy/legacy.ts +3 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/front_end/ui/visual_logging/LoggingDriver.ts +3 -0
- package/package.json +1 -1
- package/front_end/models/ai_assistance/ArtifactsManager.ts +0 -67
- package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +0 -183
- package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +0 -89
- package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +0 -133
- package/front_end/panels/ai_assistance/components/artifactsViewer.css +0 -15
- package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +0 -32
|
@@ -3,38 +3,26 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
|
-
import * as Root from '../../core/root/root.js';
|
|
7
6
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
-
import * as UI from '../../ui/legacy/legacy.js';
|
|
9
|
-
|
|
10
|
-
import {ComputedStyleWidget} from './ComputedStyleWidget.js';
|
|
11
|
-
import {StylesSidebarPane} from './StylesSidebarPane.js';
|
|
12
7
|
|
|
8
|
+
/**
|
|
9
|
+
* A thin wrapper around the CSS Model to gather up changes in CSS files that
|
|
10
|
+
* could impact a node's computed styles.
|
|
11
|
+
* Callers are expected to initiate tracking of the Node themselves via the CSS
|
|
12
|
+
* Model trackComputedStyleUpdatesForNode method.
|
|
13
|
+
*/
|
|
13
14
|
export class ComputedStyleModel extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
14
15
|
#node: SDK.DOMModel.DOMNode|null;
|
|
15
16
|
#cssModel: SDK.CSSModel.CSSModel|null;
|
|
16
17
|
private eventListeners: Common.EventTarget.EventDescriptor[];
|
|
17
18
|
private frameResizedTimer?: number;
|
|
18
19
|
private computedStylePromise?: Promise<ComputedStyle|null>;
|
|
19
|
-
private currentTrackedNodeId?: number;
|
|
20
20
|
|
|
21
21
|
constructor(node?: SDK.DOMModel.DOMNode|null) {
|
|
22
22
|
super();
|
|
23
23
|
this.#cssModel = null;
|
|
24
24
|
this.eventListeners = [];
|
|
25
25
|
this.#node = node ?? null;
|
|
26
|
-
|
|
27
|
-
UI.Context.Context.instance().addFlavorChangeListener(
|
|
28
|
-
StylesSidebarPane, this.evaluateTrackingComputedStyleUpdatesForNode, this);
|
|
29
|
-
UI.Context.Context.instance().addFlavorChangeListener(
|
|
30
|
-
ComputedStyleWidget, this.evaluateTrackingComputedStyleUpdatesForNode, this);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
dispose(): void {
|
|
34
|
-
UI.Context.Context.instance().removeFlavorChangeListener(
|
|
35
|
-
StylesSidebarPane, this.evaluateTrackingComputedStyleUpdatesForNode, this);
|
|
36
|
-
UI.Context.Context.instance().removeFlavorChangeListener(
|
|
37
|
-
ComputedStyleWidget, this.evaluateTrackingComputedStyleUpdatesForNode, this);
|
|
38
26
|
}
|
|
39
27
|
|
|
40
28
|
get node(): SDK.DOMModel.DOMNode|null {
|
|
@@ -45,48 +33,12 @@ export class ComputedStyleModel extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
45
33
|
this.#node = node;
|
|
46
34
|
this.updateModel(this.#node ? this.#node.domModel().cssModel() : null);
|
|
47
35
|
this.onCSSModelChanged(null);
|
|
48
|
-
this.evaluateTrackingComputedStyleUpdatesForNode();
|
|
49
36
|
}
|
|
50
37
|
|
|
51
38
|
cssModel(): SDK.CSSModel.CSSModel|null {
|
|
52
39
|
return this.#cssModel?.isEnabled() ? this.#cssModel : null;
|
|
53
40
|
}
|
|
54
41
|
|
|
55
|
-
// This is a debounced method because the user might be navigated from Styles tab to Computed Style tab and vice versa.
|
|
56
|
-
// For that case, we want to only run this function once.
|
|
57
|
-
private evaluateTrackingComputedStyleUpdatesForNode = Common.Debouncer.debounce((): void => {
|
|
58
|
-
if (!this.#node) {
|
|
59
|
-
// There isn't a node selected now, so let's stop tracking computed style updates for the previously tracked node.
|
|
60
|
-
if (this.currentTrackedNodeId) {
|
|
61
|
-
void this.cssModel()?.trackComputedStyleUpdatesForNode(undefined);
|
|
62
|
-
this.currentTrackedNodeId = undefined;
|
|
63
|
-
}
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const isComputedStyleWidgetVisible = Boolean(UI.Context.Context.instance().flavor(ComputedStyleWidget));
|
|
68
|
-
const isStylesTabVisible = Boolean(UI.Context.Context.instance().flavor(StylesSidebarPane));
|
|
69
|
-
const shouldTrackComputedStyleUpdates = isComputedStyleWidgetVisible ||
|
|
70
|
-
(isStylesTabVisible && Root.Runtime.hostConfig.devToolsAnimationStylesInStylesTab?.enabled);
|
|
71
|
-
// There is a selected node but not the computed style widget nor the styles tab is visible.
|
|
72
|
-
// If there is a previously tracked node let's stop tracking computed style updates for that node.
|
|
73
|
-
if (!shouldTrackComputedStyleUpdates) {
|
|
74
|
-
if (this.currentTrackedNodeId) {
|
|
75
|
-
void this.cssModel()?.trackComputedStyleUpdatesForNode(undefined);
|
|
76
|
-
this.currentTrackedNodeId = undefined;
|
|
77
|
-
}
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Either computed style widget or styles tab is visible
|
|
82
|
-
// if the currently tracked node id is not the same as the selected node
|
|
83
|
-
// let's start tracking the currently selected node.
|
|
84
|
-
if (this.currentTrackedNodeId !== this.#node.id) {
|
|
85
|
-
void this.cssModel()?.trackComputedStyleUpdatesForNode(this.#node.id);
|
|
86
|
-
this.currentTrackedNodeId = this.#node.id;
|
|
87
|
-
}
|
|
88
|
-
}, 100);
|
|
89
|
-
|
|
90
42
|
private updateModel(cssModel: SDK.CSSModel.CSSModel|null): void {
|
|
91
43
|
if (this.#cssModel === cssModel) {
|
|
92
44
|
return;
|
|
@@ -95,6 +47,7 @@ export class ComputedStyleModel extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
95
47
|
this.#cssModel = cssModel;
|
|
96
48
|
const domModel = cssModel ? cssModel.domModel() : null;
|
|
97
49
|
const resourceTreeModel = cssModel ? cssModel.target().model(SDK.ResourceTreeModel.ResourceTreeModel) : null;
|
|
50
|
+
|
|
98
51
|
if (cssModel && domModel && resourceTreeModel) {
|
|
99
52
|
this.eventListeners = [
|
|
100
53
|
cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, this.onCSSModelChanged, this),
|
|
@@ -199,6 +199,8 @@ const createAccessibilityTreeToggleButton = (isActive: boolean): HTMLElement =>
|
|
|
199
199
|
|
|
200
200
|
let elementsPanelInstance: ElementsPanel;
|
|
201
201
|
|
|
202
|
+
export const DEFAULT_COMPUTED_STYLES_DEBOUNCE_MS = 100;
|
|
203
|
+
|
|
202
204
|
export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.Searchable,
|
|
203
205
|
SDK.TargetManager.SDKModelObserver<SDK.DOMModel.DOMModel>,
|
|
204
206
|
UI.View.ViewLocationResolver {
|
|
@@ -240,6 +242,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
240
242
|
|
|
241
243
|
private cssStyleTrackerByCSSModel: Map<SDK.CSSModel.CSSModel, SDK.CSSModel.CSSPropertyTracker>;
|
|
242
244
|
#domTreeWidget: DOMTreeWidget;
|
|
245
|
+
#computedStyleModel: ComputedStyleModel;
|
|
243
246
|
|
|
244
247
|
getTreeOutlineForTesting(): ElementsTreeOutline|undefined {
|
|
245
248
|
return this.#domTreeWidget.getTreeOutlineForTesting();
|
|
@@ -263,7 +266,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
263
266
|
this.mainContainer = document.createElement('div');
|
|
264
267
|
this.domTreeContainer = document.createElement('div');
|
|
265
268
|
const crumbsContainer = document.createElement('div');
|
|
266
|
-
if (Root.Runtime.experiments.isEnabled(Root.
|
|
269
|
+
if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.FULL_ACCESSIBILITY_TREE)) {
|
|
267
270
|
this.initializeFullAccessibilityTreeView();
|
|
268
271
|
}
|
|
269
272
|
this.mainContainer.appendChild(this.domTreeContainer);
|
|
@@ -299,13 +302,20 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
299
302
|
|
|
300
303
|
crumbsContainer.appendChild(this.breadcrumbs);
|
|
301
304
|
|
|
302
|
-
|
|
305
|
+
this.#computedStyleModel = new ComputedStyleModel(UI.Context.Context.instance().flavor(SDK.DOMModel.DOMNode));
|
|
303
306
|
UI.Context.Context.instance().addFlavorChangeListener(SDK.DOMModel.DOMNode, event => {
|
|
304
|
-
computedStyleModel.node = event.data;
|
|
307
|
+
this.#computedStyleModel.node = event.data;
|
|
308
|
+
this.evaluateTrackingComputedStyleUpdatesForNode();
|
|
305
309
|
});
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
310
|
+
|
|
311
|
+
UI.Context.Context.instance().addFlavorChangeListener(
|
|
312
|
+
StylesSidebarPane, this.evaluateTrackingComputedStyleUpdatesForNode, this);
|
|
313
|
+
UI.Context.Context.instance().addFlavorChangeListener(
|
|
314
|
+
ComputedStyleWidget, this.evaluateTrackingComputedStyleUpdatesForNode, this);
|
|
315
|
+
|
|
316
|
+
this.stylesWidget = new StylesSidebarPane(this.#computedStyleModel);
|
|
317
|
+
this.computedStyleWidget = new ComputedStyleWidget(this.#computedStyleModel);
|
|
318
|
+
this.metricsWidget = new MetricsSidebarPane(this.#computedStyleModel);
|
|
309
319
|
|
|
310
320
|
Common.Settings.Settings.instance()
|
|
311
321
|
.moduleSetting('sidebar-position')
|
|
@@ -346,6 +356,23 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
346
356
|
}
|
|
347
357
|
}
|
|
348
358
|
|
|
359
|
+
// This is a debounced method because the user might be navigated from Styles tab to Computed Style tab and vice versa.
|
|
360
|
+
// For that case, we want to only run this function once.
|
|
361
|
+
private evaluateTrackingComputedStyleUpdatesForNode = Common.Debouncer.debounce((): void => {
|
|
362
|
+
const selectedNode = UI.Context.Context.instance().flavor(SDK.DOMModel.DOMNode);
|
|
363
|
+
if (!selectedNode) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const isComputedStyleWidgetVisible = Boolean(UI.Context.Context.instance().flavor(ComputedStyleWidget));
|
|
368
|
+
const isStylesTabVisible = Boolean(UI.Context.Context.instance().flavor(StylesSidebarPane));
|
|
369
|
+
const shouldTrackComputedStyleUpdates = isComputedStyleWidgetVisible ||
|
|
370
|
+
(isStylesTabVisible && Root.Runtime.hostConfig.devToolsAnimationStylesInStylesTab?.enabled);
|
|
371
|
+
|
|
372
|
+
void selectedNode.domModel()?.cssModel()?.trackComputedStyleUpdatesForNode(
|
|
373
|
+
shouldTrackComputedStyleUpdates ? selectedNode.id : undefined);
|
|
374
|
+
}, 100);
|
|
375
|
+
|
|
349
376
|
private handleElementExpanded(): void {
|
|
350
377
|
if (Annotations.AnnotationRepository.annotationsEnabled()) {
|
|
351
378
|
void PanelCommon.AnnotationManager.instance().resolveAnnotationsOfType(Annotations.AnnotationType.ELEMENT_NODE);
|
|
@@ -606,7 +606,7 @@ export class ElementsTreeOutline extends
|
|
|
606
606
|
return html`
|
|
607
607
|
<div class="squiggles-content-item">
|
|
608
608
|
<devtools-icon .name=${issueKindIconName} @click=${openIssueEvent}></devtools-icon>
|
|
609
|
-
<
|
|
609
|
+
<devtools-link class="link" @click=${openIssueEvent}>${i18nString(UIStrings.viewIssue)}</devtools-link>
|
|
610
610
|
<span>${elementIssueDetails.tooltip}</span>
|
|
611
611
|
</div>`;})}
|
|
612
612
|
</div>`, popover.contentElement);
|
|
@@ -128,6 +128,7 @@ export class StylePropertiesSection {
|
|
|
128
128
|
readonly matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles;
|
|
129
129
|
private computedStyles: Map<string, string>|null;
|
|
130
130
|
private parentsComputedStyles: Map<string, string>|null;
|
|
131
|
+
private computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null;
|
|
131
132
|
editable: boolean;
|
|
132
133
|
private hoverTimer: number|null = null;
|
|
133
134
|
private willCauseCancelEditing = false;
|
|
@@ -168,7 +169,8 @@ export class StylePropertiesSection {
|
|
|
168
169
|
constructor(
|
|
169
170
|
parentPane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
170
171
|
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number, computedStyles: Map<string, string>|null,
|
|
171
|
-
parentsComputedStyles: Map<string, string>|null,
|
|
172
|
+
parentsComputedStyles: Map<string, string>|null,
|
|
173
|
+
computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null, customHeaderText?: string) {
|
|
172
174
|
this.#customHeaderText = customHeaderText;
|
|
173
175
|
this.parentPane = parentPane;
|
|
174
176
|
this.sectionIdx = sectionIdx;
|
|
@@ -176,6 +178,7 @@ export class StylePropertiesSection {
|
|
|
176
178
|
this.matchedStyles = matchedStyles;
|
|
177
179
|
this.computedStyles = computedStyles;
|
|
178
180
|
this.parentsComputedStyles = parentsComputedStyles;
|
|
181
|
+
this.computedStyleExtraFields = computedStyleExtraFields;
|
|
179
182
|
this.editable = Boolean(style.styleSheetId && style.range);
|
|
180
183
|
this.originalPropertiesCount = style.leadingProperties().length;
|
|
181
184
|
this.customPopulateCallback = () => this.populateStyle(this.styleInternal, this.propertiesTreeOutline);
|
|
@@ -257,7 +260,7 @@ export class StylePropertiesSection {
|
|
|
257
260
|
UI.ARIAUtils.setHidden(this.newStyleRuleToolbar, true);
|
|
258
261
|
}
|
|
259
262
|
|
|
260
|
-
if (Root.Runtime.experiments.isEnabled(Root.
|
|
263
|
+
if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.FONT_EDITOR) && this.editable) {
|
|
261
264
|
this.fontEditorToolbar = this.#styleRuleElement.createChild('devtools-toolbar', 'sidebar-pane-section-toolbar');
|
|
262
265
|
this.fontEditorSectionManager = new FontEditorSectionManager(this.parentPane.swatchPopoverHelper(), this);
|
|
263
266
|
this.fontEditorButton =
|
|
@@ -330,6 +333,10 @@ export class StylePropertiesSection {
|
|
|
330
333
|
this.parentsComputedStyles = parentsComputedStyles;
|
|
331
334
|
}
|
|
332
335
|
|
|
336
|
+
setComputedStyleExtraFields(computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null): void {
|
|
337
|
+
this.computedStyleExtraFields = computedStyleExtraFields;
|
|
338
|
+
}
|
|
339
|
+
|
|
333
340
|
updateAuthoringHint(): void {
|
|
334
341
|
let child = this.propertiesTreeOutline.firstChild();
|
|
335
342
|
while (child) {
|
|
@@ -1165,6 +1172,7 @@ export class StylePropertiesSection {
|
|
|
1165
1172
|
});
|
|
1166
1173
|
item.setComputedStyles(this.computedStyles);
|
|
1167
1174
|
item.setParentsComputedStyles(this.parentsComputedStyles);
|
|
1175
|
+
item.setComputedStyleExtraFields(this.computedStyleExtraFields);
|
|
1168
1176
|
parent.appendChild(item);
|
|
1169
1177
|
}
|
|
1170
1178
|
|
|
@@ -1677,7 +1685,7 @@ export class BlankStylePropertiesSection extends StylePropertiesSection {
|
|
|
1677
1685
|
insertAfterStyle: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number) {
|
|
1678
1686
|
const cssModel = (stylesPane.cssModel() as SDK.CSSModel.CSSModel);
|
|
1679
1687
|
const rule = SDK.CSSRule.CSSStyleRule.createDummyRule(cssModel, defaultSelectorText);
|
|
1680
|
-
super(stylesPane, matchedStyles, rule.style, sectionIdx, null, null);
|
|
1688
|
+
super(stylesPane, matchedStyles, rule.style, sectionIdx, null, null, null);
|
|
1681
1689
|
this.normal = false;
|
|
1682
1690
|
this.ruleLocation = ruleLocation;
|
|
1683
1691
|
this.styleSheetHeader = styleSheetHeader;
|
|
@@ -1779,7 +1787,7 @@ export class RegisteredPropertiesSection extends StylePropertiesSection {
|
|
|
1779
1787
|
stylesPane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1780
1788
|
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number, propertyName: string,
|
|
1781
1789
|
expandedByDefault: boolean) {
|
|
1782
|
-
super(stylesPane, matchedStyles, style, sectionIdx, null, null, propertyName);
|
|
1790
|
+
super(stylesPane, matchedStyles, style, sectionIdx, null, null, null, propertyName);
|
|
1783
1791
|
if (!expandedByDefault) {
|
|
1784
1792
|
this.element.classList.add('hidden');
|
|
1785
1793
|
}
|
|
@@ -1814,7 +1822,7 @@ export class FunctionRuleSection extends StylePropertiesSection {
|
|
|
1814
1822
|
stylesPane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1815
1823
|
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, children: SDK.CSSRule.CSSNestedStyle[], sectionIdx: number,
|
|
1816
1824
|
functionName: string, expandedByDefault: boolean) {
|
|
1817
|
-
super(stylesPane, matchedStyles, style, sectionIdx, null, null, functionName);
|
|
1825
|
+
super(stylesPane, matchedStyles, style, sectionIdx, null, null, null, functionName);
|
|
1818
1826
|
if (!expandedByDefault) {
|
|
1819
1827
|
this.element.classList.add('hidden');
|
|
1820
1828
|
}
|
|
@@ -1876,7 +1884,7 @@ export class AtRuleSection extends StylePropertiesSection {
|
|
|
1876
1884
|
constructor(
|
|
1877
1885
|
stylesPane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1878
1886
|
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number, expandedByDefault: boolean) {
|
|
1879
|
-
super(stylesPane, matchedStyles, style, sectionIdx, null, null);
|
|
1887
|
+
super(stylesPane, matchedStyles, style, sectionIdx, null, null, null);
|
|
1880
1888
|
this.selectorElement.className = 'font-palette-values-key';
|
|
1881
1889
|
if (!expandedByDefault) {
|
|
1882
1890
|
this.element.classList.add('hidden');
|
|
@@ -1888,7 +1896,7 @@ export class PositionTryRuleSection extends StylePropertiesSection {
|
|
|
1888
1896
|
constructor(
|
|
1889
1897
|
stylesPane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1890
1898
|
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number, active: boolean) {
|
|
1891
|
-
super(stylesPane, matchedStyles, style, sectionIdx, null, null);
|
|
1899
|
+
super(stylesPane, matchedStyles, style, sectionIdx, null, null, null);
|
|
1892
1900
|
this.selectorElement.className = 'position-try-values-key';
|
|
1893
1901
|
this.propertiesTreeOutline.element.classList.toggle('no-affect', !active);
|
|
1894
1902
|
}
|
|
@@ -1898,7 +1906,7 @@ export class KeyframePropertiesSection extends StylePropertiesSection {
|
|
|
1898
1906
|
constructor(
|
|
1899
1907
|
stylesPane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1900
1908
|
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number) {
|
|
1901
|
-
super(stylesPane, matchedStyles, style, sectionIdx, null, null);
|
|
1909
|
+
super(stylesPane, matchedStyles, style, sectionIdx, null, null, null);
|
|
1902
1910
|
this.selectorElement.className = 'keyframe-key';
|
|
1903
1911
|
}
|
|
1904
1912
|
|
|
@@ -10,6 +10,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
10
10
|
import * as Platform from '../../core/platform/platform.js';
|
|
11
11
|
import * as Root from '../../core/root/root.js';
|
|
12
12
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
13
|
+
import type * as Protocol from '../../generated/protocol.js';
|
|
13
14
|
import * as Badges from '../../models/badges/badges.js';
|
|
14
15
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
15
16
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
@@ -170,7 +171,8 @@ export class EnvFunctionRenderer extends rendererBase(SDK.CSSPropertyParserMatch
|
|
|
170
171
|
// clang-format on
|
|
171
172
|
constructor(
|
|
172
173
|
readonly treeElement: StylePropertyTreeElement|null,
|
|
173
|
-
readonly matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, readonly computedStyles: Map<string, string
|
|
174
|
+
readonly matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, readonly computedStyles: Map<string, string>,
|
|
175
|
+
readonly computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null) {
|
|
174
176
|
super();
|
|
175
177
|
}
|
|
176
178
|
override render(match: SDK.CSSPropertyParserMatchers.EnvFunctionMatch, context: RenderingContext): Node[] {
|
|
@@ -187,7 +189,8 @@ export class EnvFunctionRenderer extends rendererBase(SDK.CSSPropertyParserMatch
|
|
|
187
189
|
|
|
188
190
|
const span = document.createElement('span');
|
|
189
191
|
const func =
|
|
190
|
-
this.treeElement?.getTracingTooltip(
|
|
192
|
+
this.treeElement?.getTracingTooltip(
|
|
193
|
+
'env', match.node, this.matchedStyles, this.computedStyles, this.computedStyleExtraFields, context) ??
|
|
191
194
|
'env';
|
|
192
195
|
const valueClass = classMap({'inactive-value': !match.varNameIsValid});
|
|
193
196
|
const fallbackClass = classMap({'inactive-value': match.varNameIsValid});
|
|
@@ -315,14 +318,17 @@ export class VariableRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
|
|
|
315
318
|
readonly #treeElement: StylePropertyTreeElement|null;
|
|
316
319
|
readonly #matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles;
|
|
317
320
|
readonly #computedStyles: Map<string, string>;
|
|
321
|
+
readonly #computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null;
|
|
318
322
|
constructor(
|
|
319
323
|
stylesPane: StylesSidebarPane, treeElement: StylePropertyTreeElement|null,
|
|
320
|
-
matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, computedStyles: Map<string, string
|
|
324
|
+
matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, computedStyles: Map<string, string>,
|
|
325
|
+
computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null) {
|
|
321
326
|
super();
|
|
322
327
|
this.#treeElement = treeElement;
|
|
323
328
|
this.#stylesPane = stylesPane;
|
|
324
329
|
this.#matchedStyles = matchedStyles;
|
|
325
330
|
this.#computedStyles = computedStyles;
|
|
331
|
+
this.#computedStyleExtraFields = computedStyleExtraFields;
|
|
326
332
|
}
|
|
327
333
|
|
|
328
334
|
override render(match: SDK.CSSPropertyParserMatchers.VariableMatch, context: RenderingContext): Node[] {
|
|
@@ -343,7 +349,8 @@ export class VariableRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
|
|
|
343
349
|
{name: declaration.name, value: declaration.value ?? ''},
|
|
344
350
|
substitution.cachedParsedValue(declaration.declaration, this.#matchedStyles, this.#computedStyles),
|
|
345
351
|
getPropertyRenderers(
|
|
346
|
-
declaration.name, declaration.style, this.#stylesPane, this.#matchedStyles, null, this.#computedStyles
|
|
352
|
+
declaration.name, declaration.style, this.#stylesPane, this.#matchedStyles, null, this.#computedStyles,
|
|
353
|
+
this.#computedStyleExtraFields),
|
|
347
354
|
substitution);
|
|
348
355
|
cssControls.forEach((value, key) => value.forEach(control => context.addControl(key, control)));
|
|
349
356
|
return nodes;
|
|
@@ -355,8 +362,8 @@ export class VariableRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
|
|
|
355
362
|
|
|
356
363
|
const renderedFallback = match.fallback ? Renderer.render(match.fallback, context) : undefined;
|
|
357
364
|
|
|
358
|
-
const varCall =
|
|
359
|
-
|
|
365
|
+
const varCall = this.#treeElement?.getTracingTooltip(
|
|
366
|
+
'var', match.node, this.#matchedStyles, this.#computedStyles, this.#computedStyleExtraFields, context);
|
|
360
367
|
const tooltipContents =
|
|
361
368
|
this.#stylesPane.getVariablePopoverContents(this.#matchedStyles, match.name, variableValue ?? null);
|
|
362
369
|
const tooltipId = this.#treeElement?.getTooltipId('custom-property-var');
|
|
@@ -427,14 +434,17 @@ export class AttributeRenderer extends rendererBase(SDK.CSSPropertyParserMatcher
|
|
|
427
434
|
readonly #treeElement: StylePropertyTreeElement|null;
|
|
428
435
|
readonly #matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles;
|
|
429
436
|
readonly #computedStyles: Map<string, string>;
|
|
437
|
+
readonly #computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null;
|
|
430
438
|
constructor(
|
|
431
439
|
stylesPane: StylesSidebarPane, treeElement: StylePropertyTreeElement|null,
|
|
432
|
-
matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, computedStyles: Map<string, string
|
|
440
|
+
matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, computedStyles: Map<string, string>,
|
|
441
|
+
computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null) {
|
|
433
442
|
super();
|
|
434
443
|
this.#treeElement = treeElement;
|
|
435
444
|
this.#stylesPane = stylesPane;
|
|
436
445
|
this.#matchedStyles = matchedStyles;
|
|
437
446
|
this.#computedStyles = computedStyles;
|
|
447
|
+
this.#computedStyleExtraFields = computedStyleExtraFields;
|
|
438
448
|
}
|
|
439
449
|
|
|
440
450
|
override render(match: SDK.CSSPropertyParserMatchers.AttributeMatch, context: RenderingContext): Node[] {
|
|
@@ -473,7 +483,8 @@ export class AttributeRenderer extends rendererBase(SDK.CSSPropertyParserMatcher
|
|
|
473
483
|
.renderValueNodes(
|
|
474
484
|
{name: '--property', value: match.substitutionText}, matching,
|
|
475
485
|
getPropertyRenderers(
|
|
476
|
-
'--property', match.style, this.#stylesPane, this.#matchedStyles, null, this.#computedStyles
|
|
486
|
+
'--property', match.style, this.#stylesPane, this.#matchedStyles, null, this.#computedStyles,
|
|
487
|
+
this.#computedStyleExtraFields),
|
|
477
488
|
substitution)
|
|
478
489
|
.nodes;
|
|
479
490
|
}
|
|
@@ -481,8 +492,8 @@ export class AttributeRenderer extends rendererBase(SDK.CSSPropertyParserMatcher
|
|
|
481
492
|
|
|
482
493
|
const renderedFallback = match.fallback ? Renderer.render(match.fallback, context) : undefined;
|
|
483
494
|
|
|
484
|
-
const attrCall =
|
|
485
|
-
|
|
495
|
+
const attrCall = this.#treeElement?.getTracingTooltip(
|
|
496
|
+
'attr', match.node, this.#matchedStyles, this.#computedStyles, this.#computedStyleExtraFields, context);
|
|
486
497
|
const tooltipId = attributeMissing ? undefined : this.#treeElement?.getTooltipId('custom-attribute');
|
|
487
498
|
const tooltip = tooltipId ? {tooltipId} : undefined;
|
|
488
499
|
// clang-format off
|
|
@@ -636,7 +647,7 @@ export class ColorRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.Co
|
|
|
636
647
|
html`${
|
|
637
648
|
this.#treeElement?.getTracingTooltip(
|
|
638
649
|
func, match.node, this.#treeElement.matchedStyles(), this.#treeElement.getComputedStyles() ?? new Map(),
|
|
639
|
-
renderingContext) ??
|
|
650
|
+
this.#treeElement.getComputedStyleExtraFields(), renderingContext) ??
|
|
640
651
|
func}${nodes}`,
|
|
641
652
|
valueChild);
|
|
642
653
|
|
|
@@ -871,15 +882,18 @@ export class ColorMixRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
|
|
|
871
882
|
readonly #pane: StylesSidebarPane;
|
|
872
883
|
readonly #matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles;
|
|
873
884
|
readonly #computedStyles: Map<string, string>;
|
|
885
|
+
readonly #computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null;
|
|
874
886
|
readonly #treeElement: StylePropertyTreeElement|null;
|
|
875
887
|
|
|
876
888
|
constructor(
|
|
877
889
|
pane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
878
|
-
computedStyles: Map<string, string>,
|
|
890
|
+
computedStyles: Map<string, string>, computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null,
|
|
891
|
+
treeElement: StylePropertyTreeElement|null) {
|
|
879
892
|
super();
|
|
880
893
|
this.#pane = pane;
|
|
881
894
|
this.#matchedStyles = matchedStyles;
|
|
882
895
|
this.#computedStyles = computedStyles;
|
|
896
|
+
this.#computedStyleExtraFields = computedStyleExtraFields;
|
|
883
897
|
this.#treeElement = treeElement;
|
|
884
898
|
}
|
|
885
899
|
|
|
@@ -915,7 +929,8 @@ export class ColorMixRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
|
|
|
915
929
|
render(
|
|
916
930
|
html`${
|
|
917
931
|
this.#treeElement?.getTracingTooltip(
|
|
918
|
-
'color-mix', match.node, this.#matchedStyles, this.#computedStyles,
|
|
932
|
+
'color-mix', match.node, this.#matchedStyles, this.#computedStyles, this.#computedStyleExtraFields,
|
|
933
|
+
context) ??
|
|
919
934
|
'color-mix'}(${Renderer.render(match.space, childRenderingContexts[0]).nodes}, ${color1.nodes}, ${
|
|
920
935
|
color2.nodes})`,
|
|
921
936
|
contentChild);
|
|
@@ -1190,12 +1205,13 @@ export class BezierRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.B
|
|
|
1190
1205
|
|
|
1191
1206
|
// clang-format off
|
|
1192
1207
|
export class AutoBaseRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.AutoBaseMatch) {
|
|
1193
|
-
readonly #
|
|
1208
|
+
readonly #computedStyleExtraFields : Protocol.CSS.ComputedStyleExtraFields|null;
|
|
1194
1209
|
// clang-format on
|
|
1195
1210
|
|
|
1196
|
-
constructor(
|
|
1211
|
+
constructor(
|
|
1212
|
+
computedStyle: Map<string, string>, computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null) {
|
|
1197
1213
|
super();
|
|
1198
|
-
this.#
|
|
1214
|
+
this.#computedStyleExtraFields = computedStyleExtraFields;
|
|
1199
1215
|
}
|
|
1200
1216
|
|
|
1201
1217
|
override render(match: SDK.CSSPropertyParserMatchers.AutoBaseMatch, context: RenderingContext): Node[] {
|
|
@@ -1209,8 +1225,9 @@ export class AutoBaseRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
|
|
|
1209
1225
|
Renderer.renderInto(match.auto, context, auto);
|
|
1210
1226
|
Renderer.renderInto(match.base, context, base);
|
|
1211
1227
|
|
|
1212
|
-
|
|
1213
|
-
|
|
1228
|
+
// TODO(crbug.com/475522248): Consider cases with nested elements which
|
|
1229
|
+
// support base appearance and ensure the logic matches StyleAdjuster in blink.
|
|
1230
|
+
if (this.#computedStyleExtraFields?.isAppearanceBase) {
|
|
1214
1231
|
auto.classList.add('inactive-value');
|
|
1215
1232
|
} else {
|
|
1216
1233
|
base.classList.add('inactive-value');
|
|
@@ -1668,14 +1685,17 @@ export class BaseFunctionRenderer extends rendererBase(SDK.CSSPropertyParserMatc
|
|
|
1668
1685
|
readonly #stylesPane: StylesSidebarPane;
|
|
1669
1686
|
readonly #matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles;
|
|
1670
1687
|
readonly #computedStyles: Map<string, string>;
|
|
1688
|
+
readonly #computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null;
|
|
1671
1689
|
readonly #treeElement: StylePropertyTreeElement|null;
|
|
1672
1690
|
readonly #propertyName: string;
|
|
1673
1691
|
constructor(
|
|
1674
1692
|
stylesPane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1675
|
-
computedStyles: Map<string, string>,
|
|
1693
|
+
computedStyles: Map<string, string>, computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null,
|
|
1694
|
+
propertyName: string, treeElement: StylePropertyTreeElement|null) {
|
|
1676
1695
|
super();
|
|
1677
1696
|
this.#matchedStyles = matchedStyles;
|
|
1678
1697
|
this.#computedStyles = computedStyles;
|
|
1698
|
+
this.#computedStyleExtraFields = computedStyleExtraFields;
|
|
1679
1699
|
this.#stylesPane = stylesPane;
|
|
1680
1700
|
this.#treeElement = treeElement;
|
|
1681
1701
|
this.#propertyName = propertyName;
|
|
@@ -1694,7 +1714,8 @@ export class BaseFunctionRenderer extends rendererBase(SDK.CSSPropertyParserMatc
|
|
|
1694
1714
|
render(
|
|
1695
1715
|
html`${
|
|
1696
1716
|
this.#treeElement?.getTracingTooltip(
|
|
1697
|
-
match.func, match.node, this.#matchedStyles, this.#computedStyles,
|
|
1717
|
+
match.func, match.node, this.#matchedStyles, this.#computedStyles, this.#computedStyleExtraFields,
|
|
1718
|
+
context) ??
|
|
1698
1719
|
match.func}(${renderedArgs.map((arg, idx) => idx === 0 ? [arg] : [html`, `, arg]).flat()})`,
|
|
1699
1720
|
span);
|
|
1700
1721
|
|
|
@@ -1911,11 +1932,12 @@ export class PositionTryRenderer extends rendererBase(SDK.CSSPropertyParserMatch
|
|
|
1911
1932
|
export function getPropertyRenderers(
|
|
1912
1933
|
propertyName: string, style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, stylesPane: StylesSidebarPane,
|
|
1913
1934
|
matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, treeElement: StylePropertyTreeElement|null,
|
|
1914
|
-
computedStyles: Map<string, string
|
|
1935
|
+
computedStyles: Map<string, string>, computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null):
|
|
1936
|
+
Array<MatchRenderer<SDK.CSSPropertyParser.Match>> {
|
|
1915
1937
|
return [
|
|
1916
|
-
new VariableRenderer(stylesPane, treeElement, matchedStyles, computedStyles),
|
|
1938
|
+
new VariableRenderer(stylesPane, treeElement, matchedStyles, computedStyles, computedStyleExtraFields),
|
|
1917
1939
|
new ColorRenderer(stylesPane, treeElement),
|
|
1918
|
-
new ColorMixRenderer(stylesPane, matchedStyles, computedStyles, treeElement),
|
|
1940
|
+
new ColorMixRenderer(stylesPane, matchedStyles, computedStyles, computedStyleExtraFields, treeElement),
|
|
1919
1941
|
new URLRenderer(style.parentRule, stylesPane.node()),
|
|
1920
1942
|
new AngleRenderer(treeElement),
|
|
1921
1943
|
new LinkableNameRenderer(matchedStyles, stylesPane),
|
|
@@ -1929,15 +1951,17 @@ export function getPropertyRenderers(
|
|
|
1929
1951
|
new AnchorFunctionRenderer(stylesPane),
|
|
1930
1952
|
new PositionAnchorRenderer(stylesPane),
|
|
1931
1953
|
new FlexGridRenderer(stylesPane, treeElement),
|
|
1932
|
-
new EnvFunctionRenderer(treeElement, matchedStyles, computedStyles),
|
|
1954
|
+
new EnvFunctionRenderer(treeElement, matchedStyles, computedStyles, computedStyleExtraFields),
|
|
1933
1955
|
new PositionTryRenderer(matchedStyles),
|
|
1934
1956
|
new LengthRenderer(stylesPane, propertyName, treeElement),
|
|
1935
|
-
new MathFunctionRenderer(
|
|
1936
|
-
|
|
1937
|
-
new
|
|
1957
|
+
new MathFunctionRenderer(
|
|
1958
|
+
stylesPane, matchedStyles, computedStyles, computedStyleExtraFields, propertyName, treeElement),
|
|
1959
|
+
new CustomFunctionRenderer(
|
|
1960
|
+
stylesPane, matchedStyles, computedStyles, computedStyleExtraFields, propertyName, treeElement),
|
|
1961
|
+
new AutoBaseRenderer(computedStyles, computedStyleExtraFields),
|
|
1938
1962
|
new BinOpRenderer(),
|
|
1939
1963
|
new RelativeColorChannelRenderer(treeElement),
|
|
1940
|
-
new AttributeRenderer(stylesPane, treeElement, matchedStyles, computedStyles),
|
|
1964
|
+
new AttributeRenderer(stylesPane, treeElement, matchedStyles, computedStyles, computedStyleExtraFields),
|
|
1941
1965
|
];
|
|
1942
1966
|
}
|
|
1943
1967
|
|
|
@@ -1962,6 +1986,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1962
1986
|
private lastComputedValue: string|null = null;
|
|
1963
1987
|
private computedStyles: Map<string, string>|null = null;
|
|
1964
1988
|
private parentsComputedStyles: Map<string, string>|null = null;
|
|
1989
|
+
private computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null = null;
|
|
1965
1990
|
private contextForTest!: Context|undefined;
|
|
1966
1991
|
#gridNames: Set<string>|undefined = undefined;
|
|
1967
1992
|
#tooltipKeyCounts = new Map<string, number>();
|
|
@@ -2070,6 +2095,14 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2070
2095
|
return this.computedStyles;
|
|
2071
2096
|
}
|
|
2072
2097
|
|
|
2098
|
+
setComputedStyleExtraFields(computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null): void {
|
|
2099
|
+
this.computedStyleExtraFields = computedStyleExtraFields;
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
getComputedStyleExtraFields(): Protocol.CSS.ComputedStyleExtraFields|null {
|
|
2103
|
+
return this.computedStyleExtraFields;
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2073
2106
|
setParentsComputedStyles(parentsComputedStyles: Map<string, string>|null): void {
|
|
2074
2107
|
this.parentsComputedStyles = parentsComputedStyles;
|
|
2075
2108
|
}
|
|
@@ -2345,10 +2378,11 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2345
2378
|
|
|
2346
2379
|
const renderers = this.property.parsedOk ?
|
|
2347
2380
|
getPropertyRenderers(
|
|
2348
|
-
this.name, this.style, this.#parentPane, this.#matchedStyles, this, this.getComputedStyles() ?? new Map()
|
|
2381
|
+
this.name, this.style, this.#parentPane, this.#matchedStyles, this, this.getComputedStyles() ?? new Map(),
|
|
2382
|
+
this.getComputedStyleExtraFields()) :
|
|
2349
2383
|
[];
|
|
2350
2384
|
|
|
2351
|
-
if (Root.Runtime.experiments.isEnabled(Root.
|
|
2385
|
+
if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.FONT_EDITOR) && this.property.parsedOk) {
|
|
2352
2386
|
renderers.push(new FontRenderer(this));
|
|
2353
2387
|
}
|
|
2354
2388
|
this.listItemElement.removeChildren();
|
|
@@ -2544,7 +2578,8 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2544
2578
|
|
|
2545
2579
|
getTracingTooltip(
|
|
2546
2580
|
functionName: string, node: CodeMirror.SyntaxNode, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
2547
|
-
computedStyles: Map<string, string>,
|
|
2581
|
+
computedStyles: Map<string, string>, computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null,
|
|
2582
|
+
context: RenderingContext): Lit.TemplateResult {
|
|
2548
2583
|
if (context.tracing || !context.property) {
|
|
2549
2584
|
return html`${functionName}`;
|
|
2550
2585
|
}
|
|
@@ -2569,7 +2604,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2569
2604
|
?.showTrace(
|
|
2570
2605
|
property, text, matchedStyles, computedStyles,
|
|
2571
2606
|
getPropertyRenderers(property.name,
|
|
2572
|
-
property.ownerStyle, stylesPane, matchedStyles, null, computedStyles),
|
|
2607
|
+
property.ownerStyle, stylesPane, matchedStyles, null, computedStyles, computedStyleExtraFields),
|
|
2573
2608
|
expandPercentagesInShorthands, shorthandPositionOffset, this.openedViaHotkey);
|
|
2574
2609
|
}
|
|
2575
2610
|
}}
|