Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / zoom / xy-getcomputedstyle.html
blobebf692c2e5bde3f980113b01a6d282dfc9b5df80
1 <!doctype html>
2 <html>
3 <title>Test computed style on x and y properties</title>
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <svg xmlns="http://www.w3.org/2000/svg" height="32" width="32">
7 <defs>
8 <circle id="circle" cx="50" cy="60" r="32"/>
9 </defs>
10 <rect class="test" x="37px" y="50%" width="100" height="100"/>
11 <use class="test" x="17" y="51mm" xlink:href="#circle"/>
12 <svg class="test" x="22%" y="4cm" width="100" height="100"/>
13 <mask class="test" x="15pc" y="27pt"/>
14 <image class="test" y="57"/>
15 <foreignObject class="test" x="32%" y="1"/>
16 </svg>
17 <script>
18 var elms = document.querySelectorAll(".test");
19 var attrs = [ "x", "y" ];
20 var expected = [
21 [ "37px", "50%" ],
22 [ "17px", "192.756px" ],
23 [ "22%", "151.181px" ],
24 [ "240px", "36px" ],
25 [ "0px", "57px" ],
26 [ "32%", "1px" ],
29 function runTestsWithZoom(zoomLevel) {
30 document.querySelector("svg").setAttribute("style", "zoom: " + zoomLevel);
31 for (var i = 0; i < elms.length; i++) {
32 var style = getComputedStyle(elms[i]);
33 for (var j = 0; j < attrs.length; j++) {
34 test(function() {
35 assert_equals(style.getPropertyValue(attrs[j]), expected[i][j]);
36 }, "zoom=" + zoomLevel + ": " + elms[i].localName + " getPropertyValue(" + attrs[j] + ")");
37 test(function() {
38 assert_equals(style[attrs[j]], expected[i][j]);
39 }, "zoom=" + zoomLevel + ": " +elms[i].localName + " style." + attrs[j]);
44 runTestsWithZoom(1);
45 runTestsWithZoom(2);
46 </script>
47 </html>