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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 static Node* nextIncludingPseudoSkippingChildren(const Node&, const Node* st
ayWithin = 0); | 80 static Node* nextIncludingPseudoSkippingChildren(const Node&, const Node* st
ayWithin = 0); |
81 | 81 |
82 CORE_EXPORT static Node* nextAncestorSibling(const Node&); | 82 CORE_EXPORT static Node* nextAncestorSibling(const Node&); |
83 CORE_EXPORT static Node* nextAncestorSibling(const Node&, const Node* stayWi
thin); | 83 CORE_EXPORT static Node* nextAncestorSibling(const Node&, const Node* stayWi
thin); |
84 static Node& highestAncestorOrSelf(Node&); | 84 static Node& highestAncestorOrSelf(Node&); |
85 | 85 |
86 // Children traversal. | 86 // Children traversal. |
87 static Node* childAt(const Node& parent, unsigned index) { return childAtTem
plate(parent, index); } | 87 static Node* childAt(const Node& parent, unsigned index) { return childAtTem
plate(parent, index); } |
88 static Node* childAt(const ContainerNode& parent, unsigned index) { return c
hildAtTemplate(parent, index); } | 88 static Node* childAt(const ContainerNode& parent, unsigned index) { return c
hildAtTemplate(parent, index); } |
89 | 89 |
90 // These functions are provided for matching with |ComposedTreeTraversal|. | 90 // These functions are provided for matching with |FlatTreeTraversal|. |
91 static bool hasChildren(const Node& parent) { return firstChild(parent); } | 91 static bool hasChildren(const Node& parent) { return firstChild(parent); } |
92 static bool isDescendantOf(const Node& node, const Node& other) { return nod
e.isDescendantOf(&other); } | 92 static bool isDescendantOf(const Node& node, const Node& other) { return nod
e.isDescendantOf(&other); } |
93 static Node* firstChild(const Node& parent) { return parent.firstChild(); } | 93 static Node* firstChild(const Node& parent) { return parent.firstChild(); } |
94 static Node* lastChild(const Node& parent) { return parent.lastChild(); } | 94 static Node* lastChild(const Node& parent) { return parent.lastChild(); } |
95 static Node* nextSibling(const Node& node) { return node.nextSibling(); } | 95 static Node* nextSibling(const Node& node) { return node.nextSibling(); } |
96 static Node* previousSibling(const Node& node) { return node.previousSibling
(); } | 96 static Node* previousSibling(const Node& node) { return node.previousSibling
(); } |
97 static ContainerNode* parent(const Node& node) { return node.parentNode(); } | 97 static ContainerNode* parent(const Node& node) { return node.parentNode(); } |
98 static Node* commonAncestor(const Node& nodeA, const Node& nodeB); | 98 static Node* commonAncestor(const Node& nodeA, const Node& nodeB); |
99 static unsigned index(const Node& node) { return node.nodeIndex(); } | 99 static unsigned index(const Node& node) { return node.nodeIndex(); } |
100 static unsigned countChildren(const Node& parent) { return parent.countChild
ren(); } | 100 static unsigned countChildren(const Node& parent) { return parent.countChild
ren(); } |
(...skipping 167 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 |