4 <script src=
"../../resources/js-test.js"></script>
6 <div id=
"targetForSurround"></div>
7 <div id=
"description">Test that there is no crash when surroundContents is called with a node preceding the current selection.
</div>
8 <div id=
"trailingNode"></div>
11 var range
= document
.createRange();
12 var rootNode
= document
.getElementById("root");
13 range
.setStart(rootNode
, 4);
14 range
.setEnd(rootNode
, 6);
15 var parentElement
= document
.getElementById("targetForSurround");
16 range
.surroundContents(parentElement
);
18 shouldBe('range.startContainer.id', 'rootNode.id');
19 shouldBe('range.startOffset', '3');
20 shouldBe('range.endContainer.id', 'rootNode.id');
21 shouldBe('range.startOffset', '3');