| Index: Source/core/dom/Element.cpp
|
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
|
| index 6fda57079b921222b9414a5b413edf4afd405399..2cdd389404066a0152d229d2ab87ba10aedca84d 100644
|
| --- a/Source/core/dom/Element.cpp
|
| +++ b/Source/core/dom/Element.cpp
|
| @@ -1233,12 +1233,11 @@ const AtomicString& Element::locateNamespacePrefix(const AtomicString& namespace
|
| return prefix();
|
|
|
| if (hasAttributes()) {
|
| - unsigned attributeCount = this->attributeCount();
|
| - for (unsigned i = 0; i < attributeCount; ++i) {
|
| - const Attribute& attr = attributeItem(i);
|
| -
|
| - if (attr.prefix() == xmlnsAtom && attr.value() == namespaceToLocate)
|
| - return attr.localName();
|
| + AttributeIteratorAccessor attributes = attributesIterator();
|
| + AttributeConstIterator end = attributes.end();
|
| + for (AttributeConstIterator it = attributes.begin(); it != end; ++it) {
|
| + if (it->prefix() == xmlnsAtom && it->value() == namespaceToLocate)
|
| + return it->localName();
|
| }
|
| }
|
|
|
| @@ -2987,11 +2986,11 @@ void Element::detachAllAttrNodesFromElement()
|
| AttrNodeList* attrNodeList = attrNodeListForElement(this);
|
| ASSERT(attrNodeList);
|
|
|
| - unsigned attributeCount = this->attributeCount();
|
| - for (unsigned i = 0; i < attributeCount; ++i) {
|
| - const Attribute& attribute = attributeItem(i);
|
| - if (RefPtrWillBeRawPtr<Attr> attrNode = findAttrNodeInList(*attrNodeList, attribute.name()))
|
| - attrNode->detachFromElementWithValue(attribute.value());
|
| + AttributeIteratorAccessor attributes = attributesIterator();
|
| + AttributeConstIterator end = attributes.end();
|
| + for (AttributeConstIterator it = attributes.begin(); it != end; ++it) {
|
| + if (RefPtrWillBeRawPtr<Attr> attrNode = findAttrNodeInList(*attrNodeList, it->name()))
|
| + attrNode->detachFromElementWithValue(it->value());
|
| }
|
|
|
| removeAttrNodeListForElement(this);
|
| @@ -3055,11 +3054,10 @@ void Element::cloneAttributesFromElement(const Element& other)
|
| else
|
| m_elementData = other.m_elementData->makeUniqueCopy();
|
|
|
| - unsigned length = m_elementData->length();
|
| - for (unsigned i = 0; i < length; ++i) {
|
| - const Attribute& attribute = m_elementData->attributeItem(i);
|
| - attributeChangedFromParserOrByCloning(attribute.name(), attribute.value(), ModifiedByCloning);
|
| - }
|
| + AttributeIteratorAccessor attributes = m_elementData->attributesIterator();
|
| + AttributeConstIterator end = attributes.end();
|
| + for (AttributeConstIterator it = attributes.begin(); it != end; ++it)
|
| + attributeChangedFromParserOrByCloning(it->name(), it->value(), ModifiedByCloning);
|
| }
|
|
|
| void Element::cloneDataFromElement(const Element& other)
|
|
|