Re: [csswg-drafts] Define canonical order of longhand properties (#6894)

> I think the order is clear in the spec.

I cannot understand how it can be clear from reading the value definition. `<bg-layer>`, which cannot match a value for `background-color`, appears before `<final-bg-layer>`, which can match `background-color`. 

Firefox is consistent and puts `background-color` first. Chrome puts it last when serializing a specified value but last for a computed value. I would have said it should come last.

Firefox also puts `background-repeat` and `background-attachment` before `background-position` and `background-size`, whereas the formers appears before the latters in the grammar. This order comes from CSS 2, not CSS 3, as explained to me by Sebastian.

The property definition tables already have a `Canonical order`. It is a different request, but I thought that it is only defined for shorthands, which would have allowed me to extract a list of shorthands from the data extracted by `w3c/webref`. But it is also defined for all properties, longhands and shorthands, usually with `per grammar`, like for `margin`, whose canonical order of its longhands is not explicitly defined, like for `font-variant`:

> The `font-variant` property is a shorthand for all `font-variant` subproperties:
>
> [list in canonical order]

It would be clearer with *The `font-variant` property is a shorthand for all `font-variant` subproperties defined below in canonical order*. You also reported in #5741 that the canonical order of shorthand subproperties does not seem to be clearly defined somewhere.

**TLDR:** `Canonical order` could be used to only define the canonical order of shorthand subproperties. This would answer both requests. The canonical order of `||` and `&&` is always clear to me.

But feel free to keep it closed: I ended up with searching for `shorthand` in the specs to manually extract a list of shorthands, and browser-compatibility is very low anyway when it comes to shorthand serialization.

-- 
GitHub Notification of comment by cdoublev
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6894#issuecomment-1234203727 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 1 September 2022 12:20:24 UTC