Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: third_party/WebKit/Source/core/editing/EphemeralRange.h

Issue 2725603002: createFragmentFromMarkupWithContext() should use EphemeralRange. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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;
Xiaocheng 2017/02/28 19:26:31 Could you add unit tests for this new function? A
tanvir 2017/03/02 14:59:14 I have added the unit test cases for DOM and FlatT
tanvir 2017/03/02 14:59:14 Done.
109 static Node* commonAncestorContainer(const Node* containerA, const Node* conta inerB);
Xiaocheng 2017/02/28 19:26:31 There's no need to expose this function, as there'
tanvir 2017/03/02 14:59:14 Done.
110
108 // Returns true if |m_startPositoin| == |m_endPosition| or |isNull()|. 111 // Returns true if |m_startPositoin| == |m_endPosition| or |isNull()|.
109 bool isCollapsed() const; 112 bool isCollapsed() const;
110 bool isNull() const { 113 bool isNull() const {
111 DCHECK(isValid()); 114 DCHECK(isValid());
112 return m_startPosition.isNull(); 115 return m_startPosition.isNull();
113 } 116 }
114 bool isNotNull() const { return !isNull(); } 117 bool isNotNull() const { return !isNull(); }
115 118
116 RangeTraversal nodes() const; 119 RangeTraversal nodes() const;
117 120
(...skipping 21 matching lines...) Expand all
139 using EphemeralRangeInFlatTree = 142 using EphemeralRangeInFlatTree =
140 EphemeralRangeTemplate<EditingInFlatTreeStrategy>; 143 EphemeralRangeTemplate<EditingInFlatTreeStrategy>;
141 144
142 // Returns a newly created |Range| object from |range| or |nullptr| if 145 // Returns a newly created |Range| object from |range| or |nullptr| if
143 // |range.isNull()| returns true. 146 // |range.isNull()| returns true.
144 CORE_EXPORT Range* createRange(const EphemeralRange& /* range */); 147 CORE_EXPORT Range* createRange(const EphemeralRange& /* range */);
145 148
146 } // namespace blink 149 } // namespace blink
147 150
148 #endif 151 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698