| Index: LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled.html
|
| diff --git a/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html b/LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled.html
|
| similarity index 57%
|
| copy from LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html
|
| copy to LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled.html
|
| index 90b80d3ad44684aabc31b818a9fbeb504a062937..f997c172a5bc3313eac5f978a70c840bade936c9 100644
|
| --- a/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html
|
| +++ b/LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled.html
|
| @@ -2,45 +2,47 @@
|
| <script src="../../../../resources/js-test.js"></script>
|
| <style>
|
| html, body {
|
| - margin: 0;
|
| -}
|
| -body {
|
| - height: 1000px;
|
| -}
|
| -#target {
|
| - width: 50px;
|
| - height: 50px;
|
| + margin: 0;
|
| + width: 2000px;
|
| + height: 2000px;
|
| }
|
| </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 scrollOffset = {
|
| + x: 12,
|
| + y: 42
|
| +};
|
| var point = {
|
| - x: rect.left + rect.width / 2,
|
| - y: rect.top + rect.height / 2 - 3
|
| + x: 50,
|
| + y: 50
|
| };
|
|
|
| var eventReceived = {};
|
|
|
| -function onEventInFrame(e) {
|
| - debug("Received " + e.type + " in child frame");
|
| +function onEvent(e) {
|
| + debug("Received " + e.type + " in page");
|
| 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");
|
| + shouldBe("event.clientX", "point.x");
|
| + shouldBe("event.clientY", "point.y");
|
| + shouldBe("event.pageX", "point.x + scrollOffset.x");
|
| + shouldBe("event.pageY", "point.y + scrollOffset.y");
|
| }
|
|
|
| -description("Verifies that a tap occuring in a scrolled iframe has the correct co-ordinates");
|
| +var eventTypes = ['mousemove', 'mousedown', 'mouseup', 'click'];
|
| +for (var i = 0; i < eventTypes.length; i++)
|
| + document.addEventListener(eventTypes[i],onEvent);
|
| +
|
| +description("Verifies that a tap occuring in a scrolled page has the correct co-ordinates");
|
|
|
| if (window.eventSender) {
|
| jsTestIsAsync = true;
|
| - target.onload = function() {
|
| - target.contentWindow.scrollTo(0, 7);
|
| + window.onload = function() {
|
| + window.scrollTo(scrollOffset.x, scrollOffset.y);
|
|
|
| debug("Sending GestureTapDown to " + point.x + "," + point.y);
|
| eventSender.gestureTapDown(point.x, point.y);
|
|
|