Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1197)

Unified Diff: Source/core/input/EventHandler.cpp

Issue 1149373003: Remove Range.compareNode() as it is not in the spec (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« Source/core/dom/Range.cpp ('K') | « Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« Source/core/dom/Range.cpp ('K') | « Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698