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