OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <style> | 2 <style> |
3 #target { | 3 #target { |
4 -webkit-clip-path: circle(0px, 0px, 0px); | 4 -webkit-clip-path: circle(0px, 0px, 0px); |
5 transition: -webkit-clip-path 1s; | 5 transition: -webkit-clip-path 1s; |
6 } | 6 } |
7 </style> | 7 </style> |
8 This test must be run under the test harness. | 8 This test must be run under the test harness. |
9 <div id="target"></div> | 9 <div id="target"></div> |
10 <script> | 10 <script> |
11 if (window.testRunner) { | 11 if (window.testRunner) { |
12 testRunner.dumpAsText(); | 12 testRunner.dumpAsText(); |
13 testRunner.waitUntilDone(); | 13 testRunner.waitUntilDone(); |
14 } | 14 } |
15 var target = document.getElementById('target'); | 15 var target = document.getElementById('target'); |
| 16 var result = ''; |
16 onload = function() { | 17 onload = function() { |
17 target.style.webkitClipPath = getComputedStyle(target).webkitClipPath; | 18 target.style.webkitClipPath = getComputedStyle(target).webkitClipPath; |
| 19 requestAnimationFrame(step1); |
| 20 }; |
| 21 function step1() { |
18 target.offsetTop; | 22 target.offsetTop; |
19 var result = ''; | |
20 if (window.internals) { | 23 if (window.internals) { |
21 result = (internals.numberOfActiveAnimations() == 0) ? | 24 result = (internals.numberOfActiveAnimations() == 0) ? |
22 'PASS - No transition started.' : | 25 'PASS - No transition started.' : |
23 'FAIL - Unexpected transition started.'; | 26 'FAIL - Unexpected transition started.'; |
24 } | 27 } |
25 target.style.webkitClipPath = 'circle(0px, 0px, 200px)'; | 28 target.style.webkitClipPath = 'circle(0px, 0px, 200px)'; |
26 target.offsetTop; | 29 requestAnimationFrame(step2); |
| 30 } |
| 31 function step2() { |
27 if (window.internals) { | 32 if (window.internals) { |
28 result += (internals.numberOfActiveAnimations() == 1) ? | 33 result += (internals.numberOfActiveAnimations() == 1) ? |
29 '\nPASS - Transition started.' : | 34 '\nPASS - Transition started.' : |
30 '\nFAIL - Transition did not start.'; | 35 '\nFAIL - Transition did not start.'; |
31 document.documentElement.style.whiteSpace = 'pre'; | 36 document.documentElement.style.whiteSpace = 'pre'; |
32 document.documentElement.textContent = result; | 37 document.documentElement.textContent = result; |
33 } | 38 } |
34 if (window.testRunner) { | 39 if (window.testRunner) { |
35 testRunner.notifyDone(); | 40 testRunner.notifyDone(); |
36 } | 41 } |
37 } | 42 } |
38 </script> | 43 </script> |
OLD | NEW |