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

Side by Side Diff: LayoutTests/transitions/cancel-and-start-new.html

Issue 46043014: Web Animations CSS: Unfreeze AnimationClock if sampling timelines does not trigger style recalc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reinstate assert Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5 <style>
6 #target {
7 position: relative;
8 background-color: #933;
9 width: 50px;
10 height: 50px;
11 top: 0px;
12 left: 0px;
13 }
14 #target.transition-top {
15 top: 400px;
16 -webkit-transition: top 100ms linear;
17 transition: top 100ms linear;
18 }
19 #target.transition-left {
20 left: 400px;
21 -webkit-transition: left 100ms linear;
22 transition: left 100ms linear;
23 }
24 </style>
25 <script>
26 if (window.testRunner) {
27 testRunner.dumpAsText();
28 testRunner.waitUntilDone();
29 }
30
31 function isEqual(actual, desired, tolerance)
32 {
33 var diff = Math.abs(actual - desired);
34 return diff < tolerance;
35 }
36
37 function cancelTransition()
38 {
39 document.getElementById("target").classList.remove('transition-top') ;
40 }
41
42 function startNewTransition()
43 {
44 document.getElementById("target").classList.add('transition-left');
45 setTimeout(check, 50);
46 }
47
48 function check()
49 {
50 var left = parseFloat(window.getComputedStyle(document.getElementByI d('target')).left);
51 if (isEqual(left, 200, 50))
52 var result = "<span style='color:green'>PASS</span>";
53 else
54 var result = "<span style='color:red'>FAIL(was: " + left + ", ex pected: 200)</span>";
55 document.getElementById('result').innerHTML = result;
56 if (window.testRunner)
57 testRunner.notifyDone();
58 }
59
60 function start()
61 {
62 document.getElementById("target").classList.add('transition-top');
63 setTimeout("cancelTransition()", 50);
64 setTimeout("startNewTransition()", 100);
65 }
66 </script>
67 </head>
68 <body onload="start()">
69 <p>
70 Tests that having stopped a transition before it completes, a subsequent
71 transition starts correctly.
72 </p>
73 <div id="target"></div>
74 <div id="result"></div>
75 </body>
76 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698