Index: Source/core/dom/Element.cpp |
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
index e1c3099cf55947c5e21e9c58811291f3fe6c68f3..3d59dc934eb07e1325676dc5044ed70bcb4d078e 100644 |
--- a/Source/core/dom/Element.cpp |
+++ b/Source/core/dom/Element.cpp |
@@ -867,21 +867,23 @@ inline void Element::setAttributeInternal(size_t index, const QualifiedName& nam |
return; |
} |
+ const QualifiedName& existingAttributeName = attributeItem(index)->name(); |
+ |
if (!inSynchronizationOfLazyAttribute) |
- willModifyAttribute(name, attributeItem(index)->value(), newValue); |
+ willModifyAttribute(existingAttributeName, attributeItem(index)->value(), newValue); |
if (newValue != attributeItem(index)->value()) { |
// 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 (RefPtr<Attr> attrNode = inSynchronizationOfLazyAttribute ? 0 : attrIfExists(name)) |
+ if (RefPtr<Attr> attrNode = inSynchronizationOfLazyAttribute ? 0 : attrIfExists(existingAttributeName)) |
attrNode->setValue(newValue); |
else |
ensureUniqueElementData()->attributeItem(index)->setValue(newValue); |
} |
if (!inSynchronizationOfLazyAttribute) |
- didModifyAttribute(name, newValue); |
+ didModifyAttribute(existingAttributeName, newValue); |
} |
static inline AtomicString makeIdForStyleResolution(const AtomicString& value, bool inQuirksMode) |