OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- Check that a throttled iframe repaints itself when scrolled into view. --> |
| 3 <style> |
| 4 #frame |
| 5 { |
| 6 position: absolute; |
| 7 top: 2000px; |
| 8 } |
| 9 </style> |
| 10 |
| 11 <script src="resources/text-based-repaint.js"></script> |
| 12 <script> |
| 13 window.testIsAsync = true; |
| 14 |
| 15 function repaintTest() |
| 16 { |
| 17 var frame = document.querySelector('#frame'); |
| 18 frame.scrollIntoView(); |
| 19 // The first animation frame after this one updates the scroll position and |
| 20 // unthrottles the frame. The repainting of the iframe happens in the frame |
| 21 // after that. Therefore, we must wait for two requestAnimationFrames to |
| 22 // finish the test. |
| 23 window.requestAnimationFrame(waitForRepaint); |
| 24 } |
| 25 |
| 26 function waitForRepaint() |
| 27 { |
| 28 window.requestAnimationFrame(finishRepaintTest); |
| 29 } |
| 30 |
| 31 window.addEventListener('load', runRepaintTest); |
| 32 </script> |
| 33 |
| 34 <!-- Use sandboxing to allow rendering pipeline throtting. --> |
| 35 <iframe id="frame" srcdoc="<style> body { background: green; } </style>" sandbox
="" width="64" height="64"></iframe> |
OLD | NEW |