OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <style> |
| 3 #scrollable { overflow: auto; height: 100px; width: 100px; } |
| 4 #inside.scroll { height: 2000px; } |
| 5 </style> |
| 6 |
| 7 <p>Tests that overflowchanged events are deferred until raf.</p> |
| 8 |
| 9 <div id="scrollable"> |
| 10 <div id="inside"></div> |
| 11 </div> |
| 12 |
| 13 <div id="output"></div> |
| 14 |
| 15 <script> |
| 16 var scrollable = document.getElementById('scrollable'); |
| 17 var output = document.getElementById('output'); |
| 18 var inside = document.getElementById('inside'); |
| 19 |
| 20 if (window.testRunner) { |
| 21 testRunner.dumpAsText(); |
| 22 testRunner.waitUntilDone(); |
| 23 } |
| 24 |
| 25 function log(text) |
| 26 { |
| 27 output.appendChild(document.createElement('div')).textContent = text; |
| 28 } |
| 29 |
| 30 onload = function() { |
| 31 scrollable.addEventListener('overflowchanged', function() { |
| 32 log('overflowchanged'); |
| 33 }); |
| 34 |
| 35 document.body.offsetTop; |
| 36 |
| 37 inside.classList.toggle('scroll'); |
| 38 document.body.offsetTop; |
| 39 log('layout'); |
| 40 |
| 41 inside.classList.toggle('scroll'); |
| 42 document.body.offsetTop; |
| 43 log('layout'); |
| 44 |
| 45 inside.classList.toggle('scroll'); |
| 46 document.body.offsetTop; |
| 47 log('layout'); |
| 48 |
| 49 requestAnimationFrame(function() { |
| 50 log('requestAnimationFrame'); |
| 51 if (window.testRunner) |
| 52 testRunner.notifyDone(); |
| 53 }); |
| 54 } |
| 55 </script> |
OLD | NEW |