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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 static TraversalRange<TraversalNextIterator<NodeTraversal>> startsAfter( | 152 static TraversalRange<TraversalNextIterator<NodeTraversal>> startsAfter( |
153 const Node&); | 153 const Node&); |
154 | 154 |
155 private: | 155 private: |
156 template <class NodeType> | 156 template <class NodeType> |
157 static Node* traverseNextTemplate(NodeType&); | 157 static Node* traverseNextTemplate(NodeType&); |
158 template <class NodeType> | 158 template <class NodeType> |
159 static Node* traverseNextTemplate(NodeType&, const Node* stayWithin); | 159 static Node* traverseNextTemplate(NodeType&, const Node* stayWithin); |
160 template <class NodeType> | 160 template <class NodeType> |
161 static Node* childAtTemplate(NodeType&, unsigned); | 161 static Node* childAtTemplate(NodeType&, unsigned); |
| 162 static Node* previousAncestorSiblingPostOrder(const Node& current, |
| 163 const Node* stayWithin); |
162 }; | 164 }; |
163 | 165 |
164 template <class Iterator> | 166 template <class Iterator> |
165 class TraversalRange { | 167 class TraversalRange { |
166 STACK_ALLOCATED(); | 168 STACK_ALLOCATED(); |
167 | 169 |
168 public: | 170 public: |
169 using StartNodeType = typename Iterator::StartNodeType; | 171 using StartNodeType = typename Iterator::StartNodeType; |
170 explicit TraversalRange(const StartNodeType* start) : m_start(start) {} | 172 explicit TraversalRange(const StartNodeType* start) : m_start(start) {} |
171 Iterator begin() { return Iterator(m_start); } | 173 Iterator begin() { return Iterator(m_start); } |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 inline Node* NodeTraversal::childAtTemplate(NodeType& parent, unsigned index) { | 394 inline Node* NodeTraversal::childAtTemplate(NodeType& parent, unsigned index) { |
393 Node* child = parent.firstChild(); | 395 Node* child = parent.firstChild(); |
394 while (child && index--) | 396 while (child && index--) |
395 child = child->nextSibling(); | 397 child = child->nextSibling(); |
396 return child; | 398 return child; |
397 } | 399 } |
398 | 400 |
399 } // namespace blink | 401 } // namespace blink |
400 | 402 |
401 #endif | 403 #endif |
OLD | NEW |