Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / style / bold-with-dom-changes.html
blobf6c965c0bc2a7c9127b77c27e6679cc87481cb80
1 <!DOCTYPE html>
2 <html>
3 <body>
4 This test verifies that deleting DOM elements in a DOMSubtreeModified handler triggered by and execCommand('bold') does not produce a crash.
5 <div id="test" contenteditable style="border: 1px solid red">
6 <b class="x" id="inlined">
7 <u></u>
9 </b>
10 </div>
11 <script>
12 function treeModifiedHandler()
14 document.removeEventListener("DOMSubtreeModified", treeModifiedHandler, false);
16 var b = document.getElementById("inlined");
17 b.insertBefore(document.createTextNode(""), b.firstChild);
19 var range = document.createRange();
20 range.setStart(b,0);
21 range.setEnd(b,2);
22 range.deleteContents();
23 document.body.appendChild(document.createTextNode("PASS"));
26 function runtest()
28 var test = document.getElementById('test');
29 window.getSelection().selectAllChildren(test);
31 document.execCommand('bold', false, null);
32 document.addEventListener("DOMSubtreeModified", treeModifiedHandler, false);
33 document.execCommand('bold', false, null);
36 if (window.testRunner)
37 testRunner.dumpAsText();
39 runtest();
40 </script>
41 </body>
42 </html>