OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../resources/testharness.js"></script> | |
3 <script src="../resources/testharnessreport.js"></script> | |
4 <style> | |
5 #t { | |
6 width: 50px; | |
7 height: 50px; | |
8 transition: transform 250ms linear; | |
9 background-color: green; | |
10 } | |
11 </style> | |
12 <div id=t></div> | |
13 <script> | |
14 var test = async_test("Hit testing should not interrupt transition scheduling"); | |
15 var counter = 0; | |
16 requestAnimationFrame(function() { | |
17 t.style.transform = 'translate(500px)'; | |
18 setTimeout(function() { | |
alancutter (OOO until 2018)
2015/08/18 03:09:16
Add comment explaining why setTimeout is necessary
| |
19 t.style.transitionDuration = '10000000s'; | |
20 t.style.transform = 'translate(1000px)'; | |
21 // The original transition should be long finished, the new one should | |
22 // start from a translate-x greater than 500. | |
23 requestAnimationFrame(function() { | |
24 var tx = +/([\d.]+), [\d.]+\)/.exec(getComputedStyle(t).transform)[1]; | |
alancutter (OOO until 2018)
2015/08/18 03:09:16
If you use the translate property this can be made
| |
25 test.step(function() { | |
26 assert_true(tx >= 500); | |
27 }); | |
28 test.done(); | |
29 }); | |
30 }, 500); | |
31 }); | |
32 | |
33 setInterval(function() { | |
34 document.elementFromPoint(50, 50); | |
35 }, 1); | |
36 </script> | |
OLD | NEW |