Index: LayoutTests/animations/interpolation/transform-properties-interpolation.html |
diff --git a/LayoutTests/animations/interpolation/transform-properties-interpolation.html b/LayoutTests/animations/interpolation/transform-properties-interpolation.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bce7f27be0fb0e1ce713c51817a9946834ce7289 |
--- /dev/null |
+++ b/LayoutTests/animations/interpolation/transform-properties-interpolation.html |
@@ -0,0 +1,189 @@ |
+<!DOCTYPE html> |
+<meta charset="UTF-8"> |
+<style> |
+.target { |
+ width: 100px; |
+ height: 100px; |
+ background-color: black; |
+} |
+.expected { |
+ background-color: green; |
+} |
+</style> |
+<body> |
+<template id="target-template"> |
+<div></div> |
+</template> |
+<script src="resources/interpolation-test.js"></script> |
+<script> |
+ |
+assertInterpolation({ |
+ property: 'translate', |
+ from: '-100px', |
+ to: '100px', |
+}, [ |
+ {at: -1, is: '-300px'}, |
+ {at: 0, is: '-100px'}, |
+ {at: 0.25, is: '-50px'}, |
+ {at: 0.75, is: '50px'}, |
+ {at: 1, is: '100px'}, |
+ {at: 2, is: '300px'}, |
+]); |
+ |
+assertInterpolation({ |
+ property: 'translate', |
+ from: '-100%', |
+ to: '100%', |
+}, [ |
+ {at: -1, is: '-300%'}, |
+ {at: 0, is: '-100%'}, |
+ {at: 0.25, is: '-50%'}, |
+ {at: 0.75, is: '50%'}, |
+ {at: 1, is: '100%'}, |
+ {at: 2, is: '300%'}, |
+]); |
+ |
+assertInterpolation({ |
+ property: 'translate', |
+ from: '-100px -50px', |
+ to: '100px 50px', |
+}, [ |
+ {at: -1, is: '-300px -150px'}, |
+ {at: 0, is: '-100px -50px'}, |
+ {at: 0.25, is: '-50px -25px'}, |
+ {at: 0.75, is: '50px 25px'}, |
+ {at: 1, is: '100px 50px'}, |
+ {at: 2, is: '300px 150px'}, |
+]); |
+ |
+assertInterpolation({ |
+ property: 'translate', |
+ from: '-100px -50px 100px', |
+ to: '100px 50px 0px', |
+}, [ |
+ {at: -1, is: '-300px -150px 200px'}, |
+ {at: 0, is: '-100px -50px 100px'}, |
+ {at: 0.25, is: '-50px -25px 75px'}, |
+ {at: 0.75, is: '50px 25px 25px'}, |
+ {at: 1, is: '100px 50px 0px'}, |
+ {at: 2, is: '300px 150px -100px'}, |
+]); |
+ |
+assertInterpolation({ |
+ property: 'scale', |
+ from: '-10', |
+ to: '10', |
+}, [ |
+ {at: -1, is: '-30'}, |
+ {at: 0, is: '-10'}, |
+ {at: 0.25, is: '-5'}, |
+ {at: 0.75, is: '5'}, |
+ {at: 1, is: '10'}, |
+ {at: 2, is: '30'}, |
+]); |
+ |
+assertInterpolation({ |
+ property: 'scale', |
+ from: '-10 5', |
+ to: '10 -5', |
+}, [ |
+ {at: -1, is: '-30 15'}, |
+ {at: 0, is: '-10 5'}, |
+ {at: 0.25, is: '-5 2.5'}, |
+ {at: 0.75, is: '5 -2.5'}, |
+ {at: 1, is: '10 -5'}, |
+ {at: 2, is: '30 -15'}, |
+]); |
+ |
+assertInterpolation({ |
+ property: 'scale', |
+ from: '-10 5 1', |
+ to: '10 -5 0', |
+}, [ |
+ {at: -1, is: '-30 15 2'}, |
+ {at: 0, is: '-10 5 1'}, |
+ {at: 0.25, is: '-5 2.5 0.75'}, |
+ {at: 0.75, is: '5 -2.5 0.25'}, |
+ {at: 1, is: '10 -5 0'}, |
+ {at: 2, is: '30 -15 -1'}, |
+]); |
+ |
+assertInterpolation({ |
+ property: 'rotate', |
+ from: '100deg', |
+ to: '-100deg', |
+}, [ |
+ {at: -1, is: '300deg'}, |
+ {at: 0, is: '100deg'}, |
+ {at: 0.25, is: '50deg'}, |
+ {at: 0.75, is: '-50deg'}, |
+ {at: 1, is: '-100deg'}, |
+ {at: 2, is: '-300deg'}, |
+]); |
+ |
+assertInterpolation({ |
+ property: 'rotate', |
+ from: '100deg', |
+ to: '-100deg', |
+}, [ |
+ {at: -1, is: '300deg'}, |
+ {at: 0, is: '100deg'}, |
+ {at: 0.25, is: '50deg'}, |
+ {at: 0.75, is: '-50deg'}, |
+ {at: 1, is: '-100deg'}, |
+ {at: 2, is: '-300deg'}, |
+]); |
+ |
+assertInterpolation({ |
+ property: 'rotate', |
+ from: '100deg 0 1 0', |
+ to: '-100deg 0 1 0', |
+}, [ |
+ {at: -1, is: '300deg 0 1 0'}, |
+ {at: 0, is: '100deg 0 1 0'}, |
+ {at: 0.25, is: '50deg 0 1 0'}, |
+ {at: 0.75, is: '-50deg 0 1 0'}, |
+ {at: 1, is: '-100deg 0 1 0'}, |
+ {at: 2, is: '-300deg 0 1 0'}, |
+]); |
+ |
+assertInterpolation({ |
+ property: 'rotate', |
+ from: '100deg 1 -2.5 3.64', |
+ to: '-100deg 1 -2.5 3.64', |
+}, [ |
+ {at: -1, is: '300deg 1 -2.5 3.64'}, |
+ {at: 0, is: '100deg 1 -2.5 3.64'}, |
+ {at: 0.25, is: '50deg 1 -2.5 3.64'}, |
+ {at: 0.75, is: '-50deg 1 -2.5 3.64'}, |
+ {at: 1, is: '-100deg 1 -2.5 3.64'}, |
+ {at: 2, is: '-300deg 1 -2.5 3.64'}, |
+]); |
+ |
+assertInterpolation({ |
+ property: 'rotate', |
+ from: '0deg 1 0 0', |
+ to: '10deg 0 1 0', |
+}, [ |
+ {at: -1, is: '-10deg 1 0 0'}, |
+ {at: 0, is: '0deg 1 0 0'}, |
+ {at: 0.25, is: '2.5deg 1 0 0'}, |
+ {at: 0.75, is: '7.5deg 1 0 0'}, |
+ {at: 1, is: '10deg 0 1 0'}, |
+ {at: 2, is: '20deg 1 0 0'}, |
+]); |
+ |
+assertInterpolation({ |
+ property: 'rotate', |
+ from: '90deg 1 1 0', |
+ to: '180deg 0 1 1', |
+}, [ |
+ {at: -1, is: '120deg 0.41 -0.41 -0.82'}, |
+ {at: 0, is: '90deg 1 1 0'}, |
+ {at: 0.25, is: '82.76deg 0.8 0.27 -0.53'}, |
+ {at: 0.75, is: '138.89deg 0.27 -0.54 -0.8'}, |
+ {at: 1, is: '180deg 0 1 1'}, |
+ {at: 2, is: '90deg 0.71 0 -0.71'}, |
+]); |
+</script> |
+</body> |