Re: [csswg-drafts] [cssom] Parsing value should not be seen as side effects free (#6451)

In your example, `flex: none` is equivalent to `flex: 0 0 auto`, where the 1st `0` goes to `flex-grow`, the 2nd `0` to `flex-shrink`, and `auto` to `flex-basis`.

But note that shorthands don't always accept values for all their longhands.  For example, take `border: 1px solid black`. It has the values for `border-*-width`, `border-*-style` and `border-*-color` longhands. But it also sets `border-image-source: none; border-image-slice: 100%; border-image-width: 1; border-image-outset: 0; border-image-repeat: stretch`. However, the `border` grammar doesn't accept e.g. `stretch`.

So in general this can't be done just by changing the list of component values. We would need a map associating each longhand with its own list, or something like that.

> Do you mean that the appropriate values for flex-grow, flex-shrink, flex-basis, ie. 0, 0, auto, should be "expanded" at this step, from the list of component value, eg. [Identifier('none')]?

I think that's what supposed to happen, yes, but it's handwaved.

> Does this implementation is strictly spec compliant?

Implementations don't have to follow the specs step by step. If the result is indistinguishable from what you should get according to the spec, then it's fine.

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


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

Received on Thursday, 15 July 2021 22:27:15 UTC