| Index: Source/core/input/EventHandler.cpp
|
| diff --git a/Source/core/input/EventHandler.cpp b/Source/core/input/EventHandler.cpp
|
| index 2385b4e685d715befd987ef797187d68381080ab..3e189769aa16307ecebb497cbb8dacefc233dc06 100644
|
| --- a/Source/core/input/EventHandler.cpp
|
| +++ b/Source/core/input/EventHandler.cpp
|
| @@ -2053,11 +2053,12 @@ bool EventHandler::handleMouseFocus(const MouseEventWithHitTestResults& targeted
|
| // be focused if the user does a mouseup over it, however, because the
|
| // mouseup will set a selection inside it, which will call
|
| // FrameSelection::setFocusedNodeIfNeeded.
|
| - if (element
|
| - && m_frame->selection().isRange()
|
| - && m_frame->selection().toNormalizedRange()->compareNode(element, IGNORE_EXCEPTION) == Range::NODE_INSIDE
|
| - && element->isDescendantOf(m_frame->document()->focusedElement()))
|
| - return false;
|
| + if (element && m_frame->selection().isRange()) {
|
| + if (m_frame->selection().toNormalizedRange()->isNodeFullySelected(*element)
|
| + && element->isDescendantOf(m_frame->document()->focusedElement()))
|
| + return false;
|
| + }
|
| +
|
|
|
| // Only change the focus when clicking scrollbars if it can transfered to a
|
| // mouse focusable node.
|
|
|