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 #include "core/editing/SelectionTemplate.h" | 5 #include "core/editing/SelectionTemplate.h" |
6 | 6 |
7 #include "core/editing/VisibleSelection.h" | |
7 #include "wtf/Assertions.h" | 8 #include "wtf/Assertions.h" |
8 #include <ostream> // NOLINT | 9 #include <ostream> // NOLINT |
9 | 10 |
10 namespace blink { | 11 namespace blink { |
11 | 12 |
12 template <typename Strategy> | 13 template <typename Strategy> |
13 SelectionTemplate<Strategy>::SelectionTemplate(const SelectionTemplate& other) | 14 SelectionTemplate<Strategy>::SelectionTemplate(const SelectionTemplate& other) |
14 : m_base(other.m_base), | 15 : m_base(other.m_base), |
15 m_extent(other.m_extent), | 16 m_extent(other.m_extent), |
16 m_affinity(other.m_affinity), | 17 m_affinity(other.m_affinity), |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 DCHECK_EQ(m_base.document(), m_extent.document()); | 97 DCHECK_EQ(m_base.document(), m_extent.document()); |
97 return true; | 98 return true; |
98 } | 99 } |
99 #else | 100 #else |
100 template <typename Strategy> | 101 template <typename Strategy> |
101 bool SelectionTemplate<Strategy>::assertValid() const { | 102 bool SelectionTemplate<Strategy>::assertValid() const { |
102 return true; | 103 return true; |
103 } | 104 } |
104 #endif | 105 #endif |
105 | 106 |
107 #ifndef NDEBUG | |
108 template <typename Strategy> | |
109 void SelectionTemplate<Strategy>::showTreeForThis() const { | |
110 VisibleSelectionTemplate<Strategy>::showTreeForStartAndEnd(m_base, m_extent); | |
yosin_UTC9
2016/11/28 07:56:27
We don't want to make |SelectionTemplate| to depen
| |
111 } | |
112 #endif | |
113 | |
106 template <typename Strategy> | 114 template <typename Strategy> |
107 void SelectionTemplate<Strategy>::printTo(std::ostream* ostream, | 115 void SelectionTemplate<Strategy>::printTo(std::ostream* ostream, |
108 const char* type) const { | 116 const char* type) const { |
109 if (isNone()) { | 117 if (isNone()) { |
110 *ostream << "()"; | 118 *ostream << "()"; |
111 return; | 119 return; |
112 } | 120 } |
113 *ostream << type << '('; | 121 *ostream << type << '('; |
114 #if DCHECK_IS_ON() | 122 #if DCHECK_IS_ON() |
115 if (m_domTreeVersion != m_base.document()->domTreeVersion()) { | 123 if (m_domTreeVersion != m_base.document()->domTreeVersion()) { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
262 SelectionTemplate<Strategy>::Builder::setIsDirectional(bool isDirectional) { | 270 SelectionTemplate<Strategy>::Builder::setIsDirectional(bool isDirectional) { |
263 m_selection.m_isDirectional = isDirectional; | 271 m_selection.m_isDirectional = isDirectional; |
264 return *this; | 272 return *this; |
265 } | 273 } |
266 | 274 |
267 template class CORE_TEMPLATE_EXPORT SelectionTemplate<EditingStrategy>; | 275 template class CORE_TEMPLATE_EXPORT SelectionTemplate<EditingStrategy>; |
268 template class CORE_TEMPLATE_EXPORT | 276 template class CORE_TEMPLATE_EXPORT |
269 SelectionTemplate<EditingInFlatTreeStrategy>; | 277 SelectionTemplate<EditingInFlatTreeStrategy>; |
270 | 278 |
271 } // namespace blink | 279 } // namespace blink |
OLD | NEW |