2 <title>Test that ex, em, rem and ch font sizes are unaffected by zoom level
</title>
3 <script src=
"../../resources/ahem.js"></script>
4 <script src=
"../../resources/testharness.js"></script>
5 <script src=
"../../resources/testharnessreport.js"></script>
12 <svg width=
"100%" height=
"1em" xmlns=
"http://www.w3.org/2000/svg" version=
"1.1">
14 <text id=
"em" y=
"1em" dy=
"4em">XXXXXX XXX
</text>
15 <text id=
"rem" y=
"1em" dy=
"25rem">XXXXXX XXX
</text>
16 <text id=
"ex" y=
"1em" dy=
"5ex">XXXXXX XXX
</text>
17 <text id=
"ch" y=
"1em" dy=
"4ch">XXXXXX XXX
</text>
20 var zoomLevels
= [0.3, 4];
21 var html
= document
.documentElement
;
22 var textElements
= document
.querySelectorAll('text');
24 [].forEach
.call(textElements
, function(elm
) {
26 var reference_y
= elm
.getStartPositionOfChar(0).y
;
28 zoomLevels
.forEach(function (zoom
) {
29 html
.style
.zoom
= zoom
;
31 assert_approx_equals(elm
.getStartPositionOfChar(0).y
, reference_y
, 1);
32 }, "Unit " + elm
.id
+ " not affected by zoom level " + zoom
);
35 // Clean up to avoid being classified as a text test; avoids an -expected.txt file.