| OLD | NEW |
| 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 Loading... |
| 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 = ¤t; | 389 Node* highest = ¤t; |
| 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 |
| OLD | NEW |