12 border:
1px solid red;
36 <script src=
"../../resources/js-test.js"></script>
40 Reported computed offset should not change with zoom level.
43 <div id=
"test-fixed"></div>
44 <div id=
"test-percentage"></div>
45 <div id=
"test-viewport"></div>
48 var fixedElement
= document
.getElementById('test-fixed');
49 var percentageElement
= document
.getElementById('test-percentage');
50 var viewportElement
= document
.getElementById('test-viewport');
51 function test(zoomLevel
)
53 document
.body
.style
.zoom
= zoomLevel
;
54 var windowWidth
= "'" + (window
.innerWidth
/ 10) + "px'";
55 var windowHeight
= "'" + (window
.innerHeight
/ 10) + "px'";
57 shouldBe("window.getComputedStyle(fixedElement).top", "'100px'");
58 shouldBe("window.getComputedStyle(fixedElement).right", "'100px'");
59 shouldBe("window.getComputedStyle(fixedElement).bottom", "'100px'");
60 shouldBe("window.getComputedStyle(fixedElement).left", "'100px'");
62 shouldBe("window.getComputedStyle(percentageElement).top", "'50px'");
63 shouldBe("window.getComputedStyle(percentageElement).right", "'100px'");
64 shouldBe("window.getComputedStyle(percentageElement).bottom", "'50px'");
65 shouldBe("window.getComputedStyle(percentageElement).left", "'100px'");
67 shouldBe("window.getComputedStyle(viewportElement).top", windowHeight
);
68 shouldBe("window.getComputedStyle(viewportElement).right", windowWidth
);
69 shouldBe("window.getComputedStyle(viewportElement).bottom", windowHeight
);
70 shouldBe("window.getComputedStyle(viewportElement).left", windowWidth
);