1 <script src="../js/resources/js-test-pre.js"></script>
6 outline: 1px solid black;
12 <div id="console"></div>
14 <div id="pusher">This box is here to create scrollbars.</div>
15 <div id="subpixel-test"></div>
18 var r = document.getElementById('subpixel-test').getBoundingClientRect();
19 var hasSubpixelSupport = r.right - r.left == 4.5;
25 if (window.eventSender) {
26 eventSender.mouseMoveTo(100, 100);
27 eventSender.mouseDown();
28 eventSender.mouseUp();
34 if (window.eventSender) {
35 eventSender.zoomPageIn();
39 function zoomPageOut()
41 if (window.eventSender) {
42 eventSender.zoomPageOut();
46 function scrollPage(x, y)
48 window.scrollTo(x, y);
51 if (window.layoutTestController) {
52 layoutTestController.dumpAsText();
53 layoutTestController.waitUntilDone();
61 shouldBe("event.clientX", "100");
62 shouldBe("event.clientY", "100");
63 shouldBe("event.pageX", "100");
64 shouldBe("event.pageY", "100");
66 window.addEventListener("click", base, false);
68 window.removeEventListener("click", base, false);
71 function justZoomed(e)
74 debug("\nJust zoomed");
75 shouldBe("event.clientX", "83");
76 shouldBe("event.clientY", "83");
77 shouldBe("event.pageX", "83");
78 shouldBe("event.pageY", "83");
80 window.addEventListener("click", justZoomed, false);
84 window.removeEventListener("click", justZoomed, false);
87 function justScrolled(e)
90 debug("\nJust scrolled");
91 shouldBe("event.clientX", "100");
92 shouldBe("event.clientY", "100");
93 shouldBe("event.pageX", "150");
94 shouldBe("event.pageY", "150");
96 window.addEventListener("click", justScrolled, false);
100 window.removeEventListener("click", justScrolled, false);
102 // Zoomed and scrolled.
103 function zoomedAndScrolled(e)
106 debug("\nZoomed and scrolled");
107 shouldBe("event.clientX", hasSubpixelSupport ? "83" : "84");
108 shouldBe("event.clientY", hasSubpixelSupport ? "83" : "84");
109 shouldBe("event.pageX", "133");
110 shouldBe("event.pageY", "133");
112 window.addEventListener("click", zoomedAndScrolled, false);
118 window.removeEventListener("click", zoomedAndScrolled, false);
120 if (window.layoutTestController) {
121 var area = document.getElementById('testArea');
122 area.parentNode.removeChild(area);
124 layoutTestController.notifyDone();
127 <script src="../js/resources/js-test-post.js"></script>