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

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

Issue 354363002: Move attributes-related API from UniqueElementData to AttributeCollection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 5 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/dom/ElementData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ElementData.h
diff --git a/Source/core/dom/ElementData.h b/Source/core/dom/ElementData.h
index c911969f05390263815e59b56bc9a34448e5e870..8efccea8ed2bd25e90d7f96d3be920808467877f 100644
--- a/Source/core/dom/ElementData.h
+++ b/Source/core/dom/ElementData.h
@@ -166,15 +166,9 @@ public:
static PassRefPtrWillBeRawPtr<UniqueElementData> create();
PassRefPtrWillBeRawPtr<ShareableElementData> makeShareableCopy() const;
- // These functions do no error/duplicate checking.
- void appendAttribute(const QualifiedName&, const AtomicString&);
- void removeAttributeAt(size_t index);
-
+ MutableAttributeCollection attributes();
AttributeCollection attributes() const;
- Attribute& attributeAt(unsigned index);
- Attribute* findAttributeByName(const QualifiedName&);
-
UniqueElementData();
explicit UniqueElementData(const ShareableElementData&);
explicit UniqueElementData(const UniqueElementData&);
@@ -186,7 +180,7 @@ public:
// attributes. Most modern pages don't use presentation attributes though
// so this might not make sense.
mutable RefPtrWillBeMember<StylePropertySet> m_presentationAttributeStyle;
- Vector<Attribute, 4> m_attributeVector;
+ AttributeVector m_attributeVector;
};
DEFINE_ELEMENT_DATA_TYPE_CASTS(UniqueElementData, data->isUnique(), data.isUnique());
@@ -224,19 +218,9 @@ inline AttributeCollection UniqueElementData::attributes() const
return AttributeCollection(m_attributeVector.data(), m_attributeVector.size());
}
-inline void UniqueElementData::appendAttribute(const QualifiedName& attributeName, const AtomicString& value)
-{
- m_attributeVector.append(Attribute(attributeName, value));
-}
-
-inline void UniqueElementData::removeAttributeAt(size_t index)
-{
- m_attributeVector.remove(index);
-}
-
-inline Attribute& UniqueElementData::attributeAt(unsigned index)
+inline MutableAttributeCollection UniqueElementData::attributes()
{
- return m_attributeVector.at(index);
+ return MutableAttributeCollection(m_attributeVector);
}
} // namespace blink
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/dom/ElementData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698