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

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: updated webexposed/global-interface-listing.html Created 5 years, 5 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
« no previous file with comments | « 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 ab0864fa0e9ed5b4cbd8e77859449c1b3a9666a7..d16e9e2e4ef679e408209463115845eef5fa68ce 100644
--- a/Source/core/input/EventHandler.cpp
+++ b/Source/core/input/EventHandler.cpp
@@ -1638,11 +1638,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()->isNodeFullyContained(*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.
« no previous file with comments | « Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698