blob: 955fb08b72597f580ec642053b91694e3b5c2562 [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] SVGFEOffsetElement-dom-dy-attr.js
// [Expected rendering result] A green circle in the center of the image - and a series of PASS messages
description("Tests dynamic updates of the 'dy' attribute of the SVGFEOffsetElement object")
createSVGTestCase();
var offsetElement = createSVGElement("feOffset");
offsetElement.setAttribute("dx", "0");
offsetElement.setAttribute("dy", "50");
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(offsetElement);
var defsElement = createSVGElement("defs");
defsElement.appendChild(filterElement);
rootSVGElement.appendChild(defsElement);
var rectElement = createSVGElement("circle");
rectElement.setAttribute("width", 200);
rectElement.setAttribute("height", 200);
rectElement.setAttribute("cx", "100");
rectElement.setAttribute("cy", "100");
rectElement.setAttribute("r", "70");
rectElement.setAttribute("fill", "green");
rectElement.setAttribute("filter", "url(#myFilter)");
rootSVGElement.appendChild(rectElement);
shouldBeEqualToString("offsetElement.getAttribute('dy')", "50");
function repaintTest() {
offsetElement.setAttribute("dy", "0");
shouldBeEqualToString("offsetElement.getAttribute('dy')", "0");
completeTest();
}
var successfullyParsed = true;
</script>
</body>
</html>