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

Unified Diff: third_party/WebKit/Source/core/input/MouseEventManager.cpp

Issue 2786573002: Use EphemeralRange instead of Range in Range::isNodeFullyContainded (Closed)
Patch Set: update Created 3 years, 9 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
Index: third_party/WebKit/Source/core/input/MouseEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/MouseEventManager.cpp b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
index 85f6eaecd3145df12c4a08e0afed61da5a5e9eff..d6af4c624f760dfddd6bdcde4c30b852e694082c 100644
--- a/third_party/WebKit/Source/core/input/MouseEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
@@ -431,12 +431,11 @@ WebInputEventResult MouseEventManager::handleMouseFocus(
m_frame->selection()
.computeVisibleSelectionInDOMTreeDeprecated()
.isRange()) {
- // TODO(yosin) We should not create |Range| object for calling
- // |isNodeFullyContained()|.
- if (createRange(m_frame->selection()
- .computeVisibleSelectionInDOMTreeDeprecated()
- .toNormalizedEphemeralRange())
- ->isNodeFullyContained(*element) &&
+ const EphemeralRange& range =
+ m_frame->selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .toNormalizedEphemeralRange();
+ if (isNodeFullyContained(range, *element) &&
element->isDescendantOf(m_frame->document()->focusedElement()))
return WebInputEventResult::NotHandled;
}

Powered by Google App Engine
This is Rietveld 408576698