Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / script-tests / svg-modify-currentTranslate.js
blob761f58f0a0112135106692ad820a53ed60213df6
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;