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

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

Issue 357033002: Remove attributeCount() / attributeAt() API from Element (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Clean up 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.cpp ('k') | Source/core/editing/ApplyStyleCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NamedNodeMap.cpp
diff --git a/Source/core/dom/NamedNodeMap.cpp b/Source/core/dom/NamedNodeMap.cpp
index ebb226ffdb2978434f7dbfb128b07d1f3b9bce5f..bac96429a3ddb58517354eabe77d876623754875 100644
--- a/Source/core/dom/NamedNodeMap.cpp
+++ b/Source/core/dom/NamedNodeMap.cpp
@@ -99,16 +99,19 @@ PassRefPtrWillBeRawPtr<Node> NamedNodeMap::setNamedItemNS(Node* node, ExceptionS
PassRefPtrWillBeRawPtr<Node> NamedNodeMap::item(unsigned index) const
{
- if (index >= length())
+ if (!m_element->hasAttributes())
+ return nullptr;
+ AttributeCollection attributes = m_element->attributes();
+ if (index >= attributes.size())
return nullptr;
- return m_element->ensureAttr(m_element->attributeAt(index).name());
+ return m_element->ensureAttr(attributes[index].name());
}
size_t NamedNodeMap::length() const
{
if (!m_element->hasAttributes())
return 0;
- return m_element->attributeCount();
+ return m_element->attributes().size();
}
void NamedNodeMap::trace(Visitor* visitor)
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/editing/ApplyStyleCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698