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

Side by Side Diff: third_party/WebKit/Source/core/editing/PositionIterator.cpp

Issue 2720593005: Make PositionIterator to skip contents of INPUT/SELECT/TEXTAREA (Closed)
Patch Set: 2017-03-02T14:30:36 Simplify if-condition in PositionIterator::increment() 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 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * 12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "core/editing/PositionIterator.h" 26 #include "core/editing/PositionIterator.h"
27 27
28 #include "core/editing/EditingUtilities.h"
29
28 namespace blink { 30 namespace blink {
29 31
32 namespace {
33
34 // TODO(editing-dev): We should replace usages of |hasChildren()| in
35 // |PositionIterator| to |shouldTraverseChildren()|.
36 template <typename Strategy>
37 bool shouldTraverseChildren(const Node& node) {
38 return Strategy::hasChildren(node) && !isUserSelectContain(node);
39 }
40
41 // TODO(editing-dev): We should replace usages of |parent()| in
42 // |PositionIterator| to |selectableParentOf()|.
43 template <typename Strategy>
44 ContainerNode* selectableParentOf(const Node& node) {
45 ContainerNode* const parent = Strategy::parent(node);
46 return parent && !isUserSelectContain(*parent) ? parent : nullptr;
47 }
48
49 } // namespace
50
30 static const int kInvalidOffset = -1; 51 static const int kInvalidOffset = -1;
31 52
32 template <typename Strategy> 53 template <typename Strategy>
33 PositionIteratorAlgorithm<Strategy>::PositionIteratorAlgorithm( 54 PositionIteratorAlgorithm<Strategy>::PositionIteratorAlgorithm(
34 Node* anchorNode, 55 Node* anchorNode,
35 int offsetInAnchor) 56 int offsetInAnchor)
36 : m_anchorNode(anchorNode), 57 : m_anchorNode(anchorNode),
37 m_nodeAfterPositionInAnchor( 58 m_nodeAfterPositionInAnchor(
38 Strategy::childAt(*anchorNode, offsetInAnchor)), 59 Strategy::childAt(*anchorNode, offsetInAnchor)),
39 m_offsetInAnchor(m_nodeAfterPositionInAnchor ? 0 : offsetInAnchor), 60 m_offsetInAnchor(m_nodeAfterPositionInAnchor ? 0 : offsetInAnchor),
40 m_depthToAnchorNode(0), 61 m_depthToAnchorNode(0),
41 m_domTreeVersion(anchorNode->document().domTreeVersion()) { 62 m_domTreeVersion(anchorNode->document().domTreeVersion()) {
42 for (Node* node = Strategy::parent(*anchorNode); node; 63 for (Node* node = selectableParentOf<Strategy>(*anchorNode); node;
43 node = Strategy::parent(*node)) { 64 node = selectableParentOf<Strategy>(*node)) {
44 // Each m_offsetsInAnchorNode[offset] should be an index of node in 65 // Each m_offsetsInAnchorNode[offset] should be an index of node in
45 // parent, but delay to calculate the index until it is needed for 66 // parent, but delay to calculate the index until it is needed for
46 // performance. 67 // performance.
47 m_offsetsInAnchorNode.push_back(kInvalidOffset); 68 m_offsetsInAnchorNode.push_back(kInvalidOffset);
48 ++m_depthToAnchorNode; 69 ++m_depthToAnchorNode;
49 } 70 }
50 if (m_nodeAfterPositionInAnchor) 71 if (m_nodeAfterPositionInAnchor)
51 m_offsetsInAnchorNode.push_back(offsetInAnchor); 72 m_offsetsInAnchorNode.push_back(offsetInAnchor);
52 } 73 }
53 template <typename Strategy> 74 template <typename Strategy>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 if (m_nodeAfterPositionInAnchor) { 122 if (m_nodeAfterPositionInAnchor) {
102 // For example, position is before E, F. 123 // For example, position is before E, F.
103 DCHECK_EQ(Strategy::parent(*m_nodeAfterPositionInAnchor), m_anchorNode); 124 DCHECK_EQ(Strategy::parent(*m_nodeAfterPositionInAnchor), m_anchorNode);
104 DCHECK_NE(m_offsetsInAnchorNode[m_depthToAnchorNode], kInvalidOffset); 125 DCHECK_NE(m_offsetsInAnchorNode[m_depthToAnchorNode], kInvalidOffset);
105 // TODO(yoichio): This should be equivalent to 126 // TODO(yoichio): This should be equivalent to
106 // PositionTemplate<Strategy>(m_anchorNode, 127 // PositionTemplate<Strategy>(m_anchorNode,
107 // PositionAnchorType::BeforeAnchor); 128 // PositionAnchorType::BeforeAnchor);
108 return PositionTemplate<Strategy>( 129 return PositionTemplate<Strategy>(
109 m_anchorNode, m_offsetsInAnchorNode[m_depthToAnchorNode]); 130 m_anchorNode, m_offsetsInAnchorNode[m_depthToAnchorNode]);
110 } 131 }
111 if (Strategy::hasChildren(*m_anchorNode)) 132 if (shouldTraverseChildren<Strategy>(*m_anchorNode))
112 // For example, position is the end of B. 133 // For example, position is the end of B.
113 return PositionTemplate<Strategy>::lastPositionInOrAfterNode(m_anchorNode); 134 return PositionTemplate<Strategy>::lastPositionInOrAfterNode(m_anchorNode);
114 if (m_anchorNode->isTextNode()) 135 if (m_anchorNode->isTextNode())
115 return PositionTemplate<Strategy>(m_anchorNode, m_offsetInAnchor); 136 return PositionTemplate<Strategy>(m_anchorNode, m_offsetInAnchor);
116 if (m_offsetInAnchor) 137 if (m_offsetInAnchor)
117 // For example, position is after G. 138 // For example, position is after G.
118 return PositionTemplate<Strategy>(m_anchorNode, 139 return PositionTemplate<Strategy>(m_anchorNode,
119 PositionAnchorType::AfterAnchor); 140 PositionAnchorType::AfterAnchor);
120 // For example, position is before G. 141 // For example, position is before G.
121 return PositionTemplate<Strategy>(m_anchorNode, 142 return PositionTemplate<Strategy>(m_anchorNode,
(...skipping 18 matching lines...) Expand all
140 // +-H 161 // +-H
141 // Let |anchor| as |m_anchorNode| and 162 // Let |anchor| as |m_anchorNode| and
142 // |child| as |m_nodeAfterPositionInAnchor|. 163 // |child| as |m_nodeAfterPositionInAnchor|.
143 if (m_nodeAfterPositionInAnchor) { 164 if (m_nodeAfterPositionInAnchor) {
144 // Case #1: Move to position before the first child of 165 // Case #1: Move to position before the first child of
145 // |m_nodeAfterPositionInAnchor|. 166 // |m_nodeAfterPositionInAnchor|.
146 // This is a point just before |child|. 167 // This is a point just before |child|.
147 // Let |anchor| is A and |child| is B, 168 // Let |anchor| is A and |child| is B,
148 // then next |anchor| is B and |child| is E. 169 // then next |anchor| is B and |child| is E.
149 m_anchorNode = m_nodeAfterPositionInAnchor; 170 m_anchorNode = m_nodeAfterPositionInAnchor;
150 m_nodeAfterPositionInAnchor = Strategy::firstChild(*m_anchorNode); 171 m_nodeAfterPositionInAnchor =
172 shouldTraverseChildren<Strategy>(*m_anchorNode)
173 ? Strategy::firstChild(*m_anchorNode)
174 : nullptr;
151 m_offsetInAnchor = 0; 175 m_offsetInAnchor = 0;
152 // Increment depth intializing with 0. 176 // Increment depth intializing with 0.
153 ++m_depthToAnchorNode; 177 ++m_depthToAnchorNode;
154 if (m_depthToAnchorNode == m_offsetsInAnchorNode.size()) 178 if (m_depthToAnchorNode == m_offsetsInAnchorNode.size())
155 m_offsetsInAnchorNode.push_back(0); 179 m_offsetsInAnchorNode.push_back(0);
156 else 180 else
157 m_offsetsInAnchorNode[m_depthToAnchorNode] = 0; 181 m_offsetsInAnchorNode[m_depthToAnchorNode] = 0;
158 return; 182 return;
159 } 183 }
160 184
161 if (m_anchorNode->layoutObject() && !Strategy::hasChildren(*m_anchorNode) && 185 if (m_anchorNode->layoutObject() &&
186 (!Strategy::hasChildren(*m_anchorNode) ||
187 isUserSelectContain(*m_anchorNode)) &&
yoichio 2017/03/02 08:49:11 This must be |!shouldTraverseChildren(*m_anchorNod
yosin_UTC9 2017/03/02 09:17:17 Good catch! Done.
162 m_offsetInAnchor < Strategy::lastOffsetForEditing(m_anchorNode)) { 188 m_offsetInAnchor < Strategy::lastOffsetForEditing(m_anchorNode)) {
163 // Case #2. This is the next of Case #1 or #2 itself. 189 // Case #2. This is the next of Case #1 or #2 itself.
164 // Position is (|anchor|, |m_offsetInAchor|). 190 // Position is (|anchor|, |m_offsetInAchor|).
165 // In this case |anchor| is a leaf(E,F,C,G or H) and 191 // In this case |anchor| is a leaf(E,F,C,G or H) and
166 // |m_offsetInAnchor| is not on the end of |anchor|. 192 // |m_offsetInAnchor| is not on the end of |anchor|.
167 // Then just increment |m_offsetInAnchor|. 193 // Then just increment |m_offsetInAnchor|.
168 m_offsetInAnchor = nextGraphemeBoundaryOf(m_anchorNode, m_offsetInAnchor); 194 m_offsetInAnchor = nextGraphemeBoundaryOf(m_anchorNode, m_offsetInAnchor);
169 } else { 195 } else {
170 // Case #3. This is the next of Case #2 or #3. 196 // Case #3. This is the next of Case #2 or #3.
171 // Position is the end of |anchor|. 197 // Position is the end of |anchor|.
172 // 3-a. If |anchor| has next sibling (let E), 198 // 3-a. If |anchor| has next sibling (let E),
173 // next |anchor| is B and |child| is F (next is Case #1.) 199 // next |anchor| is B and |child| is F (next is Case #1.)
174 // 3-b. If |anchor| doesn't have next sibling (let F), 200 // 3-b. If |anchor| doesn't have next sibling (let F),
175 // next |anchor| is B and |child| is null. (next is Case #3.) 201 // next |anchor| is B and |child| is null. (next is Case #3.)
176 m_nodeAfterPositionInAnchor = m_anchorNode; 202 m_nodeAfterPositionInAnchor = m_anchorNode;
177 m_anchorNode = Strategy::parent(*m_nodeAfterPositionInAnchor); 203 m_anchorNode = selectableParentOf<Strategy>(*m_nodeAfterPositionInAnchor);
178 if (!m_anchorNode) 204 if (!m_anchorNode)
179 return; 205 return;
180 DCHECK_GT(m_depthToAnchorNode, 0u); 206 DCHECK_GT(m_depthToAnchorNode, 0u);
181 --m_depthToAnchorNode; 207 --m_depthToAnchorNode;
182 // Increment offset of |child| or initialize if it have never been 208 // Increment offset of |child| or initialize if it have never been
183 // used. 209 // used.
184 if (m_offsetsInAnchorNode[m_depthToAnchorNode] == kInvalidOffset) 210 if (m_offsetsInAnchorNode[m_depthToAnchorNode] == kInvalidOffset)
185 m_offsetsInAnchorNode[m_depthToAnchorNode] = 211 m_offsetsInAnchorNode[m_depthToAnchorNode] =
186 Strategy::index(*m_nodeAfterPositionInAnchor) + 1; 212 Strategy::index(*m_nodeAfterPositionInAnchor) + 1;
187 else 213 else
(...skipping 24 matching lines...) Expand all
212 // |child| as |m_nodeAfterPositionInAnchor|. 238 // |child| as |m_nodeAfterPositionInAnchor|.
213 // decrement() is complex but logically reverse of increment(), of course:) 239 // decrement() is complex but logically reverse of increment(), of course:)
214 if (m_nodeAfterPositionInAnchor) { 240 if (m_nodeAfterPositionInAnchor) {
215 m_anchorNode = Strategy::previousSibling(*m_nodeAfterPositionInAnchor); 241 m_anchorNode = Strategy::previousSibling(*m_nodeAfterPositionInAnchor);
216 if (m_anchorNode) { 242 if (m_anchorNode) {
217 // Case #1-a. This is a revese of increment()::Case#3-a. 243 // Case #1-a. This is a revese of increment()::Case#3-a.
218 // |child| has a previous sibling. 244 // |child| has a previous sibling.
219 // Let |anchor| is B and |child| is F, 245 // Let |anchor| is B and |child| is F,
220 // next |anchor| is E and |child| is null. 246 // next |anchor| is E and |child| is null.
221 m_nodeAfterPositionInAnchor = nullptr; 247 m_nodeAfterPositionInAnchor = nullptr;
222 m_offsetInAnchor = Strategy::hasChildren(*m_anchorNode) 248 m_offsetInAnchor = shouldTraverseChildren<Strategy>(*m_anchorNode)
223 ? 0 249 ? 0
224 : Strategy::lastOffsetForEditing(m_anchorNode); 250 : Strategy::lastOffsetForEditing(m_anchorNode);
225 // Decrement offset of |child| or initialize if it have never been 251 // Decrement offset of |child| or initialize if it have never been
226 // used. 252 // used.
227 if (m_offsetsInAnchorNode[m_depthToAnchorNode] == kInvalidOffset) 253 if (m_offsetsInAnchorNode[m_depthToAnchorNode] == kInvalidOffset)
228 m_offsetsInAnchorNode[m_depthToAnchorNode] = 254 m_offsetsInAnchorNode[m_depthToAnchorNode] =
229 Strategy::index(*m_nodeAfterPositionInAnchor); 255 Strategy::index(*m_nodeAfterPositionInAnchor);
230 else 256 else
231 --m_offsetsInAnchorNode[m_depthToAnchorNode]; 257 --m_offsetsInAnchorNode[m_depthToAnchorNode];
232 DCHECK_GE(m_offsetsInAnchorNode[m_depthToAnchorNode], 0); 258 DCHECK_GE(m_offsetsInAnchorNode[m_depthToAnchorNode], 0);
233 // Increment depth intializing with last offset. 259 // Increment depth intializing with last offset.
234 ++m_depthToAnchorNode; 260 ++m_depthToAnchorNode;
235 if (m_depthToAnchorNode >= m_offsetsInAnchorNode.size()) 261 if (m_depthToAnchorNode >= m_offsetsInAnchorNode.size())
236 m_offsetsInAnchorNode.push_back(m_offsetInAnchor); 262 m_offsetsInAnchorNode.push_back(m_offsetInAnchor);
237 else 263 else
238 m_offsetsInAnchorNode[m_depthToAnchorNode] = m_offsetInAnchor; 264 m_offsetsInAnchorNode[m_depthToAnchorNode] = m_offsetInAnchor;
239 return; 265 return;
240 } else { 266 } else {
241 // Case #1-b. This is a revese of increment()::Case#1. 267 // Case #1-b. This is a revese of increment()::Case#1.
242 // |child| doesn't have a previous sibling. 268 // |child| doesn't have a previous sibling.
243 // Let |anchor| is B and |child| is E, 269 // Let |anchor| is B and |child| is E,
244 // next |anchor| is A and |child| is B. 270 // next |anchor| is A and |child| is B.
245 m_nodeAfterPositionInAnchor = 271 m_nodeAfterPositionInAnchor =
246 Strategy::parent(*m_nodeAfterPositionInAnchor); 272 Strategy::parent(*m_nodeAfterPositionInAnchor);
247 m_anchorNode = Strategy::parent(*m_nodeAfterPositionInAnchor); 273 m_anchorNode = selectableParentOf<Strategy>(*m_nodeAfterPositionInAnchor);
248 if (!m_anchorNode) 274 if (!m_anchorNode)
249 return; 275 return;
250 m_offsetInAnchor = 0; 276 m_offsetInAnchor = 0;
251 // Decrement depth and intialize if needs. 277 // Decrement depth and intialize if needs.
252 DCHECK_GT(m_depthToAnchorNode, 0u); 278 DCHECK_GT(m_depthToAnchorNode, 0u);
253 --m_depthToAnchorNode; 279 --m_depthToAnchorNode;
254 if (m_offsetsInAnchorNode[m_depthToAnchorNode] == kInvalidOffset) 280 if (m_offsetsInAnchorNode[m_depthToAnchorNode] == kInvalidOffset)
255 m_offsetsInAnchorNode[m_depthToAnchorNode] = 281 m_offsetsInAnchorNode[m_depthToAnchorNode] =
256 Strategy::index(*m_nodeAfterPositionInAnchor); 282 Strategy::index(*m_nodeAfterPositionInAnchor);
257 } 283 }
258 return; 284 return;
259 } 285 }
260 286
261 if (Strategy::hasChildren(*m_anchorNode)) { 287 if (shouldTraverseChildren<Strategy>(*m_anchorNode)) {
262 // Case #2. This is a reverse of increment()::Case3-b. 288 // Case #2. This is a reverse of increment()::Case3-b.
263 // Let |anchor| is B, next |anchor| is F. 289 // Let |anchor| is B, next |anchor| is F.
264 m_anchorNode = Strategy::lastChild(*m_anchorNode); 290 m_anchorNode = Strategy::lastChild(*m_anchorNode);
265 m_offsetInAnchor = Strategy::hasChildren(*m_anchorNode) 291 m_offsetInAnchor = shouldTraverseChildren<Strategy>(*m_anchorNode)
266 ? 0 292 ? 0
267 : Strategy::lastOffsetForEditing(m_anchorNode); 293 : Strategy::lastOffsetForEditing(m_anchorNode);
268 // Decrement depth initializing with -1 because 294 // Decrement depth initializing with -1 because
269 // |m_nodeAfterPositionInAnchor| is null so still unneeded. 295 // |m_nodeAfterPositionInAnchor| is null so still unneeded.
270 if (m_depthToAnchorNode >= m_offsetsInAnchorNode.size()) 296 if (m_depthToAnchorNode >= m_offsetsInAnchorNode.size())
271 m_offsetsInAnchorNode.push_back(kInvalidOffset); 297 m_offsetsInAnchorNode.push_back(kInvalidOffset);
272 else 298 else
273 m_offsetsInAnchorNode[m_depthToAnchorNode] = kInvalidOffset; 299 m_offsetsInAnchorNode[m_depthToAnchorNode] = kInvalidOffset;
274 ++m_depthToAnchorNode; 300 ++m_depthToAnchorNode;
275 return; 301 return;
276 } 302 }
277
278 if (m_offsetInAnchor && m_anchorNode->layoutObject()) { 303 if (m_offsetInAnchor && m_anchorNode->layoutObject()) {
279 // Case #3-a. This is a reverse of increment()::Case#2. 304 // Case #3-a. This is a reverse of increment()::Case#2.
280 // In this case |anchor| is a leaf(E,F,C,G or H) and 305 // In this case |anchor| is a leaf(E,F,C,G or H) and
281 // |m_offsetInAnchor| is not on the beginning of |anchor|. 306 // |m_offsetInAnchor| is not on the beginning of |anchor|.
282 // Then just decrement |m_offsetInAnchor|. 307 // Then just decrement |m_offsetInAnchor|.
283 m_offsetInAnchor = 308 m_offsetInAnchor =
284 previousGraphemeBoundaryOf(m_anchorNode, m_offsetInAnchor); 309 previousGraphemeBoundaryOf(m_anchorNode, m_offsetInAnchor);
285 return; 310 return;
286 } 311 }
287 // Case #3-b. This is a reverse of increment()::Case#1. 312 // Case #3-b. This is a reverse of increment()::Case#1.
288 // In this case |anchor| is a leaf(E,F,C,G or H) and 313 // In this case |anchor| is a leaf(E,F,C,G or H) and
289 // |m_offsetInAnchor| is on the beginning of |anchor|. 314 // |m_offsetInAnchor| is on the beginning of |anchor|.
290 // Let |anchor| is E, 315 // Let |anchor| is E,
291 // next |anchor| is B and |child| is E. 316 // next |anchor| is B and |child| is E.
292 m_nodeAfterPositionInAnchor = m_anchorNode; 317 m_nodeAfterPositionInAnchor = m_anchorNode;
293 m_anchorNode = Strategy::parent(*m_anchorNode); 318 m_anchorNode = selectableParentOf<Strategy>(*m_anchorNode);
294 if (!m_anchorNode) 319 if (!m_anchorNode)
295 return; 320 return;
296 DCHECK_GT(m_depthToAnchorNode, 0u); 321 DCHECK_GT(m_depthToAnchorNode, 0u);
297 --m_depthToAnchorNode; 322 --m_depthToAnchorNode;
298 if (m_offsetsInAnchorNode[m_depthToAnchorNode] != kInvalidOffset) 323 if (m_offsetsInAnchorNode[m_depthToAnchorNode] != kInvalidOffset)
299 return; 324 return;
300 m_offsetsInAnchorNode[m_depthToAnchorNode] = 325 m_offsetsInAnchorNode[m_depthToAnchorNode] =
301 Strategy::index(*m_nodeAfterPositionInAnchor); 326 Strategy::index(*m_nodeAfterPositionInAnchor);
302 } 327 }
303 328
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 return false; 369 return false;
345 return Strategy::hasChildren(*m_anchorNode) || 370 return Strategy::hasChildren(*m_anchorNode) ||
346 m_offsetInAnchor >= Strategy::lastOffsetForEditing(m_anchorNode); 371 m_offsetInAnchor >= Strategy::lastOffsetForEditing(m_anchorNode);
347 } 372 }
348 373
349 template class CORE_TEMPLATE_EXPORT PositionIteratorAlgorithm<EditingStrategy>; 374 template class CORE_TEMPLATE_EXPORT PositionIteratorAlgorithm<EditingStrategy>;
350 template class CORE_TEMPLATE_EXPORT 375 template class CORE_TEMPLATE_EXPORT
351 PositionIteratorAlgorithm<EditingInFlatTreeStrategy>; 376 PositionIteratorAlgorithm<EditingInFlatTreeStrategy>;
352 377
353 } // namespace blink 378 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698