Skip to content

[css-contain-3] Contain specs disagree about canonical order of contain keywords #8600

Closed
@dholbert

Description

@dholbert

css-contain-1 defined the grammar for contain with size at the start when using the longhand syntax, like so:

Value: none | strict | content | [ size || layout || paint ]

...whereas css-contain-3 flips the order to put size (and the new value inline-size) at the end:

New values: layout || style || paint || [ size | inline-size ]

The order matters for serialization, per https://drafts.csswg.org/cssom/#serialize-a-css-value , which says:

If certain component values can appear in any order without changing the meaning of the value (a pattern typically represented by a double bar || in the value syntax), reorder the component values to use the canonical order of component values as given in the property definition table.

If you're looking at css-contain-1, you would expect size (and hence inline-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:

So 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.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions