- From: Callum Law via GitHub <noreply@w3.org>
- Date: Tue, 03 Jun 2025 01:12:16 +0000
- To: public-css-archive@w3.org
Calme1709 has just created a new issue for https://github.com/w3c/csswg-drafts: == [cssom] Serialized CSS shorthand declaration has incorrect property == In the steps labeled shorthand loop within [serialize a css declaration block](https://www.w3.org/TR/cssom/#serialize-a-css-declaration-block), there is a case where we will serialize the declaration with an incorrect shorthand property. For example declarations: `border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;` are serialized as `border: 1px` despite missing the required `border-style-*` and `border-color-*` declarations rather than the correct `border-width: 1px`. This is because [serialize a css value](https://www.w3.org/TR/cssom/#serialize-a-css-value) returns a value for the first shorthand property that exactly maps to all `current longhands` (note step 1), not just `shorthand` The fix here would be to either: - Check that `current longhands` can be serialized as `shorthand` (i.e. `shorthand` exactly maps to all of the longhand properties in `current longhands` and `shorthand` can exactly represent the values of all the properties in `current shorthand`) before step 7 of shorthand loop. - Pass `shorthand` to [serialize a css value](https://www.w3.org/TR/cssom/#serialize-a-css-value) and only try to serialize as that shorthand. Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12262 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 3 June 2025 01:12:17 UTC