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

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: 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 e5891c08428e877c5107002f9a7e06cbf3f5a1ab..d8965abf7c50c9204a7b6e6a5cb6fd0cb2b36b48 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1084,17 +1084,7 @@ 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);
- }
-
+ ensureUniqueElementData().attributes().at(index).setValue(newValue);
davve 2015/05/28 14:32:14 We may want to keep the newValue != existingAttrib
philipj_slow 2015/05/28 15:28:36 Done.
if (!inSynchronizationOfLazyAttribute)
didModifyAttribute(existingAttributeName, newValue);
}
@@ -2677,21 +2667,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