summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2012-02-24 07:27:54 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-24 07:27:54 -0800
commit0b19fab9010e8be98e5be962d403eaaa9ea14ba8 (patch)
treee52495d18f69efd4f7fbd89e365686fecfab90fc /Source
parent9f30b61e2c62ca17fb816bff1fc612c3ebc8c4b3 (diff)
parentcc95248cace682365bf4d69a0b60990799351f33 (diff)
downloadexternal_webkit-0b19fab9010e8be98e5be962d403eaaa9ea14ba8.zip
external_webkit-0b19fab9010e8be98e5be962d403eaaa9ea14ba8.tar.gz
external_webkit-0b19fab9010e8be98e5be962d403eaaa9ea14ba8.tar.bz2
Merge "Selection node used for selection region rather than focus node."
Diffstat (limited to 'Source')
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 08ad3b6..d10a7e9 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -3942,14 +3942,14 @@ void WebViewCore::updateTextSelection()
AutoJObject javaObject = m_javaGlue->object(env);
if (!javaObject.get())
return;
- WebCore::Node* focusNode = currentFocus();
+ VisibleSelection selection = focusedFrame()->selection()->selection();
int start = 0;
int end = 0;
- if (focusNode)
- getSelectionOffsets(focusNode, start, end);
- SelectText* selectText = createSelectText(focusedFrame()->selection()->selection());
+ if (selection.isCaretOrRange())
+ getSelectionOffsets(selection.start().anchorNode(), start, end);
+ SelectText* selectText = createSelectText(selection);
env->CallVoidMethod(javaObject.get(),
- m_javaGlue->m_updateTextSelection, reinterpret_cast<int>(focusNode),
+ m_javaGlue->m_updateTextSelection, reinterpret_cast<int>(currentFocus()),
start, end, m_textGeneration, reinterpret_cast<int>(selectText));
checkException(env);
}