chrome-devtools-frontend 1.0.1589336 → 1.0.1590494
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/common/Settings.ts +30 -1
- package/front_end/generated/Deprecation.ts +7 -0
- package/front_end/generated/InspectorBackendCommands.ts +9 -3
- package/front_end/generated/protocol-mapping.d.ts +9 -0
- package/front_end/generated/protocol-proxy-api.d.ts +7 -0
- package/front_end/generated/protocol.ts +98 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +48 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +140 -32
- package/front_end/panels/ai_assistance/README.md +71 -0
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +5 -0
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +110 -7
- package/front_end/panels/ai_assistance/components/ChatView.ts +10 -0
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +208 -0
- package/front_end/panels/ai_assistance/components/chatMessage.css +2 -2
- package/front_end/panels/ai_assistance/components/walkthroughView.css +121 -0
- package/front_end/panels/application/DeviceBoundSessionsView.ts +64 -2
- package/front_end/panels/console/ConsoleView.ts +8 -8
- package/front_end/panels/console/console-meta.ts +10 -6
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +14 -14
- package/front_end/panels/elements/ComputedStyleWidget.ts +27 -22
- package/front_end/panels/elements/ElementsTreeElement.ts +56 -2
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -0
- package/front_end/panels/elements/StyleEditorWidget.ts +12 -12
- package/front_end/panels/elements/StylePropertiesSection.ts +65 -64
- package/front_end/panels/elements/StylePropertyTreeElement.ts +138 -135
- package/front_end/panels/elements/StylesContainer.ts +57 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +2 -1
- package/front_end/panels/layer_viewer/Layers3DView.ts +2 -2
- package/front_end/panels/network/RequestInitiatorView.ts +3 -2
- package/front_end/panels/timeline/timeline-meta.ts +4 -4
- package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -16
- package/front_end/panels/whats_new/resources/WNDT.md +6 -6
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.ts +5 -6
- package/front_end/ui/components/markdown_view/markdownView.css +6 -0
- package/front_end/ui/components/markdown_view/markdown_view.ts +0 -2
- package/front_end/ui/legacy/Treeoutline.ts +58 -10
- package/front_end/ui/legacy/Widget.ts +11 -1
- package/front_end/ui/legacy/inspectorCommon.css +2 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +11 -1
- package/package.json +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +0 -53
- package/front_end/ui/components/markdown_view/markdownLink.css +0 -11
|
@@ -56,7 +56,7 @@ import * as ElementsComponents from './components/components.js';
|
|
|
56
56
|
import {ElementsPanel} from './ElementsPanel.js';
|
|
57
57
|
import stylePropertiesTreeOutlineStyles from './stylePropertiesTreeOutline.css.js';
|
|
58
58
|
import {type Context, StylePropertyTreeElement} from './StylePropertyTreeElement.js';
|
|
59
|
-
import type {
|
|
59
|
+
import type {StylesContainer} from './StylesContainer.js';
|
|
60
60
|
|
|
61
61
|
const UIStrings = {
|
|
62
62
|
/**
|
|
@@ -123,7 +123,7 @@ const STYLE_TAG = '<style>';
|
|
|
123
123
|
const DEFAULT_MAX_PROPERTIES = 50;
|
|
124
124
|
|
|
125
125
|
export class StylePropertiesSection {
|
|
126
|
-
protected
|
|
126
|
+
protected stylesContainer: StylesContainer;
|
|
127
127
|
styleInternal: SDK.CSSStyleDeclaration.CSSStyleDeclaration;
|
|
128
128
|
readonly matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles;
|
|
129
129
|
private computedStyles: Map<string, string>|null;
|
|
@@ -167,12 +167,12 @@ export class StylePropertiesSection {
|
|
|
167
167
|
readonly sectionTooltipIdPrefix = StylePropertiesSection.#nextSectionTooltipIdPrefix++;
|
|
168
168
|
|
|
169
169
|
constructor(
|
|
170
|
-
|
|
170
|
+
stylesContainer: StylesContainer, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
171
171
|
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number, computedStyles: Map<string, string>|null,
|
|
172
172
|
parentsComputedStyles: Map<string, string>|null,
|
|
173
173
|
computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null, customHeaderText?: string) {
|
|
174
174
|
this.#customHeaderText = customHeaderText;
|
|
175
|
-
this.
|
|
175
|
+
this.stylesContainer = stylesContainer;
|
|
176
176
|
this.sectionIdx = sectionIdx;
|
|
177
177
|
this.styleInternal = style;
|
|
178
178
|
this.matchedStyles = matchedStyles;
|
|
@@ -196,7 +196,7 @@ export class StylePropertiesSection {
|
|
|
196
196
|
this.element.tabIndex = -1;
|
|
197
197
|
UI.ARIAUtils.markAsListitem(this.element);
|
|
198
198
|
this.element.addEventListener('keydown', this.onKeyDown.bind(this), false);
|
|
199
|
-
|
|
199
|
+
stylesContainer.sectionByElement.set(this.element, this);
|
|
200
200
|
this.#styleRuleElement = this.element.createChild('div', 'style-rule');
|
|
201
201
|
|
|
202
202
|
this.#ancestorRuleListElement = document.createElement('div');
|
|
@@ -262,7 +262,7 @@ export class StylePropertiesSection {
|
|
|
262
262
|
|
|
263
263
|
if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.FONT_EDITOR) && this.editable) {
|
|
264
264
|
this.fontEditorToolbar = this.#styleRuleElement.createChild('devtools-toolbar', 'sidebar-pane-section-toolbar');
|
|
265
|
-
this.fontEditorSectionManager = new FontEditorSectionManager(this.
|
|
265
|
+
this.fontEditorSectionManager = new FontEditorSectionManager(this.stylesContainer.swatchPopoverHelper(), this);
|
|
266
266
|
this.fontEditorButton =
|
|
267
267
|
new UI.Toolbar.ToolbarButton('Font Editor', 'custom-typography', undefined, 'font-editor');
|
|
268
268
|
this.fontEditorButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => {
|
|
@@ -371,7 +371,7 @@ export class StylePropertiesSection {
|
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
resetToolbars(): void {
|
|
374
|
-
if (this.
|
|
374
|
+
if (this.stylesContainer.swatchPopoverHelper().isShowing() ||
|
|
375
375
|
this.styleInternal.type === SDK.CSSStyleDeclaration.Type.Inline) {
|
|
376
376
|
return;
|
|
377
377
|
}
|
|
@@ -601,7 +601,7 @@ export class StylePropertiesSection {
|
|
|
601
601
|
|
|
602
602
|
private onMouseLeave(_event: Event): void {
|
|
603
603
|
this.setSectionHovered(false);
|
|
604
|
-
this.
|
|
604
|
+
this.stylesContainer.setActiveProperty(null);
|
|
605
605
|
}
|
|
606
606
|
|
|
607
607
|
private onMouseMove(event: MouseEvent): void {
|
|
@@ -610,9 +610,9 @@ export class StylePropertiesSection {
|
|
|
610
610
|
|
|
611
611
|
const treeElement = this.propertiesTreeOutline.treeElementFromEvent(event);
|
|
612
612
|
if (treeElement instanceof StylePropertyTreeElement) {
|
|
613
|
-
this.
|
|
613
|
+
this.stylesContainer.setActiveProperty((treeElement));
|
|
614
614
|
} else {
|
|
615
|
-
this.
|
|
615
|
+
this.stylesContainer.setActiveProperty(null);
|
|
616
616
|
}
|
|
617
617
|
const selection = this.element.getComponentSelection();
|
|
618
618
|
if (!this.selectedSinceMouseDown && selection?.toString()) {
|
|
@@ -622,7 +622,7 @@ export class StylePropertiesSection {
|
|
|
622
622
|
|
|
623
623
|
private onFontEditorButtonClicked(): void {
|
|
624
624
|
if (this.fontEditorSectionManager && this.fontEditorButton) {
|
|
625
|
-
void this.fontEditorSectionManager.showPopover(this.fontEditorButton.element, this.
|
|
625
|
+
void this.fontEditorSectionManager.showPopover(this.fontEditorButton.element, this.stylesContainer);
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
628
|
|
|
@@ -682,7 +682,7 @@ export class StylePropertiesSection {
|
|
|
682
682
|
|
|
683
683
|
highlight(mode: string|undefined = 'all'): void {
|
|
684
684
|
SDK.OverlayModel.OverlayModel.hideDOMNodeHighlight();
|
|
685
|
-
const node = this.
|
|
685
|
+
const node = this.stylesContainer.node();
|
|
686
686
|
if (!node) {
|
|
687
687
|
return;
|
|
688
688
|
}
|
|
@@ -701,7 +701,7 @@ export class StylePropertiesSection {
|
|
|
701
701
|
|
|
702
702
|
let childElement: (ChildNode|null) = parent.firstChild;
|
|
703
703
|
while (childElement) {
|
|
704
|
-
const childSection = this.
|
|
704
|
+
const childSection = this.stylesContainer.sectionByElement.get(childElement);
|
|
705
705
|
if (childSection) {
|
|
706
706
|
return childSection;
|
|
707
707
|
}
|
|
@@ -744,7 +744,7 @@ export class StylePropertiesSection {
|
|
|
744
744
|
|
|
745
745
|
let childElement: (ChildNode|null) = parent.lastChild;
|
|
746
746
|
while (childElement) {
|
|
747
|
-
const childSection = this.
|
|
747
|
+
const childSection = this.stylesContainer.sectionByElement.get(childElement);
|
|
748
748
|
if (childSection) {
|
|
749
749
|
return childSection;
|
|
750
750
|
}
|
|
@@ -758,10 +758,10 @@ export class StylePropertiesSection {
|
|
|
758
758
|
let curElement: (ChildNode|null)|HTMLDivElement = this.element;
|
|
759
759
|
do {
|
|
760
760
|
curElement = curElement.nextSibling;
|
|
761
|
-
} while (curElement && !this.
|
|
761
|
+
} while (curElement && !this.stylesContainer.sectionByElement.has(curElement));
|
|
762
762
|
|
|
763
763
|
if (curElement) {
|
|
764
|
-
return this.
|
|
764
|
+
return this.stylesContainer.sectionByElement.get(curElement);
|
|
765
765
|
}
|
|
766
766
|
return;
|
|
767
767
|
}
|
|
@@ -770,10 +770,10 @@ export class StylePropertiesSection {
|
|
|
770
770
|
let curElement: (ChildNode|null)|HTMLDivElement = this.element;
|
|
771
771
|
do {
|
|
772
772
|
curElement = curElement.previousSibling;
|
|
773
|
-
} while (curElement && !this.
|
|
773
|
+
} while (curElement && !this.stylesContainer.sectionByElement.has(curElement));
|
|
774
774
|
|
|
775
775
|
if (curElement) {
|
|
776
|
-
return this.
|
|
776
|
+
return this.stylesContainer.sectionByElement.get(curElement);
|
|
777
777
|
}
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
@@ -786,7 +786,7 @@ export class StylePropertiesSection {
|
|
|
786
786
|
}
|
|
787
787
|
const range =
|
|
788
788
|
TextUtils.TextRange.TextRange.createFromLocation(rule.style.range.endLine, rule.style.range.endColumn + 1);
|
|
789
|
-
this.
|
|
789
|
+
this.stylesContainer.addBlankSection(this, rule.header, range);
|
|
790
790
|
}
|
|
791
791
|
|
|
792
792
|
styleSheetEdited(edit: SDK.CSSModel.Edit): void {
|
|
@@ -1093,7 +1093,7 @@ export class StylePropertiesSection {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
|
|
1095
1095
|
refreshUpdate(editedTreeElement: StylePropertyTreeElement): void {
|
|
1096
|
-
this.
|
|
1096
|
+
this.stylesContainer.refreshUpdate(this, editedTreeElement);
|
|
1097
1097
|
}
|
|
1098
1098
|
|
|
1099
1099
|
updateVarFunctions(editedTreeElement: StylePropertyTreeElement): void {
|
|
@@ -1138,7 +1138,7 @@ export class StylePropertiesSection {
|
|
|
1138
1138
|
}
|
|
1139
1139
|
|
|
1140
1140
|
onpopulate(): void {
|
|
1141
|
-
this.
|
|
1141
|
+
this.stylesContainer.setActiveProperty(null);
|
|
1142
1142
|
this.nextEditorTriggerButtonIdx = 1;
|
|
1143
1143
|
this.propertiesTreeOutline.removeChildren();
|
|
1144
1144
|
this.customPopulateCallback();
|
|
@@ -1161,7 +1161,7 @@ export class StylePropertiesSection {
|
|
|
1161
1161
|
continue;
|
|
1162
1162
|
}
|
|
1163
1163
|
const item = new StylePropertyTreeElement({
|
|
1164
|
-
|
|
1164
|
+
stylesContainer: this.stylesContainer,
|
|
1165
1165
|
section: this,
|
|
1166
1166
|
matchedStyles: this.matchedStyles,
|
|
1167
1167
|
property,
|
|
@@ -1198,7 +1198,7 @@ export class StylePropertiesSection {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
1200
1200
|
|
|
1201
|
-
const regex = this.
|
|
1201
|
+
const regex = this.stylesContainer.filterRegex();
|
|
1202
1202
|
const hideRule = !hasMatchingChild && regex !== null && !regex.test(this.element.deepTextContent());
|
|
1203
1203
|
this.#isHidden = hideRule;
|
|
1204
1204
|
this.element.classList.toggle('hidden', hideRule);
|
|
@@ -1224,7 +1224,7 @@ export class StylePropertiesSection {
|
|
|
1224
1224
|
matchingSelectors[matchingIndex] = true;
|
|
1225
1225
|
}
|
|
1226
1226
|
|
|
1227
|
-
if (this.
|
|
1227
|
+
if (this.stylesContainer.isEditingStyle) {
|
|
1228
1228
|
return;
|
|
1229
1229
|
}
|
|
1230
1230
|
|
|
@@ -1265,7 +1265,7 @@ export class StylePropertiesSection {
|
|
|
1265
1265
|
|
|
1266
1266
|
markSelectorHighlights(): void {
|
|
1267
1267
|
const selectors = this.selectorElement.getElementsByClassName('simple-selector');
|
|
1268
|
-
const regex = this.
|
|
1268
|
+
const regex = this.stylesContainer.filterRegex();
|
|
1269
1269
|
for (let i = 0; i < selectors.length; ++i) {
|
|
1270
1270
|
const selectorMatchesFilter = regex?.test(selectors[i].textContent || '');
|
|
1271
1271
|
selectors[i].classList.toggle('filter-match', selectorMatchesFilter);
|
|
@@ -1276,7 +1276,7 @@ export class StylePropertiesSection {
|
|
|
1276
1276
|
StylePropertyTreeElement {
|
|
1277
1277
|
const property = this.styleInternal.newBlankProperty(index);
|
|
1278
1278
|
const item = new StylePropertyTreeElement({
|
|
1279
|
-
|
|
1279
|
+
stylesContainer: this.stylesContainer,
|
|
1280
1280
|
section: this,
|
|
1281
1281
|
matchedStyles: this.matchedStyles,
|
|
1282
1282
|
property,
|
|
@@ -1290,7 +1290,7 @@ export class StylePropertiesSection {
|
|
|
1290
1290
|
}
|
|
1291
1291
|
|
|
1292
1292
|
private handleEmptySpaceMouseDown(): void {
|
|
1293
|
-
this.willCauseCancelEditing = this.
|
|
1293
|
+
this.willCauseCancelEditing = this.stylesContainer.isEditingStyle;
|
|
1294
1294
|
this.selectedSinceMouseDown = false;
|
|
1295
1295
|
}
|
|
1296
1296
|
|
|
@@ -1364,7 +1364,7 @@ export class StylePropertiesSection {
|
|
|
1364
1364
|
if (selection) {
|
|
1365
1365
|
selection.selectAllChildren(element);
|
|
1366
1366
|
}
|
|
1367
|
-
this.
|
|
1367
|
+
this.stylesContainer.setEditingStyle(true);
|
|
1368
1368
|
const parentMediaElement = element.enclosingNodeOrSelfWithClass('query');
|
|
1369
1369
|
parentMediaElement.classList.add('editing-query');
|
|
1370
1370
|
|
|
@@ -1372,7 +1372,7 @@ export class StylePropertiesSection {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
|
|
1374
1374
|
private editingMediaFinished(element: Element): void {
|
|
1375
|
-
this.
|
|
1375
|
+
this.stylesContainer.setEditingStyle(false);
|
|
1376
1376
|
const parentMediaElement = element.enclosingNodeOrSelfWithClass('query');
|
|
1377
1377
|
parentMediaElement.classList.remove('editing-query');
|
|
1378
1378
|
}
|
|
@@ -1400,7 +1400,7 @@ export class StylePropertiesSection {
|
|
|
1400
1400
|
_context: Context|undefined,
|
|
1401
1401
|
_moveDirection: string,
|
|
1402
1402
|
): Promise<void> {
|
|
1403
|
-
this.
|
|
1403
|
+
this.stylesContainer.setEditingStyle(false);
|
|
1404
1404
|
this.editingMediaFinished(element);
|
|
1405
1405
|
|
|
1406
1406
|
if (newContent) {
|
|
@@ -1408,8 +1408,8 @@ export class StylePropertiesSection {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
|
|
1410
1410
|
// This gets deleted in finishOperation(), which is called both on success and failure.
|
|
1411
|
-
this.
|
|
1412
|
-
const cssModel = this.
|
|
1411
|
+
this.stylesContainer.setUserOperation(true);
|
|
1412
|
+
const cssModel = this.stylesContainer.cssModel();
|
|
1413
1413
|
if (cssModel && query.styleSheetId) {
|
|
1414
1414
|
const range = query.range as TextUtils.TextRange.TextRange;
|
|
1415
1415
|
let success = false;
|
|
@@ -1425,9 +1425,9 @@ export class StylePropertiesSection {
|
|
|
1425
1425
|
|
|
1426
1426
|
if (success) {
|
|
1427
1427
|
this.matchedStyles.resetActiveProperties();
|
|
1428
|
-
this.
|
|
1428
|
+
this.stylesContainer.refreshUpdate(this);
|
|
1429
1429
|
}
|
|
1430
|
-
this.
|
|
1430
|
+
this.stylesContainer.setUserOperation(false);
|
|
1431
1431
|
this.editingMediaTextCommittedForTest();
|
|
1432
1432
|
}
|
|
1433
1433
|
}
|
|
@@ -1511,7 +1511,7 @@ export class StylePropertiesSection {
|
|
|
1511
1511
|
}
|
|
1512
1512
|
|
|
1513
1513
|
private navigateToSelectorSource(index: number, focus: boolean): void {
|
|
1514
|
-
const cssModel = this.
|
|
1514
|
+
const cssModel = this.stylesContainer.cssModel();
|
|
1515
1515
|
if (!cssModel) {
|
|
1516
1516
|
return;
|
|
1517
1517
|
}
|
|
@@ -1570,7 +1570,7 @@ export class StylePropertiesSection {
|
|
|
1570
1570
|
if (selection) {
|
|
1571
1571
|
selection.selectAllChildren(element);
|
|
1572
1572
|
}
|
|
1573
|
-
this.
|
|
1573
|
+
this.stylesContainer.setEditingStyle(true);
|
|
1574
1574
|
if (element.classList.contains('simple-selector')) {
|
|
1575
1575
|
this.navigateToSelectorSource(0, false);
|
|
1576
1576
|
}
|
|
@@ -1628,13 +1628,13 @@ export class StylePropertiesSection {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
|
|
1630
1630
|
function headerTextCommitted(this: StylePropertiesSection): void {
|
|
1631
|
-
this.
|
|
1631
|
+
this.stylesContainer.setUserOperation(false);
|
|
1632
1632
|
this.moveEditorFromSelector(moveDirection);
|
|
1633
1633
|
this.editingSelectorCommittedForTest();
|
|
1634
1634
|
}
|
|
1635
1635
|
|
|
1636
1636
|
// This gets deleted in finishOperationAndMoveEditor(), which is called both on success and failure.
|
|
1637
|
-
this.
|
|
1637
|
+
this.stylesContainer.setUserOperation(true);
|
|
1638
1638
|
void this.setHeaderText(rule, newContent).then(headerTextCommitted.bind(this));
|
|
1639
1639
|
}
|
|
1640
1640
|
|
|
@@ -1653,7 +1653,7 @@ export class StylePropertiesSection {
|
|
|
1653
1653
|
const doesAffectSelectedNode = this.matchedStyles.getMatchingSelectors(rule).length > 0;
|
|
1654
1654
|
this.propertiesTreeOutline.element.classList.toggle('no-affect', !doesAffectSelectedNode);
|
|
1655
1655
|
this.matchedStyles.resetActiveProperties();
|
|
1656
|
-
this.
|
|
1656
|
+
this.stylesContainer.refreshUpdate(this);
|
|
1657
1657
|
}
|
|
1658
1658
|
|
|
1659
1659
|
if (!(rule instanceof SDK.CSSRule.CSSStyleRule)) {
|
|
@@ -1673,11 +1673,11 @@ export class StylePropertiesSection {
|
|
|
1673
1673
|
protected updateRuleOrigin(): void {
|
|
1674
1674
|
this.selectorRefElement.removeChildren();
|
|
1675
1675
|
this.selectorRefElement.appendChild(
|
|
1676
|
-
this.createRuleOriginNode(this.matchedStyles, this.
|
|
1676
|
+
this.createRuleOriginNode(this.matchedStyles, this.stylesContainer.linkifier, this.styleInternal.parentRule));
|
|
1677
1677
|
}
|
|
1678
1678
|
|
|
1679
1679
|
protected editingSelectorEnded(): void {
|
|
1680
|
-
this.
|
|
1680
|
+
this.stylesContainer.setEditingStyle(false);
|
|
1681
1681
|
}
|
|
1682
1682
|
|
|
1683
1683
|
editingSelectorCancelled(): void {
|
|
@@ -1709,18 +1709,19 @@ export class BlankStylePropertiesSection extends StylePropertiesSection {
|
|
|
1709
1709
|
private readonly styleSheetHeader;
|
|
1710
1710
|
|
|
1711
1711
|
constructor(
|
|
1712
|
-
|
|
1713
|
-
styleSheetHeader: SDK.CSSStyleSheetHeader.CSSStyleSheetHeader,
|
|
1714
|
-
insertAfterStyle: SDK.CSSStyleDeclaration.CSSStyleDeclaration,
|
|
1715
|
-
|
|
1712
|
+
stylesContainer: StylesContainer, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1713
|
+
defaultSelectorText: string, styleSheetHeader: SDK.CSSStyleSheetHeader.CSSStyleSheetHeader,
|
|
1714
|
+
ruleLocation: TextUtils.TextRange.TextRange, insertAfterStyle: SDK.CSSStyleDeclaration.CSSStyleDeclaration,
|
|
1715
|
+
sectionIdx: number) {
|
|
1716
|
+
const cssModel = (stylesContainer.cssModel() as SDK.CSSModel.CSSModel);
|
|
1716
1717
|
const rule = SDK.CSSRule.CSSStyleRule.createDummyRule(cssModel, defaultSelectorText);
|
|
1717
|
-
super(
|
|
1718
|
+
super(stylesContainer, matchedStyles, rule.style, sectionIdx, null, null, null);
|
|
1718
1719
|
this.normal = false;
|
|
1719
1720
|
this.ruleLocation = ruleLocation;
|
|
1720
1721
|
this.styleSheetHeader = styleSheetHeader;
|
|
1721
1722
|
this.selectorRefElement.removeChildren();
|
|
1722
1723
|
this.selectorRefElement.appendChild(StylePropertiesSection.linkifyRuleLocation(
|
|
1723
|
-
cssModel, this.
|
|
1724
|
+
cssModel, this.stylesContainer.linkifier, styleSheetHeader, this.actualRuleLocation()));
|
|
1724
1725
|
this.maybeCreateAncestorRules(insertAfterStyle);
|
|
1725
1726
|
this.element.classList.add('blank-section');
|
|
1726
1727
|
}
|
|
@@ -1769,7 +1770,7 @@ export class BlankStylePropertiesSection extends StylePropertiesSection {
|
|
|
1769
1770
|
|
|
1770
1771
|
this.updateRuleOrigin();
|
|
1771
1772
|
|
|
1772
|
-
this.
|
|
1773
|
+
this.stylesContainer.setUserOperation(false);
|
|
1773
1774
|
this.editingSelectorEnded();
|
|
1774
1775
|
if (this.element.parentElement) // Might have been detached already.
|
|
1775
1776
|
{
|
|
@@ -1783,9 +1784,9 @@ export class BlankStylePropertiesSection extends StylePropertiesSection {
|
|
|
1783
1784
|
if (newContent) {
|
|
1784
1785
|
newContent = newContent.trim();
|
|
1785
1786
|
}
|
|
1786
|
-
this.
|
|
1787
|
+
this.stylesContainer.setUserOperation(true);
|
|
1787
1788
|
|
|
1788
|
-
const cssModel = this.
|
|
1789
|
+
const cssModel = this.stylesContainer.cssModel();
|
|
1789
1790
|
const ruleText = this.rulePrefix() + newContent + ' {}';
|
|
1790
1791
|
if (cssModel) {
|
|
1791
1792
|
void cssModel.addRule(this.styleSheetHeader.id, ruleText, this.ruleLocation).then(onRuleAdded.bind(this));
|
|
@@ -1793,14 +1794,14 @@ export class BlankStylePropertiesSection extends StylePropertiesSection {
|
|
|
1793
1794
|
}
|
|
1794
1795
|
|
|
1795
1796
|
override editingSelectorCancelled(): void {
|
|
1796
|
-
this.
|
|
1797
|
+
this.stylesContainer.setUserOperation(false);
|
|
1797
1798
|
if (!this.isBlank) {
|
|
1798
1799
|
super.editingSelectorCancelled();
|
|
1799
1800
|
return;
|
|
1800
1801
|
}
|
|
1801
1802
|
|
|
1802
1803
|
this.editingSelectorEnded();
|
|
1803
|
-
this.
|
|
1804
|
+
this.stylesContainer.removeSection(this);
|
|
1804
1805
|
}
|
|
1805
1806
|
|
|
1806
1807
|
private makeNormal(newRule: SDK.CSSRule.CSSRule): void {
|
|
@@ -1813,10 +1814,10 @@ export class BlankStylePropertiesSection extends StylePropertiesSection {
|
|
|
1813
1814
|
|
|
1814
1815
|
export class RegisteredPropertiesSection extends StylePropertiesSection {
|
|
1815
1816
|
constructor(
|
|
1816
|
-
|
|
1817
|
+
stylesContainer: StylesContainer, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1817
1818
|
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number, propertyName: string,
|
|
1818
1819
|
expandedByDefault: boolean) {
|
|
1819
|
-
super(
|
|
1820
|
+
super(stylesContainer, matchedStyles, style, sectionIdx, null, null, null, propertyName);
|
|
1820
1821
|
if (!expandedByDefault) {
|
|
1821
1822
|
this.element.classList.add('hidden');
|
|
1822
1823
|
}
|
|
@@ -1832,7 +1833,7 @@ export class RegisteredPropertiesSection extends StylePropertiesSection {
|
|
|
1832
1833
|
return;
|
|
1833
1834
|
}
|
|
1834
1835
|
if (await rule.setPropertyName(newContent)) {
|
|
1835
|
-
this.
|
|
1836
|
+
this.stylesContainer.forceUpdate();
|
|
1836
1837
|
}
|
|
1837
1838
|
}
|
|
1838
1839
|
|
|
@@ -1848,10 +1849,10 @@ export class RegisteredPropertiesSection extends StylePropertiesSection {
|
|
|
1848
1849
|
|
|
1849
1850
|
export class FunctionRuleSection extends StylePropertiesSection {
|
|
1850
1851
|
constructor(
|
|
1851
|
-
|
|
1852
|
+
stylesContainer: StylesContainer, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1852
1853
|
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, children: SDK.CSSRule.CSSNestedStyle[], sectionIdx: number,
|
|
1853
1854
|
functionName: string, expandedByDefault: boolean) {
|
|
1854
|
-
super(
|
|
1855
|
+
super(stylesContainer, matchedStyles, style, sectionIdx, null, null, null, functionName);
|
|
1855
1856
|
if (!expandedByDefault) {
|
|
1856
1857
|
this.element.classList.add('hidden');
|
|
1857
1858
|
}
|
|
@@ -1911,9 +1912,9 @@ export class FunctionRuleSection extends StylePropertiesSection {
|
|
|
1911
1912
|
|
|
1912
1913
|
export class AtRuleSection extends StylePropertiesSection {
|
|
1913
1914
|
constructor(
|
|
1914
|
-
|
|
1915
|
+
stylesContainer: StylesContainer, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1915
1916
|
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number, expandedByDefault: boolean) {
|
|
1916
|
-
super(
|
|
1917
|
+
super(stylesContainer, matchedStyles, style, sectionIdx, null, null, null);
|
|
1917
1918
|
this.selectorElement.className = 'font-palette-values-key';
|
|
1918
1919
|
if (!expandedByDefault) {
|
|
1919
1920
|
this.element.classList.add('hidden');
|
|
@@ -1923,9 +1924,9 @@ export class AtRuleSection extends StylePropertiesSection {
|
|
|
1923
1924
|
|
|
1924
1925
|
export class PositionTryRuleSection extends StylePropertiesSection {
|
|
1925
1926
|
constructor(
|
|
1926
|
-
|
|
1927
|
+
stylesContainer: StylesContainer, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1927
1928
|
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number, active: boolean) {
|
|
1928
|
-
super(
|
|
1929
|
+
super(stylesContainer, matchedStyles, style, sectionIdx, null, null, null);
|
|
1929
1930
|
this.selectorElement.className = 'position-try-values-key';
|
|
1930
1931
|
this.propertiesTreeOutline.element.classList.toggle('no-affect', !active);
|
|
1931
1932
|
}
|
|
@@ -1933,9 +1934,9 @@ export class PositionTryRuleSection extends StylePropertiesSection {
|
|
|
1933
1934
|
|
|
1934
1935
|
export class KeyframePropertiesSection extends StylePropertiesSection {
|
|
1935
1936
|
constructor(
|
|
1936
|
-
|
|
1937
|
+
stylesContainer: StylesContainer, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1937
1938
|
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number) {
|
|
1938
|
-
super(
|
|
1939
|
+
super(stylesContainer, matchedStyles, style, sectionIdx, null, null, null);
|
|
1939
1940
|
this.selectorElement.className = 'keyframe-key';
|
|
1940
1941
|
}
|
|
1941
1942
|
|
|
@@ -1951,7 +1952,7 @@ export class KeyframePropertiesSection extends StylePropertiesSection {
|
|
|
1951
1952
|
if (!success) {
|
|
1952
1953
|
return;
|
|
1953
1954
|
}
|
|
1954
|
-
this.
|
|
1955
|
+
this.stylesContainer.refreshUpdate(this);
|
|
1955
1956
|
}
|
|
1956
1957
|
|
|
1957
1958
|
if (!(rule instanceof SDK.CSSRule.CSSKeyframeRule)) {
|