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

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

Issue 674553002: Move parts of core/dom to C++11 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make Windows shut up when I just try following the style guide Created 6 years, 2 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/DatasetDOMStringMap.cpp ('k') | Source/core/dom/Node.h » ('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 49a36546b8d463d3cced1b42aebbaecd52a6a968..0b4e9b9d8be66bd1c8cf151466f8a3af40927a32 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1192,10 +1192,9 @@ const AtomicString& Element::locateNamespacePrefix(const AtomicString& namespace
return prefix();
AttributeCollection attributes = this->attributes();
- AttributeCollection::iterator end = attributes.end();
- for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) {
- if (it->prefix() == xmlnsAtom && it->value() == namespaceToLocate)
- return it->localName();
+ for (const Attribute& attr : attributes) {
+ if (attr.prefix() == xmlnsAtom && attr.value() == namespaceToLocate)
+ return attr.localName();
}
if (Element* parent = parentElement())
@@ -2927,10 +2926,9 @@ void Element::detachAllAttrNodesFromElement()
ASSERT(list);
AttributeCollection attributes = elementData()->attributes();
- AttributeCollection::iterator end = attributes.end();
- for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) {
- if (RefPtrWillBeRawPtr<Attr> attrNode = findAttrNodeInList(*list, it->name()))
- attrNode->detachFromElementWithValue(it->value());
+ for (const Attribute& attr : attributes) {
+ if (RefPtrWillBeRawPtr<Attr> attrNode = findAttrNodeInList(*list, attr.name()))
+ attrNode->detachFromElementWithValue(attr.value());
}
removeAttrNodeList();
@@ -2995,9 +2993,8 @@ void Element::cloneAttributesFromElement(const Element& other)
m_elementData = other.m_elementData->makeUniqueCopy();
AttributeCollection attributes = m_elementData->attributes();
- AttributeCollection::iterator end = attributes.end();
- for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it)
- attributeChangedFromParserOrByCloning(it->name(), it->value(), ModifiedByCloning);
+ for (const Attribute& attr : attributes)
+ attributeChangedFromParserOrByCloning(attr.name(), attr.value(), ModifiedByCloning);
}
void Element::cloneDataFromElement(const Element& other)
« no previous file with comments | « Source/core/dom/DatasetDOMStringMap.cpp ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698