From cc95248cace682365bf4d69a0b60990799351f33 Mon Sep 17 00:00:00 2001 From: George Mount Date: Thu, 23 Feb 2012 15:22:39 -0800 Subject: Selection node used for selection region rather than focus node. Bug 6059606 Change-Id: I6be963f30adef0c1dab19399d0eb505b4d0452d3 --- Source/WebKit/android/jni/WebViewCore.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source') diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 0030621..1a3f7ca 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -3939,14 +3939,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(focusNode), + m_javaGlue->m_updateTextSelection, reinterpret_cast(currentFocus()), start, end, m_textGeneration, reinterpret_cast(selectText)); checkException(env); } -- cgit v1.1