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

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

Issue 1318183002: Move global function intersectsNode() to local function in FrameSelection.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-28T10:16:38 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 | « no previous file | Source/core/editing/VisibleSelection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/FrameSelection.cpp
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
index 651f570459b6ad2d3133edcd1cbf1d66a0968113..a9ca281adba5bccd01a0725c682adbe0899600a0 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -360,6 +360,17 @@ void FrameSelection::nodeWillBeRemoved(Node& node)
removingNodeRemovesPosition(node, m_selection.start()), removingNodeRemovesPosition(node, m_selection.end()));
}
+static bool intersectsNode(const VisibleSelection& selection, Node* node)
+{
+ if (selection.isNone())
+ return false;
+ 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();
+}
+
void FrameSelection::respondToNodeModification(Node& node, bool baseRemoved, bool extentRemoved, bool startRemoved, bool endRemoved)
{
ASSERT(node.document().isActive());
« no previous file with comments | « no previous file | Source/core/editing/VisibleSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698