Re: [csswg-drafts] [css-typed-om-1] Should css typed om support the same simplifications as css-values-4? (#9451)

Reading the specs, this is what it looks like to me:

 - cssom/css-values _simplifies_ during _parsing_.  (E.g. distribution, but not sorting).
 - cssom/css-values _sorts by unit_ during _serialization_. 

However:

- css-typed-om _does not_ simplify during "create an internal representation".
- css-typed-om _does not_ sort by unit during reification.

So this means:

 - Any internal representation you create from a `CSSMathValue` is the same thing you get when it's reified back. It's not simplified nor sorted. (Specified values).
 - An internal representation produced from _parsing_, will be simplified (but not sorted), and so it will reify as the simplified structure (again, unsorted).
 - An internal representation produced from a `CSSMathValue` will be _sorted_ when serialized (cssom/css-values), but not _simplified_.

This is a mess, but I think we can make it more sane if we do one of the following:

 - Move all sorting and simplification to _parsing_, or
 - Move all sorting and simplification to _serialization_. (Maybe better? https://github.com/w3c/csswg-drafts/issues/9437)

In any case, preserving `CSSMathValue`-produced values as-is seems like nice behavior worth maintaining.

cc @tabatkins 

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


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

Received on Thursday, 12 October 2023 10:48:32 UTC