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

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

Issue 1158433004: Remove Attr child nodes (making Attr a Node, not a ContainerNode) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address feedback Created 5 years, 7 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
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 5de0390a18066f89d4c6313834d575e3c1740414..cfa50f7f18db8093780c85eba91f7f3df436b46f 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1084,17 +1084,8 @@ ALWAYS_INLINE void Element::setAttributeInternal(size_t index, const QualifiedNa
if (!inSynchronizationOfLazyAttribute)
willModifyAttribute(existingAttributeName, existingAttributeValue, newValue);
-
- if (newValue != existingAttributeValue) {
- // If there is an Attr node hooked to this attribute, the Attr::setValue() call below
- // will write into the ElementData.
- // FIXME: Refactor this so it makes some sense.
- if (RefPtrWillBeRawPtr<Attr> attrNode = inSynchronizationOfLazyAttribute ? nullptr : attrIfExists(existingAttributeName))
- attrNode->setValue(newValue);
- else
- ensureUniqueElementData().attributes().at(index).setValue(newValue);
- }
-
+ if (newValue != existingAttributeValue)
+ ensureUniqueElementData().attributes().at(index).setValue(newValue);
if (!inSynchronizationOfLazyAttribute)
didModifyAttribute(existingAttributeName, newValue);
}
@@ -2678,21 +2669,6 @@ void Element::cancelFocusAppearanceUpdate()
document().cancelFocusAppearanceUpdate();
}
-void Element::normalizeAttributes()
-{
- if (!hasAttributes())
- return;
- AttrNodeList* attrNodes = attrNodeList();
- if (!attrNodes)
- return;
- // Copy the Attr Vector because Node::normalize() can fire synchronous JS
- // events (e.g. DOMSubtreeModified) and a JS listener could add / remove
- // attributes while we are iterating.
- AttrNodeList attrNodesCopy(*attrNodes);
- for (size_t i = 0; i < attrNodesCopy.size(); ++i)
- attrNodesCopy[i]->normalize();
-}
-
void Element::updatePseudoElement(PseudoId pseudoId, StyleRecalcChange change)
{
ASSERT(!needsStyleRecalc());

Powered by Google App Engine
This is Rietveld 408576698