diff options
Diffstat (limited to 'WebKit/android/nav')
| -rw-r--r-- | WebKit/android/nav/CachedRoot.cpp | 10 | ||||
| -rw-r--r-- | WebKit/android/nav/WebView.cpp | 28 |
2 files changed, 21 insertions, 17 deletions
diff --git a/WebKit/android/nav/CachedRoot.cpp b/WebKit/android/nav/CachedRoot.cpp index d9669bd..5805e5f 100644 --- a/WebKit/android/nav/CachedRoot.cpp +++ b/WebKit/android/nav/CachedRoot.cpp @@ -154,11 +154,11 @@ public: } if (interestingType == false) return false; - if (mBoundsSlop.contains(rect) || + if (!mDrawnOver.contains(rect) && (mBoundsSlop.contains(rect) || (mBounds.fLeft == rect.fLeft && mBounds.fRight == rect.fRight && mBounds.fTop >= rect.fTop && mBounds.fBottom <= rect.fBottom) || (mBounds.fTop == rect.fTop && mBounds.fBottom == rect.fBottom && - mBounds.fLeft >= rect.fLeft && mBounds.fRight <= rect.fRight)) { + mBounds.fLeft >= rect.fLeft && mBounds.fRight <= rect.fRight))) { mDrawnOver.setEmpty(); mAllDrawnIn.join(rect); DBG_NAV_LOGD("BoundsCheck (contains) rect={%d,%d,%d,%d}" @@ -1125,8 +1125,8 @@ bool CachedRoot::maskIfHidden(BestData* best) const checker.drawPicture(*mPicture); boundsCheck.checkLast(); // was it not drawn or clipped out? + CachedNode* node = const_cast<CachedNode*>(best->mNode); if (boundsCheck.hidden()) { // if hidden, return false so that nav can try again - CachedNode* node = const_cast<CachedNode*>(best->mNode); #if DEBUG_NAV_UI const SkIRect& m = boundsCheck.mBounds; const SkIRect& s = boundsCheck.mBoundsSlop; @@ -1177,12 +1177,14 @@ bool CachedRoot::maskIfHidden(BestData* best) const #if DEBUG_NAV_UI const SkIRect& modded = boundsCheck.mBounds; DBG_NAV_LOGD("partially occluded node:%p (%d) old:{%d,%d,%d,%d}" - " new:{%d,%d,%d,%d}", best->mNode, best->mNode->index(), + " new:{%d,%d,%d,%d}", node, node->index(), orig.fLeft, orig.fTop, orig.fRight, orig.fBottom, base.fLeft, base.fTop, base.fRight, base.fBottom); #endif best->mMouseBounds = WebCore::IntRect(bounds.x() + base.fLeft - kMargin, bounds.y() + base.fTop - kMargin, base.width(), base.height()); + node->clip(best->mMouseBounds); + return true; } return false; } diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 8931d72..dae93fc 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -25,9 +25,8 @@ #define LOG_TAG "webviewglue" -#include <config.h> +#include "config.h" -#include "android_graphics.h" #include "AndroidAnimation.h" #include "AndroidLog.h" #include "AtomicString.h" @@ -55,13 +54,12 @@ #include "SkPixelXorXfermode.h" #include "SkRect.h" #include "SkTime.h" -#include "WebCoreJni.h" -#include "WebViewCore.h" -#include "jni_utility.h" - #ifdef ANDROID_INSTRUMENT #include "TimeCounter.h" #endif +#include "WebCoreJni.h" +#include "WebViewCore.h" +#include "android_graphics.h" #ifdef GET_NATIVE_VIEW #undef GET_NATIVE_VIEW @@ -69,9 +67,10 @@ #define GET_NATIVE_VIEW(env, obj) ((WebView*)env->GetIntField(obj, gWebViewField)) -#include <ui/KeycodeLabels.h> +#include <JNIUtility.h> #include <JNIHelp.h> #include <jni.h> +#include <ui/KeycodeLabels.h> namespace android { @@ -1515,7 +1514,8 @@ static void nativeDrawMatches(JNIEnv *env, jobject obj, jobject canv) } static void nativeDrawLayers(JNIEnv *env, jobject obj, - jint layer, jfloat scrollX, jfloat scrollY, + jint layer, jint scrollX, jint scrollY, + jint width, jint height, jfloat scale, jobject canv) { if (!env) @@ -1529,7 +1529,7 @@ static void nativeDrawLayers(JNIEnv *env, jobject obj, LayerAndroid* layerImpl = reinterpret_cast<LayerAndroid*>(layer); SkCanvas* canvas = GraphicsJNI::getNativeCanvas(env, canv); if (canvas) - layerImpl->paintOn(scrollX, scrollY, scale, canvas); + layerImpl->paintOn(scrollX, scrollY, width, height, scale, canvas); #endif } @@ -1998,13 +1998,15 @@ static void nativeMoveCursorToNextTextInput(JNIEnv *env, jobject obj) CachedRoot* root = view->getFrameCache(WebView::DontAllowNewer); if (!root) return; - const CachedNode* current = root->currentCursor(); + const CachedFrame* containingFrame; + const CachedNode* current = root->currentCursor(&containingFrame); if (!current) - current = root->currentFocus(); + current = root->currentFocus(&containingFrame); if (!current) return; const CachedFrame* frame; - const CachedNode* next = root->nextTextField(current, &frame, true); + const CachedNode* next = containingFrame->nextTextField(current, &frame, + true); if (!next) return; const WebCore::IntRect& bounds = next->bounds(); @@ -2134,7 +2136,7 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeLayersHaveAnimations }, { "nativeEvaluateLayersAnimations", "(I)I", (void*) nativeEvaluateLayersAnimations }, - { "nativeDrawLayers", "(IFFFLandroid/graphics/Canvas;)V", + { "nativeDrawLayers", "(IIIIIFLandroid/graphics/Canvas;)V", (void*) nativeDrawLayers }, { "nativeUpdateLayers", "(II)V", (void*) nativeUpdateLayers }, |
