diff options
Diffstat (limited to 'Source/WebKit/android')
| -rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 15 | ||||
| -rw-r--r-- | Source/WebKit/android/jni/WebViewCore.h | 1 |
2 files changed, 14 insertions, 2 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 32befc7..763b4bf 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -489,7 +489,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m #endif m_javaGlue->m_setWebTextViewAutoFillable = GetJMethod(env, clazz, "setWebTextViewAutoFillable", "(ILjava/lang/String;)V"); m_javaGlue->m_selectAt = GetJMethod(env, clazz, "selectAt", "(II)V"); - m_javaGlue->m_initEditField = GetJMethod(env, clazz, "initEditField", "(ILjava/lang/String;IZZLjava/lang/String;III)V"); + m_javaGlue->m_initEditField = GetJMethod(env, clazz, "initEditField", "(ILjava/lang/String;IZZLjava/lang/String;IIII)V"); m_javaGlue->m_updateMatchCount = GetJMethod(env, clazz, "updateMatchCount", "(IILjava/lang/String;)V"); env->DeleteLocalRef(clazz); @@ -3288,6 +3288,16 @@ WebViewCore::InputType WebViewCore::getInputType(Node* node) return WebViewCore::NONE; } +int WebViewCore::getMaxLength(Node* node) +{ + int maxLength = -1; + if (node->hasTagName(WebCore::HTMLNames::inputTag)) { + HTMLInputElement* htmlInput = static_cast<HTMLInputElement*>(node); + maxLength = htmlInput->maxLength(); + } + return maxLength; +} + bool WebViewCore::isSpellCheckEnabled(Node* node) { bool isEnabled = true; @@ -3317,6 +3327,7 @@ void WebViewCore::initEditField(Node* node) Node* nextFocus = document->nextFocusableNode(node, tabEvent.get()); bool isNextText = isTextInput(nextFocus); bool spellCheckEnabled = isSpellCheckEnabled(node); + int maxLength = getMaxLength(node); String label = requestLabel(document->frame(), node); jstring fieldText = wtfStringToJstring(env, text, true); jstring labelText = wtfStringToJstring(env, text, false); @@ -3324,7 +3335,7 @@ void WebViewCore::initEditField(Node* node) env->CallVoidMethod(javaObject.get(), m_javaGlue->m_initEditField, reinterpret_cast<int>(node), fieldText, inputType, spellCheckEnabled, isNextText, labelText, start, end, - reinterpret_cast<int>(selectText)); + reinterpret_cast<int>(selectText), maxLength); checkException(env); } diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h index c5bb63f..7c45096 100644 --- a/Source/WebKit/android/jni/WebViewCore.h +++ b/Source/WebKit/android/jni/WebViewCore.h @@ -717,6 +717,7 @@ namespace android { VisiblePosition visiblePositionForContentPoint(const IntPoint& point); void selectWordAroundPosition(Frame* frame, VisiblePosition pos); SelectText* createSelectText(const VisibleSelection&); + static int getMaxLength(Node* node); // called from constructor, to add this to a global list static void addInstance(WebViewCore*); |
