blob: 63ffc7356bb098f4788c4cd652311ff8218a4b25 [file] [log] [blame]
// [Name] SVGPolygonElement-svgdom-requiredFeatures.js
// [Expected rendering result] a series of PASS messages
createSVGTestCase();
var polygonElement = createSVGElement("polygon");
polygonElement.setAttribute("points", "0,0 200,0 200,200 0, 200");
rootSVGElement.appendChild(polygonElement);
function repaintTest() {
debug("Check that SVGPolygonElement is initially displayed");
shouldBeEqualToString("document.defaultView.getComputedStyle(polygonElement, null).display", "inline");
debug("Check that setting requiredFeatures to something invalid makes it not render");
polygonElement.requiredFeatures.appendItem("http://www.w3.org/TR/SVG11/feature#BogusFeature");
shouldBeEqualToString("document.defaultView.getComputedStyle(polygonElement, null).display", "");
debug("Check that setting requiredFeatures to something valid makes it render again");
polygonElement.requiredFeatures.replaceItem("http://www.w3.org/TR/SVG11/feature#Shape", 0);
shouldBeEqualToString("document.defaultView.getComputedStyle(polygonElement, null).display", "inline");
debug("Check that adding something valid to requiredFeatures keeps rendering the element");
polygonElement.requiredFeatures.appendItem("http://www.w3.org/TR/SVG11/feature#Gradient");
shouldBeEqualToString("document.defaultView.getComputedStyle(polygonElement, null).display", "inline");
debug("Check that adding something invalid to requiredFeatures makes it not render");
polygonElement.requiredFeatures.appendItem("http://www.w3.org/TR/SVG11/feature#BogusFeature");
shouldBeEqualToString("document.defaultView.getComputedStyle(polygonElement, null).display", "");
completeTest();
}
var successfullyParsed = true;