4 <script src=
"../../../resources/js-test.js"></script>
8 description("Test deleteData() + replaceData() overflow handling.");
13 shouldBeNonNull("textNode = new Text('chopped off and then some'); textNode");
14 document
.body
.appendChild(textNode
);
15 document
.getSelection().extend(textNode
, textNode
.length
);
16 range
= document
.getSelection().getRangeAt(0);
18 shouldBeEqualToString("textNode.deleteData(11, 0xfffffff7); textNode.data", "chopped off");
19 shouldBe("range.endOffset", "11");
20 document
.body
.removeChild(textNode
);
22 shouldBeNonNull("textNode = new Text('hello world'); textNode");
23 document
.body
.appendChild(textNode
);
24 document
.getSelection().extend(textNode
, textNode
.length
);
25 range
= document
.getSelection().getRangeAt(0);
27 shouldBeEqualToString("textNode.replaceData(6, 0xfffffffe, 'bob'); textNode.data", "hello bob");
28 shouldBe("range.endOffset", "6");
29 document
.body
.removeChild(textNode
);
31 shouldBeNonNull("textNode = new Text('hello world'); textNode");
32 shouldBeEqualToString("textNode.replaceData(6, -1, 'bob'); textNode.data", "hello bob");
33 shouldBeNonNull("textNode = new Text('hello world'); textNode");
34 shouldBeEqualToString("textNode.replaceData(6, -2, 'bob'); textNode.data", "hello bob");