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">
8 <circle id=
"circle" cx=
"50" cy=
"60" r=
"32"/>
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"/>
18 var elms
= document
.querySelectorAll(".test");
19 var attrs
= [ "x", "y" ];
22 [ "17px", "192.756px" ],
23 [ "22%", "151.181px" ],
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
++) {
35 assert_equals(style
.getPropertyValue(attrs
[j
]), expected
[i
][j
]);
36 }, "zoom=" + zoomLevel
+ ": " + elms
[i
].localName
+ " getPropertyValue(" + attrs
[j
] + ")");
38 assert_equals(style
[attrs
[j
]], expected
[i
][j
]);
39 }, "zoom=" + zoomLevel
+ ": " +elms
[i
].localName
+ " style." + attrs
[j
]);