Skip to content

Commit a3bb9f7

Browse files
emiliomoz-wptsync-bot
authored andcommitted
Make CSSStyleRule inherit from CSSGroupingRule.
As per w3c/csswg-drafts#8940. I didn't do this in bug 1837638 because that's what the spec said at the time, that's what other browsers did, and specially because if we did this we had no way of runtime-disable nesting during development or if things went south. This means that we can't keep the nesting pref in 118, but that seems fine (it's already enabled everywhere in 117). Differential Revision: https://phabricator.services.mozilla.com/D184930 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1846251 gecko-commit: 62534bac923526d52c2d5f377d00bdf2d34b9a05 gecko-reviewers: peterv, devtools-reviewers
1 parent 5561d72 commit a3bb9f7

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

css/css-nesting/cssom.html

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
<style id="ss"></style>
99

1010
<script>
11+
test(() => {
12+
assert_equals(CSSStyleRule.__proto__, CSSGroupingRule);
13+
}, "CSSStyleRule is a CSSGroupingRule");
14+
1115
test(() => {
1216
let [ss] = document.styleSheets;
1317
assert_equals(ss.cssRules.length, 0);

interfaces/cssom.idl

+6-6
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ interface CSSRule {
9696
const unsigned short NAMESPACE_RULE = 10;
9797
};
9898

99-
[Exposed=Window]
100-
interface CSSStyleRule : CSSRule {
101-
attribute CSSOMString selectorText;
102-
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
103-
};
104-
10599
[Exposed=Window]
106100
interface CSSImportRule : CSSRule {
107101
readonly attribute USVString href;
@@ -118,6 +112,12 @@ interface CSSGroupingRule : CSSRule {
118112
undefined deleteRule(unsigned long index);
119113
};
120114

115+
[Exposed=Window]
116+
interface CSSStyleRule : CSSGroupingRule {
117+
attribute CSSOMString selectorText;
118+
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
119+
};
120+
121121
[Exposed=Window]
122122
interface CSSPageRule : CSSGroupingRule {
123123
attribute CSSOMString selectorText;

0 commit comments

Comments
 (0)