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

Side by Side Diff: third_party/WebKit/WebCore/xml/XPathNodeSet.cpp

Issue 20076: WebKit merge 40500:40539 [WebKit side] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 | « third_party/WebKit/WebCore/svg/graphics/SVGImage.cpp ('k') | no next file » | 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 parentsVector.append(n); 155 parentsVector.append(n);
156 containsAttributeNodes = true; 156 containsAttributeNodes = true;
157 } 157 }
158 while ((n = n->parent())) 158 while ((n = n->parent()))
159 parentsVector.append(n); 159 parentsVector.append(n);
160 } 160 }
161 sortBlock(0, nodeCount, parentMatrix, containsAttributeNodes); 161 sortBlock(0, nodeCount, parentMatrix, containsAttributeNodes);
162 162
163 // It is not possible to just assign the result to m_nodes, because some nod es may get dereferenced and destroyed. 163 // It is not possible to just assign the result to m_nodes, because some nod es may get dereferenced and destroyed.
164 Vector<RefPtr<Node> > sortedNodes; 164 Vector<RefPtr<Node> > sortedNodes;
165 sortedNodes.reserveCapacity(nodeCount); 165 sortedNodes.reserveInitialCapacity(nodeCount);
166 for (unsigned i = 0; i < nodeCount; ++i) 166 for (unsigned i = 0; i < nodeCount; ++i)
167 sortedNodes.append(parentMatrix[i][0]); 167 sortedNodes.append(parentMatrix[i][0]);
168 168
169 const_cast<Vector<RefPtr<Node> >& >(m_nodes).swap(sortedNodes); 169 const_cast<Vector<RefPtr<Node> >& >(m_nodes).swap(sortedNodes);
170 } 170 }
171 171
172 void NodeSet::reverse() 172 void NodeSet::reverse()
173 { 173 {
174 if (m_nodes.isEmpty()) 174 if (m_nodes.isEmpty())
175 return; 175 return;
(...skipping 21 matching lines...) Expand all
197 if (isEmpty()) 197 if (isEmpty())
198 return 0; 198 return 0;
199 199
200 return m_nodes.at(0).get(); 200 return m_nodes.at(0).get();
201 } 201 }
202 202
203 } 203 }
204 } 204 }
205 205
206 #endif // ENABLE(XPATH) 206 #endif // ENABLE(XPATH)
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/svg/graphics/SVGImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698