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

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

Issue 2354893002: Introduce VisiblePosition::isValid (Closed)
Patch Set: 201609211817 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..4feb6bbe71b8c942e1b06149deca8bd526b56e19 100644
--- a/third_party/WebKit/Source/core/editing/VisiblePosition.h
+++ b/third_party/WebKit/Source/core/editing/VisiblePosition.h
@@ -82,6 +82,11 @@ public:
bool operator==(const VisiblePositionTemplate&) const = delete;
bool operator!=(const VisiblePositionTemplate&) const = delete;
+ bool isValid() const;
+
+ // TODO(xiaochengh): We should have |DCHECK(isValid())| in the following
+ // functions. However, there are some clients storing a VisiblePosition and
+ // inspecting its properties after mutation. This should be fixed.
bool isNull() const { return m_positionWithAffinity.isNull(); }
bool isNotNull() const { return m_positionWithAffinity.isNotNull(); }
bool isOrphan() const { return deepEquivalent().isOrphan(); }
@@ -111,6 +116,11 @@ private:
explicit VisiblePositionTemplate(const PositionWithAffinityTemplate<Strategy>&);
PositionWithAffinityTemplate<Strategy> m_positionWithAffinity;
+
+#if DCHECK_IS_ON()
+ uint64_t m_domTreeVersion;
+ uint64_t m_styleVersion;
+#endif
};
extern template class CORE_EXTERN_TEMPLATE_EXPORT VisiblePositionTemplate<EditingStrategy>;
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | third_party/WebKit/Source/core/editing/VisiblePosition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698