Commit 585f6a68 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

Gesture events sent to wrong node when page is scrolled

https://bugs.webkit.org/show_bug.cgi?id=96788

Patch by Rick Byers <rbyers@chromium.org> on 2012-09-14
Reviewed by Antonio Gomes.

Source/WebCore:

Adjust the co-ordinate space correctly when doing hit testing for
gesture events (as for all other event handling code here).

Test: platform/chromium/plugins/gesture-events-scrolled.html

* page/EventHandler.cpp:
(WebCore::EventHandler::handleGestureEvent):

LayoutTests:

Add layout test based on gesture-events.html which tests the case when
the document is scrolled (so that client co-ordinates don't equal page
co-ordinates).
* platform/chromium/plugins/gesture-events-scrolled-expected.txt: Added.
* platform/chromium/plugins/gesture-events-scrolled.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 67066198
2012-09-14 Rick Byers <rbyers@chromium.org>
Gesture events sent to wrong node when page is scrolled
https://bugs.webkit.org/show_bug.cgi?id=96788
Reviewed by Antonio Gomes.
Add layout test based on gesture-events.html which tests the case when
the document is scrolled (so that client co-ordinates don't equal page
co-ordinates).
* platform/chromium/plugins/gesture-events-scrolled-expected.txt: Added.
* platform/chromium/plugins/gesture-events-scrolled.html: Added.
2012-09-14 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
 
[EFL][WK2] Unskip test cases that are now passing
Plugin received event: GestureTap
Plugin received event: MouseEnter
Plugin received event: MouseMove
Plugin received event: MouseDown
Plugin received event: MouseUp
Plugin received event: GestureScrollBegin
Plugin received event: GestureScrollUpdate
Plugin received event: MouseWheel
Plugin received event: GestureScrollEnd
<html>
<head>
<style>
body {
height: 2000px;
}
#plugin {
position: absolute;
top: 500px;
width: 150px;
height: 150px;
}
</style>
</head>
<body>
<embed id="plugin" type="application/x-webkit-test-webplugin" primitive="triangle" background-color="green" primitive-color="blue"></embed>
<script>
if (!window.testRunner) {
document.write("This test does not work in manual mode.");
} else {
testRunner.dumpAsText();
// Scroll so the plugin is 100px down the page
window.scroll(0, 400);
// These events should not reach the plugin since it's futher down on the page.
eventSender.gestureTapDown(30, 30);
eventSender.gestureTapDown(30, 530);
// Send some gesture events to the plugin.
var positionX = 30;
var positionY = 110;
eventSender.gestureTap(positionX, positionY);
eventSender.gestureScrollBegin(positionX, positionY);
eventSender.gestureScrollUpdate(30, 0);
eventSender.gestureScrollEnd(0, 0);
}
</script>
</body>
</html>
2012-09-14 Rick Byers <rbyers@chromium.org>
Gesture events sent to wrong node when page is scrolled
https://bugs.webkit.org/show_bug.cgi?id=96788
Reviewed by Antonio Gomes.
Adjust the co-ordinate space correctly when doing hit testing for
gesture events (as for all other event handling code here).
Test: platform/chromium/plugins/gesture-events-scrolled.html
* page/EventHandler.cpp:
(WebCore::EventHandler::handleGestureEvent):
2012-09-14 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
 
[EFL] Attempt to create a theme for 0 sized element leads to assertion hit
......@@ -2381,7 +2381,8 @@ bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent)
eventTarget = m_scrollGestureHandlingNode.get();
if (!eventTarget) {
HitTestResult result = hitTestResultAtPoint(gestureEvent.position(), false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active);
IntPoint hitTestPoint = m_frame->view()->windowToContents(gestureEvent.position());
HitTestResult result = hitTestResultAtPoint(hitTestPoint, false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active);
eventTarget = result.targetNode();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment