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

Side by Side Diff: third_party/WebKit/Source/core/dom/NodeTraversal.h

Issue 2329463004: ABANDONED CL: Changes needed to make things compile after running rewrite_to_chrome_style tool. (Closed)
Patch Set: Rebasing the fixes... Created 3 years, 10 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
8 * (http://www.torchmobile.com/) 8 * (http://www.torchmobile.com/)
9 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 9 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
10 * 10 *
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 return TraversalRange<TraversalNextIterator<NodeTraversal>>(&start); 339 return TraversalRange<TraversalNextIterator<NodeTraversal>>(&start);
340 }; 340 };
341 341
342 inline TraversalRange<TraversalNextIterator<NodeTraversal>> 342 inline TraversalRange<TraversalNextIterator<NodeTraversal>>
343 NodeTraversal::startsAfter(const Node& start) { 343 NodeTraversal::startsAfter(const Node& start) {
344 return TraversalRange<TraversalNextIterator<NodeTraversal>>( 344 return TraversalRange<TraversalNextIterator<NodeTraversal>>(
345 NodeTraversal::next(start)); 345 NodeTraversal::next(start));
346 }; 346 };
347 347
348 template <class NodeType> 348 template <class NodeType>
349 inline Node* NodeTraversal::traverseNextTemplate(NodeType& current) { 349 inline Node* NodeTraversal::TraverseNextTemplate(NodeType& current) {
350 /* DO NOT SUBMIT - conflict resolution marker */
351 /* Below we should have: hasChildren, firstChild, nextSibling, etc. */
350 if (current.hasChildren()) 352 if (current.hasChildren())
351 return current.firstChild(); 353 return current.firstChild();
352 if (current.nextSibling()) 354 if (current.nextSibling())
353 return current.nextSibling(); 355 return current.nextSibling();
354 return nextAncestorSibling(current); 356 return NextAncestorSibling(current);
355 } 357 }
356 358
357 template <class NodeType> 359 template <class NodeType>
358 inline Node* NodeTraversal::traverseNextTemplate(NodeType& current, 360 inline Node* NodeTraversal::TraverseNextTemplate(NodeType& current,
359 const Node* stayWithin) { 361 const Node* stay_within) {
362 /* DO NOT SUBMIT - conflict resolution marker */
363 /* Below we should have: hasChildren, firstChild, nextSibling, etc. */
360 if (current.hasChildren()) 364 if (current.hasChildren())
361 return current.firstChild(); 365 return current.firstChild();
362 if (current == stayWithin) 366 if (current == stay_within)
363 return 0; 367 return 0;
364 if (current.nextSibling()) 368 if (current.nextSibling())
365 return current.nextSibling(); 369 return current.nextSibling();
366 return nextAncestorSibling(current, stayWithin); 370 return NextAncestorSibling(current, stay_within);
367 } 371 }
368 372
369 inline Node* NodeTraversal::nextSkippingChildren(const Node& current) { 373 inline Node* NodeTraversal::nextSkippingChildren(const Node& current) {
370 if (current.nextSibling()) 374 if (current.nextSibling())
371 return current.nextSibling(); 375 return current.nextSibling();
372 return nextAncestorSibling(current); 376 return nextAncestorSibling(current);
373 } 377 }
374 378
375 inline Node* NodeTraversal::nextSkippingChildren(const Node& current, 379 inline Node* NodeTraversal::nextSkippingChildren(const Node& current,
376 const Node* stayWithin) { 380 const Node* stayWithin) {
377 if (current == stayWithin) 381 if (current == stayWithin)
378 return 0; 382 return 0;
379 if (current.nextSibling()) 383 if (current.nextSibling())
380 return current.nextSibling(); 384 return current.nextSibling();
381 return nextAncestorSibling(current, stayWithin); 385 return nextAncestorSibling(current, stayWithin);
382 } 386 }
383 387
384 inline Node& NodeTraversal::highestAncestorOrSelf(Node& current) { 388 inline Node& NodeTraversal::highestAncestorOrSelf(Node& current) {
385 Node* highest = &current; 389 Node* highest = &current;
386 while (highest->parentNode()) 390 while (highest->parentNode())
387 highest = highest->parentNode(); 391 highest = highest->parentNode();
388 return *highest; 392 return *highest;
389 } 393 }
390 394
391 template <class NodeType> 395 template <class NodeType>
392 inline Node* NodeTraversal::childAtTemplate(NodeType& parent, unsigned index) { 396 inline Node* NodeTraversal::ChildAtTemplate(NodeType& parent, unsigned index) {
397 /* DO NOT SUBMIT - conflict resolution marker */
398 /* Below we should have: hasChildren, firstChild, nextSibling, etc. */
393 Node* child = parent.firstChild(); 399 Node* child = parent.firstChild();
394 while (child && index--) 400 while (child && index--)
395 child = child->nextSibling(); 401 child = child->nextSibling();
396 return child; 402 return child;
397 } 403 }
398 404
399 } // namespace blink 405 } // namespace blink
400 406
401 #endif 407 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/editing/EditingCommandTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698