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

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

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/AttributeCollection.cpp ('k') | Source/core/dom/ElementData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 11fbccd74a3891a4971d9f1d6f1619055fc09aa7..d07d5236860134e0884511bc8f30103ca5d9088c 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -923,7 +923,7 @@ ALWAYS_INLINE void Element::setAttributeInternal(size_t index, const QualifiedNa
if (RefPtrWillBeRawPtr<Attr> attrNode = inSynchronizationOfLazyAttribute ? nullptr : attrIfExists(existingAttributeName))
attrNode->setValue(newValue);
else
- ensureUniqueElementData().attributeAt(index).setValue(newValue);
+ ensureUniqueElementData().attributes().at(index).setValue(newValue);
}
if (!inSynchronizationOfLazyAttribute)
@@ -1848,7 +1848,7 @@ PassRefPtrWillBeRawPtr<Attr> Element::setAttributeNode(Attr* attrNode, Exception
}
synchronizeAllAttributes();
- UniqueElementData& elementData = ensureUniqueElementData();
+ const UniqueElementData& elementData = ensureUniqueElementData();
AttributeCollection attributes = elementData.attributes();
size_t index = attributes.findIndex(attrNode->qualifiedName(), shouldIgnoreAttributeCase());
@@ -1960,8 +1960,7 @@ void Element::setAttributeNS(const AtomicString& namespaceURI, const AtomicStrin
void Element::removeAttributeInternal(size_t index, SynchronizationOfLazyAttribute inSynchronizationOfLazyAttribute)
{
- UniqueElementData& elementData = ensureUniqueElementData();
- AttributeCollection attributes = elementData.attributes();
+ MutableAttributeCollection attributes = ensureUniqueElementData().attributes();
ASSERT_WITH_SECURITY_IMPLICATION(index < attributes.size());
QualifiedName name = attributes[index].name();
@@ -1975,7 +1974,7 @@ void Element::removeAttributeInternal(size_t index, SynchronizationOfLazyAttribu
if (RefPtrWillBeRawPtr<Attr> attrNode = attrIfExists(name))
detachAttrNodeFromElementWithValue(attrNode.get(), attributes[index].value());
- elementData.removeAttributeAt(index);
+ attributes.remove(index);
if (!inSynchronizationOfLazyAttribute)
didRemoveAttribute(name);
@@ -1985,7 +1984,7 @@ void Element::appendAttributeInternal(const QualifiedName& name, const AtomicStr
{
if (!inSynchronizationOfLazyAttribute)
willModifyAttribute(name, nullAtom, value);
- ensureUniqueElementData().appendAttribute(name, value);
+ ensureUniqueElementData().attributes().append(name, value);
if (!inSynchronizationOfLazyAttribute)
didAddAttribute(name, value);
}
« no previous file with comments | « Source/core/dom/AttributeCollection.cpp ('k') | Source/core/dom/ElementData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698