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

Unified Diff: Source/core/editing/VisibleSelection.cpp

Issue 1316303002: Move a member function intersectsNode() out from VisibleSelection class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-27T17:53:54 Created 5 years, 4 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/editing/VisibleSelection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleSelection.cpp
diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp
index 16e6d189df7a0d76ec9e7a9c069a09e6d636ced9..8637118b6c9bcb088e33ab01c458635dba7a0655 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -230,13 +230,15 @@ PassRefPtrWillBeRawPtr<Range> firstRangeOf(const VisibleSelection& selection)
return Range::create(*start.document(), start, end);
}
-bool VisibleSelection::intersectsNode(Node* node) const
+// TODO(yosin) We should move |intersectsNode()| to "FrameSelection.cpp".
+bool intersectsNode(const VisibleSelection& selection, Node* node)
{
- if (isNone())
+ if (selection.isNone())
return false;
- Position start = m_start.parentAnchoredEquivalent();
- Position end = m_end.parentAnchoredEquivalent();
+ Position start = selection.start().parentAnchoredEquivalent();
+ Position end = selection.end().parentAnchoredEquivalent();
TrackExceptionState exceptionState;
+ // TODO(yosin) We should avoid to use |Range::intersectsNode()|.
return Range::intersectsNode(node, start, end, exceptionState) && !exceptionState.hadException();
}
« no previous file with comments | « Source/core/editing/VisibleSelection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698