2 <script src="../../../../resources/js-test.js"></script>
15 <iframe frameborder=0 id="target" src="resources/event-delegator.html"></iframe>
16 <div id=console></div>
19 window.scrollTo(0, 3);
20 var rect = target.getBoundingClientRect();
22 x: rect.left + rect.width / 2,
23 y: rect.top + rect.height / 2 - 3
26 var eventReceived = {};
28 function onEventInFrame(e) {
29 debug("Received " + e.type + " in child frame");
31 eventReceived[e.type] = true;
32 shouldBe("event.screenX", "point.x");
33 shouldBe("event.screenY", "point.y");
34 shouldBe("event.clientX", "50 / 2");
35 shouldBe("event.clientY", "50 / 2 + 7");
38 description("Verifies that a tap occuring in a scrolled iframe has the correct co-ordinates");
40 if (window.eventSender) {
42 target.onload = function() {
43 target.contentWindow.scrollTo(0, 7);
45 debug("Sending GestureTapDown to " + point.x + "," + point.y);
46 eventSender.gestureTapDown(point.x, point.y);
48 debug("Sending GestureShowPress");
49 eventSender.gestureShowPress(point.x, point.y);
51 debug("Sending GestureTap");
52 eventSender.gestureTap(point.x, point.y);
54 shouldBeTrue("eventReceived.mousemove");
55 shouldBeTrue("eventReceived.mousedown");
56 shouldBeTrue("eventReceived.mouseup");
57 shouldBeTrue("eventReceived.click");
58 setTimeout(finishJSTest, 100);
61 debug("This test requires eventSender");