blob: e681b1b0d5e7ba8f92c3b0a509a0ca6c351c7298 [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] SVGFETurbulenceElement-dom-baseFrequency-attr.js
// [Expected rendering result] An image with turbulence filter - and a series of PASS messages
description("Tests dynamic updates of the 'baseFrequency' attribute of the SVGFETurbulenceElement object")
createSVGTestCase();
var turbulence = createSVGElement("feTurbulence");
turbulence.setAttribute("baseFrequency", "0.07");
turbulence.setAttribute("numOctaves", "3");
turbulence.setAttribute("seed", "5");
turbulence.setAttribute("stitchTiles", "noStitch");
turbulence.setAttribute("type", "turbulence");
var filterElement = createSVGElement("filter");
filterElement.setAttribute("id", "myFilter");
filterElement.setAttribute("filterUnits", "userSpaceOnUse");
filterElement.setAttribute("x", "0");
filterElement.setAttribute("y", "0");
filterElement.setAttribute("width", "200");
filterElement.setAttribute("height", "200");
filterElement.appendChild(turbulence);
var defsElement = createSVGElement("defs");
defsElement.appendChild(filterElement);
rootSVGElement.appendChild(defsElement);
var rectElement = createSVGElement("rect");
rectElement.setAttribute("x", "0");
rectElement.setAttribute("y", "0");
rectElement.setAttribute("width", 200);
rectElement.setAttribute("height", 200);
rectElement.setAttribute("filter", "url(#myFilter)");
rootSVGElement.appendChild(rectElement);
shouldBeEqualToString("turbulence.getAttribute('baseFrequency')", "0.07");
function repaintTest() {
turbulence.setAttribute("baseFrequency", "0.05");
shouldBeEqualToString("turbulence.getAttribute('baseFrequency')", "0.05");
completeTest();
}
var successfullyParsed = true;
</script>
</body>
</html>