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

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

Issue 2698793003: Get rid of redundant layout tree update related to selection (Closed)
Patch Set: 2017-02-17T00:37:54 FrameSelection::selectFrameElementInParentIfFullySelected() to use FS::isRange() Created 3 years, 10 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/SelectionTemplate.h
diff --git a/third_party/WebKit/Source/core/editing/SelectionTemplate.h b/third_party/WebKit/Source/core/editing/SelectionTemplate.h
index ae04d0d868cca37eca1b86650335516d362bb355..b661e9816546a66984a2716fcac12b1625907371 100644
--- a/third_party/WebKit/Source/core/editing/SelectionTemplate.h
+++ b/third_party/WebKit/Source/core/editing/SelectionTemplate.h
@@ -87,15 +87,20 @@ class CORE_EXPORT SelectionTemplate final {
TextAffinity affinity() const { return m_affinity; }
TextGranularity granularity() const { return m_granularity; }
bool hasTrailingWhitespace() const { return m_hasTrailingWhitespace; }
+ bool isCaret() const { return m_base.isNotNull() && m_base == m_extent; }
bool isDirectional() const { return m_isDirectional; }
bool isHandleVisible() const { return m_isHandleVisible; }
bool isNone() const { return m_base.isNull(); }
+ bool isRange() const { return m_base != m_extent; }
// Returns true if |this| selection holds valid values otherwise it causes
// assertion failure.
bool assertValid() const;
bool assertValidFor(const Document&) const;
+ const PositionTemplate<Strategy>& computeEndPosition() const;
+ const PositionTemplate<Strategy>& computeStartPosition() const;
+
DECLARE_TRACE();
void printTo(std::ostream*, const char* type) const;

Powered by Google App Engine
This is Rietveld 408576698