Index: WebCore/dom/Attr.cpp |
=================================================================== |
--- WebCore/dom/Attr.cpp (revision 69030) |
+++ WebCore/dom/Attr.cpp (working copy) |
@@ -117,14 +117,22 @@ |
return value(); |
} |
-void Attr::setValue(const AtomicString& value, ExceptionCode&) |
+void Attr::setValue(const AtomicString& value) |
{ |
m_ignoreChildrenChanged++; |
removeChildren(); |
m_attribute->setValue(value); |
createTextChild(); |
m_ignoreChildrenChanged--; |
+} |
+void Attr::setValue(const AtomicString& value, ExceptionCode&) |
+{ |
+ if (m_element && m_element->isIdAttributeName(m_attribute->name())) |
+ m_element->updateId(m_element->getIdAttribute(), value); |
+ |
+ setValue(value); |
+ |
if (m_element) |
m_element->attributeChanged(m_attribute.get()); |
} |
@@ -167,7 +175,10 @@ |
if (n->isTextNode()) |
val += static_cast<Text *>(n)->data(); |
} |
- |
+ |
+ if (m_element && m_element->isIdAttributeName(m_attribute->name())) |
+ m_element->updateId(m_attribute->value(), val); |
+ |
m_attribute->setValue(val.impl()); |
if (m_element) |
m_element->attributeChanged(m_attribute.get()); |