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

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

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 | « no previous file | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.h
diff --git a/Source/core/dom/Element.h b/Source/core/dom/Element.h
index 8a92a302ae83de24bfae0496f44ba511faaf6753..277e94e0c03428c0cbcca833db11b3da141e7e9e 100644
--- a/Source/core/dom/Element.h
+++ b/Source/core/dom/Element.h
@@ -171,9 +171,7 @@ public:
// Internal methods that assume the existence of attribute storage, one should use hasAttributes()
// before calling them. This is not a trivial getter and its return value should be cached for
// performance.
- AttributeCollection attributes() const { return elementData()->attributes(); }
- size_t attributeCount() const;
- const Attribute& attributeAt(unsigned index) const;
+ AttributeCollection attributes() const;
const Attribute* findAttributeByName(const QualifiedName&) const;
size_t findAttributeIndexByName(const QualifiedName& name) const { return elementData()->attributes().findIndex(name); }
size_t findAttributeIndexByName(const AtomicString& name, bool shouldIgnoreAttributeCase) const { return elementData()->attributes().findIndex(name, shouldIgnoreAttributeCase); }
@@ -713,6 +711,12 @@ inline const AtomicString& Element::fastGetAttribute(const QualifiedName& name)
return nullAtom;
}
+inline AttributeCollection Element::attributes() const
+{
+ ASSERT(elementData());
+ return elementData()->attributes();
+}
+
inline bool Element::hasAttributesWithoutUpdate() const
{
return elementData() && !elementData()->attributes().isEmpty();
@@ -764,18 +768,6 @@ inline const SpaceSplitString& Element::classNames() const
return elementData()->classNames();
}
-inline size_t Element::attributeCount() const
-{
- ASSERT(elementData());
- return elementData()->attributes().size();
-}
-
-inline const Attribute& Element::attributeAt(unsigned index) const
-{
- ASSERT(elementData());
- return elementData()->attributes()[index];
-}
-
inline const Attribute* Element::findAttributeByName(const QualifiedName& name) const
{
ASSERT(elementData());
« no previous file with comments | « no previous file | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698