summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/android/jni')
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp20
-rw-r--r--Source/WebKit/android/jni/WebViewCore.h6
2 files changed, 26 insertions, 0 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index d263a22..4fbf6ed 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -337,6 +337,7 @@ struct WebViewCore::JavaGlue {
jmethodID m_sendViewInvalidate;
jmethodID m_updateTextfield;
jmethodID m_updateTextSelection;
+ jmethodID m_updateTextSizeAndScroll;
jmethodID m_clearTextEntry;
jmethodID m_restoreScale;
jmethodID m_needTouchEvents;
@@ -471,6 +472,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m
m_javaGlue->m_sendViewInvalidate = GetJMethod(env, clazz, "sendViewInvalidate", "(IIII)V");
m_javaGlue->m_updateTextfield = GetJMethod(env, clazz, "updateTextfield", "(IZLjava/lang/String;I)V");
m_javaGlue->m_updateTextSelection = GetJMethod(env, clazz, "updateTextSelection", "(IIIII)V");
+ m_javaGlue->m_updateTextSizeAndScroll = GetJMethod(env, clazz, "updateTextSizeAndScroll", "(IIIII)V");
m_javaGlue->m_clearTextEntry = GetJMethod(env, clazz, "clearTextEntry", "()V");
m_javaGlue->m_restoreScale = GetJMethod(env, clazz, "restoreScale", "(FF)V");
m_javaGlue->m_needTouchEvents = GetJMethod(env, clazz, "needTouchEvents", "(Z)V");
@@ -3802,6 +3804,24 @@ void WebViewCore::updateTextSelection()
checkException(env);
}
+void WebViewCore::updateTextSizeAndScroll(WebCore::Node* node)
+{
+ JNIEnv* env = JSC::Bindings::getJNIEnv();
+ AutoJObject javaObject = m_javaGlue->object(env);
+ if (!javaObject.get())
+ return;
+ RenderTextControl* rtc = toRenderTextControl(node);
+ if (!rtc)
+ return;
+ int width = rtc->scrollWidth();
+ int height = rtc->contentHeight();
+ int scrollX = rtc->scrollLeft();
+ int scrollY = rtc->scrollTop();
+ env->CallVoidMethod(javaObject.get(), m_javaGlue->m_updateTextSizeAndScroll,
+ reinterpret_cast<int>(node), width, height, scrollX, scrollY);
+ checkException(env);
+}
+
void WebViewCore::updateTextfield(WebCore::Node* ptr, bool changeToPassword,
const WTF::String& text)
{
diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h
index baf9995..6850111 100644
--- a/Source/WebKit/android/jni/WebViewCore.h
+++ b/Source/WebKit/android/jni/WebViewCore.h
@@ -229,6 +229,12 @@ namespace android {
*/
void updateTextSelection();
+ /**
+ * Updates the java side with the node's content size and scroll
+ * position.
+ */
+ void updateTextSizeAndScroll(WebCore::Node* node);
+
void clearTextEntry();
// JavaScript support
void jsAlert(const WTF::String& url, const WTF::String& text);