4 <title>layout zoom test
</title>
20 The box above should be navy blue with no banding effects.
<br>
24 var testElement
= document
.getElementById('test');
25 var consoleElement
= document
.getElementById('console');
29 testElement
.innerHTML
= '';
30 for (var i
= 0; i
< 100; i
++)
31 testElement
.appendChild(document
.createElement('div'));
36 testElement
.style
.zoom
= zoom
+ '%';
38 var lastElementBottom
= testElement
.lastChild
.getBoundingClientRect().bottom
;
39 var containerBottom
= testElement
.getBoundingClientRect().bottom
;
41 var tolerance
= Math
.ceil(1 / (zoom
/ 100));
42 if (Math
.abs(lastElementBottom
- containerBottom
) <= tolerance
)
43 log('PASS: With zoom of ' + zoom
+ '% bottom edge of last child lines up with bottom edge of container.');
45 log('FAIL: With zoom of ' + zoom
+ '% bottom edge of last child at ' + lastElementBottom
+ ', container at ' + containerBottom
+ '.');
50 consoleElement
.appendChild(document
.createTextNode(str
));
51 consoleElement
.appendChild(document
.createElement('br'));