Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[CSS Math Functions] Correctly serialize mod/rem/clamp root nodes
https://bugs.webkit.org/show_bug.cgi?id=259020 rdar://111960904 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 mod/rem/clamp, e.g. clamp(1px, 2px, 3px) now gives calc(2px) instead of clamp(1px, 2px, 3px). This is consistent with calc(clamp(1px, 2px, 3px)) being serialized as calc(2px). * LayoutTests/fast/css/calc-parsing-expected.txt: * LayoutTests/fast/css/calc-parsing.html: * LayoutTests/imported/w3c/web-platform-tests/css/css-values/clamp-length-serialize-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-values/clamp-length-serialize.html: * LayoutTests/imported/w3c/web-platform-tests/css/css-values/round-mod-rem-serialize-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-values/round-mod-rem-serialize.html: * Source/WebCore/css/calc/CSSCalcOperationNode.h: Canonical link: https://commits.webkit.org/265886@main
- Loading branch information
Showing
7 changed files
with
37 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...tTests/imported/w3c/web-platform-tests/css/css-values/clamp-length-serialize-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
|
||
PASS e.style['letter-spacing'] = "clamp(1px, 2px, 3px)" should set the property value | ||
FAIL e.style['letter-spacing'] = "clamp(1px, 2px, clamp(2px, 3px, 4px))" should set the property value assert_equals: serialization should be canonical expected "clamp(1px, 2px, clamp(2px, 3px, 4px))" but got "clamp(1px, 2px, 3px)" | ||
PASS e.style['letter-spacing'] = "calc(clamp(1px, 2px, 3px))" should set the property value | ||
PASS e.style['letter-spacing'] = "clamp(1px, 2px, clamp(2px, 3px, 4px))" should set the property value | ||
PASS e.style['letter-spacing'] = "calc(clamp(1px, 2px, clamp(2px, 3px, 4px)))" should set the property value | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters