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.
All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
7 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 7 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 STATIC_ONLY(NodeTraversal); | 43 STATIC_ONLY(NodeTraversal); |
44 public: | 44 public: |
45 using TraversalNodeType = Node; | 45 using TraversalNodeType = Node; |
46 | 46 |
47 // Does a pre-order traversal of the tree to find the next node after this o
ne. | 47 // Does a pre-order traversal of the tree to find the next node after this o
ne. |
48 // This uses the same order that tags appear in the source file. If the stay
Within | 48 // This uses the same order that tags appear in the source file. If the stay
Within |
49 // argument is non-null, the traversal will stop once the specified node is
reached. | 49 // argument is non-null, the traversal will stop once the specified node is
reached. |
50 // This can be used to restrict traversal to a particular sub-tree. | 50 // This can be used to restrict traversal to a particular sub-tree. |
51 static Node* next(const Node& current) { return traverseNextTemplate(current
); } | 51 static Node* next(const Node& current) { return traverseNextTemplate(current
); } |
52 static Node* next(const ContainerNode& current) { return traverseNextTemplat
e(current); } | 52 static Node* next(const ContainerNode& current) { return traverseNextTemplat
e(current); } |
53 static Node* next(const Node& current, const Node* stayWithin) { return trav
erseNextTemplate(current, stayWithin); } | 53 CORE_EXPORT static Node* next(const Node& current, const Node* stayWithin) {
return traverseNextTemplate(current, stayWithin); } |
54 static Node* next(const ContainerNode& current, const Node* stayWithin) { re
turn traverseNextTemplate(current, stayWithin); } | 54 static Node* next(const ContainerNode& current, const Node* stayWithin) { re
turn traverseNextTemplate(current, stayWithin); } |
55 | 55 |
56 // Like next, but skips children and starts with the next sibling. | 56 // Like next, but skips children and starts with the next sibling. |
57 static Node* nextSkippingChildren(const Node&); | 57 static Node* nextSkippingChildren(const Node&); |
58 static Node* nextSkippingChildren(const Node&, const Node* stayWithin); | 58 static Node* nextSkippingChildren(const Node&, const Node* stayWithin); |
59 | 59 |
60 static Node* firstWithin(const Node& current) { return current.firstChild();
} | 60 static Node* firstWithin(const Node& current) { return current.firstChild();
} |
61 | 61 |
62 static Node* lastWithin(const ContainerNode&); | 62 static Node* lastWithin(const ContainerNode&); |
63 static Node& lastWithinOrSelf(Node&); | 63 static Node& lastWithinOrSelf(Node&); |
64 | 64 |
65 // Does a reverse pre-order traversal to find the node that comes before the
current one in document order | 65 // Does a reverse pre-order traversal to find the node that comes before the
current one in document order |
66 static Node* previous(const Node&, const Node* stayWithin = 0); | 66 CORE_EXPORT static Node* previous(const Node&, const Node* stayWithin = 0); |
67 | 67 |
68 // Like previous, but skips children and starts with the next sibling. | 68 // Like previous, but skips children and starts with the next sibling. |
69 static Node* previousSkippingChildren(const Node&, const Node* stayWithin =
0); | 69 static Node* previousSkippingChildren(const Node&, const Node* stayWithin =
0); |
70 | 70 |
71 // Like next, but visits parents after their children. | 71 // Like next, but visits parents after their children. |
72 static Node* nextPostOrder(const Node&, const Node* stayWithin = 0); | 72 static Node* nextPostOrder(const Node&, const Node* stayWithin = 0); |
73 | 73 |
74 // Like previous, but visits parents before their children. | 74 // Like previous, but visits parents before their children. |
75 static Node* previousPostOrder(const Node&, const Node* stayWithin = 0); | 75 static Node* previousPostOrder(const Node&, const Node* stayWithin = 0); |
76 | 76 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 { | 268 { |
269 Node* child = parent.firstChild(); | 269 Node* child = parent.firstChild(); |
270 while (child && index--) | 270 while (child && index--) |
271 child = child->nextSibling(); | 271 child = child->nextSibling(); |
272 return child; | 272 return child; |
273 } | 273 } |
274 | 274 |
275 } // namespace blink | 275 } // namespace blink |
276 | 276 |
277 #endif | 277 #endif |
OLD | NEW |