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

[cssom] Define "canonical order". #5741

Open
emilio opened this issue Nov 24, 2020 · 2 comments
Open

[cssom] Define "canonical order". #5741

emilio opened this issue Nov 24, 2020 · 2 comments
Labels
cssom-1 Current Work

Comments

@emilio
Copy link
Collaborator

emilio commented Nov 24, 2020

CSSOM makes references to "canonical order" in a bunch of places to refer to the order in which a shorthand expands to their longhands.

For example, for:

flex: 0; flex-grow: inherit;

Browsers serialize it as:

flex-shrink: 1; flex-basis: 0%; flex-grow: inherit;

which means that "flex" expands "flex-shrink" before "flex-basis". I don't think that's defined anywhere, and it probably should.

cc @fantasai @tabatkins

@emilio emilio added the cssom-1 Current Work label Nov 24, 2020
@cdoublev
Copy link
Collaborator

cdoublev commented Jul 14, 2021

"[...] reorder the component values to use the canonical order of component values as given in the property definition table

I spent several days on the CSSOM specification and while searching for an issue similar to mine, I remembered this part. Sorry if that doesn't help answer this issue.

Related: #6894.

@SamB
Copy link
Contributor

SamB commented Jul 31, 2023

Hmm. Is that one "canonical order" or two?

Either way, this definitely needs to define the meaning of "Canonical order: per grammar", and if that definition does not work on all possible grammars, you might want some sort of lint to warn you of cases where it doesn't work. For example, does it actually make any sense for https://drafts.csswg.org/css-backgrounds/#propdef-border-width? The grammar isn't particularly complicated, but the mapping to longhand properties is defined in the prose, not the grammar.

Regardless of the above, bikeshed needs a better place to link these table entries to than https://www.w3.org/TR/cssom/#serializing-css-values (added in speced/bikeshed@ed3425a).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cssom-1 Current Work
Projects
None yet
Development

No branches or pull requests

3 participants