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

Unified Diff: LayoutTests/animations/interpolation/scale-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/scale-interpolation.html
diff --git a/LayoutTests/animations/interpolation/scale-interpolation.html b/LayoutTests/animations/interpolation/scale-interpolation.html
new file mode 100644
index 0000000000000000000000000000000000000000..582cbc9a35434e6874a5655d15be017d66a0197c
--- /dev/null
+++ b/LayoutTests/animations/interpolation/scale-interpolation.html
@@ -0,0 +1,165 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<style>
+.parent {
+ scale: 0.5 1 2
+}
+.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: '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: 'scale',
+ from: '1',
+ to: '10 -5 0',
+}, [
+ {at: -1, is: '-8 7 2'},
+ {at: 0, is: '1'},
+ {at: 0.25, is: '3.25 -0.5 0.75'},
+ {at: 0.75, is: '7.75 -3.5 0.25'},
+ {at: 1, is: '10 -5 0'},
+ {at: 2, is: '19 -11 -1'},
+]);
+
+assertInterpolation({
+ property: 'scale',
+ from: '-10 5 1',
+ to: '1',
+}, [
+ {at: -1, is: '-21 9'},
+ {at: 0, is: '-10 5'},
+ {at: 0.25, is: '-7.25 4'},
+ {at: 0.75, is: '-1.75 2'},
+ {at: 1, is: '1'},
+ {at: 2, is: '12 -3'},
+]);
+
+assertInterpolation({
+ property: 'scale',
+ from: 'inherit',
+ to: '2 0.5 1',
+}, [
+ {at: -1, is: '-1 1.5 3'},
+ {at: 0, is: '0.5 1 2'},
+ {at: 0.25, is: '0.875 0.875 1.75'},
+ {at: 0.75, is: '1.625 0.625 1.25'},
+ {at: 1, is: '2 0.5 1'},
+ {at: 2, is: '3.5 0 0'},
+]);
+
+assertInterpolation({
+ property: 'scale',
+ from: '2 0.5 1',
+ to: 'inherit',
+}, [
+ {at: -1, is: '3.5 0 0'},
+ {at: 0, is: '2 0.5 1'},
+ {at: 0.25, is: '1.625 0.625 1.25'},
+ {at: 0.75, is: '0.875 0.875 1.75'},
+ {at: 1, is: '0.5 1 2'},
+ {at: 2, is: '-1 1.5 3'},
+]);
+
+assertInterpolation({
+ property: 'scale',
+ from: 'initial',
+ to: '2 0.5 1',
+}, [
+ {at: -1, is: '0 1.5'},
+ {at: 0, is: '1'},
+ {at: 0.25, is: '1.25 0.875'},
+ {at: 0.75, is: '1.75 0.625'},
+ {at: 1, is: '2 0.5'},
+ {at: 2, is: '3 0'},
+]);
+
+assertInterpolation({
+ property: 'scale',
+ from: '2 0.5 1',
+ to: 'initial',
+}, [
+ {at: -1, is: '3 0'},
+ {at: 0, is: '2 0.5 1'},
+ {at: 0.25, is: '1.75 0.6251'},
+ {at: 0.75, is: '1.25 0.875'},
+ {at: 1, is: '1 1 1'},
+ {at: 2, is: '0 1.5'},
+]);
+
+assertInterpolation({
+ property: 'scale',
+ from: 'initial',
+ to: 'inherit',
+}, [
+ {at: -1, is: '1.5 1 0'},
+ {at: 0, is: '1'},
+ {at: 0.25, is: '0.875 1 1.25'},
+ {at: 0.75, is: '0.625 1 1.75'},
+ {at: 1, is: '0.5 1 2'},
+ {at: 2, is: '0 1 3'},
+]);
+
+assertInterpolation({
+ property: 'scale',
+ from: 'inherit',
+ to: 'initial',
+}, [
+ {at: -1, is: '0 1 3'},
+ {at: 0, is: '0.5 1 2'},
+ {at: 0.25, is: '0.625 1 1.75'},
+ {at: 0.75, is: '0.875 1 1.25'},
+ {at: 1, is: '1 1 1'},
+ {at: 2, is: '1.5 1 0'},
+]);
+</script>

Powered by Google App Engine
This is Rietveld 408576698