Skip to content

Commit cda4b9f

Browse files
dbaronchromium-wpt-export-bot
authored andcommitted
Simplify arithmetic operations on calc-size() during animation.
This tries to ensure that math done by the animation code keeps calc-size() at the top level of an expression rather than creating arithmetic operations containing calc-size() expressions. This is a step towards following the spec's rules that calc-size() cannot be nested within calc() expressions. It also makes it easier for animation code to examine calc-size() values since they are always at the top level of the expression. Bug: 313072 Change-Id: I37ca94bcf3c0897f83fa84ed56f367522dc5c5e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5374566 Reviewed-by: Daniil Sakhapov <[email protected]> Commit-Queue: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1275978}
1 parent 7e1caa5 commit cda4b9f

7 files changed

+72
-1
lines changed

Diff for: css/css-sizing/animation/height-interpolation.html

+12
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,16 @@
109109
to: 'stretch',
110110
});
111111

112+
test_no_interpolation({
113+
property: 'height',
114+
from: 'max-content',
115+
to: neutralKeyframe,
116+
});
117+
118+
test_no_interpolation({
119+
property: 'height',
120+
from: neutralKeyframe,
121+
to: 'fit-content',
122+
});
123+
112124
</script>

Diff for: css/css-sizing/animation/max-height-interpolation.html

+12
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,16 @@
109109
to: 'min-content',
110110
});
111111

112+
test_no_interpolation({
113+
property: 'max-height',
114+
from: 'min-content',
115+
to: neutralKeyframe,
116+
});
117+
118+
test_no_interpolation({
119+
property: 'max-height',
120+
from: neutralKeyframe,
121+
to: 'max-content',
122+
});
123+
112124
</script>

Diff for: css/css-sizing/animation/max-width-interpolation.html

+12
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,16 @@
102102
to: 'min-content',
103103
});
104104

105+
test_no_interpolation({
106+
property: 'max-width',
107+
from: 'min-content',
108+
to: neutralKeyframe,
109+
});
110+
111+
test_no_interpolation({
112+
property: 'max-width',
113+
from: neutralKeyframe,
114+
to: 'fit-content',
115+
});
116+
105117
</script>

Diff for: css/css-sizing/animation/min-height-interpolation.html

+12
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,16 @@
102102
to: 'stretch',
103103
});
104104

105+
test_no_interpolation({
106+
property: 'min-height',
107+
from: 'fit-content',
108+
to: neutralKeyframe,
109+
});
110+
111+
test_no_interpolation({
112+
property: 'min-height',
113+
from: neutralKeyframe,
114+
to: 'min-content',
115+
});
116+
105117
</script>

Diff for: css/css-sizing/animation/min-width-interpolation.html

+12
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,16 @@
101101
to: 'max-content',
102102
});
103103

104+
test_no_interpolation({
105+
property: 'min-width',
106+
from: 'fit-content',
107+
to: neutralKeyframe,
108+
});
109+
110+
test_no_interpolation({
111+
property: 'min-width',
112+
from: neutralKeyframe,
113+
to: 'max-content',
114+
});
115+
104116
</script>

Diff for: css/css-sizing/animation/width-interpolation.html

+12
Original file line numberDiff line numberDiff line change
@@ -154,5 +154,17 @@
154154
to: 'min-content',
155155
});
156156

157+
test_no_interpolation({
158+
property: 'width',
159+
from: 'max-content',
160+
to: neutralKeyframe,
161+
});
162+
163+
test_no_interpolation({
164+
property: 'width',
165+
from: neutralKeyframe,
166+
to: 'min-content',
167+
});
168+
157169
</script>
158170
</body>

Diff for: css/css-values/calc-size/calc-size-height.tentative.html

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
{ value: "calc-size(calc-size(2in, 30px), 15em)", expected: "300px" },
3838
{ value: "calc-size(calc-size(min-content, 30px), 15em)", expected: "300px" },
3939
{ value: "calc-size(calc-size(min-content, size), size)", expected: "10px" },
40-
{ value: "calc(12% + calc-size(any, 31%))", expected_auto: "10px", expected_definite: "43px" },
4140
{ value: "calc-size(any, 31% + 12px)", expected_auto: "12px", expected_definite: "43px" },
4241
{ value: "calc-size(auto, size * 1.5)", expected: "15px" },
4342
];

0 commit comments

Comments
 (0)