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

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: Rebase and tidy up Created 5 years, 10 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
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 @keyframes anim-missing-ems { from { top: 1em; } }
10
11 .target-before {
12 width: 100px;
13 height: 100px;
14 background-color: rgb(0, 0, 0);
15 left: 20px;
16 top: 1em;
17 font-size: 12px;
18 opacity: 1.0;
19 }
20
21 .target-after {
22 width: 600px;
23 height: 300px;
24 background-color: rgb(120, 160, 200);
25 left: 200px;
26 top: 2em;
27 opacity: 0.5;
28 }
29
30 #target1 { animation: anim-missing-from 4s -1s linear paused; }
31 #target2 { animation: anim-missing-to 4s -1s linear paused; }
32 #target3 { animation: anim-missing-both 4s -1s linear paused; }
33 #target4 { animation: anim-missing-both 0.2s 2 linear paused forwards; }
34 #target5 { animation: anim-missing-compositor 2s -1s linear paused; }
35 #target6 { animation: anim-missing-ems 0.2s 2 linear paused forwards; }
36
37 </style>
38 <div id="target1" class="target-before"></div>
39 <div id="target2" class="target-before"></div>
40 <div id="target3" class="target-before"></div>
41 <div id="target4" class="target-before"></div>
42 <div id="target5" class="target-before"></div>
43 <div id="target6" class="target-before"></div>
44 <script>
45 var async1 = async_test("Neutral keyframe updates during animation style updat e");
46 var async2 = async_test("Neutral keyframe specified with ems responds to chang es in font size");
47
48 test(function() {
Timothy Loh 2015/02/11 03:54:36 Looks like there are 6 tests here, so split each t
shend 2015/02/12 01:01:42 Done.
49 assert_equals(parseInt(getComputedStyle(target1).width), 125);
50 assert_equals(parseInt(getComputedStyle(target1).height), 125);
51 target1.className = 'target-after';
52 assert_equals(parseInt(getComputedStyle(target1).width), 500);
53 assert_equals(parseInt(getComputedStyle(target1).height), 275);
54
55 assert_equals(parseInt(getComputedStyle(target2).left), 80);
56 target2.className = 'target-after';
57 assert_equals(parseInt(getComputedStyle(target2).left), 125);
58
59 assert_equals(getComputedStyle(target3).backgroundColor, 'rgb(100, 50, 20)') ;
60 target3.className = 'target-after';
61 assert_equals(getComputedStyle(target3).backgroundColor, 'rgb(160, 130, 120) ');
62
63 target4.addEventListener('animationiteration', function() {
64 target4.className = 'target-after';
65 });
66
67 target4.addEventListener('animationend', function() {
68 assert_equals(getComputedStyle(target4).backgroundColor, 'rgb(120, 160, 200)');
69 async1.done();
70 });
71
72 target4.style.animationPlayState = 'running';
73
74 assert_approx_equals(parseFloat(getComputedStyle(target5).opacity), 0.5, 0.0 01);
75 target5.className = 'target-after';
76 assert_approx_equals(parseFloat(getComputedStyle(target5).opacity), 0.25, 0. 001);
77
78 assert_equals(parseInt(getComputedStyle(target6).top), 12); // 1em at 12px
79
80 target6.addEventListener('animationiteration', function() {
81 target6.style.fontSize = '24px';
82 target6.className = 'target-after';
83 });
84
85 target6.addEventListener('animationend', function() {
86 assert_equals(parseInt(getComputedStyle(target6).top), 48); // 2em at 24 px
87 async2.done();
88 });
89
90 target6.style.animationPlayState = 'running';
91
92 }, "Check that neutral keyframes are responsive to underlying style changes");
93 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698