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

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

Issue 180723006: Have ElementData::attributeItem() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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/css/SelectorChecker.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DatasetDOMStringMap.cpp
diff --git a/Source/core/dom/DatasetDOMStringMap.cpp b/Source/core/dom/DatasetDOMStringMap.cpp
index 147e36612ffee50d987a3c85a7817426e71b7be3..8690449f86314d26cc57d9bed216cec09c41e1c0 100644
--- a/Source/core/dom/DatasetDOMStringMap.cpp
+++ b/Source/core/dom/DatasetDOMStringMap.cpp
@@ -157,9 +157,9 @@ void DatasetDOMStringMap::getNames(Vector<String>& names)
unsigned length = m_element->attributeCount();
for (unsigned i = 0; i < length; i++) {
- const Attribute* attribute = m_element->attributeItem(i);
- if (isValidAttributeName(attribute->localName()))
- names.append(convertAttributeNameToPropertyName(attribute->localName()));
+ const Attribute& attribute = m_element->attributeItem(i);
+ if (isValidAttributeName(attribute.localName()))
+ names.append(convertAttributeNameToPropertyName(attribute.localName()));
}
}
@@ -170,9 +170,9 @@ String DatasetDOMStringMap::item(const String& name)
unsigned length = m_element->attributeCount();
for (unsigned i = 0; i < length; i++) {
- const Attribute* attribute = m_element->attributeItem(i);
- if (propertyNameMatchesAttributeName(name, attribute->localName()))
- return attribute->value();
+ const Attribute& attribute = m_element->attributeItem(i);
+ if (propertyNameMatchesAttributeName(name, attribute.localName()))
+ return attribute.value();
}
return String();
@@ -185,8 +185,8 @@ bool DatasetDOMStringMap::contains(const String& name)
unsigned length = m_element->attributeCount();
for (unsigned i = 0; i < length; i++) {
- const Attribute* attribute = m_element->attributeItem(i);
- if (propertyNameMatchesAttributeName(name, attribute->localName()))
+ const Attribute& attribute = m_element->attributeItem(i);
+ if (propertyNameMatchesAttributeName(name, attribute.localName()))
return true;
}
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698