-
Notifications
You must be signed in to change notification settings - Fork 708
[css-contain-3] Contain specs disagree about canonical order of contain
keywords
#8600
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
Comments
It is. CSS Contain 3 should redefine the entire value definition (with the right canonical order), in my opinion. As noted in this comment, all other uses of New values in other specs assume concatenation with |
Yeah, css contain 3 should probably say "Value: [...]" and include the whole grammar, instead of specifying "New values" with a subset of the preexisting grammar. Also, it looks like I forgot to link to the relevant spec sections. Here they are (including level 2 as well for completeness): Level 2: https://drafts.csswg.org/css-contain-2/#contain-property Level 3: https://drafts.csswg.org/css-contain-3/#contain-property That last one is the one that needs fixing. |
Pushed a fix. Let me know if there are still issues there. |
Thanks! So with that fix, the Level 3 definition now reads:
i.e. the same ordering as in Level 2, but with That make sense to me, and it means the spec matches the tests that I linked in the initial comment here. (Firefox still mistakenly serializes |
css-contain-1 defined the grammar for
contain
withsize
at the start when using the longhand syntax, like so:...whereas css-contain-3 flips the order to put
size
(and the new valueinline-size
) at the end:The order matters for serialization, per https://drafts.csswg.org/cssom/#serialize-a-css-value , which says:
If you're looking at css-contain-1, you would expect
size
(and henceinline-size
) to serialize at the start of the list. If you're looking at css-contain-3, you'd expect them to serialize them at the end of the list.Looking at what immplementations do & WPT tests expect:
size
at the start, and Chromium/WebKit serializeinline-size
at the start too (whereas Firefox serializes it at the end, but probably should put it at the start, for consistency with the fact that we serializesize
at the start).size
andinline-size
to serialize at the start: https://wpt.fyi/results/css/css-contain/parsing/contain-valid.html and https://wpt.fyi/results/css/css-contain/parsing/contain-computed.htmlSo probably the ordering in css-contain-3 should be fixed to put
[size | inline-size]
at the start.(Perhaps we should also add
none | strict | content
keywords to it as well, while we're at it? I'm not sure whether it's problematic for those to be omitted from "New values" or not, given that we're repeating most of the preexisting grammar there except for those ones.)The text was updated successfully, but these errors were encountered: