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

Unified Diff: third_party/WebKit/Source/core/editing/VisiblePosition.h

Issue 2354893002: Introduce VisiblePosition::isValid (Closed)
Patch Set: Further fix compile... Created 4 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
Index: third_party/WebKit/Source/core/editing/VisiblePosition.h
diff --git a/third_party/WebKit/Source/core/editing/VisiblePosition.h b/third_party/WebKit/Source/core/editing/VisiblePosition.h
index ffaab651d8adc7f529bcac23e32549e44ace65bf..5e17fb4f2599a9d12548b8327fbf9919b92f1cc0 100644
--- a/third_party/WebKit/Source/core/editing/VisiblePosition.h
+++ b/third_party/WebKit/Source/core/editing/VisiblePosition.h
@@ -85,6 +85,7 @@ public:
bool isNull() const { return m_positionWithAffinity.isNull(); }
bool isNotNull() const { return m_positionWithAffinity.isNotNull(); }
bool isOrphan() const { return deepEquivalent().isOrphan(); }
+ bool isValid() const;
PositionTemplate<Strategy> deepEquivalent() const { return m_positionWithAffinity.position(); }
yosin_UTC9 2016/09/20 13:55:51 Should we have |DCHECK(isValid())| in |deepEquival
Xiaocheng 2016/09/21 06:31:49 I think we can't do that, at least for now. Some
PositionTemplate<Strategy> toParentAnchoredPosition() const { return deepEquivalent().parentAnchoredEquivalent(); }
@@ -111,6 +112,10 @@ private:
explicit VisiblePositionTemplate(const PositionWithAffinityTemplate<Strategy>&);
PositionWithAffinityTemplate<Strategy> m_positionWithAffinity;
+
+#if DCHECK_IS_ON()
+ uint64_t m_domTreeVersion;
+#endif
};
extern template class CORE_EXTERN_TEMPLATE_EXPORT VisiblePositionTemplate<EditingStrategy>;

Powered by Google App Engine
This is Rietveld 408576698