summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/WebCore/editing/SelectionController.cpp7
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp6
2 files changed, 9 insertions, 4 deletions
diff --git a/Source/WebCore/editing/SelectionController.cpp b/Source/WebCore/editing/SelectionController.cpp
index 3eec640..e9bdd6a 100644
--- a/Source/WebCore/editing/SelectionController.cpp
+++ b/Source/WebCore/editing/SelectionController.cpp
@@ -1562,9 +1562,6 @@ bool SelectionController::isFocusedAndActive() const
void SelectionController::updateAppearance()
{
-#if PLATFORM(ANDROID)
- return;
-#endif
ASSERT(!m_isDragCaretController);
#if ENABLE(TEXT_CARET)
@@ -1595,6 +1592,10 @@ void SelectionController::updateAppearance()
// We need to update style in case the node containing the selection is made display:none.
m_frame->document()->updateStyleIfNeeded();
+#if PLATFORM(ANDROID)
+ return;
+#endif
+
RenderView* view = m_frame->contentRenderer();
if (!view)
return;
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 40b59f1..ee6e338 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -1796,7 +1796,9 @@ void setCaretInfo(const VisiblePosition& pos, SelectText::HandleId handle,
SelectText* WebViewCore::createSelectText(const VisibleSelection& selection)
{
- if (!selection.isRange())
+ // We need to agressively check to see if this is an empty selection to prevent
+ // accidentally entering text selection mode
+ if (!selection.isRange() || !comparePositions(selection.start(), selection.end()))
return 0;
RefPtr<Range> range = selection.firstRange();
@@ -1805,6 +1807,8 @@ SelectText* WebViewCore::createSelectText(const VisibleSelection& selection)
if (!startContainer || !endContainer)
return 0;
+ if (startContainer == endContainer && range->startOffset() == range->endOffset())
+ return 0;
SelectText* selectTextContainer = new SelectText();
IntPoint frameOffset = convertGlobalContentToFrameContent(IntPoint());