diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-masking/animations/clip-interpolation.html')
-rw-r--r-- | testing/web-platform/tests/css/css-masking/animations/clip-interpolation.html | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-masking/animations/clip-interpolation.html b/testing/web-platform/tests/css/css-masking/animations/clip-interpolation.html new file mode 100644 index 0000000000..322ebd724e --- /dev/null +++ b/testing/web-platform/tests/css/css-masking/animations/clip-interpolation.html @@ -0,0 +1,117 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<title>clip interpolation</title> +<link rel="help" href="https://drafts.fxtf.org/css-masking-1/#clip-property"> +<meta name="assert" content="clip supports animation"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/interpolation-testcommon.js"></script> + +<style> +.container { + width: 80px; + height: 80px; + background: black; + display: inline-block; + padding: 5px; +} + +.container:nth-child(2n) { + background: green; +} + +.parent { + clip: rect(100px, 0px, 100px, 0px); +} + +.target { + width: 80px; + height: 80px; + display: inline-block; + position: absolute; + background: white; + clip: rect(0px, 100px, 0px, 100px); +} +</style> + +<body> +<template id="target-template"> +<div class="container"><div class="target"></div></div> +</template> +<script> +test_interpolation({ + property: 'clip', + from: neutralKeyframe, + to: 'rect(20px, 20px, 20px, 20px)', +}, [ + {at: -1, expect: 'rect(-20px 180px -20px 180px)'}, + {at: 0, expect: 'rect(0px 100px 0px 100px)'}, + {at: 0.25, expect: 'rect(5px 80px 5px 80px)'}, + {at: 0.75, expect: 'rect(15px 40px 15px 40px)'}, + {at: 1, expect: 'rect(20px 20px 20px 20px)'}, + {at: 2, expect: 'rect(40px -60px 40px -60px)'}, +]); + +test_no_interpolation({ + property: 'clip', + from: 'initial', + to: 'rect(20px, 20px, 20px, 20px)', +}); + +test_interpolation({ + property: 'clip', + from: 'inherit', + to: 'rect(20px, 20px, 20px, 20px)', +}, [ + {at: -1, expect: 'rect(180px -20px 180px -20px)'}, + {at: 0, expect: 'rect(100px 0px 100px 0px)'}, + {at: 0.25, expect: 'rect(80px 5px 80px 5px)'}, + {at: 0.75, expect: 'rect(40px 15px 40px 15px)'}, + {at: 1, expect: 'rect(20px 20px 20px 20px)'}, + {at: 2, expect: 'rect(-60px 40px -60px 40px)'}, +]); + +test_no_interpolation({ + property: 'clip', + from: 'unset', + to: 'rect(20px, 20px, 20px, 20px)', +}); + +test_interpolation({ + property: 'clip', + from: 'rect(0px, 75px, 80px, 10px)', + to: 'rect(0px, 100px, 90px, 5px)' +}, [ + {at: -1, expect: 'rect(0px, 50px, 70px, 15px)'}, + {at: 0, expect: 'rect(0px, 75px, 80px, 10px)'}, + {at: 0.25, expect: 'rect(0px, 81.25px, 82.5px, 8.75px)'}, + {at: 0.75, expect: 'rect(0px, 93.75px, 87.5px, 6.25px)'}, + {at: 1, expect: 'rect(0px, 100px, 90px, 5px)'}, + {at: 2, expect: 'rect(0px, 125px, 100px, 0px)'}, +]); + +test_no_interpolation({ + property: 'clip', + from: 'rect(auto, auto, auto, 10px)', + to: 'rect(20px, 50px, 50px, auto)' +}); + +test_no_interpolation({ + property: 'clip', + from: 'rect(auto, 0px, auto, 10px)', + to: 'rect(auto, 50px, 50px, auto)' +}); + +test_no_interpolation({ + property: 'clip', + from: 'auto', + to: 'rect(0px, 50px, 50px, 0px)' +}); + +test_no_interpolation({ + property: 'clip', + from: 'rect(0px, 50px, 50px, 0px)', + to: 'auto' +}); +</script> |