Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / inserting / insert-with-mutation-event.html
1 <!DOCTYPE html>
2 <body>
3 <div id="sample" contenteditable="true">
4 foo
5 <div id="test" style="font-weight:bold">bar</div>
6 </div>
7 </body>
8 <script>
9 if (window.testRunner)
10     testRunner.dumpAsText();
11 function $(id) { return document.getElementById(id); }
12 window.getSelection().collapse($('test'), 0);
13 document.execCommand('Delete');
14 var sample = $('sample');
15 sample.addEventListener('DOMSubtreeModified', function () {
16     // Move nodes being processed by 'InsertText' to another document.
17     var anotherDoc = document.implementation.createDocument('', null);
18     anotherDoc.adoptNode(sample);
19 });
20 document.execCommand('InsertText', false, 'ab123cd');
21 document.body.textContent = 'PASS; NOT CRASHED';
22 </script>