OLD | NEW |
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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 for (unsigned i = 0; i < nodeCount; ++i) { | 200 for (unsigned i = 0; i < nodeCount; ++i) { |
201 Node* node = m_nodes[i].get(); | 201 Node* node = m_nodes[i].get(); |
202 nodes.add(node); | 202 nodes.add(node); |
203 if (node->isAttributeNode()) | 203 if (node->isAttributeNode()) |
204 containsAttributeNodes = true; | 204 containsAttributeNodes = true; |
205 } | 205 } |
206 | 206 |
207 Vector<RefPtr<Node> > sortedNodes; | 207 Vector<RefPtr<Node> > sortedNodes; |
208 sortedNodes.reserveInitialCapacity(nodeCount); | 208 sortedNodes.reserveInitialCapacity(nodeCount); |
209 | 209 |
210 for (Node* n = findRootNode(m_nodes.first().get()); n; n = NodeTraversal::ne
xt(n)) { | 210 for (Node* n = findRootNode(m_nodes.first().get()); n; n = NodeTraversal::ne
xt(*n)) { |
211 if (nodes.contains(n)) | 211 if (nodes.contains(n)) |
212 sortedNodes.append(n); | 212 sortedNodes.append(n); |
213 | 213 |
214 if (!containsAttributeNodes || !n->isElementNode()) | 214 if (!containsAttributeNodes || !n->isElementNode()) |
215 continue; | 215 continue; |
216 | 216 |
217 Element* element = toElement(n); | 217 Element* element = toElement(n); |
218 if (!element->hasAttributes()) | 218 if (!element->hasAttributes()) |
219 continue; | 219 continue; |
220 | 220 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 Node* NodeSet::anyNode() const | 256 Node* NodeSet::anyNode() const |
257 { | 257 { |
258 if (isEmpty()) | 258 if (isEmpty()) |
259 return 0; | 259 return 0; |
260 | 260 |
261 return m_nodes.at(0).get(); | 261 return m_nodes.at(0).get(); |
262 } | 262 } |
263 | 263 |
264 } | 264 } |
265 } | 265 } |
OLD | NEW |