[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
eric at webkit.org
eric at webkit.org
Wed Jan 20 22:19:11 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit b38969670f46ceef6f1651bb5e95708972f98ddd
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Jan 11 09:44:58 2010 +0000
2010-01-11 Kim Grönholm <kim.gronholm at nomovok.com>
Reviewed by Antti Koivisto.
Touchevent coordinates are incorrect after page zoom and page scroll
https://bugs.webkit.org/show_bug.cgi?id=32899
* fast/events/touch-coords-in-zoom-and-scroll-expected.txt: Added.
* fast/events/touch-coords-in-zoom-and-scroll.html: Added.
* platform/gtk/Skipped:
* platform/mac/Skipped:
* platform/win/Skipped:
2010-01-11 Kim Grönholm <kim.gronholm at nomovok.com>
Reviewed by Antti Koivisto.
Touchevent coordinates are incorrect after page zoom and page scroll
https://bugs.webkit.org/show_bug.cgi?id=32899
Test: fast/events/touch-coords-in-zoom-and-scroll.html
* dom/Touch.cpp:
(WebCore::contentsX):
(WebCore::contentsY):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleTouchEvent):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 0bd2a9a..2f1e5e7 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-11 Kim Grönholm <kim.gronholm at nomovok.com>
+
+ Reviewed by Antti Koivisto.
+
+ Touchevent coordinates are incorrect after page zoom and page scroll
+ https://bugs.webkit.org/show_bug.cgi?id=32899
+
+ * fast/events/touch-coords-in-zoom-and-scroll-expected.txt: Added.
+ * fast/events/touch-coords-in-zoom-and-scroll.html: Added.
+ * platform/gtk/Skipped:
+ * platform/mac/Skipped:
+ * platform/win/Skipped:
+
2010-01-11 Tony Chang <tony at chromium.org>
Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/events/touch-coords-in-zoom-and-scroll-expected.txt b/LayoutTests/fast/events/touch-coords-in-zoom-and-scroll-expected.txt
new file mode 100644
index 0000000..83823f4
--- /dev/null
+++ b/LayoutTests/fast/events/touch-coords-in-zoom-and-scroll-expected.txt
@@ -0,0 +1,27 @@
+Base
+PASS event.touches[0].clientX is 100
+PASS event.touches[0].clientY is 100
+PASS event.touches[0].pageX is 100
+PASS event.touches[0].pageY is 100
+
+Just zoomed
+PASS event.touches[0].clientX is 83
+PASS event.touches[0].clientY is 83
+PASS event.touches[0].pageX is 83
+PASS event.touches[0].pageY is 83
+
+Just scrolled
+PASS event.touches[0].clientX is 100
+PASS event.touches[0].clientY is 100
+PASS event.touches[0].pageX is 150
+PASS event.touches[0].pageY is 150
+
+Zoomed and scrolled
+PASS event.touches[0].clientX is 84
+PASS event.touches[0].clientY is 84
+PASS event.touches[0].pageX is 133
+PASS event.touches[0].pageY is 133
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch-coords-in-zoom-and-scroll.html b/LayoutTests/fast/events/touch-coords-in-zoom-and-scroll.html
new file mode 100644
index 0000000..761b0b9
--- /dev/null
+++ b/LayoutTests/fast/events/touch-coords-in-zoom-and-scroll.html
@@ -0,0 +1,132 @@
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+<style>
+ #pusher {
+ width: 1000px;
+ height: 1000px;
+ outline: 1px solid black;
+ }
+</style>
+<div id="console"></div>
+<div id="testArea">
+ <div id="pusher">This box is here to create scrollbars.</div>
+</div>
+<script src="../js/resources/js-test-post-function.js"></script>
+<script>
+ var event;
+
+ function sendTouchMove()
+ {
+ if (window.eventSender) {
+ eventSender.touchMove();
+ }
+ }
+
+ function zoomPageIn()
+ {
+ if (window.eventSender) {
+ eventSender.zoomPageIn();
+ }
+ }
+
+ function zoomPageOut()
+ {
+ if (window.eventSender) {
+ eventSender.zoomPageOut();
+ }
+ }
+
+ function scrollPage(x, y)
+ {
+ window.scrollTo(x, y);
+ }
+
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ // Default.
+ function base(e)
+ {
+ event = e;
+ debug("Base");
+ shouldBe("event.touches[0].clientX", "100");
+ shouldBe("event.touches[0].clientY", "100");
+ shouldBe("event.touches[0].pageX", "100");
+ shouldBe("event.touches[0].pageY", "100");
+ }
+
+ window.addEventListener("touchmove", base, false);
+
+ if (window.eventSender) {
+ eventSender.addTouchPoint(100, 100);
+ eventSender.touchStart();
+ }
+
+ sendTouchMove();
+ window.removeEventListener("touchmove", base, false);
+
+ // Just zoomed.
+ function justZoomed(e)
+ {
+ event = e;
+ debug("\nJust zoomed");
+ shouldBe("event.touches[0].clientX", "83");
+ shouldBe("event.touches[0].clientY", "83");
+ shouldBe("event.touches[0].pageX", "83");
+ shouldBe("event.touches[0].pageY", "83");
+ }
+ window.addEventListener("touchmove", justZoomed, false);
+ zoomPageIn();
+ sendTouchMove();
+ zoomPageOut();
+ window.removeEventListener("touchmove", justZoomed, false);
+
+ // Just scrolled.
+ function justScrolled(e)
+ {
+ event = e;
+ debug("\nJust scrolled");
+ shouldBe("event.touches[0].clientX", "100");
+ shouldBe("event.touches[0].clientY", "100");
+ shouldBe("event.touches[0].pageX", "150");
+ shouldBe("event.touches[0].pageY", "150");
+ }
+ window.addEventListener("touchmove", justScrolled, false);
+ scrollPage(50, 50);
+ sendTouchMove();
+ scrollPage(0, 0);
+ window.removeEventListener("touchmove", justScrolled, false);
+
+ // Zoomed and scrolled.
+ function zoomedAndScrolled(e)
+ {
+ event = e;
+ debug("\nZoomed and scrolled");
+ shouldBe("event.touches[0].clientX", "84");
+ shouldBe("event.touches[0].clientY", "84");
+ shouldBe("event.touches[0].pageX", "133");
+ shouldBe("event.touches[0].pageY", "133");
+ }
+ window.addEventListener("touchmove", zoomedAndScrolled, false);
+ zoomPageIn();
+ scrollPage(50, 50);
+ sendTouchMove();
+ zoomPageOut();
+ scrollPage(0, 0);
+ window.removeEventListener("touchmove", zoomedAndScrolled, false);
+
+ if (window.eventSender) {
+ eventSender.touchEnd();
+ eventSender.clearTouchPoints();
+ }
+
+ if (window.layoutTestController) {
+ var area = document.getElementById('testArea');
+ area.parentNode.removeChild(area);
+ successfullyParsed = true;
+ isSuccessfullyParsed();
+ layoutTestController.notifyDone();
+ }
+</script>
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index 933d95f..e6ae3bb 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -5704,8 +5704,9 @@ http/tests/security/mixedContent/empty-url-plugin-in-frame.html
# See: https://bugzilla.gnome.org/show_bug.cgi?id=603825
fast/cookies/local-file-can-set-cookies.html
-# This test requires touch support
+# These tests require touch support
fast/events/basic-touch-events.html
+fast/events/touch-coords-in-zoom-and-scroll.html
# Javascript execution/mainloop problem
# See https://bugs.webkit.org/show_bug.cgi?id=32441
diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped
index f73d7f9..5565101 100644
--- a/LayoutTests/platform/mac/Skipped
+++ b/LayoutTests/platform/mac/Skipped
@@ -93,5 +93,6 @@ plugins/reloadplugins-and-pages.html
# This test requires ogg codecs
media/media-can-play-ogg.html
-# This test requires touch support
+# These tests require touch support
fast/events/basic-touch-events.html
+fast/events/touch-coords-in-zoom-and-scroll.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index a4bbe69..0f2863f 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -717,8 +717,9 @@ inspector/timeline-network-resource.html
# This test requires ogg codecs
media/media-can-play-ogg.html
-# This test requires touch support
+# These tests require touch support
fast/events/basic-touch-events.html
+fast/events/touch-coords-in-zoom-and-scroll.html
# XSS auditor tests intermittently time out <http://webkit.org/b/32528>
http/tests/security/xss-DENIED-getSVGDocument-iframe.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 075a233..1a10811 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-01-11 Kim Grönholm <kim.gronholm at nomovok.com>
+
+ Reviewed by Antti Koivisto.
+
+ Touchevent coordinates are incorrect after page zoom and page scroll
+ https://bugs.webkit.org/show_bug.cgi?id=32899
+
+ Test: fast/events/touch-coords-in-zoom-and-scroll.html
+
+ * dom/Touch.cpp:
+ (WebCore::contentsX):
+ (WebCore::contentsY):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleTouchEvent):
+
2010-01-11 Tony Chang <tony at chromium.org>
Reviewed by Eric Seidel.
diff --git a/WebCore/dom/Touch.cpp b/WebCore/dom/Touch.cpp
index 6dd2b8e..41d5c19 100644
--- a/WebCore/dom/Touch.cpp
+++ b/WebCore/dom/Touch.cpp
@@ -40,7 +40,7 @@ static int contentsX(Frame* frame)
FrameView* frameView = frame->view();
if (!frameView)
return 0;
- return frameView->scrollX();
+ return frameView->scrollX() / frame->pageZoomFactor();
}
static int contentsY(Frame* frame)
@@ -50,7 +50,7 @@ static int contentsY(Frame* frame)
FrameView* frameView = frame->view();
if (!frameView)
return 0;
- return frameView->scrollY();
+ return frameView->scrollY() / frame->pageZoomFactor();
}
Touch::Touch(Frame* frame, EventTarget* target, unsigned identifier,
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index ed6bc4a..add5ade 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -2563,9 +2563,12 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
if (target && target->isTextNode())
target = target->parentNode();
+ int adjustedPageX = lroundf(framePoint.x() / m_frame->pageZoomFactor());
+ int adjustedPageY = lroundf(framePoint.y() / m_frame->pageZoomFactor());
+
RefPtr<Touch> touch = Touch::create(m_frame, target, point.id(),
point.screenPos().x(), point.screenPos().y(),
- framePoint.x(), framePoint.y());
+ adjustedPageX, adjustedPageY);
if (event.type() == TouchStart && !i) {
m_touchEventTarget = target;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list