blob: a1e3eb99a510eeab4e6ab51ecace73c28d394383 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Tests that out of bounds accesses of SVGList correctly throw exceptions");
var path = document.createElementNS("http://www.w3.org/2000/svg","path");
var svgList = path.pathSegList;
var indicesToTest = [-Infinity, NaN, -1, 0, 1, Infinity];
for (var i = 0; i < indicesToTest.length; i++) {
shouldThrow("svgList.getItem(i)");
shouldBeNull("svgList.insertItemBefore(null, i)");
svgList.removeItem(0);
shouldThrow("svgList.replaceItem(null, i)");
shouldThrow("svgList.removeItem(i)");
}
successfullyParsed = true;
</script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>