| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <div id="sample">foo</div> | 4 <div id="sample">foo</div> |
| 5 <div id="log"></div> | 5 <div id="log"></div> |
| 6 <script> | 6 <script> |
| 7 var test = async_test('Remove IFRAME in load event handler should not crash'); | 7 var test = async_test('Remove IFRAME in load event handler should not crash'); |
| 8 var sample = document.getElementById('sample'); | 8 var sample = document.getElementById('sample'); |
| 9 var iframe = document.createElement('iframe'); | 9 var iframe = document.createElement('iframe'); |
| 10 iframe.srcdoc = 'foo'; | 10 iframe.srcdoc = 'foo'; |
| 11 iframe.onload = function () { | 11 iframe.onload = function () { |
| 12 document.execCommand('selectAll'); | 12 document.execCommand('selectAll'); |
| 13 iframe.remove(); | 13 iframe.remove(); |
| 14 window.setTimeout(function() { | 14 window.setTimeout(function() { |
| 15 test.step(function() { | 15 test.step(function() { |
| 16 var selection = window.getSelection(); | 16 var selection = window.getSelection(); |
| 17 assert_equals(selection.anchorNode, sample.firstChild, 'anchorNode')
; | 17 assert_equals(selection.anchorNode, sample.firstChild, 'anchorNode')
; |
| 18 assert_equals(selection.anchorOffset, 0, 'anchorOffset'); | 18 assert_equals(selection.anchorOffset, 0, 'anchorOffset'); |
| 19 assert_equals(selection.focusNode, sample, 'focusNode'); | 19 assert_equals(selection.focusNode, sample.firstChild, 'focusNode'); |
| 20 assert_equals(selection.focusOffset, 1, 'focusOffset'); | 20 assert_equals(selection.focusOffset, 3, 'focusOffset'); |
| 21 }); | 21 }); |
| 22 test.done(); | 22 test.done(); |
| 23 }, 0); | 23 }, 0); |
| 24 }; | 24 }; |
| 25 sample.appendChild(iframe); | 25 sample.appendChild(iframe); |
| 26 </script> | 26 </script> |
| OLD | NEW |