OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SelectionTemplate_h | 5 #ifndef SelectionTemplate_h |
6 #define SelectionTemplate_h | 6 #define SelectionTemplate_h |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "core/editing/EphemeralRange.h" | 10 #include "core/editing/EphemeralRange.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 bool hasTrailingWhitespace() const { return m_hasTrailingWhitespace; } | 89 bool hasTrailingWhitespace() const { return m_hasTrailingWhitespace; } |
90 bool isDirectional() const { return m_isDirectional; } | 90 bool isDirectional() const { return m_isDirectional; } |
91 bool isHandleVisible() const { return m_isHandleVisible; } | 91 bool isHandleVisible() const { return m_isHandleVisible; } |
92 bool isNone() const { return m_base.isNull(); } | 92 bool isNone() const { return m_base.isNull(); } |
93 | 93 |
94 // Returns true if |this| selection holds valid values otherwise it causes | 94 // Returns true if |this| selection holds valid values otherwise it causes |
95 // assertion failure. | 95 // assertion failure. |
96 bool assertValid() const; | 96 bool assertValid() const; |
97 bool assertValidFor(const Document&) const; | 97 bool assertValidFor(const Document&) const; |
98 | 98 |
99 DEFINE_INLINE_TRACE() { | 99 DECLARE_TRACE(); |
100 visitor->trace(m_base); | |
101 visitor->trace(m_extent); | |
102 } | |
103 | 100 |
104 void printTo(std::ostream*, const char* type) const; | 101 void printTo(std::ostream*, const char* type) const; |
105 #ifndef NDEBUG | 102 #ifndef NDEBUG |
106 void showTreeForThis() const; | 103 void showTreeForThis() const; |
107 #endif | 104 #endif |
108 | 105 |
109 private: | 106 private: |
110 friend class SelectionEditor; | 107 friend class SelectionEditor; |
111 | 108 |
112 Document* document() const; | 109 Document* document() const; |
(...skipping 17 matching lines...) Expand all Loading... |
130 | 127 |
131 using SelectionInDOMTree = SelectionTemplate<EditingStrategy>; | 128 using SelectionInDOMTree = SelectionTemplate<EditingStrategy>; |
132 using SelectionInFlatTree = SelectionTemplate<EditingInFlatTreeStrategy>; | 129 using SelectionInFlatTree = SelectionTemplate<EditingInFlatTreeStrategy>; |
133 | 130 |
134 CORE_EXPORT std::ostream& operator<<(std::ostream&, const SelectionInDOMTree&); | 131 CORE_EXPORT std::ostream& operator<<(std::ostream&, const SelectionInDOMTree&); |
135 CORE_EXPORT std::ostream& operator<<(std::ostream&, const SelectionInFlatTree&); | 132 CORE_EXPORT std::ostream& operator<<(std::ostream&, const SelectionInFlatTree&); |
136 | 133 |
137 } // namespace blink | 134 } // namespace blink |
138 | 135 |
139 #endif // SelectionTemplate_h | 136 #endif // SelectionTemplate_h |
OLD | NEW |