4 <script src=
"../../resources/js-test.js"></script>
9 <b></b><b id=
"oldChild"></b><b></b>
11 <div id=
"newChild"></div>
15 description("Ensures that replaceChild() throws an exception if mutation even handler does something wrong");
16 var target
= document
.getElementById('target');
17 var oldChild
= document
.getElementById('oldChild');
18 var newChild
= document
.getElementById('newChild');
21 document
.removeEventListener("DOMNodeRemoved", handler
, false);
22 newChild
.parentNode
.removeChild(newChild
);
23 target
.parentNode
.removeChild(target
);
24 newChild
.appendChild(target
);
26 document
.addEventListener("DOMNodeRemoved", handler
, false);
27 shouldThrow("target.replaceChild(newChild, oldChild);", '"HierarchyRequestError: Failed to execute \'replaceChild\' on \'Node\': The new child element contains the parent."');