Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: Source/core/dom/NodeTraversal.h

Issue 69003004: Have NodeTraversal::previous*() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/dom/NodeIterator.cpp ('k') | Source/core/dom/NodeTraversal.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 29 matching lines...) Expand all
40 Node* next(const ContainerNode&); 40 Node* next(const ContainerNode&);
41 Node* next(const ContainerNode&, const Node* stayWithin); 41 Node* next(const ContainerNode&, const Node* stayWithin);
42 42
43 // Like next, but skips children and starts with the next sibling. 43 // Like next, but skips children and starts with the next sibling.
44 Node* nextSkippingChildren(const Node*); 44 Node* nextSkippingChildren(const Node*);
45 Node* nextSkippingChildren(const Node*, const Node* stayWithin); 45 Node* nextSkippingChildren(const Node*, const Node* stayWithin);
46 Node* nextSkippingChildren(const ContainerNode*); 46 Node* nextSkippingChildren(const ContainerNode*);
47 Node* nextSkippingChildren(const ContainerNode*, const Node* stayWithin); 47 Node* nextSkippingChildren(const ContainerNode*, const Node* stayWithin);
48 48
49 // Does a reverse pre-order traversal to find the node that comes before the cur rent one in document order 49 // Does a reverse pre-order traversal to find the node that comes before the cur rent one in document order
50 Node* previous(const Node*, const Node* stayWithin = 0); 50 Node* previous(const Node&, const Node* stayWithin = 0);
51 51
52 // Like previous, but skips children and starts with the next sibling. 52 // Like previous, but skips children and starts with the next sibling.
53 Node* previousSkippingChildren(const Node*, const Node* stayWithin = 0); 53 Node* previousSkippingChildren(const Node&, const Node* stayWithin = 0);
54 54
55 // Like next, but visits parents after their children. 55 // Like next, but visits parents after their children.
56 Node* nextPostOrder(const Node*, const Node* stayWithin = 0); 56 Node* nextPostOrder(const Node*, const Node* stayWithin = 0);
57 57
58 // Like previous/previousSkippingChildren, but visits parents before their child ren. 58 // Like previous/previousSkippingChildren, but visits parents before their child ren.
59 Node* previousPostOrder(const Node*, const Node* stayWithin = 0); 59 Node* previousPostOrder(const Node&, const Node* stayWithin = 0);
60 Node* previousSkippingChildrenPostOrder(const Node*, const Node* stayWithin = 0) ; 60 Node* previousSkippingChildrenPostOrder(const Node&, const Node* stayWithin = 0) ;
61 61
62 // Pre-order traversal including the pseudo-elements. 62 // Pre-order traversal including the pseudo-elements.
63 Node* previousIncludingPseudo(const Node*, const Node* stayWithin = 0); 63 Node* previousIncludingPseudo(const Node&, const Node* stayWithin = 0);
64 Node* nextIncludingPseudo(const Node*, const Node* stayWithin = 0); 64 Node* nextIncludingPseudo(const Node*, const Node* stayWithin = 0);
65 Node* nextIncludingPseudoSkippingChildren(const Node*, const Node* stayWithin = 0); 65 Node* nextIncludingPseudoSkippingChildren(const Node*, const Node* stayWithin = 0);
66 66
67 Node* nextAncestorSibling(const Node*); 67 Node* nextAncestorSibling(const Node*);
68 Node* nextAncestorSibling(const Node*, const Node* stayWithin); 68 Node* nextAncestorSibling(const Node*, const Node* stayWithin);
69 69
70 template <class NodeType> 70 template <class NodeType>
71 inline Node* traverseNextTemplate(NodeType& current) 71 inline Node* traverseNextTemplate(NodeType& current)
72 { 72 {
73 if (current.firstChild()) 73 if (current.firstChild())
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 return nextAncestorSibling(current, stayWithin); 113 return nextAncestorSibling(current, stayWithin);
114 } 114 }
115 inline Node* nextSkippingChildren(const Node* current, const Node* stayWithin) { return traverseNextSkippingChildrenTemplate(current, stayWithin); } 115 inline Node* nextSkippingChildren(const Node* current, const Node* stayWithin) { return traverseNextSkippingChildrenTemplate(current, stayWithin); }
116 inline Node* nextSkippingChildren(const ContainerNode* current, const Node* stay Within) { return traverseNextSkippingChildrenTemplate(current, stayWithin); } 116 inline Node* nextSkippingChildren(const ContainerNode* current, const Node* stay Within) { return traverseNextSkippingChildrenTemplate(current, stayWithin); }
117 117
118 } 118 }
119 119
120 } 120 }
121 121
122 #endif 122 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/NodeIterator.cpp ('k') | Source/core/dom/NodeTraversal.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698