blob: 30133beddc0c7eec740de1dd729ad497361f7547 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="resources/SVGTestCase.js"></script>
<script src="../../resources/js-test-pre.js"></script>
<script src="../../fast/repaint/resources/repaint.js"></script>
</head>
<body onload="runRepaintTest()">
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
<script>
// [Name] SVGFESpotLightElement-svgdom-specularExponent-prop.js
// [Expected rendering result] A shining cone (performed by diffuse lighting) - and a series of PASS messages
description("Tests dynamic updates of the 'specularExponent' property of the SVGFESpotLightElement object")
createSVGTestCase();
var spotLightElement = createSVGElement("feSpotLight");
spotLightElement.setAttribute("x", "113");
spotLightElement.setAttribute("y", "0");
spotLightElement.setAttribute("z", "100");
spotLightElement.setAttribute("pointsAtX", "113");
spotLightElement.setAttribute("pointsAtY", "100");
spotLightElement.setAttribute("pointsAtZ", "0");
spotLightElement.setAttribute("specularExponent", "20");
spotLightElement.setAttribute("limitingConeAngle", "15");
var gradientElement = createSVGElement("feDiffuseLighting");
gradientElement.setAttribute("surfaceScale", "1");
gradientElement.setAttribute("diffuseConstant", "1");
gradientElement.setAttribute("lighting-color", "aqua");
gradientElement.appendChild(spotLightElement);
var filterElement = createSVGElement("filter");
filterElement.setAttribute("id", "myFilter");
filterElement.setAttribute("filterUnits", "userSpaceOnUse");
filterElement.setAttribute("width", "200");
filterElement.setAttribute("height", "200");
filterElement.appendChild(gradientElement);
var defsElement = createSVGElement("defs");
defsElement.appendChild(filterElement);
rootSVGElement.appendChild(defsElement);
var rectElement = createSVGElement("rect");
rectElement.setAttribute("width", "200");
rectElement.setAttribute("height", "200");
rectElement.setAttribute("filter", "url(#myFilter)");
rootSVGElement.appendChild(rectElement);
shouldBe("spotLightElement.specularExponent.baseVal", "20");
function repaintTest() {
spotLightElement.specularExponent.baseVal = 1;
shouldBe("spotLightElement.specularExponent.baseVal", "1");
completeTest();
}
var successfullyParsed = true;
</script>
</body>
</html>