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

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

Issue 313973003: Rename ElementData's attribute related methods for clarity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/Attr.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 4574822f3d3fa2687babc827fe3b811d472aba15..3d86958fce1e0c97c37a260bfeb6e13d3d034585 100644
--- a/Source/core/dom/Element.h
+++ b/Source/core/dom/Element.h
@@ -171,10 +171,10 @@ public:
// performance.
AttributeIteratorAccessor attributesIterator() const { return elementData()->attributesIterator(); }
size_t attributeCount() const;
- const Attribute& attributeItem(unsigned index) const;
- const Attribute* getAttributeItem(const QualifiedName&) const;
- size_t getAttributeItemIndex(const QualifiedName& name) const { return elementData()->getAttributeItemIndex(name); }
- size_t getAttributeItemIndex(const AtomicString& name, bool shouldIgnoreAttributeCase) const { return elementData()->getAttributeItemIndex(name, shouldIgnoreAttributeCase); }
+ 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); }
void scrollIntoView(bool alignToTop = true);
void scrollIntoViewIfNeeded(bool centerIfNeeded = true);
@@ -602,7 +602,7 @@ private:
virtual bool childTypeAllowed(NodeType) const OVERRIDE FINAL;
void setAttributeInternal(size_t index, const QualifiedName&, const AtomicString& value, SynchronizationOfLazyAttribute);
- void addAttributeInternal(const QualifiedName&, const AtomicString& value, SynchronizationOfLazyAttribute);
+ void appendAttributeInternal(const QualifiedName&, const AtomicString& value, SynchronizationOfLazyAttribute);
void removeAttributeInternal(size_t index, SynchronizationOfLazyAttribute);
void attributeChangedFromParserOrByCloning(const QualifiedName&, const AtomicString&, AttributeModificationReason);
@@ -695,14 +695,14 @@ inline Element* Node::parentElement() const
inline bool Element::fastHasAttribute(const QualifiedName& name) const
{
ASSERT(fastAttributeLookupAllowed(name));
- return elementData() && getAttributeItem(name);
+ return elementData() && findAttributeByName(name);
}
inline const AtomicString& Element::fastGetAttribute(const QualifiedName& name) const
{
ASSERT(fastAttributeLookupAllowed(name));
if (elementData()) {
- if (const Attribute* attribute = getAttributeItem(name))
+ if (const Attribute* attribute = findAttributeByName(name))
return attribute->value();
}
return nullAtom;
@@ -710,7 +710,7 @@ inline const AtomicString& Element::fastGetAttribute(const QualifiedName& name)
inline bool Element::hasAttributesWithoutUpdate() const
{
- return elementData() && !elementData()->isEmpty();
+ return elementData() && elementData()->hasAttributes();
}
inline const AtomicString& Element::idForStyleResolution() const
@@ -767,19 +767,19 @@ inline const SpaceSplitString& Element::classNames() const
inline size_t Element::attributeCount() const
{
ASSERT(elementData());
- return elementData()->length();
+ return elementData()->attributeCount();
}
-inline const Attribute& Element::attributeItem(unsigned index) const
+inline const Attribute& Element::attributeAt(unsigned index) const
{
ASSERT(elementData());
- return elementData()->attributeItem(index);
+ return elementData()->attributeAt(index);
}
-inline const Attribute* Element::getAttributeItem(const QualifiedName& name) const
+inline const Attribute* Element::findAttributeByName(const QualifiedName& name) const
{
ASSERT(elementData());
- return elementData()->getAttributeItem(name);
+ return elementData()->findAttributeByName(name);
}
inline bool Element::hasID() const
« no previous file with comments | « Source/core/dom/Attr.cpp ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698