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

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

Issue 354023008: Move attributes-related methods from ElementData to AttributeCollection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take feedback into consideration 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/AttributeCollection.cpp ('k') | 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 f2f70281979eba7b0bbf5288f6014b6a76dabe79..be870b3e20018b2ffde18ec1d117aa994c28f89d 100644
--- a/Source/core/dom/Element.h
+++ b/Source/core/dom/Element.h
@@ -175,8 +175,8 @@ public:
size_t attributeCount() const;
const Attribute& attributeAt(unsigned index) const;
const Attribute* findAttributeByName(const QualifiedName&) const;
- size_t findAttributeIndexByName(const QualifiedName& name) const { return elementData()->findAttributeIndexByName(name); }
- size_t findAttributeIndexByName(const AtomicString& name, bool shouldIgnoreAttributeCase) const { return elementData()->findAttributeIndexByName(name, shouldIgnoreAttributeCase); }
+ 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); }
void scrollIntoView(bool alignToTop = true);
void scrollIntoViewIfNeeded(bool centerIfNeeded = true);
@@ -717,7 +717,7 @@ inline const AtomicString& Element::fastGetAttribute(const QualifiedName& name)
inline bool Element::hasAttributesWithoutUpdate() const
{
- return elementData() && elementData()->hasAttributes();
+ return elementData() && !elementData()->attributes().isEmpty();
}
inline const AtomicString& Element::idForStyleResolution() const
@@ -769,19 +769,19 @@ inline const SpaceSplitString& Element::classNames() const
inline size_t Element::attributeCount() const
{
ASSERT(elementData());
- return elementData()->attributeCount();
+ return elementData()->attributes().size();
}
inline const Attribute& Element::attributeAt(unsigned index) const
{
ASSERT(elementData());
- return elementData()->attributeAt(index);
+ return elementData()->attributes()[index];
}
inline const Attribute* Element::findAttributeByName(const QualifiedName& name) const
{
ASSERT(elementData());
- return elementData()->findAttributeByName(name);
+ return elementData()->attributes().find(name);
}
inline bool Element::hasID() const
« no previous file with comments | « Source/core/dom/AttributeCollection.cpp ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698