Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Unified Diff: LayoutTests/animations/interpolation/translate-interpolation.html

Issue 1196913005: Implement animations for Independent CSS Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix rotate-interpolation test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/animations/interpolation/translate-interpolation.html
diff --git a/LayoutTests/animations/interpolation/translate-interpolation.html b/LayoutTests/animations/interpolation/translate-interpolation.html
new file mode 100644
index 0000000000000000000000000000000000000000..5051cbdf058ba8794153faa95092a1a08ddc3de8
--- /dev/null
+++ b/LayoutTests/animations/interpolation/translate-interpolation.html
@@ -0,0 +1,178 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<style>
+.parent {
+ translate: 100px 200px 300px;
+}
+.target {
+ width: 100px;
+ height: 100px;
+ background-color: black;
+}
+.expected {
+ background-color: green;
+}
+</style>
+<template id="target-template">
+<div class="parent">
+ <div class="target"></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: 'translate',
+ from: '0px',
+ to: '-100px -50px 100px',
+}, [
+ {at: -1, is: '100px 50px -100px'},
+ {at: 0, is: '0px'},
+ {at: 0.25, is: '-25px -12.5px 25px'},
+ {at: 0.75, is: '-75px -37.5px 75px'},
+ {at: 1, is: '-100px -50px 100px'},
+ {at: 2, is: '-200px -100px 200px'},
+]);
+
+assertInterpolation({
+ property: 'translate',
+ from: '-100px -50px 100px',
+ to: '0px',
+}, [
+ {at: -1, is: '-200px -100px 200px'},
+ {at: 0, is: '-100px -50px 100px'},
+ {at: 0.25, is: '-75px -37.5px 75px'},
+ {at: 0.75, is: '-25px -12.5px 25px'},
+ {at: 1, is: '0px'},
+ {at: 2, is: '100px 50px -100px'},
+]);
+
+assertInterpolation({
+ property: 'translate',
+ from: 'inherit',
+ to: '200px 100px 200px',
+}, [
+ {at: -1, is: '0px 300px 400px'},
+ {at: 0, is: '100px 200px 300px'},
+ {at: 0.25, is: '125px 175px 275px'},
+ {at: 0.75, is: '175px 125px 225px'},
+ {at: 1, is: '200px 100px 200px'},
+ {at: 2, is: '300px 0px 100px'},
+]);
+
+assertInterpolation({
+ property: 'translate',
+ from: '200px 100px 200px',
+ to: 'inherit',
+}, [
+ {at: -1, is: '300px 0px 100px'},
+ {at: 0, is: '200px 100px 200px'},
+ {at: 0.25, is: '175px 125px 225px'},
+ {at: 0.75, is: '125px 175px 275px'},
+ {at: 1, is: '100px 200px 300px'},
+ {at: 2, is: '0px 300px 400px'},
+]);
+
+assertInterpolation({
+ property: 'translate',
+ from: 'initial',
+ to: '200px 100px 200px',
+}, [
+ {at: -1, is: '-200px -100px -200px'},
+ {at: 0, is: '0px'},
+ {at: 0.25, is: '50px 25px 50px'},
+ {at: 0.75, is: '150px 75px 150px'},
+ {at: 1, is: '200px 100px 200px'},
+ {at: 2, is: '400px 200px 400px'},
+]);
+
+assertInterpolation({
+ property: 'translate',
+ from: '200px 100px 200px',
+ to: 'initial',
+}, [
+ {at: -1, is: '400px 200px 400px'},
+ {at: 0, is: '200px 100px 200px'},
+ {at: 0.25, is: '150px 75px 150px'},
+ {at: 0.75, is: '50px 25px 50px'},
+ {at: 1, is: '0px'},
+ {at: 2, is: '-200px -100px -200px'},
+]);
+
+assertInterpolation({
+ property: 'translate',
+ from: 'initial',
+ to: 'inherit',
+}, [
+ {at: -1, is: '-100px -200px -300px'},
+ {at: 0, is: '0px'},
+ {at: 0.25, is: '25px 50px 75px'},
+ {at: 0.75, is: '75px 150px 225px'},
+ {at: 1, is: '100px 200px 300px'},
+ {at: 2, is: '200px 400px 600px'},
+]);
+
+assertInterpolation({
+ property: 'translate',
+ from: 'inherit',
+ to: 'initial',
+}, [
+ {at: -1, is: '200px 400px 600px'},
+ {at: 0, is: '100px 200px 300px'},
+ {at: 0.25, is: '75px 150px 225px'},
+ {at: 0.75, is: '25px 50px 75px'},
+ {at: 1, is: '0px'},
+ {at: 2, is: '-100px -200px -300px'},
+]);
+</script>

Powered by Google App Engine
This is Rietveld 408576698