Skip to content

Commit c87bc60

Browse files
lilleschromium-wpt-export-bot
authored andcommitted
Disallow percentage values in number interpolations
line-height and registered custom property "<number>|<percentage>" incorrectly mixed numbers and percentages in interpolations. The text-size-adjust accepts percentages, not numbers. It still worked using interpolable numbers, but it's more correct to make it a percentage interpolation type. Bug: 407800771, 408030109 Change-Id: I23fc95c9d208bf4b6f83f85164722b1df7df8724 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6425427 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#1442670}
1 parent e0308c7 commit c87bc60

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

css/CSS2/linebox/animations/line-height-interpolation.html

+17
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,21 @@
183183
from: '14q',
184184
to: 'normal',
185185
});
186+
187+
test_no_interpolation({
188+
property: 'line-height',
189+
from: '1',
190+
to: '200%',
191+
});
192+
193+
test_interpolation({
194+
property: 'line-height',
195+
from: '100%',
196+
to: '200%',
197+
}, [
198+
{at: 0, expect: '100%'},
199+
{at: 0.3, expect: '130%'},
200+
{at: 0.6, expect: '160%'},
201+
{at: 1, expect: '200%'},
202+
]);
186203
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<title>CSS Properties and Values API Test: Transitions between percentages and numbers are discrete</title>
3+
<link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api-1/">
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="../resources/utils.js"></script>
7+
<div id="target"></div>
8+
<script>
9+
transition_test({
10+
syntax: "<number>|<percentage>",
11+
from: "100",
12+
to: "200%",
13+
expected: "200%",
14+
behavior: 'allow-discrete',
15+
}, 'A custom property with <number>|<percentage> syntax should not transition between values of the different types');
16+
</script>

0 commit comments

Comments
 (0)