Index: Source/core/xml/XPathNodeSet.cpp |
diff --git a/Source/core/xml/XPathNodeSet.cpp b/Source/core/xml/XPathNodeSet.cpp |
index 3126c4da59cf06d340171f60ac1f0e524dcb81df..ceb8562a064e9f79a8aace4f97abdaf4e39656fa 100644 |
--- a/Source/core/xml/XPathNodeSet.cpp |
+++ b/Source/core/xml/XPathNodeSet.cpp |
@@ -228,9 +228,10 @@ void NodeSet::traversalSort() const |
if (!element->hasAttributes()) |
continue; |
- unsigned attributeCount = element->attributeCount(); |
- for (unsigned i = 0; i < attributeCount; ++i) { |
- RefPtrWillBeRawPtr<Attr> attr = element->attrIfExists(element->attributeItem(i).name()); |
+ AttributeIteratorAccessor attributes = element->attributesIterator(); |
+ AttributeConstIterator end = attributes.end(); |
+ for (AttributeConstIterator it = attributes.begin(); it != end; ++it) { |
+ RefPtrWillBeRawPtr<Attr> attr = element->attrIfExists(it->name()); |
if (attr && nodes.contains(attr.get())) |
sortedNodes.append(attr); |
} |