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

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

Issue 1196913005: Implement animations for Independent CSS Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove Compositor Animations and add tests for inherit and initial 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/rotate-interpolation.html
diff --git a/LayoutTests/animations/interpolation/rotate-interpolation.html b/LayoutTests/animations/interpolation/rotate-interpolation.html
new file mode 100644
index 0000000000000000000000000000000000000000..815657fedd13b7a85039ec18b401ef5726d8e769
--- /dev/null
+++ b/LayoutTests/animations/interpolation/rotate-interpolation.html
@@ -0,0 +1,179 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<style>
+.parent {
+ rotate: 90deg;
+}
+.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: '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'},
+]);
+
+assertInterpolation({
+ property: 'rotate',
+ from: 'inherit',
+ to: '0deg'
alancutter (OOO until 2018) 2015/06/24 01:17:09 Trailing comma for consistency.
soonm 2015/06/24 02:53:19 Done - added comma
+}, [
+ {at: -1, is: '180deg'},
+ {at: 0, is: '90deg'},
+ {at: 0.25, is: '67.5deg'},
+ {at: 0.75, is: '22.5deg'},
+ {at: 1, is: '0deg'},
+ {at: 2, is: '-90deg'},
+]);
+
+assertInterpolation({
+ property: 'rotate',
+ from: '0deg',
+ to: 'inherit',
+}, [
+ {at: -1, is: '-90deg'},
+ {at: 0, is: '0deg'},
+ {at: 0.25, is: '22.5deg'},
+ {at: 0.75, is: '67.5deg'},
+ {at: 1, is: '90deg'},
+ {at: 2, is: '180deg'},
+]);
+
+assertInterpolation({
+ property: 'rotate',
+ from: 'initial',
+ to: '90deg',
+}, [
+ {at: -1, is: '-90deg'},
+ {at: 0, is: '0deg'},
+ {at: 0.25, is: '22.5deg'},
+ {at: 0.75, is: '67.5deg'},
+ {at: 1, is: '90deg'},
+ {at: 2, is: '180deg'},
+]);
+
+assertInterpolation({
+ property: 'rotate',
+ from: '90deg',
+ to: 'initial',
+}, [
+ {at: -1, is: '180deg'},
+ {at: 0, is: '90deg'},
+ {at: 0.25, is: '67.5deg'},
+ {at: 0.75, is: '22.5deg'},
+ {at: 1, is: '0deg'},
+ {at: 2, is: '-90deg'},
+]);
+
+assertInterpolation({
+ property: 'rotate',
+ from: 'initial',
+ to: 'inherit',
+}, [
+ {at: -1, is: '-90deg'},
+ {at: 0, is: '0deg'},
+ {at: 0.25, is: '22.5deg'},
+ {at: 0.75, is: '67.5deg'},
+ {at: 1, is: '90deg'},
+ {at: 2, is: '180deg'},
+]);
+
+assertInterpolation({
+ property: 'rotate',
+ from: 'inherit',
+ to: 'initial',
+}, [
+ {at: -1, is: '180deg'},
+ {at: 0, is: '90deg'},
+ {at: 0.25, is: '67.5deg'},
+ {at: 0.75, is: '22.5deg'},
+ {at: 1, is: '0deg'},
+ {at: 2, is: '-90deg'},
+]);
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698