[csswg-drafts] [css-values-4] Simplification algorithm should possibly return single child for min/max (#9559)

johannesodland has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values-4] Simplification algorithm should possibly return single child for min/max ==
Step 5 for min/max of [simplify a calculation tree](https://drafts.csswg.org/css-values-4/#simplify-a-calculation-tree) currently states:

> If root is a Min or Max node, attempt to partially simplify it:
>
> [For each](https://infra.spec.whatwg.org/#list-iterate) node child of root’s children:
>
> If child is a numeric value with enough information to compare magnitudes with another child of the same unit (see note in previous step), and there are other children of root that are numeric values with the same unit, combine all such children with the appropriate operator per root, and replace child with the result, removing all other child nodes involved.
>
> Return root.

I might miss something, but this seems to simplify the children of the Min or Max node, but if you're left with only one child it seems to return the Min/Max node with a single child. 

Should it not return the child in this case? I belive an earlier version of the spec did the same as the step for Sum nodes: 

> If root has only a single child at this point, return the child. Otherwise, return root.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9559 using your GitHub account


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

Received on Sunday, 5 November 2023 07:11:26 UTC