OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 html, body { height: 10000px; } |
| 6 </style> |
| 7 <h1>doc.write() to iframe should not cause scrolling of the parent</h1> |
| 8 <script> |
| 9 var t = async_test('doc.write() to iframe should not cause ' + |
| 10 'scrolling of the parent'); |
| 11 var isFirstTime = true; |
| 12 |
| 13 function doTest() { |
| 14 if (!isFirstTime) |
| 15 return; |
| 16 isFirstTime = false; |
| 17 |
| 18 requestAnimationFrame(t.step_func(function() { |
| 19 var iframe = document.getElementById('iframe'); |
| 20 var doc = iframe.contentWindow.document; |
| 21 doc.open(); |
| 22 doc.write("Hello"); |
| 23 doc.close(); |
| 24 |
| 25 assert_equals(scrollY, 0); |
| 26 t.done(); |
| 27 })); |
| 28 } |
| 29 |
| 30 if (!location.href.endsWith('#')) { |
| 31 location.href += '#'; |
| 32 } |
| 33 </script> |
| 34 <iframe id="iframe" onload="doTest()"></iframe> |
OLD | NEW |