blob: 0f53240a27a0c30c8976ace6fdb9b7da7ab1a0b0 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("This test checks the SVGStringList API - utilizing the requiredFeatures property of SVGRectElement");
var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
rect.setAttribute("requiredFeatures", "foo bar");
debug("");
debug("Check initial requiredFeatures values");
shouldBe("rect.requiredFeatures.numberOfItems", "2");
shouldBeEqualToString("rect.requiredFeatures.getItem(0)", "foo");
shouldBeEqualToString("rect.requiredFeatures.getItem(1)", "bar");
debug("");
debug("Check that getItem() does NOT return live strings, as the IDL defines the return types as plain DOMString");
var firstItem = rect.requiredFeatures.getItem(0);
shouldBeEqualToString("firstItem = 'test'", "test");
shouldBe("rect.requiredFeatures.numberOfItems", "2");
shouldBeEqualToString("rect.requiredFeatures.getItem(0)", "foo");
shouldBeEqualToString("rect.requiredFeatures.getItem(1)", "bar");
successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>