Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 EphemeralRange_h | 5 #ifndef EphemeralRange_h |
| 6 #define EphemeralRange_h | 6 #define EphemeralRange_h |
| 7 | 7 |
| 8 #include "core/editing/Position.h" | 8 #include "core/editing/Position.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 // Returns true if |m_startPositoin| == |m_endPosition| or |isNull()|. | 108 // Returns true if |m_startPositoin| == |m_endPosition| or |isNull()|. |
| 109 bool isCollapsed() const; | 109 bool isCollapsed() const; |
| 110 bool isNull() const { | 110 bool isNull() const { |
| 111 DCHECK(isValid()); | 111 DCHECK(isValid()); |
| 112 return m_startPosition.isNull(); | 112 return m_startPosition.isNull(); |
| 113 } | 113 } |
| 114 bool isNotNull() const { return !isNull(); } | 114 bool isNotNull() const { return !isNull(); } |
| 115 | 115 |
| 116 RangeTraversal nodes() const; | 116 RangeTraversal nodes() const; |
| 117 | 117 |
| 118 DEFINE_INLINE_TRACE() { | |
|
sof
2017/02/07 11:05:57
This was an unused trace method (the class is STAC
| |
| 119 visitor->trace(m_startPosition); | |
| 120 visitor->trace(m_endPosition); | |
| 121 } | |
| 122 | |
| 123 // |node| should be in-document and valid for anchor node of | 118 // |node| should be in-document and valid for anchor node of |
| 124 // |PositionTemplate<Strategy>|. | 119 // |PositionTemplate<Strategy>|. |
| 125 static EphemeralRangeTemplate<Strategy> rangeOfContents( | 120 static EphemeralRangeTemplate<Strategy> rangeOfContents( |
| 126 const Node& /* node */); | 121 const Node& /* node */); |
| 127 | 122 |
| 128 private: | 123 private: |
| 129 bool isValid() const; | 124 bool isValid() const; |
| 130 | 125 |
| 131 PositionTemplate<Strategy> m_startPosition; | 126 PositionTemplate<Strategy> m_startPosition; |
| 132 PositionTemplate<Strategy> m_endPosition; | 127 PositionTemplate<Strategy> m_endPosition; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 144 using EphemeralRangeInFlatTree = | 139 using EphemeralRangeInFlatTree = |
| 145 EphemeralRangeTemplate<EditingInFlatTreeStrategy>; | 140 EphemeralRangeTemplate<EditingInFlatTreeStrategy>; |
| 146 | 141 |
| 147 // Returns a newly created |Range| object from |range| or |nullptr| if | 142 // Returns a newly created |Range| object from |range| or |nullptr| if |
| 148 // |range.isNull()| returns true. | 143 // |range.isNull()| returns true. |
| 149 CORE_EXPORT Range* createRange(const EphemeralRange& /* range */); | 144 CORE_EXPORT Range* createRange(const EphemeralRange& /* range */); |
| 150 | 145 |
| 151 } // namespace blink | 146 } // namespace blink |
| 152 | 147 |
| 153 #endif | 148 #endif |
| OLD | NEW |