| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 }; | 342 }; |
| 343 | 343 |
| 344 inline TraversalRange<TraversalNextIterator<NodeTraversal>> | 344 inline TraversalRange<TraversalNextIterator<NodeTraversal>> |
| 345 NodeTraversal::startsAfter(const Node& start) { | 345 NodeTraversal::startsAfter(const Node& start) { |
| 346 return TraversalRange<TraversalNextIterator<NodeTraversal>>( | 346 return TraversalRange<TraversalNextIterator<NodeTraversal>>( |
| 347 NodeTraversal::next(start)); | 347 NodeTraversal::next(start)); |
| 348 }; | 348 }; |
| 349 | 349 |
| 350 template <class NodeType> | 350 template <class NodeType> |
| 351 inline Node* NodeTraversal::traverseNextTemplate(NodeType& current) { | 351 inline Node* NodeTraversal::traverseNextTemplate(NodeType& current) { |
| 352 /* DO NOT SUBMIT - conflict resolution marker */ |
| 353 /* Below we should have: hasChildren, firstChild, nextSibling, etc. */ |
| 352 if (current.hasChildren()) | 354 if (current.hasChildren()) |
| 353 return current.firstChild(); | 355 return current.firstChild(); |
| 354 if (current.nextSibling()) | 356 if (current.nextSibling()) |
| 355 return current.nextSibling(); | 357 return current.nextSibling(); |
| 356 return nextAncestorSibling(current); | 358 return nextAncestorSibling(current); |
| 357 } | 359 } |
| 358 | 360 |
| 359 template <class NodeType> | 361 template <class NodeType> |
| 360 inline Node* NodeTraversal::traverseNextTemplate(NodeType& current, | 362 inline Node* NodeTraversal::traverseNextTemplate(NodeType& current, |
| 361 const Node* stayWithin) { | 363 const Node* stayWithin) { |
| 364 /* DO NOT SUBMIT - conflict resolution marker */ |
| 365 /* Below we should have: hasChildren, firstChild, nextSibling, etc. */ |
| 362 if (current.hasChildren()) | 366 if (current.hasChildren()) |
| 363 return current.firstChild(); | 367 return current.firstChild(); |
| 364 if (current == stayWithin) | 368 if (current == stayWithin) |
| 365 return 0; | 369 return 0; |
| 366 if (current.nextSibling()) | 370 if (current.nextSibling()) |
| 367 return current.nextSibling(); | 371 return current.nextSibling(); |
| 372 <<<<<<< HEAD |
| 368 return nextAncestorSibling(current, stayWithin); | 373 return nextAncestorSibling(current, stayWithin); |
| 374 ======= |
| 375 return NextAncestorSibling(current, stay_within); |
| 376 >>>>>>> 5c8ef794871f... More fixes. |
| 369 } | 377 } |
| 370 | 378 |
| 371 inline Node* NodeTraversal::nextSkippingChildren(const Node& current) { | 379 inline Node* NodeTraversal::nextSkippingChildren(const Node& current) { |
| 372 if (current.nextSibling()) | 380 if (current.nextSibling()) |
| 373 return current.nextSibling(); | 381 return current.nextSibling(); |
| 374 return nextAncestorSibling(current); | 382 return nextAncestorSibling(current); |
| 375 } | 383 } |
| 376 | 384 |
| 377 inline Node* NodeTraversal::nextSkippingChildren(const Node& current, | 385 inline Node* NodeTraversal::nextSkippingChildren(const Node& current, |
| 378 const Node* stayWithin) { | 386 const Node* stayWithin) { |
| 379 if (current == stayWithin) | 387 if (current == stayWithin) |
| 380 return 0; | 388 return 0; |
| 381 if (current.nextSibling()) | 389 if (current.nextSibling()) |
| 382 return current.nextSibling(); | 390 return current.nextSibling(); |
| 383 return nextAncestorSibling(current, stayWithin); | 391 return nextAncestorSibling(current, stayWithin); |
| 384 } | 392 } |
| 385 | 393 |
| 386 inline Node& NodeTraversal::highestAncestorOrSelf(Node& current) { | 394 inline Node& NodeTraversal::highestAncestorOrSelf(Node& current) { |
| 387 Node* highest = ¤t; | 395 Node* highest = ¤t; |
| 388 while (highest->parentNode()) | 396 while (highest->parentNode()) |
| 389 highest = highest->parentNode(); | 397 highest = highest->parentNode(); |
| 390 return *highest; | 398 return *highest; |
| 391 } | 399 } |
| 392 | 400 |
| 393 template <class NodeType> | 401 template <class NodeType> |
| 394 inline Node* NodeTraversal::childAtTemplate(NodeType& parent, unsigned index) { | 402 inline Node* NodeTraversal::ChildAtTemplate(NodeType& parent, unsigned index) { |
| 403 /* DO NOT SUBMIT - conflict resolution marker */ |
| 404 /* Below we should have: hasChildren, firstChild, nextSibling, etc. */ |
| 395 Node* child = parent.firstChild(); | 405 Node* child = parent.firstChild(); |
| 396 while (child && index--) | 406 while (child && index--) |
| 397 child = child->nextSibling(); | 407 child = child->nextSibling(); |
| 398 return child; | 408 return child; |
| 399 } | 409 } |
| 400 | 410 |
| 401 } // namespace blink | 411 } // namespace blink |
| 402 | 412 |
| 403 #endif | 413 #endif |
| OLD | NEW |