OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <body> | 2 <body> |
3 <script src="../../js/resources/js-test-pre.js"></script> | 3 <script src="../../../resources/js-test.js"></script> |
4 <div id="parent1">text</div> | 4 <div id="parent1">text</div> |
5 <script> | 5 <script> |
6 var parent = document.getElementById('parent1'); | 6 var parent = document.getElementById('parent1'); |
7 var target = parent.firstChild; | 7 var target = parent.firstChild; |
8 | 8 |
9 function handleInsertion() { | 9 function handleInsertion() { |
10 document.removeEventListener('DOMNodeInserted', handleInsertion); | 10 document.removeEventListener('DOMNodeInserted', handleInsertion); |
11 target.nextSibling.remove(); | 11 target.nextSibling.remove(); |
12 } | 12 } |
13 | 13 |
14 document.addEventListener('DOMNodeInserted', handleInsertion, false); | 14 document.addEventListener('DOMNodeInserted', handleInsertion, false); |
15 var r = new Range(); | 15 var r = new Range(); |
16 //window.getSelection().addRange(r); | 16 //window.getSelection().addRange(r); |
17 r.setStart(target, 0); | 17 r.setStart(target, 0); |
18 r.setEnd(target, 4); | 18 r.setEnd(target, 4); |
19 target.splitText(2); | 19 target.splitText(2); |
20 description('No assertion failures even if an DOM mutation event handler updates
the new node created by Text::splitText.'); | 20 description('No assertion failures even if an DOM mutation event handler updates
the new node created by Text::splitText.'); |
21 testPassed(' if the test wasn\'t terminated by an assertion.'); | 21 testPassed(' if the test wasn\'t terminated by an assertion.'); |
22 parent.remove(); | 22 parent.remove(); |
23 </script> | 23 </script> |
24 </body> | 24 </body> |
OLD | NEW |