Index: LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html |
diff --git a/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html b/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..90b80d3ad44684aabc31b818a9fbeb504a062937 |
--- /dev/null |
+++ b/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html |
@@ -0,0 +1,63 @@ |
+<!DOCTYPE HTML> |
+<script src="../../../../resources/js-test.js"></script> |
+<style> |
+html, body { |
+ margin: 0; |
+} |
+body { |
+ height: 1000px; |
+} |
+#target { |
+ width: 50px; |
+ height: 50px; |
+} |
+</style> |
+<iframe frameborder=0 id="target" src="resources/event-delegator.html"></iframe> |
+<div id=console></div> |
+<script> |
+var event; |
+window.scrollTo(0, 3); |
+var rect = target.getBoundingClientRect(); |
+var point = { |
+ x: rect.left + rect.width / 2, |
+ y: rect.top + rect.height / 2 - 3 |
+}; |
+ |
+var eventReceived = {}; |
+ |
+function onEventInFrame(e) { |
+ debug("Received " + e.type + " in child frame"); |
+ event = e; |
+ eventReceived[e.type] = true; |
+ shouldBe("event.screenX", "point.x"); |
+ shouldBe("event.screenY", "point.y"); |
+ shouldBe("event.clientX", "50 / 2"); |
+ shouldBe("event.clientY", "50 / 2 + 7"); |
+} |
+ |
+description("Verifies that a tap occuring in a scrolled iframe has the correct co-ordinates"); |
+ |
+if (window.eventSender) { |
+ jsTestIsAsync = true; |
+ target.onload = function() { |
+ target.contentWindow.scrollTo(0, 7); |
+ |
+ debug("Sending GestureTapDown to " + point.x + "," + point.y); |
+ eventSender.gestureTapDown(point.x, point.y); |
+ |
+ debug("Sending GestureShowPress"); |
+ eventSender.gestureShowPress(point.x, point.y); |
+ |
+ debug("Sending GestureTap"); |
+ eventSender.gestureTap(point.x, point.y); |
+ |
+ shouldBeTrue("eventReceived.mousemove"); |
+ shouldBeTrue("eventReceived.mousedown"); |
+ shouldBeTrue("eventReceived.mouseup"); |
+ shouldBeTrue("eventReceived.click"); |
+ setTimeout(finishJSTest, 100); |
+ } |
+} else { |
+ debug("This test requires eventSender"); |
+} |
+</script> |