Index: Source/core/dom/DatasetDOMStringMap.cpp |
diff --git a/Source/core/dom/DatasetDOMStringMap.cpp b/Source/core/dom/DatasetDOMStringMap.cpp |
index 921531948ca49d0f372263ce1972af4b43334950..f9cd4eec6d78473b65a590e135e358bb7f7c5228 100644 |
--- a/Source/core/dom/DatasetDOMStringMap.cpp |
+++ b/Source/core/dom/DatasetDOMStringMap.cpp |
@@ -188,14 +188,16 @@ void DatasetDOMStringMap::setItem(const String& name, const String& value, Excep |
m_element->setAttribute(convertPropertyNameToAttributeName(name), value, exceptionState); |
} |
-void DatasetDOMStringMap::deleteItem(const String& name, ExceptionState& exceptionState) |
+bool DatasetDOMStringMap::deleteItem(const String& name) |
{ |
- if (!isValidPropertyName(name)) { |
- exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToDelete(name, "DOMStringMap", "'" + name + "' is not a valid property name.")); |
- return; |
+ if (isValidPropertyName(name)) { |
+ String attributeName = convertPropertyNameToAttributeName(name); |
+ if (m_element->hasAttribute(attributeName)) { |
+ m_element->removeAttribute(attributeName); |
+ return true; |
+ } |
} |
- |
- m_element->removeAttribute(convertPropertyNameToAttributeName(name)); |
+ return false; |
} |
} // namespace WebCore |