summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2009-07-31 15:11:35 -0400
committerLeon Scroggins <scroggo@google.com>2009-07-31 15:28:09 -0400
commit51c0d4c6b1b74fff7336d81451ba7d2fc132e31c (patch)
tree4b02d56c7c285fd261299835b325498372628210 /WebKit
parentfa768f11d82c34980cce020f442329299efb08ca (diff)
downloadexternal_webkit-51c0d4c6b1b74fff7336d81451ba7d2fc132e31c.zip
external_webkit-51c0d4c6b1b74fff7336d81451ba7d2fc132e31c.tar.gz
external_webkit-51c0d4c6b1b74fff7336d81451ba7d2fc132e31c.tar.bz2
Fix a bug in find.
Fix for http://b/issue?id=2021424. When trying to draw the matches, if we find that the page needs to be scrolled to put the match on screen, we request a scroll, do a viewInvalidate and stop, so that the matches will be drawn after the invalidate. Unfortunately, for some values, we do not end up scrolling, because contentToView turns the scroll into a no op. So we forever request scrolls, and never draw the matches. Fix this by getting a return value from scrollBy, and if it returned false, go ahead and draw the matches.
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/nav/WebView.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index ced21d2..a920777 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -125,7 +125,7 @@ WebView(JNIEnv* env, jobject javaWebView, int viewImpl)
jclass clazz = env->FindClass("android/webkit/WebView");
// m_javaGlue = new JavaGlue;
m_javaGlue.m_obj = adoptGlobalRef(env, javaWebView);
- m_javaGlue.m_scrollBy = GetJMethod(env, clazz, "setContentScrollBy", "(IIZ)V");
+ m_javaGlue.m_scrollBy = GetJMethod(env, clazz, "setContentScrollBy", "(IIZ)Z");
m_javaGlue.m_clearTextEntry = GetJMethod(env, clazz, "clearTextEntry", "()V");
m_javaGlue.m_overrideLoading = GetJMethod(env, clazz, "overrideLoading", "(Ljava/lang/String;)V");
m_javaGlue.m_sendPluginState = GetJMethod(env, clazz, "sendPluginState", "(I)V");
@@ -357,12 +357,10 @@ bool scrollRectOnScreen(int left, int top, int right, int bottom)
} else if (bottom > visible.bottom() && bottom - top < visible.height()) {
dy = bottom - visible.bottom();
}
- if ((dx|dy)) {
- scrollBy(dx, dy);
- viewInvalidate();
- return true;
- }
- return false;
+ if ((dx|dy) == 0 || !scrollBy(dx, dy))
+ return false;
+ viewInvalidate();
+ return true;
}
// Put a cap on the number of matches to draw. If the current page has more
@@ -1250,14 +1248,15 @@ void setMatches(WTF::Vector<MatchInfo>* matches)
viewInvalidate();
}
-void scrollBy(int dx, int dy)
+bool scrollBy(int dx, int dy)
{
LOG_ASSERT(m_javaGlue.m_obj, "A java object was not associated with this native WebView!");
JNIEnv* env = JSC::Bindings::getJNIEnv();
- env->CallVoidMethod(m_javaGlue.object(env).get(), m_javaGlue.m_scrollBy,
- dx, dy, true);
+ bool result = env->CallBooleanMethod(m_javaGlue.object(env).get(),
+ m_javaGlue.m_scrollBy, dx, dy, true);
checkException(env);
+ return result;
}
bool hasCursorNode()