Bug 248925 - Sum & Product calculation node children should only get sorted for serialization
Summary: Sum & Product calculation node children should only get sorted for serialization
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 175733
  Show dependency treegraph
 
Reported: 2022-12-07 19:40 PST by Chris Dumez
Modified: 2022-12-08 10:32 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2022-12-07 19:40:00 PST
Sum & Product calculation node children should only get sorted for serialization, as per:
- https://drafts.csswg.org/css-values-4/#serialize-a-calculation-tree
- https://drafts.csswg.org/css-values-4/#sort-a-calculations-children

However, we were doing this eagerly after parsing the calculation value, during the simplification step:
- https://w3c.github.io/csswg-drafts/css-values/#calc-simplification

This is observable with CSS Typed OM since the following:
`CSSStyleValue.parse("width", "calc(1px + 1em)")` would get parsed as `new CSSMathSum(CSS.em(1), CSS.px(1))` instead of `new CSSMathSum(CSS.px(1), CSS.em(1))`
Comment 1 Chris Dumez 2022-12-07 19:47:28 PST
Pull request: https://github.com/WebKit/WebKit/pull/7301
Comment 2 EWS 2022-12-08 10:31:25 PST
Committed 257573@main (e06fc205e555): <https://commits.webkit.org/257573@main>

Reviewed commits have been landed. Closing PR #7301 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2022-12-08 10:32:18 PST
<rdar://problem/103136508>