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

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

Issue 1318913004: [CodeHealth][Editing] Refactor EphemeralRange::isNull/isNotNull impl. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/EphemeralRange.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/EphemeralRange.h
diff --git a/Source/core/editing/EphemeralRange.h b/Source/core/editing/EphemeralRange.h
index b8daf06b4f6bf61207a170fb8b19de9b027f712e..5d41069dea26815487bbd41a6ce4973c02748e02 100644
--- a/Source/core/editing/EphemeralRange.h
+++ b/Source/core/editing/EphemeralRange.h
@@ -40,9 +40,9 @@ class CORE_TEMPLATE_CLASS_EXPORT EphemeralRangeTemplate final {
public:
EphemeralRangeTemplate(const PositionAlgorithm<Strategy>& start, const PositionAlgorithm<Strategy>& end);
EphemeralRangeTemplate(const EphemeralRangeTemplate& other);
- // |position| should be null or in-document.
+ // |position| should be |Position::isNull()| or in-document.
explicit EphemeralRangeTemplate(const PositionAlgorithm<Strategy>& /* position */);
- // When |range| is nullptr, |EphemeralRangeTemplate| is null.
+ // When |range| is nullptr, |EphemeralRangeTemplate| is |isNull()|.
explicit EphemeralRangeTemplate(const Range* /* range */);
EphemeralRangeTemplate();
~EphemeralRangeTemplate();
@@ -58,8 +58,12 @@ public:
// Returns true if |m_startPositoin| == |m_endPosition| or |isNull()|.
bool isCollapsed() const;
- bool isNull() const { return !isNotNull(); }
- bool isNotNull() const;
+ bool isNull() const
+ {
+ ASSERT(isValid());
+ return m_startPosition.isNull();
+ }
+ bool isNotNull() const { return !isNull(); }
DEFINE_INLINE_TRACE()
{
« no previous file with comments | « no previous file | Source/core/editing/EphemeralRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698