blob: 3bc052050ce1d772bc85f011140aaedf9637fad0 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<div>
<div id="child"></div>
<div id="newparent"><span id="beforeChild"></div>
</div>
<script>
description("Ensures that insertBefore() throws an exception if mutation even handler does something wrong");
var listener = function() {
document.removeEventListener("DOMNodeRemoved", listener, false);
child.appendChild(newparent);
};
document.addEventListener("DOMNodeRemoved", listener, false);
shouldThrow("newparent.insertBefore(child, beforeChild);", "'HierarchyRequestError (DOM Exception 3): The operation would yield an incorrect node tree.'");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>