[go: nahoru, domu]

Skip to content

Commit

Permalink
Make CSSStyleRule inherit from CSSGroupingRule.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
emilio authored and moz-wptsync-bot committed Aug 1, 2023
1 parent 5561d72 commit a3bb9f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions css/css-nesting/cssom.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<style id="ss"></style>

<script>
test(() => {
assert_equals(CSSStyleRule.__proto__, CSSGroupingRule);
}, "CSSStyleRule is a CSSGroupingRule");

test(() => {
let [ss] = document.styleSheets;
assert_equals(ss.cssRules.length, 0);
Expand Down
12 changes: 6 additions & 6 deletions interfaces/cssom.idl
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ interface CSSRule {
const unsigned short NAMESPACE_RULE = 10;
};

[Exposed=Window]
interface CSSStyleRule : CSSRule {
attribute CSSOMString selectorText;
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
};

[Exposed=Window]
interface CSSImportRule : CSSRule {
readonly attribute USVString href;
Expand All @@ -118,6 +112,12 @@ interface CSSGroupingRule : CSSRule {
undefined deleteRule(unsigned long index);
};

[Exposed=Window]
interface CSSStyleRule : CSSGroupingRule {
attribute CSSOMString selectorText;
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
};

[Exposed=Window]
interface CSSPageRule : CSSGroupingRule {
attribute CSSOMString selectorText;
Expand Down

0 comments on commit a3bb9f7

Please sign in to comment.