Skip to content

[cssom-1][css-cascade-4] Define which longhands a shorthand maps to #7323

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

Closed
cdoublev opened this issue May 27, 2022 · 2 comments
Closed

[cssom-1][css-cascade-4] Define which longhands a shorthand maps to #7323

cdoublev opened this issue May 27, 2022 · 2 comments
Labels
Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. css-cascade-3

Comments

@cdoublev
Copy link
Collaborator

I would like to know if a shorthand is considered to map to all its sub-properties, including reset-only sub-properties.

If all properties that map to shorthand are not present in longhands, continue with the steps labeled shorthand loop.

According to the above step from serialize a CSS declaration block, I guess reset-only sub-properties are excluded from the longhands that the shorthand maps to. But from reading 3. Shorthand properties in Cascade 4, this is not clearly defined, and I'm not sure how to serialize a shorthand to empty string if one of its reset-only sub-property is declared with a non-initial value.

@Loirooriol
Copy link
Contributor

What makes you think they are excluded? I don't think they should behave different just because the shorthand always sets them to the same value.

@cdoublev
Copy link
Collaborator Author

cdoublev commented May 30, 2022

I'm sorry because I do not remember why I thought that, and I even wrote the opposite in my personal notes.

I may have been confused by the serialization of style.cssText in Chrome/Firefox after declaring a shorthand then one of its reset-only sub-property to a non-initial value. For example, after declaring border to 1px solid black then border-image-width to 1px, style.cssText does not include border, even though all its sub-properties are declared, which is better than serializing to border: ;, but that is because it would serialize to empty string and serialize a CSS declaration block handles that: If value is the empty string, continue with the steps labeled shorthand loop.

I'm closing this issue because no clarification is actually required if a shorthand also maps to its reset-only sub-properties. Sorry again.

@fantasai fantasai added css-cascade-3 Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. labels Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. css-cascade-3
Projects
None yet
Development

No branches or pull requests

3 participants