diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/css/css-align/animation | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-align/animation')
6 files changed, 368 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-align/animation/align-no-interpolation.html b/testing/web-platform/tests/css/css-align/animation/align-no-interpolation.html new file mode 100644 index 0000000000..037743bdd3 --- /dev/null +++ b/testing/web-platform/tests/css/css-align/animation/align-no-interpolation.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<link rel=author href="mailto:jarhar@chromium.org"> +<link rel=help href="https://github.com/w3c/csswg-drafts/issues/4441"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/interpolation-testcommon.js"></script> + +<body> +<script> +test_no_interpolation({ + property: 'align-content', + from: 'initial', + to: 'baseline' +}); + +test_no_interpolation({ + property: 'align-items', + from: 'initial', + to: 'baseline' +}); + +test_no_interpolation({ + property: 'align-self', + from: 'initial', + to: 'baseline' +}); +</script> diff --git a/testing/web-platform/tests/css/css-align/animation/column-gap-composition.html b/testing/web-platform/tests/css/css-align/animation/column-gap-composition.html new file mode 100644 index 0000000000..0054206cca --- /dev/null +++ b/testing/web-platform/tests/css/css-align/animation/column-gap-composition.html @@ -0,0 +1,65 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<title>column-gap composition</title> +<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-column-gap"> +<meta name="assert" content="column-gap 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> + +<body> +<script> +test_composition({ + property: 'column-gap', + underlying: '50px', + addFrom: '100px', + addTo: '200px', +}, [ + {at: -0.3, expect: '120px'}, + {at: 0, expect: '150px'}, + {at: 0.5, expect: '200px'}, + {at: 1, expect: '250px'}, + {at: 1.5, expect: '300px'}, +]); + +test_composition({ + property: 'column-gap', + underlying: '100px', + addFrom: '10px', + addTo: '2px', +}, [ + {at: -0.5, expect: '114px'}, + {at: 0, expect: '110px'}, + {at: 0.5, expect: '106px'}, + {at: 1, expect: '102px'}, + {at: 1.5, expect: '98px'}, // Value clamping should happen after composition. +]); + +test_composition({ + property: 'column-gap', + underlying: '50px', + addFrom: '100px', + replaceTo: '200px', +}, [ + {at: -0.3, expect: '135px'}, + {at: 0, expect: '150px'}, + {at: 0.5, expect: '175px'}, + {at: 1, expect: '200px'}, + {at: 1.5, expect: '225px'}, +]); + +test_composition({ + property: 'column-gap', + underlying: '100px', + addFrom: '100px', + addTo: 'normal', +}, [ + {at: -0.3, expect: '200px'}, + {at: 0, expect: '200px'}, + {at: 0.5, expect: 'normal'}, + {at: 1, expect: 'normal'}, + {at: 1.5, expect: 'normal'}, +]); +</script> +</body> diff --git a/testing/web-platform/tests/css/css-align/animation/column-gap-interpolation.html b/testing/web-platform/tests/css/css-align/animation/column-gap-interpolation.html new file mode 100644 index 0000000000..c2f02d3ba8 --- /dev/null +++ b/testing/web-platform/tests/css/css-align/animation/column-gap-interpolation.html @@ -0,0 +1,94 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<title>column-gap interpolation</title> +<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-column-gap"> +<meta name="assert" content="column-gap 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-gap: 90px; +} +.target { + column-count: 2; + column-gap: 10px; +} +.expected div { + opacity: 0.7; +} +.target > div { + height: 20px; + background-color: black; +} +.target.expected > div { + background-color: green; +} +</style> + +<body> +<template id='target-template'> + <div></div><div></div> +</template> +</body> + +<script> +test_interpolation({ + property: 'column-gap', + from: neutralKeyframe, + to: '40px', +}, [ + {at: -0.3, expect: '1px'}, + {at: 0, expect: '10px'}, + {at: 0.3, expect: '19px'}, + {at: 0.6, expect: '28px'}, + {at: 1, expect: '40px'}, + {at: 1.5, expect: '55px'}, +]); + +test_no_interpolation({ + property: 'column-gap', + from: 'initial', + to: '20px', +}); + +test_interpolation({ + property: 'column-gap', + from: 'inherit', + to: '20px', +}, [ + {at: -0.3, expect: '111px'}, + {at: 0, expect: '90px'}, + {at: 0.3, expect: '69px'}, + {at: 0.6, expect: '48px'}, + {at: 1, expect: '20px'}, + {at: 1.5, expect: '0px'}, +]); + +test_no_interpolation({ + property: 'column-gap', + from: 'unset', + to: '20px', +}); + +test_no_interpolation({ + property: 'column-gap', + from: 'normal', + to: '20px', +}); + +test_interpolation({ + property: 'column-gap', + from: '0px', + to: '100px' +}, [ + {at: -0.3, expect: '0'}, // column-gap can't be negative. + {at: 0, expect: '0'}, + {at: 0.3, expect: '30px'}, + {at: 0.6, expect: '60px'}, + {at: 1, expect: '100px'}, + {at: 1.5, expect: '150px'} +]); +</script> diff --git a/testing/web-platform/tests/css/css-align/animation/justify-no-interpolation.html b/testing/web-platform/tests/css/css-align/animation/justify-no-interpolation.html new file mode 100644 index 0000000000..a242fb73e9 --- /dev/null +++ b/testing/web-platform/tests/css/css-align/animation/justify-no-interpolation.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<link rel=author href="mailto:jarhar@chromium.org"> +<link rel=help href="https://w3c.github.io/csswg-drafts/css-align/#justify-items-property"> +<link rel=help href="https://w3c.github.io/csswg-drafts/css-align/#justify-self-property"> +<link rel=help href="https://github.com/w3c/csswg-drafts/issues/4441"> +<link rel=help href="https://drafts.csswg.org/css-transitions-2/#transition-property-property"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/interpolation-testcommon.js"></script> + +<body> +<script> +test_no_interpolation({ + property: 'justify-items', + from: 'initial', + to: 'baseline' +}); + +test_no_interpolation({ + property: 'justify-self', + from: 'initial', + to: 'baseline' +}); +</script> diff --git a/testing/web-platform/tests/css/css-align/animation/row-gap-composition.html b/testing/web-platform/tests/css/css-align/animation/row-gap-composition.html new file mode 100644 index 0000000000..238253adf0 --- /dev/null +++ b/testing/web-platform/tests/css/css-align/animation/row-gap-composition.html @@ -0,0 +1,65 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<title>row-gap composition</title> +<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-row-gap"> +<meta name="assert" content="row-gap 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> + +<body> +<script> +test_composition({ + property: 'row-gap', + underlying: '50px', + addFrom: '100px', + addTo: '200px', +}, [ + {at: -0.3, expect: '120px'}, + {at: 0, expect: '150px'}, + {at: 0.5, expect: '200px'}, + {at: 1, expect: '250px'}, + {at: 1.5, expect: '300px'}, +]); + +test_composition({ + property: 'row-gap', + underlying: '100px', + addFrom: '10px', + addTo: '2px', +}, [ + {at: -0.5, expect: '114px'}, + {at: 0, expect: '110px'}, + {at: 0.5, expect: '106px'}, + {at: 1, expect: '102px'}, + {at: 1.5, expect: '98px'}, // Value clamping should happen after composition. +]); + +test_composition({ + property: 'row-gap', + underlying: '50px', + addFrom: '100px', + replaceTo: '200px', +}, [ + {at: -0.3, expect: '135px'}, + {at: 0, expect: '150px'}, + {at: 0.5, expect: '175px'}, + {at: 1, expect: '200px'}, + {at: 1.5, expect: '225px'}, +]); + +test_composition({ + property: 'row-gap', + underlying: '100px', + addFrom: '100px', + addTo: 'normal', +}, [ + {at: -0.3, expect: '200px'}, + {at: 0, expect: '200px'}, + {at: 0.5, expect: 'normal'}, + {at: 1, expect: 'normal'}, + {at: 1.5, expect: 'normal'}, +]); +</script> +</body> diff --git a/testing/web-platform/tests/css/css-align/animation/row-gap-interpolation.html b/testing/web-platform/tests/css/css-align/animation/row-gap-interpolation.html new file mode 100644 index 0000000000..1d85ffa3b0 --- /dev/null +++ b/testing/web-platform/tests/css/css-align/animation/row-gap-interpolation.html @@ -0,0 +1,93 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<title>row-gap interpolation</title> +<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-row-gap"> +<meta name="assert" content="row-gap 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 { + row-gap: 90px; +} +.target { + row-gap: 10px; +} +.expected div { + opacity: 0.7; +} +.target > div { + height: 20px; + background-color: black; +} +.target.expected > div { + background-color: green; +} +</style> + +<body> +<template id='target-template'> + <div></div><div></div> +</template> +</body> + +<script> +test_interpolation({ + property: 'row-gap', + from: neutralKeyframe, + to: '40px', +}, [ + {at: -0.3, expect: '1px'}, + {at: 0, expect: '10px'}, + {at: 0.3, expect: '19px'}, + {at: 0.6, expect: '28px'}, + {at: 1, expect: '40px'}, + {at: 1.5, expect: '55px'}, +]); + +test_no_interpolation({ + property: 'row-gap', + from: 'initial', + to: '20px', +}); + +test_interpolation({ + property: 'row-gap', + from: 'inherit', + to: '20px', +}, [ + {at: -0.3, expect: '111px'}, + {at: 0, expect: '90px'}, + {at: 0.3, expect: '69px'}, + {at: 0.6, expect: '48px'}, + {at: 1, expect: '20px'}, + {at: 1.5, expect: '0px'}, +]); + +test_no_interpolation({ + property: 'row-gap', + from: 'unset', + to: '20px', +}); + +test_no_interpolation({ + property: 'row-gap', + from: 'normal', + to: '20px', +}); + +test_interpolation({ + property: 'row-gap', + from: '0px', + to: '100px' +}, [ + {at: -0.3, expect: '0'}, // row-gap can't be negative. + {at: 0, expect: '0'}, + {at: 0.3, expect: '30px'}, + {at: 0.6, expect: '60px'}, + {at: 1, expect: '100px'}, + {at: 1.5, expect: '150px'} +]); +</script> |