summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2009-10-28 14:25:19 -0400
committerLeon Scroggins <scroggo@google.com>2009-10-28 15:09:28 -0400
commit19194ea29920c2f7a02d08dfb0416608bc81dbb7 (patch)
tree6cb485cb986d886d210066e5585419e77e69d220 /WebKit/android
parent8c6c2864439f5757f8e480c9b23f640baacb9f4f (diff)
downloadexternal_webkit-19194ea29920c2f7a02d08dfb0416608bc81dbb7.zip
external_webkit-19194ea29920c2f7a02d08dfb0416608bc81dbb7.tar.gz
external_webkit-19194ea29920c2f7a02d08dfb0416608bc81dbb7.tar.bz2
Fix a clicking bug.
Remove some code that simulates a mouse click at the beginning of a textarea and the end of a textfield. The original goal was to make the click change the selection to be at the beginning or end of the field, respectively. However, we actually make another call which prevents this click from the selection. Further, the selection actually gets changed elsewhere. Fixes http://b/issue?id=2219233
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/nav/CachedRoot.cpp11
-rw-r--r--WebKit/android/nav/CachedRoot.h2
-rw-r--r--WebKit/android/nav/WebView.cpp7
3 files changed, 5 insertions, 15 deletions
diff --git a/WebKit/android/nav/CachedRoot.cpp b/WebKit/android/nav/CachedRoot.cpp
index 9608d64..38417b1 100644
--- a/WebKit/android/nav/CachedRoot.cpp
+++ b/WebKit/android/nav/CachedRoot.cpp
@@ -866,8 +866,7 @@ int CachedRoot::getBlockLeftEdge(int x, int y, float scale) const
return result;
}
-void CachedRoot::getSimulatedMousePosition(const CachedNode* cursor,
- WebCore::IntPoint* point) const
+void CachedRoot::getSimulatedMousePosition(WebCore::IntPoint* point) const
{
#ifndef NDEBUG
ASSERT(CachedFrame::mDebug.mInUse);
@@ -879,14 +878,6 @@ void CachedRoot::getSimulatedMousePosition(const CachedNode* cursor,
int height = mouseBounds.height();
point->setX(x + (width >> 1)); // default to box center
point->setY(y + (height >> 1));
- if (cursor && cursor->bounds().contains(mHistory->mMouseBounds)) {
- if (cursor->isTextField()) // if text field, return end of line
- point->setX(x + width - 1);
- else if (cursor->isTextArea()) { // if text area, return start
- point->setX(x + 1);
- point->setY(y + 1);
- }
- }
#if DEBUG_NAV_UI
const WebCore::IntRect& navBounds = mHistory->mNavBounds;
DBG_NAV_LOGD("mHistory->mNavBounds={%d,%d,%d,%d} "
diff --git a/WebKit/android/nav/CachedRoot.h b/WebKit/android/nav/CachedRoot.h
index f84542c..123e7d2 100644
--- a/WebKit/android/nav/CachedRoot.h
+++ b/WebKit/android/nav/CachedRoot.h
@@ -67,7 +67,7 @@ public:
int getAndResetSelectionEnd();
int getAndResetSelectionStart();
int getBlockLeftEdge(int x, int y, float scale) const;
- void getSimulatedMousePosition(const CachedNode* , WebCore::IntPoint* ) const;
+ void getSimulatedMousePosition(WebCore::IntPoint* ) const;
void init(WebCore::Frame* , CachedHistory* );
bool innerDown(const CachedNode* , BestData* ) const;
bool innerLeft(const CachedNode* , BestData* ) const;
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index 20daafc..cc90396 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -741,8 +741,7 @@ void updateCursorBounds(const CachedRoot* root, const CachedFrame* cachedFrame,
m_viewImpl->m_cursorBounds = cachedNode->bounds();
m_viewImpl->m_cursorHitBounds = cachedNode->hitBounds();
m_viewImpl->m_cursorFrame = cachedFrame->framePointer();
- root->getSimulatedMousePosition(cachedNode,
- &m_viewImpl->m_cursorLocation);
+ root->getSimulatedMousePosition(&m_viewImpl->m_cursorLocation);
m_viewImpl->m_cursorNode = cachedNode->nodePointer();
}
m_viewImpl->gCursorBoundsMutex.unlock();
@@ -1462,7 +1461,7 @@ static jobject nativeCursorPosition(JNIEnv *env, jobject obj)
const CachedRoot* root = view->getFrameCache(WebView::DontAllowNewer);
WebCore::IntPoint pos = WebCore::IntPoint(0, 0);
if (root)
- root->getSimulatedMousePosition(root->currentCursor(), &pos);
+ root->getSimulatedMousePosition(&pos);
jclass pointClass = env->FindClass("android/graphics/Point");
jmethodID init = env->GetMethodID(pointClass, "<init>", "(II)V");
jobject point = env->NewObject(pointClass, init, pos.x(), pos.y());
@@ -1929,7 +1928,7 @@ static void nativeMoveCursorToNextTextInput(JNIEnv *env, jobject obj)
root->setCursor(const_cast<CachedFrame*>(frame),
const_cast<CachedNode*>(next));
WebCore::IntPoint pos;
- root->getSimulatedMousePosition(next, &pos);
+ root->getSimulatedMousePosition(&pos);
view->sendMoveMouse(static_cast<WebCore::Frame*>(frame->framePointer()),
static_cast<WebCore::Node*>(next->nodePointer()), pos.x(), pos.y());
view->scrollRectOnScreen(bounds.x(), bounds.y(), bounds.right(),