Chromium Code Reviews| Index: Source/core/page/EventHandler.cpp |
| diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp |
| index 3b91fb4dd11166fc9c311b372d95f929bcf027b3..3ea0a34df0e1c3aa1f4cd8b97163047139d5935e 100644 |
| --- a/Source/core/page/EventHandler.cpp |
| +++ b/Source/core/page/EventHandler.cpp |
| @@ -762,16 +762,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->rendererIsEditable())) { |
| + if (node && node->renderer()) { |
|
Yuta Kitamura
2014/06/04 08:19:38
I think this change means that you will get a care
b.rout
2014/06/04 12:53:04
It will not show the caret, but it will set select
|
| VisiblePosition pos = VisiblePosition(node->renderer()->positionForPoint(event.localPoint())); |
| newSelection = VisibleSelection(pos); |
| } |