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

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

Issue 667403002: Rename nodes/elements traversal function names. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename to startsAt (and startsAfter) Created 6 years, 2 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/DocumentOrderedMap.cpp ('k') | Source/core/dom/Node.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, 2013 Appl e Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Appl e 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 static ElementType* previousSibling(const Node&); 91 static ElementType* previousSibling(const Node&);
92 template <class MatchFunc> 92 template <class MatchFunc>
93 static ElementType* previousSibling(const Node&, MatchFunc); 93 static ElementType* previousSibling(const Node&, MatchFunc);
94 static ElementType* nextSibling(const Node&); 94 static ElementType* nextSibling(const Node&);
95 template <class MatchFunc> 95 template <class MatchFunc>
96 static ElementType* nextSibling(const Node&, MatchFunc); 96 static ElementType* nextSibling(const Node&, MatchFunc);
97 97
98 static TraversalRange<TraversalChildrenIterator<Traversal<ElementType>>> chi ldrenOf(const Node&); 98 static TraversalRange<TraversalChildrenIterator<Traversal<ElementType>>> chi ldrenOf(const Node&);
99 static TraversalRange<TraversalDescendantIterator<Traversal<ElementType>>> d escendantsOf(const Node&); 99 static TraversalRange<TraversalDescendantIterator<Traversal<ElementType>>> d escendantsOf(const Node&);
100 static TraversalRange<TraversalInclusiveDescendantIterator<Traversal<Element Type>>> inclusiveDescendantsOf(const ElementType&); 100 static TraversalRange<TraversalInclusiveDescendantIterator<Traversal<Element Type>>> inclusiveDescendantsOf(const ElementType&);
101 static TraversalRange<TraversalInclusiveNextIterator<Traversal<ElementType>> > from(const ElementType*); 101 static TraversalRange<TraversalNextIterator<Traversal<ElementType>>> startsA t(const ElementType*);
102 static TraversalRange<TraversalNextIterator<Traversal<ElementType>>> fromNex t(const Node&); 102 static TraversalRange<TraversalNextIterator<Traversal<ElementType>>> startsA fter(const Node&);
103 103
104 private: 104 private:
105 template <class NodeType> 105 template <class NodeType>
106 static ElementType* firstChildTemplate(NodeType&); 106 static ElementType* firstChildTemplate(NodeType&);
107 template <class NodeType> 107 template <class NodeType>
108 static ElementType* lastChildTemplate(NodeType&); 108 static ElementType* lastChildTemplate(NodeType&);
109 template <class NodeType> 109 template <class NodeType>
110 static ElementType* firstAncestorOrSelfTemplate(NodeType&); 110 static ElementType* firstAncestorOrSelfTemplate(NodeType&);
111 template <class NodeType> 111 template <class NodeType>
112 static ElementType* firstWithinTemplate(NodeType&); 112 static ElementType* firstWithinTemplate(NodeType&);
(...skipping 19 matching lines...) Expand all
132 return TraversalRange<TraversalDescendantIterator<Traversal<ElementType>>>(& root); 132 return TraversalRange<TraversalDescendantIterator<Traversal<ElementType>>>(& root);
133 }; 133 };
134 134
135 template <class ElementType> 135 template <class ElementType>
136 inline TraversalRange<TraversalInclusiveDescendantIterator<Traversal<ElementType >>> Traversal<ElementType>::inclusiveDescendantsOf(const ElementType& root) 136 inline TraversalRange<TraversalInclusiveDescendantIterator<Traversal<ElementType >>> Traversal<ElementType>::inclusiveDescendantsOf(const ElementType& root)
137 { 137 {
138 return TraversalRange<TraversalInclusiveDescendantIterator<Traversal<Element Type>>>(&root); 138 return TraversalRange<TraversalInclusiveDescendantIterator<Traversal<Element Type>>>(&root);
139 }; 139 };
140 140
141 template <class ElementType> 141 template <class ElementType>
142 inline TraversalRange<TraversalInclusiveNextIterator<Traversal<ElementType>>> Tr aversal<ElementType>::from(const ElementType* start) 142 inline TraversalRange<TraversalNextIterator<Traversal<ElementType>>> Traversal<E lementType>::startsAt(const ElementType* start)
143 { 143 {
144 return TraversalRange<TraversalInclusiveNextIterator<Traversal<ElementType>> >(start); 144 return TraversalRange<TraversalNextIterator<Traversal<ElementType>>>(start);
145 }; 145 };
146 146
147 template <class ElementType> 147 template <class ElementType>
148 inline TraversalRange<TraversalNextIterator<Traversal<ElementType>>> Traversal<E lementType>::fromNext(const Node& start) 148 inline TraversalRange<TraversalNextIterator<Traversal<ElementType>>> Traversal<E lementType>::startsAfter(const Node& start)
149 { 149 {
150 return TraversalRange<TraversalNextIterator<Traversal<ElementType>>>(&start) ; 150 return startsAt(Traversal<ElementType>::next(start));
151 }; 151 };
152 152
153 // Specialized for pure Element to exploit the fact that Elements parent is alwa ys either another Element or the root. 153 // Specialized for pure Element to exploit the fact that Elements parent is alwa ys either another Element or the root.
154 template <> 154 template <>
155 template <class NodeType> 155 template <class NodeType>
156 inline Element* Traversal<Element>::firstWithinTemplate(NodeType& current) 156 inline Element* Traversal<Element>::firstWithinTemplate(NodeType& current)
157 { 157 {
158 return firstChildTemplate(current); 158 return firstChildTemplate(current);
159 } 159 }
160 160
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 { 423 {
424 ElementType* element = Traversal<ElementType>::nextSibling(current); 424 ElementType* element = Traversal<ElementType>::nextSibling(current);
425 while (element && !isMatch(*element)) 425 while (element && !isMatch(*element))
426 element = Traversal<ElementType>::nextSibling(*element); 426 element = Traversal<ElementType>::nextSibling(*element);
427 return element; 427 return element;
428 } 428 }
429 429
430 } // namespace blink 430 } // namespace blink
431 431
432 #endif 432 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/DocumentOrderedMap.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698