Chromium Code Reviews| 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() { | |
| 18 var srcElement = event.srcElement; | |
|
Yuta Kitamura
2014/08/07 09:30:41
Does this work? You have to receive the event as t
kangil_
2014/08/07 09:59:50
Please refer to https://code.google.com/p/chromium
Yuta Kitamura
2014/08/08 04:27:55
No, that's not .srcElement I'm talking about. I'm
kangil_
2014/08/08 04:52:25
I will add event argument in next patch.
| |
| 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 |