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

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

Issue 420323002: Move Node::lastDescendantOrSelf() to NodeTraversal and rename to lastWithinOrSelf() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Node.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 * 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 27 matching lines...) Expand all
38 // This can be used to restrict traversal to a particular sub-tree. 38 // This can be used to restrict traversal to a particular sub-tree.
39 static Node* next(const Node& current) { return traverseNextTemplate(current ); } 39 static Node* next(const Node& current) { return traverseNextTemplate(current ); }
40 static Node* next(const ContainerNode& current) { return traverseNextTemplat e(current); } 40 static Node* next(const ContainerNode& current) { return traverseNextTemplat e(current); }
41 static Node* next(const Node& current, const Node* stayWithin) { return trav erseNextTemplate(current, stayWithin); } 41 static Node* next(const Node& current, const Node* stayWithin) { return trav erseNextTemplate(current, stayWithin); }
42 static Node* next(const ContainerNode& current, const Node* stayWithin) { re turn traverseNextTemplate(current, stayWithin); } 42 static Node* next(const ContainerNode& current, const Node* stayWithin) { re turn traverseNextTemplate(current, stayWithin); }
43 43
44 // Like next, but skips children and starts with the next sibling. 44 // Like next, but skips children and starts with the next sibling.
45 static Node* nextSkippingChildren(const Node&); 45 static Node* nextSkippingChildren(const Node&);
46 static Node* nextSkippingChildren(const Node&, const Node* stayWithin); 46 static Node* nextSkippingChildren(const Node&, const Node* stayWithin);
47 47
48 static Node* lastWithin(const ContainerNode&);
49 static Node& lastWithinOrSelf(Node&);
50
48 // Does a reverse pre-order traversal to find the node that comes before the current one in document order 51 // Does a reverse pre-order traversal to find the node that comes before the current one in document order
49 static Node* lastWithin(const ContainerNode&);
50 static Node* previous(const Node&, const Node* stayWithin = 0); 52 static Node* previous(const Node&, const Node* stayWithin = 0);
51 53
52 // Like previous, but skips children and starts with the next sibling. 54 // Like previous, but skips children and starts with the next sibling.
53 static Node* previousSkippingChildren(const Node&, const Node* stayWithin = 0); 55 static Node* previousSkippingChildren(const Node&, const Node* stayWithin = 0);
54 56
55 // Like next, but visits parents after their children. 57 // Like next, but visits parents after their children.
56 static Node* nextPostOrder(const Node&, const Node* stayWithin = 0); 58 static Node* nextPostOrder(const Node&, const Node* stayWithin = 0);
57 59
58 // Like previous, but visits parents before their children. 60 // Like previous, but visits parents before their children.
59 static Node* previousPostOrder(const Node&, const Node* stayWithin = 0); 61 static Node* previousPostOrder(const Node&, const Node* stayWithin = 0);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (current == stayWithin) 109 if (current == stayWithin)
108 return 0; 110 return 0;
109 if (current.nextSibling()) 111 if (current.nextSibling())
110 return current.nextSibling(); 112 return current.nextSibling();
111 return nextAncestorSibling(current, stayWithin); 113 return nextAncestorSibling(current, stayWithin);
112 } 114 }
113 115
114 } // namespace blink 116 } // namespace blink
115 117
116 #endif 118 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/NodeTraversal.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698