2 You should see
7 OKs below (and not hang):
<br>
5 testRunner
.dumpAsText();
6 var body
= document
.body
;
7 var selection
= window
.getSelection();
9 function shouldThrowIndexSizeErrorException(script
)
14 document
.write(((e
.code
== DOMException
.INDEX_SIZE_ERR
) ? "OK" : "FAIL") + "<br>");
18 shouldThrowIndexSizeErrorException("selection.collapse(body, -1);");
19 shouldThrowIndexSizeErrorException("selection.setBaseAndExtent(body, -1, body, 0);");
20 shouldThrowIndexSizeErrorException("selection.setBaseAndExtent(body, 0, body, -1);");
21 shouldThrowIndexSizeErrorException("selection.collapse(body, -1);");
22 shouldThrowIndexSizeErrorException("selection.getRangeAt(-1);");
23 shouldThrowIndexSizeErrorException("selection.getRangeAt(10000);");
24 shouldThrowIndexSizeErrorException("selection.collapse(body, 10000);");
26 // these should throw as well but don't at the moment. Just checking they don't crash.
27 selection
.setBaseAndExtent(body
, 1000, body
, 0);
28 selection
.setBaseAndExtent(body
, 0, body
, 10000);