diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-multicol/animation')
4 files changed, 377 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-multicol/animation/column-count-interpolation.html b/testing/web-platform/tests/css/css-multicol/animation/column-count-interpolation.html new file mode 100644 index 0000000000..66a7513265 --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/animation/column-count-interpolation.html @@ -0,0 +1,80 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<title>column-count interpolation</title> +<link rel="help" href="https://drafts.csswg.org/css-multicol-1/#cc"> +<meta name="assert" content="column-count supports animation by computed value"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/interpolation-testcommon.js"></script> + +<style> +.parent { + column-count: 30; +} +.target { + column-count: 10; +} +</style> + +<body></body> + +<script> +test_interpolation({ + property: 'column-count', + from: neutralKeyframe, + to: '20', +}, [ + {at: -0.5, expect: '5'}, + {at: 0, expect: '10'}, + {at: 0.3, expect: '13'}, + {at: 0.7, expect: '17'}, + {at: 1, expect: '20'}, + {at: 1.5, expect: '25'}, +]); + +test_no_interpolation({ + property: 'column-count', + from: 'auto', + to: '20', +}); + +test_interpolation({ + property: 'column-count', + from: 'inherit', + to: '20', +}, [ + {at: -0.5, expect: '35'}, + {at: 0, expect: '30'}, + {at: 0.3, expect: '27'}, + {at: 0.7, expect: '23'}, + {at: 1, expect: '20'}, + {at: 1.5, expect: '15'}, +]); + +test_interpolation({ + property: 'column-count', + from: '10', + to: '1' +}, [ + {at: -0.5, expect: '15'}, + {at: 0, expect: '10'}, + {at: 0.3, expect: '7'}, + {at: 0.7, expect: '4'}, + // Only positive integers are valid + {at: 1, expect: '1'}, + {at: 1.5, expect: '1'} +]); + +test_no_interpolation({ + property: 'column-count', + from: 'initial', + to: '5', +}); + +test_no_interpolation({ + property: 'column-count', + from: 'unset', + to: '5', +}); +</script> diff --git a/testing/web-platform/tests/css/css-multicol/animation/column-rule-color-interpolation.html b/testing/web-platform/tests/css/css-multicol/animation/column-rule-color-interpolation.html new file mode 100644 index 0000000000..3aba9446b4 --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/animation/column-rule-color-interpolation.html @@ -0,0 +1,105 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<title>column-rule-color interpolation</title> +<link rel="help" href="https://drafts.csswg.org/css-multicol-1/#crc"> +<meta name="assert" content="column-rule-color supports animation by computed value type"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/interpolation-testcommon.js"></script> + +<style> +.parent { + column-count: 2; + column-rule-color: rgb(70, 70, 170); +} +.target { + column-count: 2; + color: rgb(70, 170, 70); + column-rule-color: rgb(170, 70, 70); +} +</style> + +<body></body> + +<script> +test_interpolation({ + property: 'column-rule-color', + from: neutralKeyframe, + to: 'rgb(70, 170, 70)', +}, [ + {at: -0.5, expect: 'rgb(220, 20, 70)'}, + {at: 0, expect: 'rgb(170, 70, 70)'}, + {at: 0.3, expect: 'rgb(140, 100, 70)'}, + {at: 0.6, expect: 'rgb(110, 130, 70)'}, + {at: 1, expect: 'rgb(70, 170, 70)'}, + {at: 1.5, expect: 'rgb(20, 220, 70)'}, +]); + +test_interpolation({ + property: 'column-rule-color', + from: 'initial', + to: 'rgb(70, 70, 170)', +}, [ + {at: -0.5, expect: 'rgb(70, 220, 20)'}, + {at: 0, expect: 'rgb(70, 170, 70)'}, + {at: 0.3, expect: 'rgb(70, 140, 100)'}, + {at: 0.6, expect: 'rgb(70, 110, 130)'}, + {at: 1, expect: 'rgb(70, 70, 170)'}, + {at: 1.5, expect: 'rgb(70, 20, 220)'}, +]); + +test_interpolation({ + property: 'column-rule-color', + from: 'inherit', + to: 'rgb(70, 170, 70)', +}, [ + {at: -0.5, expect: 'rgb(70, 20, 220)'}, + {at: 0, expect: 'rgb(70, 70, 170)'}, + {at: 0.3, expect: 'rgb(70, 100, 140)'}, + {at: 0.6, expect: 'rgb(70, 130, 110)'}, + {at: 1, expect: 'rgb(70, 170, 70)'}, + {at: 1.5, expect: 'rgb(70, 220, 20)'}, +]); + +test_interpolation({ + property: 'column-rule-color', + from: 'currentcolor', + to: 'rgb(170, 70, 70)', +}, [ + {at: -0.5, expect: 'rgb(20, 220, 70)'}, + {at: 0, expect: 'rgb(70, 170, 70)'}, + {at: 0.3, expect: 'rgb(100, 140, 70)'}, + {at: 0.6, expect: 'rgb(130, 110, 70)'}, + {at: 1, expect: 'rgb(170, 70, 70)'}, + {at: 1.5, expect: 'rgb(220, 20, 70)'}, +]); + +test_interpolation({ + property: 'column-rule-color', + from: 'unset', + to: 'rgb(0, 255, 0)', +}, [ + {at: -5, expect: 'rgb(255, 0, 255)'}, + {at: -0.4, expect: 'rgb(98, 136, 98)'}, + {at: 0, expect: 'rgb(70, 170, 70)'}, + {at: 0.2, expect: 'rgb(56, 187, 56)'}, + {at: 0.6, expect: 'rgb(28, 221, 28)'}, + {at: 1, expect: 'rgb(0, 255, 0)'}, + {at: 1.5, expect: 'rgb(0, 255, 0)'}, +]); + +test_interpolation({ + property: 'column-rule-color', + from: 'orange', + to: 'blue' +}, [ + {at: -5, expect: '#ffff00'}, + {at: -0.4, expect: '#ffe700'}, + {at: 0, expect: 'orange'}, + {at: 0.2, expect: '#cc8433'}, + {at: 0.6, expect: '#664299'}, + {at: 1, expect: 'blue'}, + {at: 1.5, expect: 'blue'} +]); +</script> diff --git a/testing/web-platform/tests/css/css-multicol/animation/column-rule-width-interpolation.html b/testing/web-platform/tests/css/css-multicol/animation/column-rule-width-interpolation.html new file mode 100644 index 0000000000..d600d68ff1 --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/animation/column-rule-width-interpolation.html @@ -0,0 +1,101 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<title>column-rule-width interpolation</title> +<link rel="help" href="https://drafts.csswg.org/css-multicol-1/#crw"> +<meta name="assert" content="column-rule-width supports animation by computed value type"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/interpolation-testcommon.js"></script> + +<style> +.parent { + column-rule-width: 30px; +} +.target { + column-rule-width: 10px; +} +</style> + +<body></body> + +<script> +test_interpolation({ + property: 'column-rule-width', + from: neutralKeyframe, + to: '20px', +}, [ + {at: -0.3, expect: '7px'}, + {at: 0, expect: '10px'}, + {at: 0.3, expect: '13px'}, + {at: 0.6, expect: '16px'}, + {at: 1, expect: '20px'}, + {at: 1.5, expect: '25px'}, +]); + +test_interpolation({ + property: 'column-rule-width', + from: 'initial', + to: '20px', +}, [ + {at: -0.3, expect: '0px'}, + {at: 0, expect: '3px'}, + {at: 0.3, expect: '8.1px'}, + {at: 0.6, expect: '13.2px'}, + {at: 1, expect: '20px'}, + {at: 1.5, expect: '28.5px'}, +]); + +test_interpolation({ + property: 'column-rule-width', + from: 'inherit', + to: '20px', +}, [ + {at: -0.3, expect: '0px'}, + {at: 0, expect: '0px'}, + {at: 0.3, expect: '6px'}, + {at: 0.6, expect: '12px'}, + {at: 1, expect: '20px'}, + {at: 1.5, expect: '30px'}, +]); + +test_interpolation({ + property: 'column-rule-width', + from: 'unset', + to: '20px', +}, [ + {at: -0.3, expect: '0px'}, + {at: 0, expect: '3px'}, + {at: 0.3, expect: '8.1px'}, + {at: 0.6, expect: '13.2px'}, + {at: 1, expect: '20px'}, + {at: 1.5, expect: '28.5px'}, +]); + +test_interpolation({ + property: 'column-rule-width', + from: '0px', + to: '10px' +}, [ + {at: -0.3, expect: '0px'}, // CSS column-rule-width can't be negative. + {at: 0, expect: '0px'}, + {at: 0.3, expect: '3px'}, + {at: 0.6, expect: '6px'}, + {at: 1, expect: '10px'}, + {at: 1.5, expect: '15px'} +]); + +test_interpolation({ + property: 'column-rule-width', + from: '15px', + to: 'thick' +}, [ + {at: -2, expect: '35px'}, + {at: -0.3, expect: '18px'}, + {at: 0, expect: '15px'}, + {at: 0.3, expect: '12px'}, + {at: 0.6, expect: '9px'}, + {at: 1, expect: '5px'}, + {at: 1.5, expect: '0px'} +]); +</script> diff --git a/testing/web-platform/tests/css/css-multicol/animation/column-width-interpolation.html b/testing/web-platform/tests/css/css-multicol/animation/column-width-interpolation.html new file mode 100644 index 0000000000..fdb26353b4 --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/animation/column-width-interpolation.html @@ -0,0 +1,91 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<title>column-width interpolation</title> +<link rel="help" href="https://drafts.csswg.org/css-multicol-1/#cw"> +<meta name="assert" content="column-width supports animation by computed value type"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/interpolation-testcommon.js"></script> + +<style> +.parent { + column-width: 30px; +} +.target { + font-size: 0px; /* column-width "specified values must be greater than 0", so use font-size to achieve 0px computed value. */ + display: inline-block; + column-width: 10px; +} +</style> + +<body> +<template id="target-template"> + <div><div class="transformed"></div></div> +</template> +</body> + +<script> +test_interpolation({ + property: 'column-width', + from: neutralKeyframe, + to: '20px', +}, [ + {at: -20, expect: '1em'}, // column-width does not accept negative values + {at: -1, expect: '1em'}, // column-width does not accept negative values + {at: -0.3, expect: '7px'}, + {at: 0, expect: '10px'}, + {at: 0.3, expect: '13px'}, + {at: 0.6, expect: '16px'}, + {at: 1, expect: '20px'}, + {at: 1.5, expect: '25px'}, +]); + +test_no_interpolation({ + property: 'column-width', + from: 'initial', + to: '20px', +}); + +test_interpolation({ + property: 'column-width', + from: 'inherit', + to: '20px', +}, [ + {at: -20, expect: '230px'}, + {at: -1, expect: '40px'}, + {at: -0.3, expect: '33px'}, + {at: 0, expect: '30px'}, + {at: 0.3, expect: '27px'}, + {at: 0.6, expect: '24px'}, + {at: 1, expect: '20px'}, + {at: 1.5, expect: '15px'}, +]); + +test_no_interpolation({ + property: 'column-width', + from: 'unset', + to: '20px', +}); + +test_interpolation({ + property: 'column-width', + from: '50px', + to: '100px', +}, [ + {at: -20, expect: '1em'}, // column-width does not accept negative values + {at: -1, expect: '1em'}, // column-width does not accept negative values + {at: -0.3, expect: '35px'}, + {at: 0, expect: '50px'}, + {at: 0.3, expect: '65px'}, + {at: 0.6, expect: '80px'}, + {at: 1, expect: '100px'}, + {at: 1.5, expect: '125px'}, +]); + +test_no_interpolation({ + property: 'column-width', + from: '50px', + to: 'auto', +}); +</script> |