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

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

Issue 436603003: Make Element::attributes() less error-prone and simplify call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take feedback into consideration Created 6 years, 4 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/AttributeCollection.h ('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 c6a9584ca3682579cb4898091bb795ce41a18429..a7871bfa9aec933ff769881a2ee297e362d0b869 100644
--- a/Source/core/dom/DatasetDOMStringMap.cpp
+++ b/Source/core/dom/DatasetDOMStringMap.cpp
@@ -154,9 +154,6 @@ void DatasetDOMStringMap::deref()
void DatasetDOMStringMap::getNames(Vector<String>& names)
{
- if (!m_element->hasAttributes())
- return;
-
AttributeCollection attributes = m_element->attributes();
AttributeCollection::const_iterator end = attributes.end();
for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) {
@@ -167,9 +164,6 @@ void DatasetDOMStringMap::getNames(Vector<String>& names)
String DatasetDOMStringMap::item(const String& name)
{
- if (!m_element->hasAttributes())
- return String();
-
AttributeCollection attributes = m_element->attributes();
AttributeCollection::const_iterator end = attributes.end();
for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) {
@@ -182,9 +176,6 @@ String DatasetDOMStringMap::item(const String& name)
bool DatasetDOMStringMap::contains(const String& name)
{
- if (!m_element->hasAttributes())
- return false;
-
AttributeCollection attributes = m_element->attributes();
AttributeCollection::const_iterator end = attributes.end();
for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) {
« no previous file with comments | « Source/core/dom/AttributeCollection.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698