Index: Source/core/page/EventHandler.cpp |
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp |
index 1ee2587626a0969843a1281f3661bd1b8d46963e..2569a6a1969e3039e070a39abf5ce7dee7ced7e4 100644 |
--- a/Source/core/page/EventHandler.cpp |
+++ b/Source/core/page/EventHandler.cpp |
@@ -774,16 +774,18 @@ bool EventHandler::handleMouseReleaseEvent(const MouseEventWithHitTestResults& e |
// Clear the selection if the mouse didn't move after the last mouse |
// press and it's not a context menu click. We do this so when clicking |
- // on the selection, the selection goes away. However, if we are |
- // editing, place the caret. |
+ // on the selection, the selection goes away. For readonly texts |
+ // we do need to know the position of the caret for any selection |
+ // using keyboard shortcuts as its currently working in non-webkit |
+ // based browsers for ex: firefox. Therefore, place the caret even |
+ // for non-editable texts. |
if (m_mouseDownWasSingleClickInSelection && m_selectionInitiationState != ExtendedSelection |
&& m_dragStartPos == event.event().position() |
&& m_frame->selection().isRange() |
&& event.event().button() != RightButton) { |
VisibleSelection newSelection; |
Node* node = event.targetNode(); |
- bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsingEnabled(); |
- if (node && node->renderer() && (caretBrowsing || node->hasEditableStyle())) { |
+ if (node && node->renderer()) { |
VisiblePosition pos = VisiblePosition(node->renderer()->positionForPoint(event.localPoint())); |
newSelection = VisibleSelection(pos); |
} |