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

Side by Side Diff: Source/core/xml/XPathNodeSet.cpp

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, 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/page/FocusController.cpp ('k') | Source/core/xml/XPathStep.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) 2007 Alexey Proskuryakov <ap@webkit.org> 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 for (unsigned i = 0; i < nodeCount; ++i) { 219 for (unsigned i = 0; i < nodeCount; ++i) {
220 Node* node = m_nodes[i].get(); 220 Node* node = m_nodes[i].get();
221 nodes.add(node); 221 nodes.add(node);
222 if (node->isAttributeNode()) 222 if (node->isAttributeNode())
223 containsAttributeNodes = true; 223 containsAttributeNodes = true;
224 } 224 }
225 225
226 WillBeHeapVector<RefPtrWillBeMember<Node> > sortedNodes; 226 WillBeHeapVector<RefPtrWillBeMember<Node> > sortedNodes;
227 sortedNodes.reserveInitialCapacity(nodeCount); 227 sortedNodes.reserveInitialCapacity(nodeCount);
228 228
229 for (Node& n : NodeTraversal::from(findRootNode(m_nodes.first().get()))) { 229 for (Node& n : NodeTraversal::startsAt(findRootNode(m_nodes.first().get()))) {
230 if (nodes.contains(&n)) 230 if (nodes.contains(&n))
231 sortedNodes.append(&n); 231 sortedNodes.append(&n);
232 232
233 if (!containsAttributeNodes || !n.isElementNode()) 233 if (!containsAttributeNodes || !n.isElementNode())
234 continue; 234 continue;
235 235
236 Element* element = toElement(&n); 236 Element* element = toElement(&n);
237 AttributeCollection attributes = element->attributes(); 237 AttributeCollection attributes = element->attributes();
238 AttributeCollection::iterator end = attributes.end(); 238 AttributeCollection::iterator end = attributes.end();
239 for (AttributeCollection::iterator it = attributes.begin(); it != end; + +it) { 239 for (AttributeCollection::iterator it = attributes.begin(); it != end; + +it) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 Node* NodeSet::anyNode() const 275 Node* NodeSet::anyNode() const
276 { 276 {
277 if (isEmpty()) 277 if (isEmpty())
278 return 0; 278 return 0;
279 279
280 return m_nodes.at(0).get(); 280 return m_nodes.at(0).get();
281 } 281 }
282 282
283 } 283 }
284 } 284 }
OLDNEW
« no previous file with comments | « Source/core/page/FocusController.cpp ('k') | Source/core/xml/XPathStep.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698