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

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

Issue 541633004: Avoid temporary range allocation in FrameSelection::respondToNodeModification. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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.h ('K') | « 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 411437768c0c3bf2662cf67cf1c0bde506e3a3eb..59c2c5f1fb6a1e315571786c62d7bae8688f8331 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -192,6 +192,18 @@ PassRefPtrWillBeRawPtr<Range> VisibleSelection::firstRange() const
return Range::create(*start.document(), start, end);
}
+bool VisibleSelection::intersectsNode(Node* node) const
+{
+ if (isNone())
+ return false;
+ Position start = m_start.parentAnchoredEquivalent();
+ Position end = m_end.parentAnchoredEquivalent();
+ TrackExceptionState exceptionState;
+ if (Range::intersectsNode(node, start, end, exceptionState))
yosin_UTC9 2014/09/05 01:07:56 nit: Just |return Range::intersectsNode(node, star
yosin_UTC9 2014/09/05 01:07:56 Can we use |ASSERT_NO_EXCEPTION| instead of |excep
Mads Ager (chromium) 2014/09/05 08:22:52 Hmm, good point. I thought we could as well, but i
Mads Ager (chromium) 2014/09/05 08:22:52 Yes! Thanks! :)
+ return true;
+ return false;
+}
+
PassRefPtrWillBeRawPtr<Range> VisibleSelection::toNormalizedRange() const
{
if (isNone())
« Source/core/dom/Range.h ('K') | « Source/core/editing/VisibleSelection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698