| Index: third_party/WebKit/LayoutTests/animations/custom-properties/length-percentage-type-mismatch-no-interpolation.html
|
| diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/length-percentage-type-mismatch-no-interpolation.html b/third_party/WebKit/LayoutTests/animations/custom-properties/length-percentage-type-mismatch-no-interpolation.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5bdf67dbf957acf7a09177237e6e4f719f349d96
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/animations/custom-properties/length-percentage-type-mismatch-no-interpolation.html
|
| @@ -0,0 +1,45 @@
|
| +<!DOCTYPE html>
|
| +<meta charset="UTF-8">
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<div id="target"></div>
|
| +<script>
|
| +// The console warnings about "Invalid keyframe value" are expected for this test.
|
| +
|
| +setup(() => {
|
| + CSS.registerProperty({
|
| + name: '--length',
|
| + syntax: '<length>',
|
| + initialValue: '40px',
|
| + });
|
| +
|
| + CSS.registerProperty({
|
| + name: '--percentage',
|
| + syntax: '<percentage>',
|
| + initialValue: '40%',
|
| + });
|
| +});
|
| +
|
| +test(() => {
|
| + var animation = target.animate({'--length': ['10%', '100px']}, 1);
|
| + animation.currentTime = 0;
|
| + assert_equals(getComputedStyle(target).getPropertyValue('--length'), '40px',
|
| + 'percentage fails to parse and is treated as neutral value');
|
| + animation.currentTime = 0.5;
|
| + assert_equals(getComputedStyle(target).getPropertyValue('--length'), '70px',
|
| + '--length is being animated');
|
| + animation.cancel();
|
| +}, "<length> properties don't accept percentages in animation keyframes");
|
| +
|
| +test(() => {
|
| + var animation = target.animate({'--percentage': ['10px', '100%']}, 1);
|
| + animation.currentTime = 0;
|
| + assert_equals(getComputedStyle(target).getPropertyValue('--percentage'), '40%',
|
| + 'percentage fails to parse and is treated as neutral value');
|
| + animation.currentTime = 0.5;
|
| + assert_equals(getComputedStyle(target).getPropertyValue('--percentage'), '70%',
|
| + '--percentage is being animated');
|
| + animation.cancel();
|
| +}, "<percentage> properties don't accept lengths in animation keyframes");
|
| +</script>
|
| +</body>
|
|
|