blob: 8ba2551e6dd6f34068144407dd5f8146d290022a [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 SVGRect API");
var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
var rect = svgElement.createSVGRect();
debug("");
debug("Check initial rect values");
shouldBe("rect.x", "0");
shouldBe("rect.y", "0");
shouldBe("rect.width", "0");
shouldBe("rect.height", "0");
debug("");
debug("Check assigning rects");
shouldBe("rect.x = 100", "100");
shouldBe("rect.y = 200", "200");
shouldBe("rect.width = 300", "300");
shouldBe("rect.height = 400", "400");
debug("Check that the rect contains the correct values");
shouldBe("rect.x", "100");
shouldBe("rect.y", "200");
shouldBe("rect.width", "300");
shouldBe("rect.height", "400");
debug("");
debug("Check assigning invalid rects");
shouldBe("rect.x = rect", "rect");
shouldBeNull("rect.y = null");
shouldBe("rect.width = 'aString'", "'aString'");
shouldBe("rect.height = svgElement", "svgElement");
debug("");
debug("Check that the rect contains the correct values");
shouldBe("rect.x", "NaN");
shouldBe("rect.y", "0");
shouldBe("rect.width", "NaN");
shouldBe("rect.height", "NaN");
successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>