Index: Source/core/dom/PresentationAttributeStyle.cpp |
diff --git a/Source/core/dom/PresentationAttributeStyle.cpp b/Source/core/dom/PresentationAttributeStyle.cpp |
index 3d9a3e35496002585144b1fc427368e391cafac9..38cca3f2bd2171f3b99cf31f86b910d74362fd7d 100644 |
--- a/Source/core/dom/PresentationAttributeStyle.cpp |
+++ b/Source/core/dom/PresentationAttributeStyle.cpp |
@@ -123,17 +123,17 @@ static void makePresentationAttributeCacheKey(Element& element, PresentationAttr |
// Interpretation of the size attributes on <input> depends on the type attribute. |
if (isHTMLInputElement(element)) |
return; |
- unsigned size = element.attributeCount(); |
- for (unsigned i = 0; i < size; ++i) { |
- const Attribute& attribute = element.attributeItem(i); |
- if (!element.isPresentationAttribute(attribute.name())) |
+ AttributeIteratorAccessor attributes = element.attributesIterator(); |
+ AttributeConstIterator end = attributes.end(); |
+ for (AttributeConstIterator it = attributes.begin(); it != end; ++it) { |
+ if (!element.isPresentationAttribute(it->name())) |
continue; |
- if (!attribute.namespaceURI().isNull()) |
+ if (!it->namespaceURI().isNull()) |
return; |
// FIXME: Background URL may depend on the base URL and can't be shared. Disallow caching. |
- if (attribute.name() == backgroundAttr) |
+ if (it->name() == backgroundAttr) |
return; |
- result.attributesAndValues.append(std::make_pair(attribute.localName().impl(), attribute.value())); |
+ result.attributesAndValues.append(std::make_pair(it->localName().impl(), it->value())); |
} |
if (result.attributesAndValues.isEmpty()) |
return; |
@@ -178,11 +178,10 @@ PassRefPtr<StylePropertySet> computePresentationAttributeStyle(Element& element) |
cacheCleaner.didHitPresentationAttributeCache(); |
} else { |
style = MutableStylePropertySet::create(element.isSVGElement() ? SVGAttributeMode : HTMLAttributeMode); |
- unsigned size = element.attributeCount(); |
- for (unsigned i = 0; i < size; ++i) { |
- const Attribute& attribute = element.attributeItem(i); |
- element.collectStyleForPresentationAttribute(attribute.name(), attribute.value(), toMutableStylePropertySet(style)); |
- } |
+ AttributeIteratorAccessor attributes = element.attributesIterator(); |
+ AttributeConstIterator end = attributes.end(); |
+ for (AttributeConstIterator it = attributes.begin(); it != end; ++it) |
+ element.collectStyleForPresentationAttribute(it->name(), it->value(), toMutableStylePropertySet(style)); |
} |
if (!cacheHash || cacheValue->value) |