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

Unified Diff: third_party/WebKit/Source/core/editing/Position.cpp

Issue 2875253002: Introduce Position::IsEquivalent() (Closed)
Patch Set: 2017-05-15T13:06:34 Created 3 years, 7 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/editing/Position.cpp
diff --git a/third_party/WebKit/Source/core/editing/Position.cpp b/third_party/WebKit/Source/core/editing/Position.cpp
index 771328e27d55caed0c567d7e0dd7aec8c337b84d..eab61e4ba6df3f245d5175760b3664b13d1dca26 100644
--- a/third_party/WebKit/Source/core/editing/Position.cpp
+++ b/third_party/WebKit/Source/core/editing/Position.cpp
@@ -353,6 +353,16 @@ bool PositionTemplate<Strategy>::operator>=(
}
template <typename Strategy>
+bool PositionTemplate<Strategy>::IsEquivalent(
+ const PositionTemplate<Strategy>& other) const {
+ if (IsNull())
+ return other.IsNull();
+ if (anchor_type_ == other.anchor_type_)
+ return *this == other;
+ return ToOffsetInAnchor() == other.ToOffsetInAnchor();
+}
+
+template <typename Strategy>
bool PositionTemplate<Strategy>::AtFirstEditingPositionForNode() const {
if (IsNull())
return true;
« no previous file with comments | « third_party/WebKit/Source/core/editing/Position.h ('k') | third_party/WebKit/Source/core/editing/PositionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698