2 "This test checks some DOM Range exceptions."
5 // Test to be sure the name BAD_BOUNDARYPOINTS_ERR dumps properly.
6 var node = document.createElement("DIV");
7 node.innerHTML = "<BAR>AB<MOO>C</MOO>DE</BAR>";
8 shouldBe("node.innerHTML", "'<bar>AB<moo>C</moo>DE</bar>'");
10 // Ensure that we throw BAD_BOUNDARYPOINTS_ERR when trying to split a comment
11 // (non-text but character-offset node). (Test adapted from Acid3.)
12 var c1 = document.createComment("aaaaa");
14 var c2 = document.createComment("bbbbb");
16 var r = document.createRange();
19 shouldThrow("r.surroundContents(document.createElement('a'))", '"InvalidStateError: Failed to execute \'surroundContents\' on \'Range\': The Range has partially selected a non-Text node."');
21 // But not when we don't try to split the comment.
24 shouldThrow("r.surroundContents(document.createElement('a'))", '"HierarchyRequestError: Failed to execute \'surroundContents\' on \'Range\': The node to be inserted is a \'A\' node, which may not be inserted here."');