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

Unified Diff: Source/core/editing/PositionWithAffinity.h

Issue 1191283002: Make VisiblePosition::init to not use being constructed object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-06-22T16:23:26 Add a comment to PositionWIthAffinity::operator==() Created 5 years, 6 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/PositionWithAffinity.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/PositionWithAffinity.h
diff --git a/Source/core/editing/PositionWithAffinity.h b/Source/core/editing/PositionWithAffinity.h
index 38fb1f641e77ca045b928c7e8bcf77057af2dbc2..97e5de4d9705e16c18cd33134d64a0b022ee26cf 100644
--- a/Source/core/editing/PositionWithAffinity.h
+++ b/Source/core/editing/PositionWithAffinity.h
@@ -24,6 +24,14 @@ public:
EAffinity affinity() const { return m_affinity; }
const PositionType& position() const { return m_position; }
+ // Returns true if both |this| and |other| is null or both |m_position|
+ // and |m_affinity| equal.
+ bool operator==(const PositionWithAffinityTemplate& other) const;
+ bool operator!=(const PositionWithAffinityTemplate& other) const { return !operator==(other); }
+
+ bool isNotNull() const { return m_position.isNotNull(); }
+ bool isNull() const { return m_position.isNull(); }
+
DEFINE_INLINE_TRACE()
{
visitor->trace(m_position);
« no previous file with comments | « no previous file | Source/core/editing/PositionWithAffinity.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698