diff options
author | Cary Clark <cary@android.com> | 2009-06-04 16:36:05 -0400 |
---|---|---|
committer | Cary Clark <cary@android.com> | 2009-06-08 10:57:56 -0400 |
commit | 4ca8bc94f71466d1109bfbb9ef00da3256a0899b (patch) | |
tree | f9e33501cf7537082494018538140ae14fc8da82 /WebKit/android/nav | |
parent | a5ffe19691eaa28e4e2f85f34b262fe9762765e3 (diff) | |
download | external_webkit-4ca8bc94f71466d1109bfbb9ef00da3256a0899b.zip external_webkit-4ca8bc94f71466d1109bfbb9ef00da3256a0899b.tar.gz external_webkit-4ca8bc94f71466d1109bfbb9ef00da3256a0899b.tar.bz2 |
fix cursor movement bugs in browser
Remove obsolete recomputeFocus, old moveCursor code
Make sure focus is !null before using it.
Diffstat (limited to 'WebKit/android/nav')
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index bcd3622..94c419f 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -632,8 +632,7 @@ bool cursorWantsKeyEvents() } /* returns true if the key had no effect (neither scrolled nor changed cursor) */ -bool moveCursor(int keyCode, int count, bool ignoreScroll, bool inval, - void* lastSentCursor, const WebCore::IntRect* lastSentBounds) +bool moveCursor(int keyCode, int count, bool ignoreScroll) { CachedRoot* root = getFrameCache(AllowNewer); if (!root) { @@ -657,7 +656,6 @@ bool moveCursor(int keyCode, int count, bool ignoreScroll, bool inval, int xMax = getScaledMaxXScroll(); int yMax = getScaledMaxYScroll(); root->setMaxScroll(xMax, yMax); - CachedHistory savedHistory = *root->rootHistory(); const CachedNode* cachedNode = 0; int dx = 0; int dy = 0; @@ -698,25 +696,12 @@ bool moveCursor(int keyCode, int count, bool ignoreScroll, bool inval, this->scrollBy(dx, dy); m_lastDx = dx; m_lastDxTime = SkTime::GetMSecs(); - ignoreScroll = true; // if move re-executes, don't scroll the second time } bool result = false; if (cachedNode) { - WebCore::IntPoint pos; root->setCursor((CachedFrame*) cachedFrame, (CachedNode*) cachedNode); - root->getSimulatedMousePosition(&pos); - if (lastSentCursor == cachedNode->nodePointer() && lastSentBounds && - *lastSentBounds == cachedNode->bounds()) - { - sendMoveMouse((WebCore::Frame*) cachedFrame->framePointer(), - (WebCore::Node*) cachedNode->nodePointer(), pos.x(), pos.y()); - } else { - sendMoveMouseIfLatest(); - if (inval) - viewInvalidate(); - DBG_NAV_LOGD("history.mDidFirstLayout=%s", - savedHistory.didFirstLayout() ? "true" : "false"); - } + sendMoveMouseIfLatest(); + viewInvalidate(); } else { int docHeight = root->documentHeight(); int docWidth = root->documentWidth(); @@ -1556,14 +1541,7 @@ static bool nativeMoveCursor(JNIEnv *env, jobject obj, WebView* view = GET_NATIVE_VIEW(env, obj); DBG_NAV_LOGD("env=%p obj=%p view=%p", env, obj, view); LOG_ASSERT(view, "view not set in %s", __FUNCTION__); - return view->moveCursor(key, count, ignoreScroll, true, 0, 0); -} - -static void nativeRecomputeFocus(JNIEnv *env, jobject obj) -{ - WebView* view = GET_NATIVE_VIEW(env, obj); - LOG_ASSERT(view, "view not set in %s", __FUNCTION__); -// view->recomputeFocus(); + return view->moveCursor(key, count, ignoreScroll); } static void nativeRecordButtons(JNIEnv* env, jobject obj, bool hasFocus, @@ -1841,8 +1819,6 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeMoveGeneration }, { "nativeMoveSelection", "(IIZ)V", (void*) nativeMoveSelection }, - { "nativeRecomputeFocus", "()V", - (void*) nativeRecomputeFocus }, { "nativeRecordButtons", "(ZZZ)V", (void*) nativeRecordButtons }, { "nativeSelectBestAt", "(Landroid/graphics/Rect;)V", |