OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../../resources/js-test.js"></script> |
| 4 </head> |
| 5 <body> |
| 6 <div id='container'> |
| 7 <p id='start'>start</p> |
| 8 <iframe id='test'></iframe> |
| 9 <p id='end'>end</p> |
| 10 </div> |
| 11 <script> |
| 12 var range = document.createRange(); |
| 13 var start = document.getElementById('start'); |
| 14 range.setStart(start.firstChild, 0); |
| 15 range.setEnd(start.firstChild, 0); |
| 16 |
| 17 function loaded(ev) { |
| 18 var srcElement = ev.srcElement; |
| 19 range.surroundContents(document.getElementById('end')); |
| 20 srcElement.outerHTML = ''; |
| 21 } |
| 22 document.addEventListener("load", loaded, true); |
| 23 |
| 24 var testFrame = document.getElementById('test'); |
| 25 shouldThrow("range.surroundContents(testFrame)", '"HierarchyRequestError: Failed
to execute \'surroundContents\' on \'Range\': This operation would set range\'s
end to parent with new offset, but there\'s no parent into which to continue."'
); |
| 26 |
| 27 if (window.testRunner) |
| 28 document.getElementById('container').outerHTML = ''; |
| 29 </script> |
| 30 </body> |
| 31 </html> |
OLD | NEW |