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">
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();
22 range
.deleteContents();
23 document
.body
.appendChild(document
.createTextNode("PASS"));
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();