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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 EphemeralRangeTemplate<Strategy>& operator=( | 98 EphemeralRangeTemplate<Strategy>& operator=( |
99 const EphemeralRangeTemplate<Strategy>& other); | 99 const EphemeralRangeTemplate<Strategy>& other); |
100 | 100 |
101 bool operator==(const EphemeralRangeTemplate<Strategy>& other) const; | 101 bool operator==(const EphemeralRangeTemplate<Strategy>& other) const; |
102 bool operator!=(const EphemeralRangeTemplate<Strategy>& other) const; | 102 bool operator!=(const EphemeralRangeTemplate<Strategy>& other) const; |
103 | 103 |
104 Document& document() const; | 104 Document& document() const; |
105 PositionTemplate<Strategy> startPosition() const; | 105 PositionTemplate<Strategy> startPosition() const; |
106 PositionTemplate<Strategy> endPosition() const; | 106 PositionTemplate<Strategy> endPosition() const; |
107 | 107 |
| 108 Node* commonAncestorContainer() const; |
| 109 |
108 // Returns true if |m_startPositoin| == |m_endPosition| or |isNull()|. | 110 // Returns true if |m_startPositoin| == |m_endPosition| or |isNull()|. |
109 bool isCollapsed() const; | 111 bool isCollapsed() const; |
110 bool isNull() const { | 112 bool isNull() const { |
111 DCHECK(isValid()); | 113 DCHECK(isValid()); |
112 return m_startPosition.isNull(); | 114 return m_startPosition.isNull(); |
113 } | 115 } |
114 bool isNotNull() const { return !isNull(); } | 116 bool isNotNull() const { return !isNull(); } |
115 | 117 |
116 RangeTraversal nodes() const; | 118 RangeTraversal nodes() const; |
117 | 119 |
(...skipping 21 matching lines...) Expand all Loading... |
139 using EphemeralRangeInFlatTree = | 141 using EphemeralRangeInFlatTree = |
140 EphemeralRangeTemplate<EditingInFlatTreeStrategy>; | 142 EphemeralRangeTemplate<EditingInFlatTreeStrategy>; |
141 | 143 |
142 // Returns a newly created |Range| object from |range| or |nullptr| if | 144 // Returns a newly created |Range| object from |range| or |nullptr| if |
143 // |range.isNull()| returns true. | 145 // |range.isNull()| returns true. |
144 CORE_EXPORT Range* createRange(const EphemeralRange& /* range */); | 146 CORE_EXPORT Range* createRange(const EphemeralRange& /* range */); |
145 | 147 |
146 } // namespace blink | 148 } // namespace blink |
147 | 149 |
148 #endif | 150 #endif |
OLD | NEW |