Chromium Code Reviews| 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..eb5503ed32705f54884ab03ba30b1747c7d6170c |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/animations/custom-properties/length-percentage-type-mismatch-no-interpolation.html |
| @@ -0,0 +1,43 @@ |
| +<!DOCTYPE html> |
| +<meta charset="UTF-8"> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<div id="target"></div> |
| +<script> |
| +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 is treated as neutral value'); |
|
suzyh_UTC10 (ex-contributor)
2017/02/17 04:59:58
Please elaborate this to document the particular c
alancutter (OOO until 2018)
2017/02/19 23:38:57
Done.
|
| + 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 is treated as neutral value'); |
| + animation.currentTime = 0.5; |
| + assert_equals(getComputedStyle(target).getPropertyValue('--percentage'), '70%', |
| + '--length is being animated'); |
| + animation.cancel(); |
| +}, "<percentage> properties don't accept lengths in animation keyframes"); |
| +</script> |
| +</body> |