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

Side by Side Diff: third_party/WebKit/LayoutTests/animations/transitions-replay.html

Issue 2947103002: Expose getAnimations as function on Document (Closed)
Patch Set: Rebase Created 3 years, 5 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <div id='element'></div> 4 <div id='element'></div>
5 <style> 5 <style>
6 #element { 6 #element {
7 transition: background 100ms; 7 transition: background 100ms;
8 background: black; 8 background: black;
9 } 9 }
10 </style> 10 </style>
11 <script> 11 <script>
12 var t = async_test('Replaying a transition after it has finished should not trig ger a new transition'); 12 var t = async_test('Replaying a transition after it has finished should not trig ger a new transition');
13 13
14 t.step(function() { 14 t.step(function() {
15 element.offsetTop; // Force recalc 15 element.offsetTop; // Force recalc
16 element.style.background = "green"; 16 element.style.background = "green";
17 element.offsetTop; // Force recalc 17 element.offsetTop; // Force recalc
18 18
19 assert_equals(document.timeline.getAnimations().length, 1); 19 assert_equals(document.getAnimations().length, 1);
20 var animation = document.timeline.getAnimations()[0]; 20 var animation = document.getAnimations()[0];
21 animation.onfinish = function() { 21 animation.onfinish = function() {
22 requestAnimationFrame(function() { 22 requestAnimationFrame(function() {
23 requestAnimationFrame(function() { 23 requestAnimationFrame(function() {
24 animation.startTime = document.timeline.currentTime - 10; 24 animation.startTime = document.timeline.currentTime - 10;
25 animation.onfinish = t.done.bind(t); 25 animation.onfinish = t.done.bind(t);
26 }); 26 });
27 }); 27 });
28 } 28 }
29 }); 29 });
30 </script> 30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698