Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(667)

Unified Diff: Source/core/dom/Element.cpp

Issue 337753005: Make iterator for Element's attributes more lightweight (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Proper rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index b0f124778bdf5bd489fc73ad29d6b4405a92b7a2..fad08767c93d475220a829c864908f7755aaa2cd 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -317,7 +317,7 @@ void Element::setBooleanAttribute(const QualifiedName& name, bool value)
removeAttribute(name);
}
-NamedNodeMap* Element::attributes() const
+NamedNodeMap* Element::attributesForBindings() const
{
ElementRareData& rareData = const_cast<Element*>(this)->ensureElementRareData();
if (NamedNodeMap* attributeMap = rareData.attributeMap())
@@ -1211,9 +1211,9 @@ const AtomicString& Element::locateNamespacePrefix(const AtomicString& namespace
return prefix();
if (hasAttributes()) {
- AttributeIteratorAccessor attributes = attributesIterator();
- AttributeConstIterator end = attributes.end();
- for (AttributeConstIterator it = attributes.begin(); it != end; ++it) {
+ AttributeCollection attributes = this->attributes();
+ AttributeCollection::const_iterator end = attributes.end();
+ for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) {
if (it->prefix() == xmlnsAtom && it->value() == namespaceToLocate)
return it->localName();
}
@@ -3007,9 +3007,9 @@ void Element::detachAllAttrNodesFromElement()
AttrNodeList* list = this->attrNodeList();
ASSERT(list);
- AttributeIteratorAccessor attributes = attributesIterator();
- AttributeConstIterator end = attributes.end();
- for (AttributeConstIterator it = attributes.begin(); it != end; ++it) {
+ AttributeCollection attributes = this->attributes();
+ AttributeCollection::const_iterator end = attributes.end();
+ for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) {
if (RefPtrWillBeRawPtr<Attr> attrNode = findAttrNodeInList(*list, it->name()))
attrNode->detachFromElementWithValue(it->value());
}
@@ -3075,9 +3075,9 @@ void Element::cloneAttributesFromElement(const Element& other)
else
m_elementData = other.m_elementData->makeUniqueCopy();
- AttributeIteratorAccessor attributes = m_elementData->attributesIterator();
- AttributeConstIterator end = attributes.end();
- for (AttributeConstIterator it = attributes.begin(); it != end; ++it)
+ AttributeCollection attributes = m_elementData->attributes();
+ AttributeCollection::const_iterator end = attributes.end();
+ for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it)
attributeChangedFromParserOrByCloning(it->name(), it->value(), ModifiedByCloning);
}
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698