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

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: Attempt to re-snapshot only if needed 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
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
9 .target-before {
10 width: 100px;
11 height: 100px;
12 background-color: rgb(0, 0, 0);
13 left: 20px;
14 }
15
16 .target-after {
17 width: 600px;
18 height: 300px;
19 background-color: rgb(120, 160, 200);
20 left: 200px;
21 }
22
23 #target1 { animation: anim-missing-from 4s -1s linear paused; }
24 #target2 { animation: anim-missing-to 4s -1s linear paused; }
25 #target3 { animation: anim-missing-both 4s -1s linear paused; }
26
27 #target4 { animation: anim-missing-both 0.2s 2 linear paused forwards; }
28
29 </style>
30 <div id="target1" class="target-before"></div>
31 <div id="target2" class="target-before"></div>
32 <div id="target3" class="target-before"></div>
33 <div id="target4" class="target-before"></div>
34 <script>
35 var async1 = async_test("Iteration event fires in running animation");
36 var async2 = async_test("Neutral keyframe updates during animation style updat e");
37
38 test(function() {
39 assert_equals(parseInt(getComputedStyle(target1).width), 125);
40 assert_equals(parseInt(getComputedStyle(target1).height), 125);
41 target1.className = 'target-after';
42 assert_equals(parseInt(getComputedStyle(target1).width), 500);
43 assert_equals(parseInt(getComputedStyle(target1).height), 275);
44
45 assert_equals(parseInt(getComputedStyle(target2).left), 80);
46 target2.className = 'target-after';
47 assert_equals(parseInt(getComputedStyle(target2).left), 125);
48
49 assert_equals(getComputedStyle(target3).backgroundColor, 'rgb(100, 50, 20)') ;
50 target3.className = 'target-after';
51 assert_equals(getComputedStyle(target3).backgroundColor, 'rgb(160, 130, 120) ');
52
53 target4.style.animationPlayState = 'running';
54
55 target4.addEventListener('animationiteration', function() {
56 target4.className = 'target-after';
57 async1.done();
58 });
59
60 target4.addEventListener('animationend', function() {
61 assert_equals(getComputedStyle(target4).backgroundColor, 'rgb(120, 160, 200)');
62 async2.done();
63 });
64
65 }, "Check that neutral keyframes are responsive to underlying style changes");
66 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/ActiveAnimations.h » ('j') | Source/core/animation/ActiveAnimations.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698