1 description("Tests whether changes to the 'currentTranslate' SVGSVGElement property take effect. You should see an unclipped 100x100 rect above.");
3 var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4 svg.setAttribute("width", "150");
5 svg.setAttribute("height", "150");
6 document.documentElement.insertBefore(svg, document.documentElement.firstChild);
8 var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
9 rect.setAttribute("x", "-100");
10 rect.setAttribute("y", "-100");
11 rect.setAttribute("width", "100");
12 rect.setAttribute("height", "100");
13 rect.setAttribute("fill", "green");
14 svg.appendChild(rect);
16 shouldBe("svg.currentTranslate.x", "0");
17 shouldBe("svg.currentTranslate.y", "0");
19 // Modify tear off, and check results by calling svg.currentTranslate.
20 var currentTranslate = svg.currentTranslate;
21 currentTranslate.x = 100;
22 shouldBe("svg.currentTranslate.x", "100");
24 currentTranslate.y = 50;
25 shouldBe("svg.currentTranslate.y", "50");
27 currentTranslate.y = currentTranslate.y + 50;
28 shouldBe("svg.currentTranslate.y", "100");
30 var successfullyParsed = true;