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

Side by Side Diff: LayoutTests/animations/responsive-neutral-keyframes.html

Issue 851693007: Prepare for responsive CSS animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix timing function layout tests Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/animation/ActiveAnimations.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <style>
5 @keyframes anim-missing-from { to { width: 200px; height: 200px; } }
6 @keyframes anim-missing-to { from { left: 100px; } }
7 @keyframes anim-missing-both { 50% { background-color: rgb(200, 100, 40); } }
8 @keyframes anim-missing-compositor { 100% { opacity: 0.0; } }
9
10 .target-before {
11 width: 100px;
shans 2015/01/30 12:38:13 What happens if this is specified in em and the fo
12 height: 100px;
13 background-color: rgb(0, 0, 0);
14 left: 20px;
15 opacity: 1.0;
16 }
17
18 .target-after {
19 width: 600px;
20 height: 300px;
21 background-color: rgb(120, 160, 200);
22 left: 200px;
23 opacity: 0.5;
24 }
25
26 #target1 { animation: anim-missing-from 4s -1s linear paused; }
27 #target2 { animation: anim-missing-to 4s -1s linear paused; }
28 #target3 { animation: anim-missing-both 4s -1s linear paused; }
29 #target4 { animation: anim-missing-both 0.2s 2 linear paused forwards; }
30 #target5 { animation: anim-missing-compositor 2s -1s linear paused; }
31
32 </style>
33 <div id="target1" class="target-before"></div>
34 <div id="target2" class="target-before"></div>
35 <div id="target3" class="target-before"></div>
36 <div id="target4" class="target-before"></div>
37 <div id="target5" class="target-before"></div>
38 <script>
39 var async1 = async_test("Iteration event fires in running animation");
40 var async2 = async_test("Neutral keyframe updates during animation style updat e");
41
42 test(function() {
43 assert_equals(parseInt(getComputedStyle(target1).width), 125);
44 assert_equals(parseInt(getComputedStyle(target1).height), 125);
45 target1.className = 'target-after';
46 assert_equals(parseInt(getComputedStyle(target1).width), 500);
47 assert_equals(parseInt(getComputedStyle(target1).height), 275);
48
49 assert_equals(parseInt(getComputedStyle(target2).left), 80);
50 target2.className = 'target-after';
51 assert_equals(parseInt(getComputedStyle(target2).left), 125);
52
53 assert_equals(getComputedStyle(target3).backgroundColor, 'rgb(100, 50, 20)') ;
54 target3.className = 'target-after';
55 assert_equals(getComputedStyle(target3).backgroundColor, 'rgb(160, 130, 120) ');
56
57 target4.addEventListener('animationiteration', function() {
58 target4.className = 'target-after';
59 async1.done();
60 });
61
62 target4.addEventListener('animationend', function() {
63 assert_equals(getComputedStyle(target4).backgroundColor, 'rgb(120, 160, 200)');
64 async2.done();
65 });
66
67 target4.style.animationPlayState = 'running';
68
69 assert_approx_equals(parseFloat(getComputedStyle(target5).opacity), 0.5, 0.0 01);
70 target5.className = 'target-after';
71 assert_approx_equals(parseFloat(getComputedStyle(target5).opacity), 0.25, 0. 001);
72
73 }, "Check that neutral keyframes are responsive to underlying style changes");
74 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/ActiveAnimations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698