2 Test that fixed integral lengths round-trip correctly through zooming.
5 The test queries
<tt>offsetWidth
</tt> and
<tt>offsetHeight
</tt> of a
1×10-pixel rectangle under zooming by a factor of
<i>k
</i>/
100 for
100 ≤ <i>k
</i> ≤ 200.
7 <pre id=
"console"></pre>
9 <div id=
"target" style=
"width: 1px; height: 10px;"></div>
14 var console
= document
.getElementById("console");
15 console
.appendChild(document
.createTextNode(message
+ "\n"));
18 if (window
.testRunner
)
19 testRunner
.dumpAsText();
21 var target
= document
.getElementById("target");
22 var containerStyle
= document
.getElementById("container").style
;
26 for (zoom
= 100; zoom
<= 200; zoom
+= 1) {
27 containerStyle
.setProperty("zoom", zoom
/ 100);
28 if (Math
.abs(target
.offsetWidth
- 1) > 0.5 || Math
.abs(target
.offsetHeight
- 10) > 0.5) {
30 log("FAIL at " + zoom
+ "% magnification: 1 mapped to " + target
.offsetWidth
+ " and 10 mapped to " + target
.offsetHeight
+ ".");