[webkit-changes] [WebKit/WebKit] 9ff962: [CSS Math Functions] Correctly serialize round() r...
Tim Nguyen
noreply at github.com
Sun Jul 9 17:29:12 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9ff9626c9a61df3cb1ad38b6017fa6d3b7ee036f
https://github.com/WebKit/WebKit/commit/9ff9626c9a61df3cb1ad38b6017fa6d3b7ee036f
Author: Tim Nguyen <ntim at apple.com>
Date: 2023-07-09 (Sun, 09 Jul 2023)
Changed paths:
M LayoutTests/imported/w3c/web-platform-tests/css/css-values/round-mod-rem-serialize-expected.txt
M Source/WebCore/css/calc/CSSCalcOperationNode.cpp
M Source/WebCore/css/calc/CSSCalcOperationNode.h
M Source/WebCore/platform/calc/CalcOperator.h
Log Message:
-----------
[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
More information about the webkit-changes
mailing list