chrome-devtools-frontend 1.0.1587905 → 1.0.1588580
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/core/sdk/DOMModel.ts +3 -0
- package/front_end/core/sdk/PreloadingModel.ts +15 -6
- package/front_end/generated/InspectorBackendCommands.ts +5 -3
- package/front_end/generated/SupportedCSSProperties.js +46 -0
- package/front_end/generated/protocol-mapping.d.ts +4 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/generated/protocol.ts +49 -0
- package/front_end/models/computed_style/ComputedStyleModel.ts +2 -1
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -16
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +15 -21
- package/front_end/panels/application/preloading/PreloadingView.ts +18 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.css +12 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +3 -3
- package/front_end/panels/console/ConsoleViewMessage.ts +3 -3
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +1 -1
- package/front_end/panels/elements/ComputedStyleWidget.ts +2 -16
- package/front_end/panels/elements/ElementsPanel.ts +12 -4
- package/front_end/panels/elements/PropertiesWidget.ts +62 -61
- package/front_end/panels/elements/StylePropertyTreeElement.ts +11 -12
- package/front_end/panels/elements/StylesSidebarPane.ts +25 -5
- package/front_end/panels/elements/elementsPanel.css +6 -2
- package/front_end/panels/network/RequestHeadersView.ts +113 -128
- package/front_end/panels/sources/CSSPlugin.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +32 -28
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +31 -6
- package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
- package/package.json +1 -1
|
@@ -59,6 +59,7 @@ import {DOMTreeWidget, type ElementsTreeOutline} from './ElementsTreeOutline.js'
|
|
|
59
59
|
import {LayoutPane} from './LayoutPane.js';
|
|
60
60
|
import type {MarkerDecorator} from './MarkerDecorator.js';
|
|
61
61
|
import {MetricsSidebarPane} from './MetricsSidebarPane.js';
|
|
62
|
+
import {PlatformFontsWidget} from './PlatformFontsWidget.js';
|
|
62
63
|
import {
|
|
63
64
|
Events as StylesSidebarPaneEvents,
|
|
64
65
|
StylesSidebarPane,
|
|
@@ -312,8 +313,6 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
312
313
|
|
|
313
314
|
UI.Context.Context.instance().addFlavorChangeListener(
|
|
314
315
|
StylesSidebarPane, this.evaluateTrackingComputedStyleUpdatesForNode, this);
|
|
315
|
-
UI.Context.Context.instance().addFlavorChangeListener(
|
|
316
|
-
ComputedStyleWidget, this.evaluateTrackingComputedStyleUpdatesForNode, this);
|
|
317
316
|
|
|
318
317
|
this.stylesWidget = new StylesSidebarPane(this.#computedStyleModel);
|
|
319
318
|
this.#computedStyleWidget = new ComputedStyleWidget();
|
|
@@ -372,7 +371,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
372
371
|
return;
|
|
373
372
|
}
|
|
374
373
|
|
|
375
|
-
const isComputedStyleWidgetVisible =
|
|
374
|
+
const isComputedStyleWidgetVisible = this.#computedStyleWidget.isShowing();
|
|
376
375
|
const isStylesTabVisible = Boolean(UI.Context.Context.instance().flavor(StylesSidebarPane));
|
|
377
376
|
const shouldTrackComputedStyleUpdates = isComputedStyleWidgetVisible ||
|
|
378
377
|
(isStylesTabVisible && Root.Runtime.hostConfig.devToolsAnimationStylesInStylesTab?.enabled);
|
|
@@ -550,6 +549,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
550
549
|
super.wasShown();
|
|
551
550
|
UI.Context.Context.instance().setFlavor(ElementsPanel, this);
|
|
552
551
|
this.#domTreeWidget.show(this.domTreeContainer);
|
|
552
|
+
this.evaluateTrackingComputedStyleUpdatesForNode();
|
|
553
553
|
|
|
554
554
|
if (Annotations.AnnotationRepository.annotationsEnabled()) {
|
|
555
555
|
void PanelCommon.AnnotationManager.instance().resolveAnnotationsOfType(Annotations.AnnotationType.ELEMENT_NODE);
|
|
@@ -558,6 +558,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
558
558
|
|
|
559
559
|
override willHide(): void {
|
|
560
560
|
SDK.OverlayModel.OverlayModel.hideDOMNodeHighlight();
|
|
561
|
+
this.evaluateTrackingComputedStyleUpdatesForNode();
|
|
561
562
|
this.#domTreeWidget.detach();
|
|
562
563
|
super.willHide();
|
|
563
564
|
UI.Context.Context.instance().setFlavor(ElementsPanel, null);
|
|
@@ -1116,10 +1117,16 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
1116
1117
|
this.setupTextSelectionHack(matchedStylePanesWrapper.element);
|
|
1117
1118
|
|
|
1118
1119
|
const computedStylePanesWrapper = new UI.Widget.VBox();
|
|
1119
|
-
computedStylePanesWrapper.element.classList.add('style-panes-wrapper');
|
|
1120
|
+
computedStylePanesWrapper.element.classList.add('style-panes-wrapper', 'computed-styles-pane-wrapper');
|
|
1120
1121
|
computedStylePanesWrapper.element.setAttribute('jslog', `${VisualLogging.pane('computed').track({resize: true})}`);
|
|
1122
|
+
this.#computedStyleWidget.element.classList.add('computed-styles-wrapper');
|
|
1121
1123
|
this.#computedStyleWidget.show(computedStylePanesWrapper.element);
|
|
1122
1124
|
|
|
1125
|
+
const platformFontsWidget = new PlatformFontsWidget();
|
|
1126
|
+
platformFontsWidget.element.classList.add('platform-fonts-wrapper');
|
|
1127
|
+
platformFontsWidget.sharedModel = this.#computedStyleModel;
|
|
1128
|
+
platformFontsWidget.show(computedStylePanesWrapper.element);
|
|
1129
|
+
|
|
1123
1130
|
const stylesSplitWidget = new UI.SplitWidget.SplitWidget(
|
|
1124
1131
|
true /* isVertical */, true /* secondIsSidebar */, 'elements.styles.sidebar.width', 100);
|
|
1125
1132
|
stylesSplitWidget.setMainWidget(matchedStylePanesWrapper);
|
|
@@ -1162,6 +1169,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
1162
1169
|
|
|
1163
1170
|
const tabSelected = (event: Common.EventTarget.EventTargetEvent<UI.TabbedPane.EventData>): void => {
|
|
1164
1171
|
const {tabId} = event.data;
|
|
1172
|
+
this.evaluateTrackingComputedStyleUpdatesForNode();
|
|
1165
1173
|
if (tabId === SidebarPaneTabId.COMPUTED) {
|
|
1166
1174
|
computedStylePanesWrapper.show(computedView.element);
|
|
1167
1175
|
showMetricsWidgetInComputedPane();
|
|
@@ -75,8 +75,9 @@ interface PropertiesWidgetInput {
|
|
|
75
75
|
onFilterChanged: (e: CustomEvent<string>) => void;
|
|
76
76
|
onRegexToggled: () => void;
|
|
77
77
|
isRegex: boolean;
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
treeOutline: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline;
|
|
79
|
+
objectTree: ObjectUI.ObjectPropertiesSection.ObjectTree|null;
|
|
80
|
+
allChildrenFiltered: boolean;
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
type View = (input: PropertiesWidgetInput, output: object, target: HTMLElement) => void;
|
|
@@ -99,10 +100,10 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
99
100
|
</devtools-checkbox>
|
|
100
101
|
</devtools-toolbar>
|
|
101
102
|
</div>
|
|
102
|
-
${input.
|
|
103
|
+
${input.objectTree && input.allChildrenFiltered ? html`
|
|
103
104
|
<div class="gray-info-message">${i18nString(UIStrings.noMatchingProperty)}</div>
|
|
104
105
|
` : nothing}
|
|
105
|
-
${input.
|
|
106
|
+
${input.treeOutline.element}
|
|
106
107
|
</div>`, target);
|
|
107
108
|
// clang-format on
|
|
108
109
|
};
|
|
@@ -111,13 +112,13 @@ const getShowAllPropertiesSetting = (): Common.Settings.Setting<boolean> =>
|
|
|
111
112
|
Common.Settings.Settings.instance().createSetting('show-all-properties', /* defaultValue */ false);
|
|
112
113
|
|
|
113
114
|
export class PropertiesWidget extends UI.Widget.VBox {
|
|
114
|
-
private node: SDK.DOMModel.DOMNode|null;
|
|
115
115
|
private readonly showAllPropertiesSetting: Common.Settings.Setting<boolean>;
|
|
116
116
|
private filterRegex: RegExp|null = null;
|
|
117
117
|
private readonly treeOutline: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline;
|
|
118
|
-
|
|
118
|
+
#lastRequestedNode: SDK.DOMModel.DOMNode|null = null;
|
|
119
119
|
readonly #view: View;
|
|
120
|
-
#
|
|
120
|
+
#pendingNodeUpdate = true;
|
|
121
|
+
#objectTree: ObjectUI.ObjectPropertiesSection.ObjectTree|null = null;
|
|
121
122
|
#isRegex = false;
|
|
122
123
|
#filterText = '';
|
|
123
124
|
|
|
@@ -126,7 +127,7 @@ export class PropertiesWidget extends UI.Widget.VBox {
|
|
|
126
127
|
this.registerRequiredCSS(propertiesWidgetStyles);
|
|
127
128
|
|
|
128
129
|
this.showAllPropertiesSetting = getShowAllPropertiesSetting();
|
|
129
|
-
this.showAllPropertiesSetting.addChangeListener(this.
|
|
130
|
+
this.showAllPropertiesSetting.addChangeListener(this.onFilterChanged.bind(this));
|
|
130
131
|
|
|
131
132
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
132
133
|
SDK.DOMModel.DOMModel, SDK.DOMModel.Events.AttrModified, this.onNodeChange, this, {scoped: true});
|
|
@@ -137,7 +138,6 @@ export class PropertiesWidget extends UI.Widget.VBox {
|
|
|
137
138
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
138
139
|
SDK.DOMModel.DOMModel, SDK.DOMModel.Events.ChildNodeCountUpdated, this.onNodeChange, this, {scoped: true});
|
|
139
140
|
UI.Context.Context.instance().addFlavorChangeListener(SDK.DOMModel.DOMNode, this.setNode, this);
|
|
140
|
-
this.node = UI.Context.Context.instance().flavor(SDK.DOMModel.DOMNode);
|
|
141
141
|
|
|
142
142
|
this.#view = view;
|
|
143
143
|
this.treeOutline = new ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline({readOnly: true});
|
|
@@ -147,7 +147,7 @@ export class PropertiesWidget extends UI.Widget.VBox {
|
|
|
147
147
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.DOMPropertiesExpanded);
|
|
148
148
|
});
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
this.requestUpdate();
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
#buildFilterRegex(text: string): RegExp|null {
|
|
@@ -164,80 +164,80 @@ export class PropertiesWidget extends UI.Widget.VBox {
|
|
|
164
164
|
return new RegExp(Platform.StringUtilities.escapeForRegExp(text), 'i');
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
private onFilterChanged(event: CustomEvent<string>): void {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
private onFilterChanged(event: CustomEvent<string>|Common.EventTarget.EventTargetEvent<boolean>): void {
|
|
168
|
+
if ('detail' in event) {
|
|
169
|
+
this.#filterText = event.detail;
|
|
170
|
+
this.filterRegex = this.#buildFilterRegex(event.detail);
|
|
171
|
+
}
|
|
172
|
+
this.#updateFilter();
|
|
173
|
+
this.requestUpdate();
|
|
171
174
|
}
|
|
172
175
|
|
|
173
176
|
private onRegexToggled(): void {
|
|
174
177
|
this.#isRegex = !this.#isRegex;
|
|
175
178
|
this.filterRegex = this.#buildFilterRegex(this.#filterText);
|
|
176
|
-
this
|
|
177
|
-
this
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
private filterAndScheduleUpdate(): void {
|
|
181
|
-
const previousDisplay = this.#displayNoMatchingPropertyMessage;
|
|
182
|
-
this.internalFilterProperties();
|
|
183
|
-
if (previousDisplay !== this.#displayNoMatchingPropertyMessage) {
|
|
184
|
-
this.requestUpdate();
|
|
185
|
-
}
|
|
179
|
+
this.#updateFilter();
|
|
180
|
+
this.requestUpdate();
|
|
186
181
|
}
|
|
187
182
|
|
|
188
|
-
|
|
189
|
-
this.#
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
includeNullOrUndefinedValues: this.showAllPropertiesSetting.get(),
|
|
194
|
-
regex: this.filterRegex,
|
|
195
|
-
});
|
|
196
|
-
this.#displayNoMatchingPropertyMessage = this.#displayNoMatchingPropertyMessage && hidden;
|
|
197
|
-
element.hidden = hidden;
|
|
198
|
-
}
|
|
183
|
+
#updateFilter(): void {
|
|
184
|
+
this.#objectTree?.setFilter({
|
|
185
|
+
includeNullOrUndefinedValues: this.showAllPropertiesSetting.get(),
|
|
186
|
+
regex: this.filterRegex,
|
|
187
|
+
});
|
|
199
188
|
}
|
|
200
189
|
|
|
201
|
-
private setNode(
|
|
202
|
-
this
|
|
190
|
+
private setNode(): void {
|
|
191
|
+
this.#pendingNodeUpdate = true;
|
|
203
192
|
this.requestUpdate();
|
|
204
193
|
}
|
|
205
194
|
|
|
206
|
-
|
|
207
|
-
if (this
|
|
208
|
-
|
|
209
|
-
delete this.lastRequestedNode;
|
|
195
|
+
async #updateNodeIfRequired(): Promise<void> {
|
|
196
|
+
if (!this.#pendingNodeUpdate) {
|
|
197
|
+
return;
|
|
210
198
|
}
|
|
199
|
+
this.#pendingNodeUpdate = false;
|
|
200
|
+
this.#lastRequestedNode?.domModel().runtimeModel().releaseObjectGroup(OBJECT_GROUP_NAME);
|
|
201
|
+
this.#lastRequestedNode = UI.Context.Context.instance().flavor(SDK.DOMModel.DOMNode);
|
|
211
202
|
|
|
212
|
-
if (!this
|
|
203
|
+
if (!this.#lastRequestedNode) {
|
|
204
|
+
this.#objectTree = null;
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const object = await this.#lastRequestedNode.resolveToObject(OBJECT_GROUP_NAME);
|
|
208
|
+
if (!object) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
this.#objectTree = new ObjectUI.ObjectPropertiesSection.ObjectTree(
|
|
213
|
+
object, ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED);
|
|
214
|
+
this.#updateFilter();
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
override async performUpdate(): Promise<void> {
|
|
218
|
+
await this.#updateNodeIfRequired();
|
|
219
|
+
if (!this.#objectTree) {
|
|
213
220
|
this.treeOutline.removeChildren();
|
|
214
|
-
this.#displayNoMatchingPropertyMessage = false;
|
|
215
221
|
} else {
|
|
216
|
-
this.lastRequestedNode = this.node;
|
|
217
|
-
const object = await this.node.resolveToObject(OBJECT_GROUP_NAME);
|
|
218
|
-
if (!object) {
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
222
|
const treeElement = this.treeOutline.rootElement();
|
|
223
223
|
treeElement.removeChildren();
|
|
224
|
-
const root = new ObjectUI.ObjectPropertiesSection.ObjectTree(
|
|
225
|
-
object, ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED);
|
|
226
224
|
ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement.populateWithProperties(
|
|
227
|
-
treeElement, await
|
|
228
|
-
|
|
225
|
+
treeElement, await this.#objectTree.populateChildrenIfNeeded(), true /* skipProto */,
|
|
226
|
+
true /* skipGettersAndSetters */);
|
|
229
227
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
228
|
+
const allChildrenFiltered =
|
|
229
|
+
!(this.#objectTree?.children?.accessors?.some(c => !c.isFiltered) ||
|
|
230
|
+
this.#objectTree?.children?.arrayRanges?.some(() => true) ||
|
|
231
|
+
this.#objectTree?.children?.internalProperties?.some(c => !c.isFiltered) ||
|
|
232
|
+
this.#objectTree?.children?.properties?.some(c => !c.isFiltered));
|
|
234
233
|
this.#view(
|
|
235
234
|
{
|
|
236
235
|
onFilterChanged: this.onFilterChanged.bind(this),
|
|
237
236
|
onRegexToggled: this.onRegexToggled.bind(this),
|
|
238
237
|
isRegex: this.#isRegex,
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
treeOutline: this.treeOutline,
|
|
239
|
+
allChildrenFiltered,
|
|
240
|
+
objectTree: this.#objectTree,
|
|
241
241
|
},
|
|
242
242
|
{}, this.contentElement);
|
|
243
243
|
}
|
|
@@ -245,14 +245,15 @@ export class PropertiesWidget extends UI.Widget.VBox {
|
|
|
245
245
|
private onNodeChange(
|
|
246
246
|
event: Common.EventTarget.EventTargetEvent<{node: SDK.DOMModel.DOMNode, name: string}|SDK.DOMModel.DOMNode>,
|
|
247
247
|
): void {
|
|
248
|
-
if (!this
|
|
248
|
+
if (!this.#lastRequestedNode) {
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
251
|
const data = event.data;
|
|
252
252
|
const node = (data instanceof SDK.DOMModel.DOMNode ? data : data.node);
|
|
253
|
-
if (this
|
|
253
|
+
if (this.#lastRequestedNode !== node) {
|
|
254
254
|
return;
|
|
255
255
|
}
|
|
256
|
+
this.#pendingNodeUpdate = true;
|
|
256
257
|
this.requestUpdate();
|
|
257
258
|
}
|
|
258
259
|
}
|
|
@@ -413,7 +413,7 @@ export class VariableRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
|
|
|
413
413
|
if (fromFallback) {
|
|
414
414
|
renderedFallback?.cssControls.get('color')?.forEach(
|
|
415
415
|
innerSwatch => innerSwatch.addEventListener(InlineEditor.ColorSwatch.ColorChangedEvent.eventName, ev => {
|
|
416
|
-
colorSwatch.
|
|
416
|
+
colorSwatch.setColor(ev.data.color);
|
|
417
417
|
}));
|
|
418
418
|
}
|
|
419
419
|
|
|
@@ -535,7 +535,7 @@ export class AttributeRenderer extends rendererBase(SDK.CSSPropertyParserMatcher
|
|
|
535
535
|
if (fromFallback) {
|
|
536
536
|
renderedFallback?.cssControls.get('color')?.forEach(
|
|
537
537
|
innerSwatch => innerSwatch.addEventListener(InlineEditor.ColorSwatch.ColorChangedEvent.eventName, ev => {
|
|
538
|
-
colorSwatch.
|
|
538
|
+
colorSwatch.setColor(ev.data.color);
|
|
539
539
|
}));
|
|
540
540
|
}
|
|
541
541
|
|
|
@@ -718,9 +718,9 @@ export class ColorRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.Co
|
|
|
718
718
|
return;
|
|
719
719
|
}
|
|
720
720
|
if (color.is(Common.Color.Format.HSL) || color.is(Common.Color.Format.HSLA)) {
|
|
721
|
-
swatch.
|
|
721
|
+
swatch.setColor(new Common.Color.HSL(hue, color.s, color.l, color.alpha));
|
|
722
722
|
} else if (color.is(Common.Color.Format.HWB) || color.is(Common.Color.Format.HWBA)) {
|
|
723
|
-
swatch.
|
|
723
|
+
swatch.setColor(new Common.Color.HWB(hue, color.w, color.b, color.alpha));
|
|
724
724
|
}
|
|
725
725
|
angle.updateProperty(swatch.color?.asString() ?? '');
|
|
726
726
|
});
|
|
@@ -735,9 +735,9 @@ export class ColorRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.Co
|
|
|
735
735
|
const tooltip = editable ? i18nString(UIStrings.openColorPickerS, {PH1: shiftClickMessage}) : '';
|
|
736
736
|
|
|
737
737
|
const swatch = new InlineEditor.ColorSwatch.ColorSwatch(tooltip);
|
|
738
|
-
swatch.
|
|
738
|
+
swatch.setReadonly(!editable);
|
|
739
739
|
if (color) {
|
|
740
|
-
swatch.color
|
|
740
|
+
swatch.renderColor(color);
|
|
741
741
|
}
|
|
742
742
|
|
|
743
743
|
if (this.#treeElement?.editable()) {
|
|
@@ -761,7 +761,7 @@ export class ColorRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.Co
|
|
|
761
761
|
new ColorSwatchPopoverIcon(treeElement, treeElement.parentPane().swatchPopoverHelper(), swatch);
|
|
762
762
|
swatchIcon.addEventListener(ColorSwatchPopoverIconEvents.COLOR_CHANGED, ev => {
|
|
763
763
|
valueChild.textContent = ev.data.getAuthoredText() ?? ev.data.asString();
|
|
764
|
-
swatch.
|
|
764
|
+
swatch.setColor(ev.data);
|
|
765
765
|
});
|
|
766
766
|
if (treeElement.property.name === 'color') {
|
|
767
767
|
void this.#addColorContrastInfo(swatchIcon);
|
|
@@ -838,15 +838,14 @@ export class LightDarkColorRenderer extends rendererBase(SDK.CSSPropertyParserMa
|
|
|
838
838
|
|
|
839
839
|
const activeColorSwatches = (activeColor === match.light ? lightControls : darkControls).get('color');
|
|
840
840
|
activeColorSwatches?.forEach(
|
|
841
|
-
swatch => swatch.addEventListener(
|
|
842
|
-
|
|
843
|
-
}));
|
|
841
|
+
swatch => swatch.addEventListener(
|
|
842
|
+
InlineEditor.ColorSwatch.ColorChangedEvent.eventName, ev => colorSwatch.setColor(ev.data.color)));
|
|
844
843
|
const inactiveColor = (activeColor === match.light) ? dark : light;
|
|
845
844
|
const colorText = context.matchedResult.getComputedTextRange(activeColor[0], activeColor[activeColor.length - 1]);
|
|
846
845
|
const color = colorText && Common.Color.parse(colorText);
|
|
847
846
|
inactiveColor.classList.add('inactive-value');
|
|
848
847
|
if (color) {
|
|
849
|
-
colorSwatch.color
|
|
848
|
+
colorSwatch.renderColor(color);
|
|
850
849
|
}
|
|
851
850
|
}
|
|
852
851
|
|
|
@@ -972,7 +971,7 @@ export class ColorMixRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
|
|
|
972
971
|
if (results) {
|
|
973
972
|
const color = Common.Color.parse(results[0]);
|
|
974
973
|
if (color) {
|
|
975
|
-
swatch.color
|
|
974
|
+
swatch.setColor(color.as(Common.Color.Format.HEXA));
|
|
976
975
|
return true;
|
|
977
976
|
}
|
|
978
977
|
}
|
|
@@ -769,10 +769,6 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
|
769
769
|
return;
|
|
770
770
|
}
|
|
771
771
|
|
|
772
|
-
if (!UI.ViewManager.ViewManager.instance().isViewVisible('animations')) {
|
|
773
|
-
return;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
772
|
void this.computedStyleUpdateThrottler.schedule(async () => {
|
|
777
773
|
await this.#updateAnimatedStyles();
|
|
778
774
|
this.handledComputedStyleChangedForTest();
|
|
@@ -795,6 +791,11 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
|
795
791
|
#scheduleResetUpdateIfNotEditing(): void {
|
|
796
792
|
this.scheduleResetUpdateIfNotEditingCalledForTest();
|
|
797
793
|
|
|
794
|
+
// Don't schedule if editing; the edit completion will handle the update.
|
|
795
|
+
if (this.userOperation || this.isEditingStyle) {
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
|
|
798
799
|
void this.resetUpdateThrottler.schedule(async () => {
|
|
799
800
|
this.#resetUpdateIfNotEditing();
|
|
800
801
|
});
|
|
@@ -803,6 +804,13 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
|
803
804
|
scheduleResetUpdateIfNotEditingCalledForTest(): void {
|
|
804
805
|
}
|
|
805
806
|
|
|
807
|
+
#hasAnimatedStyles(animatedStyles: Protocol.CSS.GetAnimatedStylesForNodeResponse): boolean {
|
|
808
|
+
return Boolean(
|
|
809
|
+
animatedStyles.animationStyles?.length || animatedStyles.transitionsStyle?.cssProperties.length ||
|
|
810
|
+
animatedStyles.inherited?.some(
|
|
811
|
+
inherited => inherited.animationStyles?.length || inherited.transitionsStyle?.cssProperties.length));
|
|
812
|
+
}
|
|
813
|
+
|
|
806
814
|
async #updateAnimatedStyles(): Promise<void> {
|
|
807
815
|
if (!this.matchedStyles) {
|
|
808
816
|
return;
|
|
@@ -818,6 +826,18 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
|
818
826
|
return;
|
|
819
827
|
}
|
|
820
828
|
|
|
829
|
+
if (!this.#hasAnimatedStyles(animatedStyles)) {
|
|
830
|
+
// A computed style change that doesn't correspond to any animation is
|
|
831
|
+
// likely to be a change in the matched styles. In this case, we should
|
|
832
|
+
// update the matched styles.
|
|
833
|
+
this.#scheduleResetUpdateIfNotEditing();
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
if (!UI.ViewManager.ViewManager.instance().isViewVisible('animations')) {
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
|
|
821
841
|
const updateStyleSection =
|
|
822
842
|
(currentStyle: SDK.CSSStyleDeclaration.CSSStyleDeclaration|null, newStyle: Protocol.CSS.CSSStyle|null):
|
|
823
843
|
void => {
|
|
@@ -2097,7 +2117,7 @@ export class CSSPropertyPrompt extends UI.TextPrompt.TextPrompt {
|
|
|
2097
2117
|
|
|
2098
2118
|
function colorSwatchRenderer(color: Common.Color.Color): Element {
|
|
2099
2119
|
const swatch = new InlineEditor.ColorSwatch.ColorSwatch();
|
|
2100
|
-
swatch.color
|
|
2120
|
+
swatch.renderColor(color);
|
|
2101
2121
|
swatch.style.pointerEvents = 'none';
|
|
2102
2122
|
return swatch;
|
|
2103
2123
|
}
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
.style-panes-wrapper {
|
|
42
42
|
overflow: hidden scroll;
|
|
43
43
|
background-color: var(--sys-color-cdt-base-container);
|
|
44
|
+
}
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
.style-panes-wrapper:not(.computed-styles-pane-wrapper) > div:not(:last-child) {
|
|
46
47
|
border-bottom: 1px solid var(--sys-color-divider);
|
|
47
|
-
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
#elements-content:not(.elements-wrap) > div {
|
|
@@ -81,3 +81,7 @@ devtools-tree-outline {
|
|
|
81
81
|
border-radius: var(--sys-shape-corner-full);
|
|
82
82
|
box-shadow: var(--sys-elevation-level1);
|
|
83
83
|
}
|
|
84
|
+
|
|
85
|
+
.computed-styles-wrapper {
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
}
|