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][css-grid] Do shorthands serialize with the resolved value of their longhands? #11382

Open
Loirooriol opened this issue Dec 16, 2024 · 0 comments
Labels
css-grid-1 css-grid-2 Subgrid; Current Work cssom-1 Current Work

Comments

@Loirooriol
Copy link
Contributor

Loirooriol commented Dec 16, 2024

Let's say that the longhands of a shorthand have a resolved value which is different than their computed value.

How should the shorthand serialize? Some examples:

  • For position: relative; inset: auto, all browsers serialize top as 0px. But Firefox serializes inset as auto, while Blink and WebKit say 0px.
  • For margin: auto, all browsers serialize margin-top as 0px. But Firefox serializes margin as auto, while Blink and WebKit say 0px.
  • For display: grid; grid-template-rows: repeat(2, 1px), all browsers serialize grid-template-rows as 1px 1px. But Firefox and Blink serialize grid-template as repeat(2, 1px) / none, while WebKit says 1px 1px / none.
  • For display: grid; grid-template: 1px / 2px and ::before { content: ""; grid-row-end: 1 }, all browsers serialize grid-template-rows as 0px 1px. But Firefox and Blink serialize grid-template as 1px / 2px, while WebKit says 0px 1px / 2px.
  • For display: grid; grid-template: 1px / none; width: 100px and ::before { content: ""; grid-row-end: 1 }, all browsers serialize grid-template-rows as 0px 1px and grid-template-columns as 100px. But Firefox serializes grid-template as 1px / none, Blink as 1px / 100px, and WebKit as 0px 1px / 100px.

Grid is especially nonsensical.

I tend to agree with WebKit: shorthands should serialize as if the computed value of the longhands was their resolved value.

@Loirooriol Loirooriol added css-grid-1 cssom-1 Current Work css-grid-2 Subgrid; Current Work labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-grid-1 css-grid-2 Subgrid; Current Work cssom-1 Current Work
Projects
None yet
Development

No branches or pull requests

1 participant