summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-05-16 20:16:21 -0700
committerJohn Reck <jreck@google.com>2012-05-16 20:19:20 -0700
commit98db50b8d8923d319a1677bcba3784baeae03ab5 (patch)
treea561fea1c64eb4222c58327ff680101a9212581c /Source/WebKit/android/jni/WebViewCore.cpp
parentf0acbad2f51b0bd62dbc427b4f2fdc97e233edb9 (diff)
downloadexternal_webkit-98db50b8d8923d319a1677bcba3784baeae03ab5.zip
external_webkit-98db50b8d8923d319a1677bcba3784baeae03ab5.tar.gz
external_webkit-98db50b8d8923d319a1677bcba3784baeae03ab5.tar.bz2
Track where we want to click the mouse independently
Bug: 6490959 Change-Id: I920167cb16723f63132ecdb5581fb7a19e4461dd
Diffstat (limited to 'Source/WebKit/android/jni/WebViewCore.cpp')
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index dc4f70c..8870b70 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -1783,7 +1783,7 @@ bool WebViewCore::nodeIsClickableOrFocusable(Node* node)
AndroidHitTestResult WebViewCore::hitTestAtPoint(int x, int y, int slop, bool doMoveMouse)
{
if (doMoveMouse)
- moveMouse(x, y);
+ moveMouse(x, y, 0, true);
HitTestResult hitTestResult = m_mainFrame->eventHandler()->hitTestResultAtPoint(IntPoint(x, y),
false, false, DontHitTestScrollbars, HitTestRequest::Active | HitTestRequest::ReadOnly, IntSize(slop, slop));
AndroidHitTestResult androidHitResult(this, hitTestResult);
@@ -1942,7 +1942,7 @@ AndroidHitTestResult WebViewCore::hitTestAtPoint(int x, int y, int slop, bool do
testRect.move(frameAdjust.x(), frameAdjust.y());
testRect.intersect(rect);
if (!testRect.contains(x, y))
- moveMouse(testRect.center().x(), testRect.center().y());
+ moveMouse(testRect.center().x(), testRect.center().y(), 0, true);
}
} else {
androidHitResult.searchContentDetectors();
@@ -2121,10 +2121,12 @@ static PluginView* nodeIsPlugin(Node* node) {
///////////////////////////////////////////////////////////////////////////////
// Update mouse position
-void WebViewCore::moveMouse(int x, int y, HitTestResult* hoveredNode)
+void WebViewCore::moveMouse(int x, int y, HitTestResult* hoveredNode, bool isClickCandidate)
{
// mouse event expects the position in the window coordinate
m_mousePos = WebCore::IntPoint(x - m_scrollOffsetX, y - m_scrollOffsetY);
+ if (isClickCandidate)
+ m_mouseClickPos = m_mousePos;
// validNode will still return true if the node is null, as long as we have
// a valid frame. Do not want to make a call on frame unless it is valid.
WebCore::PlatformMouseEvent mouseEvent(m_mousePos, m_mousePos,
@@ -3240,12 +3242,12 @@ bool WebViewCore::handleTouchEvent(int action, Vector<int>& ids, Vector<IntPoint
bool WebViewCore::performMouseClick()
{
- WebCore::PlatformMouseEvent mouseDown(m_mousePos, m_mousePos, WebCore::LeftButton,
+ WebCore::PlatformMouseEvent mouseDown(m_mouseClickPos, m_mouseClickPos, WebCore::LeftButton,
WebCore::MouseEventPressed, 1, false, false, false, false,
WTF::currentTime());
// ignore the return from as it will return true if the hit point can trigger selection change
m_mainFrame->eventHandler()->handleMousePressEvent(mouseDown);
- WebCore::PlatformMouseEvent mouseUp(m_mousePos, m_mousePos, WebCore::LeftButton,
+ WebCore::PlatformMouseEvent mouseUp(m_mouseClickPos, m_mouseClickPos, WebCore::LeftButton,
WebCore::MouseEventReleased, 1, false, false, false, false,
WTF::currentTime());
bool handled = m_mainFrame->eventHandler()->handleMouseReleaseEvent(mouseUp);