This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse the repository at this point in the history
[CSS Math Functions] Correctly serialize round() root nodes
https://bugs.webkit.org/show_bug.cgi?id=259035 rdar://111984509 Reviewed by Darin Adler. From the spec https://drafts.csswg.org/css-values-4/#calc-simplification: > If root is an operator node that’s not one of the calc-operator nodes, and all of its calculation children are numeric values with enough information to compute the operation root represents, return the result of running root’s operation using its children, expressed in the result’s canonical unit. We now always try to resolve the top-level round() function, e.g. round(up, 2px, 5px) now gives calc(5px) instead of round(up, 2px, 5px). This is consistent with calc(round(up, 2px, 5px)) being serialized as calc(5px). * LayoutTests/imported/w3c/web-platform-tests/css/css-values/round-mod-rem-serialize-expected.txt: * Source/WebCore/css/calc/CSSCalcOperationNode.cpp: (WebCore::CSSCalcOperationNode::simplifyNode): * Source/WebCore/css/calc/CSSCalcOperationNode.h: * Source/WebCore/platform/calc/CalcOperator.h: Remove unnecessary include. Canonical link: https://commits.webkit.org/265892@main
- Loading branch information
Showing 4 changed files with 5 additions and 7 deletions.