Index: Source/web/WebPageSerializerImpl.cpp |
diff --git a/Source/web/WebPageSerializerImpl.cpp b/Source/web/WebPageSerializerImpl.cpp |
index 126b38feeb991c2f237563f4dbc836733e834124..28803d4b0731a407fe874bb9371f405b77140812 100644 |
--- a/Source/web/WebPageSerializerImpl.cpp |
+++ b/Source/web/WebPageSerializerImpl.cpp |
@@ -303,19 +303,19 @@ void WebPageSerializerImpl::openTagToString(Element* element, |
result.append(element->nodeName().lower()); |
// Go through all attributes and serialize them. |
if (element->hasAttributes()) { |
- unsigned numAttrs = element->attributeCount(); |
- for (unsigned i = 0; i < numAttrs; i++) { |
+ AttributeIteratorAccessor attributes = element->attributesIterator(); |
+ AttributeConstIterator end = attributes.end(); |
+ for (AttributeConstIterator it = attributes.begin(); it != end; ++it) { |
result.append(' '); |
// Add attribute pair |
- const Attribute& attribute = element->attributeItem(i); |
- result.append(attribute.name().toString()); |
+ result.append(it->name().toString()); |
result.appendLiteral("=\""); |
- if (!attribute.value().isEmpty()) { |
- const String& attrValue = attribute.value(); |
+ if (!it->value().isEmpty()) { |
+ const String& attrValue = it->value(); |
// Check whether we need to replace some resource links |
// with local resource paths. |
- const QualifiedName& attrName = attribute.name(); |
+ const QualifiedName& attrName = it->name(); |
if (element->hasLegalLinkAttribute(attrName)) { |
// For links start with "javascript:", we do not change it. |
if (attrValue.startsWith("javascript:", false)) |