| 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, 2013 | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 |
| 6 * Apple Inc. All rights reserved. | 6 * Apple Inc. 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 while (node && !node->isElementNode()) | 274 while (node && !node->isElementNode()) |
| 275 node = NodeTraversal::nextSkippingChildren(*node, stayWithin); | 275 node = NodeTraversal::nextSkippingChildren(*node, stayWithin); |
| 276 return toElement(node); | 276 return toElement(node); |
| 277 } | 277 } |
| 278 | 278 |
| 279 // Generic versions. | 279 // Generic versions. |
| 280 template <class ElementType> | 280 template <class ElementType> |
| 281 template <class NodeType> | 281 template <class NodeType> |
| 282 inline ElementType* Traversal<ElementType>::firstChildTemplate( | 282 inline ElementType* Traversal<ElementType>::firstChildTemplate( |
| 283 NodeType& current) { | 283 NodeType& current) { |
| 284 /* DO NOT SUBMIT - merge conflict marker. |
| 285 * Please spell |firstChild|, not |FirstChild| below. */ |
| 284 Node* node = current.firstChild(); | 286 Node* node = current.firstChild(); |
| 285 while (node && !isElementOfType<const ElementType>(*node)) | 287 while (node && !isElementOfType<const ElementType>(*node)) |
| 286 node = node->nextSibling(); | 288 node = node->nextSibling(); |
| 287 return toElement<ElementType>(node); | 289 return toElement<ElementType>(node); |
| 288 } | 290 } |
| 289 | 291 |
| 290 template <class ElementType> | 292 template <class ElementType> |
| 291 template <class MatchFunc> | 293 template <class MatchFunc> |
| 292 inline ElementType* Traversal<ElementType>::firstChild( | 294 inline ElementType* Traversal<ElementType>::firstChild( |
| 293 const ContainerNode& current, | 295 const ContainerNode& current, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 312 NodeType& current) { | 314 NodeType& current) { |
| 313 if (isElementOfType<const ElementType>(current)) | 315 if (isElementOfType<const ElementType>(current)) |
| 314 return &toElement<ElementType>(current); | 316 return &toElement<ElementType>(current); |
| 315 return firstAncestor(current); | 317 return firstAncestor(current); |
| 316 } | 318 } |
| 317 | 319 |
| 318 template <class ElementType> | 320 template <class ElementType> |
| 319 template <class NodeType> | 321 template <class NodeType> |
| 320 inline ElementType* Traversal<ElementType>::lastChildTemplate( | 322 inline ElementType* Traversal<ElementType>::lastChildTemplate( |
| 321 NodeType& current) { | 323 NodeType& current) { |
| 324 /* DO NOT SUBMIT - merge conflict marker. |
| 325 * Please spell |lastChild|, not |LastChild| below. */ |
| 322 Node* node = current.lastChild(); | 326 Node* node = current.lastChild(); |
| 323 while (node && !isElementOfType<const ElementType>(*node)) | 327 while (node && !isElementOfType<const ElementType>(*node)) |
| 324 node = node->previousSibling(); | 328 node = node->previousSibling(); |
| 325 return toElement<ElementType>(node); | 329 return toElement<ElementType>(node); |
| 326 } | 330 } |
| 327 | 331 |
| 328 template <class ElementType> | 332 template <class ElementType> |
| 329 template <class MatchFunc> | 333 template <class MatchFunc> |
| 330 inline ElementType* Traversal<ElementType>::lastChild( | 334 inline ElementType* Traversal<ElementType>::lastChild( |
| 331 const ContainerNode& current, | 335 const ContainerNode& current, |
| 332 MatchFunc isMatch) { | 336 MatchFunc isMatch) { |
| 333 ElementType* element = Traversal<ElementType>::lastChild(current); | 337 ElementType* element = Traversal<ElementType>::lastChild(current); |
| 334 while (element && !isMatch(*element)) | 338 while (element && !isMatch(*element)) |
| 335 element = Traversal<ElementType>::previousSibling(*element); | 339 element = Traversal<ElementType>::previousSibling(*element); |
| 336 return element; | 340 return element; |
| 337 } | 341 } |
| 338 | 342 |
| 339 template <class ElementType> | 343 template <class ElementType> |
| 340 template <class NodeType> | 344 template <class NodeType> |
| 341 inline ElementType* Traversal<ElementType>::firstWithinTemplate( | 345 inline ElementType* Traversal<ElementType>::firstWithinTemplate( |
| 342 NodeType& current) { | 346 NodeType& current) { |
| 347 /* DO NOT SUBMIT - merge conflict marker. |
| 348 * Please spell |firstChild|, not |FirstChild| below. */ |
| 343 Node* node = current.firstChild(); | 349 Node* node = current.firstChild(); |
| 344 while (node && !isElementOfType<const ElementType>(*node)) | 350 while (node && !isElementOfType<const ElementType>(*node)) |
| 345 node = NodeTraversal::next(*node, ¤t); | 351 node = NodeTraversal::next(*node, ¤t); |
| 346 return toElement<ElementType>(node); | 352 return toElement<ElementType>(node); |
| 347 } | 353 } |
| 348 | 354 |
| 349 template <class ElementType> | 355 template <class ElementType> |
| 350 template <typename MatchFunc> | 356 template <typename MatchFunc> |
| 351 inline ElementType* Traversal<ElementType>::firstWithin( | 357 inline ElementType* Traversal<ElementType>::firstWithin( |
| 352 const ContainerNode& current, | 358 const ContainerNode& current, |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 MatchFunc isMatch) { | 545 MatchFunc isMatch) { |
| 540 ElementType* element = Traversal<ElementType>::nextSibling(current); | 546 ElementType* element = Traversal<ElementType>::nextSibling(current); |
| 541 while (element && !isMatch(*element)) | 547 while (element && !isMatch(*element)) |
| 542 element = Traversal<ElementType>::nextSibling(*element); | 548 element = Traversal<ElementType>::nextSibling(*element); |
| 543 return element; | 549 return element; |
| 544 } | 550 } |
| 545 | 551 |
| 546 } // namespace blink | 552 } // namespace blink |
| 547 | 553 |
| 548 #endif | 554 #endif |
| OLD | NEW |