Skip to content

Commit df2f5f4

Browse files
committed
calc() simplification for a multiplication should apply the multiplication to each value of an addition
https://bugs.webkit.org/show_bug.cgi?id=224376 Reviewed by Simon Fraser. LayoutTests/imported/w3c: Mark 99 WPT progressions. * web-platform-tests/css/css-backgrounds/animations/background-position-origin-interpolation-expected.txt: * web-platform-tests/css/css-shapes/animation/shape-outside-interpolation-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-margin-003-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-circle-010-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-circle-011-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-ellipse-010-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-ellipse-011-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-008-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-009-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-polygon-006-expected.txt: * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt: Source/WebCore: An expression such as calc(0.5 * (100% + 100px)) should be simplified to calc(50% + 50px). We produce these types of expressions when blending between a percentage and a dimension, and they can also be specified explicitly in style. * css/CSSCalculationValue.cpp: (WebCore::CSSCalcOperationNode::combineChildren): LayoutTests: Rebase some non-WPT tests to account for new results. * css3/calc/simplification-expected.txt: * transitions/background-position-transitions-expected.txt: * transitions/background-position-transitions.html: Canonical link: https://commits.webkit.org/236364@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 2e989dc commit df2f5f4

20 files changed

Lines changed: 187 additions & 117 deletions

LayoutTests/ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2021-04-09 Antoine Quint <graouts@webkit.org>
2+
3+
calc() simplification for a multiplication should apply the multiplication to each value of an addition
4+
https://bugs.webkit.org/show_bug.cgi?id=224376
5+
6+
Reviewed by Simon Fraser.
7+
8+
Rebase some non-WPT tests to account for new results.
9+
10+
* css3/calc/simplification-expected.txt:
11+
* transitions/background-position-transitions-expected.txt:
12+
* transitions/background-position-transitions.html:
13+
114
2021-04-09 Wenson Hsieh <wenson_hsieh@apple.com>
215

316
REGRESSION (r271660): Tap highlight no longer shows when tapping clickable elements without touch event listeners

LayoutTests/css3/calc/simplification-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This tests parse time simplification in calc()
88
100in * (6 * (5 - 4) / 8) => calc(7200px)
99
1px * (3 + 1/(7 + 1/(15 + 1/(1 + 1/(292 + 1/(1 + 1/(1 + 1/(1 + 1)))))))) => calc(3.1415926535583574px)
1010
100pc * 20 + 100rem * 10 - 100ch * 5 + 100pc => calc(-500ch + 33600px + 1000rem)
11-
((100px + 20 * 5px) * 10 - 5 * (10em * 5 + 10em)) * 2 => calc(2 * (-300em + 2000px))
11+
((100px + 20 * 5px) * 10 - 5 * (10em * 5 + 10em)) * 2 => calc(-600em + 4000px)
1212
100px + 1in => calc(196px)
1313
10 * 10px + 0.5 * 2in => calc(196px)
1414
100px + 1in + 10% => calc(10% + 196px)

LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ PASS - "webkitShapeOutside" property for "polygon2-box" element at 1s saw someth
1919
PASS - "webkitShapeOutside" property for "circle-auto-box" element at 1s saw something close to: circle(50% at 50% 50%)
2020
PASS - "webkitShapeOutside" property for "circle-to-topleft-box" element at 1s saw something close to: circle(35% at 25% 25%)
2121
PASS - "webkitShapeOutside" property for "circle-to-topleft-box" element at 1s saw something close to: circle(35% at 25% 25%)
22-
PASS - "webkitShapeOutside" property for "circle-to-bottomright-using-keyword-box" element at 1s saw something close to: circle(35% at calc(25% + (0.5 * (100% + 0px))) calc(25% + (0.5 * (100% + 0px))))
23-
PASS - "webkitShapeOutside" property for "circle-to-bottomright-using-keyword-box" element at 1s saw something close to: circle(35% at calc(25% + (0.5 * (100% + 0px))) calc(25% + (0.5 * (100% + 0px))))
22+
PASS - "webkitShapeOutside" property for "circle-to-bottomright-using-keyword-box" element at 1s saw something close to: circle(35% at calc(75% + 0px) calc(75% + 0px))
23+
PASS - "webkitShapeOutside" property for "circle-to-bottomright-using-keyword-box" element at 1s saw something close to: circle(35% at calc(75% + 0px) calc(75% + 0px))
2424
PASS - "webkitShapeOutside" property for "circle-to-bottomright-extended-box" element at 1s saw something close to: circle(35% at 75% 75%)
25-
PASS - "webkitShapeOutside" property for "circle-to-bottomright-extended-using-keyword-box" element at 1s saw something close to: circle(35% at 70% calc(25% + (0.5 * (100% - 20px))))
26-
PASS - "webkitShapeOutside" property for "circle-to-bottomright-extended-using-keyword-2-box" element at 1s saw something close to: circle(35% at 70% calc(25% + (0.5 * (100% - 10px))))
25+
PASS - "webkitShapeOutside" property for "circle-to-bottomright-extended-using-keyword-box" element at 1s saw something close to: circle(35% at 70% calc(75% - 10px))
26+
PASS - "webkitShapeOutside" property for "circle-to-bottomright-extended-using-keyword-2-box" element at 1s saw something close to: circle(35% at 70% calc(75% - 5px)) border-box
2727

LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@
143143
["circle-auto-anim", 1, "circle-auto-box", "webkitShapeOutside", "circle(50% at 50% 50%)", 0.05],
144144
["circle-to-topleft-anim", 1, "circle-to-topleft-box", "webkitShapeOutside", "circle(35% at 25% 25%)", 0.05],
145145
["circle-to-topleft-anim", 1, "circle-to-topleft-box", "webkitShapeOutside", "circle(35% at 25% 25%)", 0.05],
146-
["circle-to-bottomright-using-keyword-anim", 1, "circle-to-bottomright-using-keyword-box", "webkitShapeOutside", "circle(35% at calc(25% + (0.5 * (100% + 0px))) calc(25% + (0.5 * (100% + 0px))))", 0.05],
147-
["circle-to-bottomright-using-keyword-anim", 1, "circle-to-bottomright-using-keyword-box", "webkitShapeOutside", "circle(35% at calc(25% + (0.5 * (100% + 0px))) calc(25% + (0.5 * (100% + 0px))))", 0.05],
146+
["circle-to-bottomright-using-keyword-anim", 1, "circle-to-bottomright-using-keyword-box", "webkitShapeOutside", "circle(35% at calc(75% + 0px) calc(75% + 0px))", 0.05],
147+
["circle-to-bottomright-using-keyword-anim", 1, "circle-to-bottomright-using-keyword-box", "webkitShapeOutside", "circle(35% at calc(75% + 0px) calc(75% + 0px))", 0.05],
148148
["circle-to-bottomright-extended-anim", 1, "circle-to-bottomright-extended-box", "webkitShapeOutside", "circle(35% at 75% 75%)", 0.05],
149-
["circle-to-bottomright-extended-using-keyword-anim", 1, "circle-to-bottomright-extended-using-keyword-box", "webkitShapeOutside", "circle(35% at 70% calc(25% + (0.5 * (100% - 20px))))", 0.01],
150-
["circle-to-bottomright-extended-using-keyword-2-anim", 1, "circle-to-bottomright-extended-using-keyword-2-box", "webkitShapeOutside", "circle(35% at 70% calc(25% + (0.5 * (100% - 10px))))", 0.01],
149+
["circle-to-bottomright-extended-using-keyword-anim", 1, "circle-to-bottomright-extended-using-keyword-box", "webkitShapeOutside", "circle(35% at 70% calc(75% - 10px))", 0.01],
150+
["circle-to-bottomright-extended-using-keyword-2-anim", 1, "circle-to-bottomright-extended-using-keyword-2-box", "webkitShapeOutside", "circle(35% at 70% calc(75% - 5px)) border-box", 0.01],
151151
];
152152

153153
runAnimationTest(expectedValues);

LayoutTests/imported/w3c/ChangeLog

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
2021-04-09 Antoine Quint <graouts@webkit.org>
2+
3+
calc() simplification for a multiplication should apply the multiplication to each value of an addition
4+
https://bugs.webkit.org/show_bug.cgi?id=224376
5+
6+
Reviewed by Simon Fraser.
7+
8+
Mark 99 WPT progressions.
9+
10+
* web-platform-tests/css/css-backgrounds/animations/background-position-origin-interpolation-expected.txt:
11+
* web-platform-tests/css/css-shapes/animation/shape-outside-interpolation-expected.txt:
12+
* web-platform-tests/css/css-shapes/shape-outside/values/shape-margin-003-expected.txt:
13+
* web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-circle-010-expected.txt:
14+
* web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-circle-011-expected.txt:
15+
* web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-ellipse-010-expected.txt:
16+
* web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-ellipse-011-expected.txt:
17+
* web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-008-expected.txt:
18+
* web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-009-expected.txt:
19+
* web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-polygon-006-expected.txt:
20+
* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:
21+
122
2021-04-08 Antoine Quint <graouts@webkit.org>
223

324
calc() values resulting from blending mixed type lengths should be simplified

0 commit comments

Comments
 (0)