| Index: Source/core/page/EventHandler.cpp
|
| diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
|
| index 17680fb568c943022b1296e3bf08c7893a8f51ad..fc0e45b05747a4310fc258a9c344493fa79e8eb5 100644
|
| --- a/Source/core/page/EventHandler.cpp
|
| +++ b/Source/core/page/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 (Range::isNodeFullySelected(element, m_frame->selection().toNormalizedRange().get())
|
| + && element->isDescendantOf(m_frame->document()->focusedElement()))
|
| + return false;
|
| + }
|
| +
|
|
|
| // Only change the focus when clicking scrollbars if it can transfered to a
|
| // mouse focusable node.
|
|
|