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] Define how relative selectors serialize. #8970
Comments
I guess you could argue the same for nested implicit rules. So:
The media rule's |
Make parsing test not depend on under-specified serialization details, see w3c/csswg-drafts#8970. Differential Revision: https://phabricator.services.mozilla.com/D181125 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1835068 gecko-commit: dbe4f23432a64d66113d4ae1656844cc498e5011 gecko-reviewers: dshin
Make parsing test not depend on under-specified serialization details, see w3c/csswg-drafts#8970. Differential Revision: https://phabricator.services.mozilla.com/D181125
Make parsing test not depend on under-specified serialization details, see w3c/csswg-drafts#8970. Differential Revision: https://phabricator.services.mozilla.com/D181125 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1835068 gecko-commit: dbe4f23432a64d66113d4ae1656844cc498e5011 gecko-reviewers: dshin
Make parsing test not depend on under-specified serialization details, see w3c/csswg-drafts#8970. Differential Revision: https://phabricator.services.mozilla.com/D181125 UltraBlame original commit: dbe4f23432a64d66113d4ae1656844cc498e5011
Make parsing test not depend on under-specified serialization details, see w3c/csswg-drafts#8970. Differential Revision: https://phabricator.services.mozilla.com/D181125 UltraBlame original commit: dbe4f23432a64d66113d4ae1656844cc498e5011
Make parsing test not depend on under-specified serialization details, see w3c/csswg-drafts#8970. Differential Revision: https://phabricator.services.mozilla.com/D181125 UltraBlame original commit: dbe4f23432a64d66113d4ae1656844cc498e5011
Make parsing test not depend on under-specified serialization details, see w3c/csswg-drafts#8970. Differential Revision: https://phabricator.services.mozilla.com/D181125
The CSS Working Group just discussed
The full IRC log of that discussion<TabAtkins> emilio: Our impl does something different from wk/blink<TabAtkins> emilio: I prefer ours <TabAtkins> emilio: blink/wk serialize relative selectors as written <TabAtkins> emilio: [missed example] <TabAtkins> emilio: In firefox we add the nesting selector at parse time, so we serialize it as well <astearns> example in issue <TabAtkins> emilio: the spec isn't clear. i have a slight preference for firefox, because selectorText works regardless of whether your'e nesting or not <TabAtkins> emilio: which I think is a nice property to have - you can set selectorText to that of another rule regardless <TabAtkins> I'm happy to specify firefox's behavior, fwiw <fantasai> +1 for consistent output <TabAtkins> emilio: this should probably also apply to the implicit style rule we add when we define nested properties in a grouping rule <TabAtkins> +1 <TabAtkins> astearns: concerns? <TabAtkins> [none] <TabAtkins> proposed resolution: nested relative selectors serialize with the implicit nesting selector <TabAtkins> proposed resolution: and styles in grouping rules serialize with the implied rule around them <fantasai> +1 <TabAtkins> RESOLVED: Nested relative selectors serialize with the (implied) nesting selector <TabAtkins> RESOLVED: Grouping rules with direct styles serialize them with the (implied) style rule around them. |
The CSS Working Group just discussed The full IRC log of that discussion<TabAtkins> fantasai: I think the second reoslution was about styles directly in a media rule?<fantasai> TabAtkins: For conditional rules that contain declarations <TabAtkins> TabAtkins: It's about `.foo { @media (...) { display: block; } }` <TabAtkins> TabAtkins: the reoslution says this'll serialize with a `& { display: block; }` inside the media <fantasai> fantasai: But doesn't apply to nested rules, right? <TabAtkins> TabAtkins: Correct, it doesn't, just to non-style rules <emilio> s/nested rules/nested style rules <fantasai> fantasai: Concerned about consistency with nested rules <fantasai> TabAtkins: this makes the serialization match the OM <TabAtkins> emilio: Yes, also it makes the cssText valid regardless of nesting status <TabAtkins> emilio: direct properties dont' parse when the @media isn't nested <TabAtkins> (well, it parses, but they're discarded) <TabAtkins> fantasai: makes sense, thanks |
I understand the benefit of being able to consistenly use |
Yes, though the "smallest syntactic equivalent" in this case isn't valid in all contexts, so I think it's better to use the longer form since it's the "always valid" form. |
Update as per the resolutions in w3c/csswg-drafts#8970, making the mixed-properties test not tentative. Differential Revision: https://phabricator.services.mozilla.com/D183518 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1843349 gecko-commit: 269d9593b265d4e6c2bc0b1a610dc182258d641a gecko-reviewers: boris
…nt resolutions. r=boris Update as per the resolutions in w3c/csswg-drafts#8970, making the mixed-properties test not tentative. Differential Revision: https://phabricator.services.mozilla.com/D183518
Update as per the resolutions in w3c/csswg-drafts#8970, making the mixed-properties test not tentative. Differential Revision: https://phabricator.services.mozilla.com/D183518 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1843349 gecko-commit: 269d9593b265d4e6c2bc0b1a610dc182258d641a gecko-reviewers: boris
Ah forgot to tag this issue into the commit message as well, this is fixed in 4810428 |
…nt resolutions. r=boris Update as per the resolutions in w3c/csswg-drafts#8970, making the mixed-properties test not tentative. Differential Revision: https://phabricator.services.mozilla.com/D183518 UltraBlame original commit: 269d9593b265d4e6c2bc0b1a610dc182258d641a
…nt resolutions. r=boris Update as per the resolutions in w3c/csswg-drafts#8970, making the mixed-properties test not tentative. Differential Revision: https://phabricator.services.mozilla.com/D183518 UltraBlame original commit: 269d9593b265d4e6c2bc0b1a610dc182258d641a
…nt resolutions. r=boris Update as per the resolutions in w3c/csswg-drafts#8970, making the mixed-properties test not tentative. Differential Revision: https://phabricator.services.mozilla.com/D183518 UltraBlame original commit: 269d9593b265d4e6c2bc0b1a610dc182258d641a
Make parsing test not depend on under-specified serialization details, see w3c/csswg-drafts#8970. Differential Revision: https://phabricator.services.mozilla.com/D181125
https://drafts.csswg.org/css-nesting/#syntax says that you're supposed to parse relative selectors while nesting.
However it doesn't say anything about how to serialize them.
Blink and WebKit serialize the selector as written (so,
+ bar
).That's ok, I suppose, but I tend to think it'd be more useful if it serialized to the expanded form (
& + bar
). That means that.cssText
,.selectorText
, etc are always valid, independently of whether the rule is a nested style rule or not. So you can always dooneRule.selectorText = anotherRule.selectorText
.Thoughts?
The text was updated successfully, but these errors were encountered: