[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-nesting] Why does CSSStyleRule not inherit from CSSGroupingRule? #8940

Closed
emilio opened this issue Jun 9, 2023 · 5 comments
Closed

Comments

@emilio
Copy link
Collaborator
emilio commented Jun 9, 2023

https://drafts.csswg.org/css-nesting/#cssom-style has:

partial interface CSSStyleRule {
  [SameObject] readonly attribute CSSRuleList cssRules;
  unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0);
  undefined deleteRule(unsigned long index);
};

Why doing that rather than inheriting from CSSGroupingRule, which gives you that?

cc @tabatkins @sesse

@emilio
Copy link
Collaborator Author
emilio commented Jun 9, 2023

cc @mdubet

@mdubet
Copy link
mdubet commented Jun 12, 2023

I've asked the same question during a WG meeting : #8350 (comment)

@tabatkins
Copy link
Member

I honestly just didn't think about changing the inheritance tree? It feels like doing that to such an old rule might have compat implications, but then again CSSMediaRule is just as old and we changed it. So yeah, probably we can just do it this way.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-nesting] Why does CSSStyleRule not inherit from CSSGroupingRule?, and agreed to the following:

  • RESOLVED: Change CSSStyleRule to inherit from CSSGroupingRule, modulo any discovered compat impact
The full IRC log of that discussion <TabAtkins> emilio: Nesting spec extends CSSSTyleRule by copypasting CSSGroupingRule API
<TabAtkins> emilio: Think there was a point in the past we discussed enhancing CSSSTyleRule but discarded that
<TabAtkins> emilio: So maybe instead we could have CSSStyleRule inherit from CSSGroupingRule? Then enhancements from either come to both.
<TabAtkins> emilio: Would make it more likely that changes (like using observablearray) would apply to both
<TabAtkins> emilio: This is all assuming there's no compat impact.
<TabAtkins> emilio: Assuming that, I think this is the right thing to do.
<TabAtkins> No objections from me, modulo possible compat impact we'll find.
<TabAtkins> (it would be *relatively* hard to have a compat impact here, I imagine)
<TabAtkins> astearns: Objections?
<TabAtkins> RESOLVED: Change CSSStyleRule to inherit from CSSGroupingRule, modulo any discovered compat impact
<TabAtkins> emilio: I'd also expect compat to be rare
<TabAtkins> emilio: Few people use instanceof, they use duck-typing
<TabAtkins> emilio: And we shipped .cssRules on CSSStyleRule without issue

tabatkins added a commit that referenced this issue Jul 14, 2023
…gRule, so remove the now extraneous definitions from Nesting.
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 31, 2023
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: 085c31f150d35371620bb3f884c9f20b396dbe08
gecko-reviewers: peterv, devtools-reviewers
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Aug 1, 2023
…v,devtools-reviewers

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
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Aug 1, 2023
…v,devtools-reviewers

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
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 1, 2023
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
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 1, 2023
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
ErichDonGubler pushed a commit to ErichDonGubler/firefox that referenced this issue Aug 4, 2023
…v,devtools-reviewers

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
ErichDonGubler pushed a commit to ErichDonGubler/firefox that referenced this issue Aug 4, 2023
…v,devtools-reviewers

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
@emilio
Copy link
Collaborator Author
emilio commented Oct 4, 2023

This has tests now, and spec text, so closing.

FWIW Gecko shipped this without issues.

@emilio emilio closed this as completed Oct 4, 2023
Lightning00Blade pushed a commit to Lightning00Blade/wpt that referenced this issue Dec 11, 2023
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
Loirooriol pushed a commit to Loirooriol/stylo that referenced this issue Mar 10, 2024
…v,devtools-reviewers

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
Loirooriol pushed a commit to Loirooriol/stylo that referenced this issue Mar 10, 2024
…v,devtools-reviewers

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants