diff options
Diffstat (limited to 'WebKit/android/nav')
-rw-r--r-- | WebKit/android/nav/SelectText.cpp | 10 | ||||
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 5 |
2 files changed, 7 insertions, 8 deletions
diff --git a/WebKit/android/nav/SelectText.cpp b/WebKit/android/nav/SelectText.cpp index f2d7521..ff69ddd 100644 --- a/WebKit/android/nav/SelectText.cpp +++ b/WebKit/android/nav/SelectText.cpp @@ -608,11 +608,11 @@ public: } // cx and cy are the distances from the tested center // The center distance is used when the test point is over the text - int cx = INT_MAX; - int cy = INT_MAX; - if (ignoreColumn && dy == 0 && mDy == 0) { - cy = std::abs(((testBounds.fTop + testBounds.fBottom) >> 1) + int cx = std::abs(((testBounds.fLeft + testBounds.fRight) >> 1) + - mFocusX); + int cy = std::abs(((testBounds.fTop + testBounds.fBottom) >> 1) - mFocusY); + if (ignoreColumn && dy == 0 && mDy == 0) { if (mCy < cy) { #ifdef EXTRA_NOISY_LOGGING DBG_NAV_LOGD("FirstCheck reject cy=%d mCy=%d", cy, mCy); @@ -621,8 +621,6 @@ public: } if (mCy == cy) { if (dx == 0 && mDx == 0) { - cx = std::abs(((testBounds.fLeft + testBounds.fRight) >> 1) - - mFocusX); if (mCx < cx) { #ifdef EXTRA_NOISY_LOGGING DBG_NAV_LOGD("FirstCheck reject cx=%d mCx=%d", cx, mCx); diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 8252bb8..76feacd 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -840,8 +840,9 @@ bool moveCursor(int keyCode, int count, bool ignoreScroll) m_viewImpl->updateCursorBounds(root, cachedFrame, cachedNode); root->setCursor(const_cast<CachedFrame*>(cachedFrame), const_cast<CachedNode*>(cachedNode)); - bool clearTextEntry = cachedNode != root->currentFocus() - && cachedNode->wantsKeyEvents(); + const CachedNode* focus = root->currentFocus(); + bool clearTextEntry = cachedNode != focus && focus + && cachedNode->nodePointer() != focus->nodePointer() && focus->isTextInput(); sendMoveMouseIfLatest(clearTextEntry); sendMoveSelection((WebCore::Frame*) cachedFrame->framePointer(), (WebCore::Node*) cachedNode->nodePointer()); |