2011-04-21 Dirk Schulze <krit@webkit.org>
[WebKit-https.git] / LayoutTests / svg / dynamic-updates / script-tests / SVGFEDropShadowElement-dom-stdDeviation-attr.js
1 // [Name] SVGFEDropShadowElement-dom-stdDeviation-attr.js
2 // [Expected rendering result] A simple circle with a black shadow - and a series of PASS messages
3
4 description("Tests dynamic updates of the 'stdDeviation' attribute of the SVGFEDropShadowElement object")
5 createSVGTestCase();
6
7 var dropShadowElement = createSVGElement("feDropShadow");
8 dropShadowElement.setAttribute("stdDeviation", "0");
9 dropShadowElement.setAttribute("dx", "0");
10 dropShadowElement.setAttribute("dy", "0");
11
12 var filterElement = createSVGElement("filter");
13 filterElement.setAttribute("id", "myFilter");
14 filterElement.setAttribute("filterUnits", "userSpaceOnUse");
15 filterElement.setAttribute("x", "0");
16 filterElement.setAttribute("y", "0");
17 filterElement.setAttribute("width", "200");
18 filterElement.setAttribute("height", "200");
19 filterElement.appendChild(dropShadowElement);
20
21 var defsElement = createSVGElement("defs");
22 defsElement.appendChild(filterElement);
23
24 rootSVGElement.appendChild(defsElement);
25
26 var circleElement = createSVGElement("circle");
27 circleElement.setAttribute("cx", "100");
28 circleElement.setAttribute("cy", "100");
29 circleElement.setAttribute("r", "70");
30 circleElement.setAttribute("fill", "green");
31 circleElement.setAttribute("filter", "url(#myFilter)");
32 rootSVGElement.appendChild(circleElement);
33
34 shouldBeEqualToString("dropShadowElement.getAttribute('stdDeviation')", "0");
35
36 function executeTest() {
37     dropShadowElement.setAttribute("stdDeviation", "10");
38     shouldBeEqualToString("dropShadowElement.getAttribute('stdDeviation')", "10");
39
40     completeTest();
41 }
42
43 startTest(circleElement, 100, 100);
44
45 var successfullyParsed = true;