diff options
| author | George Mount <mount@google.com> | 2012-03-09 16:58:04 -0800 |
|---|---|---|
| committer | George Mount <mount@google.com> | 2012-03-12 08:00:19 -0700 |
| commit | ccd3e08e1b0af988ea7c2571ebe34c0a9a47b2c4 (patch) | |
| tree | 7b131683713e0dfa3966aa22c4911b86a62852ad /Source/WebKit/android | |
| parent | 668a73488d6938004d25b6c155573e97b6600182 (diff) | |
| download | external_webkit-ccd3e08e1b0af988ea7c2571ebe34c0a9a47b2c4.zip external_webkit-ccd3e08e1b0af988ea7c2571ebe34c0a9a47b2c4.tar.gz external_webkit-ccd3e08e1b0af988ea7c2571ebe34c0a9a47b2c4.tar.bz2 | |
Support "prev" for IME input.
Bug 6152403
Framework change: I6d339d724616b9f156458dd4223d3b991191b13d
Change-Id: I09e5f63d41bb88a632f70b010e8ab4851bf90bab
Diffstat (limited to 'Source/WebKit/android')
| -rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 1bba9b8..33a6382 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -484,7 +484,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;IZZZLjava/lang/String;Ljava/lang/String;IIIILandroid/graphics/Rect;I)V"); + m_javaGlue->m_initEditField = GetJMethod(env, clazz, "initEditField", "(ILjava/lang/String;IZZZZLjava/lang/String;Ljava/lang/String;IIIILandroid/graphics/Rect;I)V"); m_javaGlue->m_updateMatchCount = GetJMethod(env, clazz, "updateMatchCount", "(IILjava/lang/String;)V"); m_javaGlue->m_chromeCanTakeFocus = GetJMethod(env, clazz, "chromeCanTakeFocus", "(I)Z"); m_javaGlue->m_chromeTakeFocus = GetJMethod(env, clazz, "chromeTakeFocus", "(I)V"); @@ -1360,19 +1360,16 @@ static bool isContentEditable(const WebCore::Node* node) { if (!node) return false; - Frame* frame = node->document()->frame(); - if (!frame) - return false; - return frame->selection()->isContentEditable(); + return node->isContentEditable(); } // Returns true if the node is a textfield, textarea, or contentEditable static bool isTextInput(const WebCore::Node* node) { - if (isContentEditable(node)) - return true; if (!node) return false; + if (isContentEditable(node)) + return true; WebCore::RenderObject* renderer = node->renderer(); return renderer && (renderer->isTextField() || renderer->isTextArea()); } @@ -3327,8 +3324,8 @@ void WebViewCore::initEditField(Node* node) PlatformKeyboardEvent tab(AKEYCODE_TAB, 0, 0, false, false, false, false); PassRefPtr<KeyboardEvent> tabEvent = KeyboardEvent::create(tab, document->defaultView()); - Node* nextFocus = document->nextFocusableNode(node, tabEvent.get()); - bool isNextText = isTextInput(nextFocus); + bool isNextText = isTextInput(document->nextFocusableNode(node, tabEvent.get())); + bool isPrevText = isTextInput(document->previousFocusableNode(node, tabEvent.get())); bool spellCheckEnabled = isSpellCheckEnabled(node); int maxLength = getMaxLength(node); String label = requestLabel(document->frame(), node); @@ -3342,8 +3339,8 @@ void WebViewCore::initEditField(Node* node) SelectText* selectText = createSelectText(focusedFrame()->selection()->selection()); env->CallVoidMethod(javaObject.get(), m_javaGlue->m_initEditField, reinterpret_cast<int>(node), fieldText, inputType, - spellCheckEnabled, autoComplete, isNextText, name, labelText, - start, end, reinterpret_cast<int>(selectText), maxLength, + spellCheckEnabled, autoComplete, isNextText, isPrevText, name, + labelText, start, end, reinterpret_cast<int>(selectText), maxLength, nodeBounds, layerId); checkException(env); } |
