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 "wtf/Assertions.h" | 7 #include "wtf/Assertions.h" |
8 #include <ostream> // NOLINT | 8 #include <ostream> // NOLINT |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 m_isDirectional == other.m_isDirectional; | 48 m_isDirectional == other.m_isDirectional; |
49 } | 49 } |
50 | 50 |
51 template <typename Strategy> | 51 template <typename Strategy> |
52 bool SelectionTemplate<Strategy>::operator!=( | 52 bool SelectionTemplate<Strategy>::operator!=( |
53 const SelectionTemplate& other) const { | 53 const SelectionTemplate& other) const { |
54 return !operator==(other); | 54 return !operator==(other); |
55 } | 55 } |
56 | 56 |
57 template <typename Strategy> | 57 template <typename Strategy> |
| 58 DEFINE_TRACE(SelectionTemplate<Strategy>) { |
| 59 visitor->trace(m_base); |
| 60 visitor->trace(m_extent); |
| 61 } |
| 62 |
| 63 template <typename Strategy> |
58 const PositionTemplate<Strategy>& SelectionTemplate<Strategy>::base() const { | 64 const PositionTemplate<Strategy>& SelectionTemplate<Strategy>::base() const { |
59 DCHECK(assertValid()); | 65 DCHECK(assertValid()); |
60 DCHECK(!m_base.isOrphan()) << m_base; | 66 DCHECK(!m_base.isOrphan()) << m_base; |
61 return m_base; | 67 return m_base; |
62 } | 68 } |
63 | 69 |
64 template <typename Strategy> | 70 template <typename Strategy> |
65 Document* SelectionTemplate<Strategy>::document() const { | 71 Document* SelectionTemplate<Strategy>::document() const { |
66 DCHECK(assertValid()); | 72 DCHECK(assertValid()); |
67 return m_base.document(); | 73 return m_base.document(); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 SelectionTemplate<Strategy>::Builder::setIsHandleVisible(bool isHandleVisible) { | 296 SelectionTemplate<Strategy>::Builder::setIsHandleVisible(bool isHandleVisible) { |
291 m_selection.m_isHandleVisible = isHandleVisible; | 297 m_selection.m_isHandleVisible = isHandleVisible; |
292 return *this; | 298 return *this; |
293 } | 299 } |
294 | 300 |
295 template class CORE_TEMPLATE_EXPORT SelectionTemplate<EditingStrategy>; | 301 template class CORE_TEMPLATE_EXPORT SelectionTemplate<EditingStrategy>; |
296 template class CORE_TEMPLATE_EXPORT | 302 template class CORE_TEMPLATE_EXPORT |
297 SelectionTemplate<EditingInFlatTreeStrategy>; | 303 SelectionTemplate<EditingInFlatTreeStrategy>; |
298 | 304 |
299 } // namespace blink | 305 } // namespace blink |
OLD | NEW |