Re: [csswg-drafts] Do the CSSOM part of #866 (#3109)

I understand that fixing this issue may not be a priority but can I assume that it can be partially fixed in [*serialize a CSS declaration block*](https://drafts.csswg.org/cssom-1/#serialize-a-css-declaration-block) (instead of *serialize a CSS value*, which seems to better seperation of concerns to ignore a legacy shorthand in a *CSS declaration block*):

```diff
- 3. If `property` maps to one or more shorthand properties, let `shorthands` be an array of those shorthand properties, in preferred order.
+ 3. If `property` maps to one or more shorthand properties, let `shorthands` be an array of those shorthand properties, in preferred order, ignoring legacy shorthands.
```

Also, there are some cases discussed in #8014 that I would like to be clarified.

Assuming an hypothetical legacy shorthand `shorthand` with syntax `a | b` and its target `longhand` with syntax `c | d`, a birectionnal mapping from `b` to `c`, I would expect the following serializations:

```js
style.shorthand = 'a'
style.shorthand; // 'a'
style.longhand;  // ''
style.cssText;   // 'shorthand: a;'

style.shorthand = 'b'
style.shorthand; // 'b'
style.longhand;  // 'c'
style.cssText;   // 'longhand: c;'

style.shorthand = 'c'
style.shorthand; // ''
style.longhand;  // ''
style.cssText;   // ''

style['--custom'] = 'a'
style.shorthand = 'var(--custom)'
style.shorthand; // 'var(--custom)'
style.longhand;  // 'var(--custom)'
style.cssText;   // 'shorthand: var(--custom);'
computedStyle.shorthand; // 'a'
computedStyle.longhand; // ''

style.longhand = 'c'
style.shorthand; // 'b'
style.longhand;  // 'c'
style.cssText;   // 'longhand: var(--custom);'

style.longhand = 'var(--custom)'
style.shorthand; // 'var(--custom)'
style.longhand;  // 'var(--custom)'
style.cssText;   // 'longhand: var(--custom);'
```

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


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

Received on Sunday, 6 November 2022 14:45:01 UTC