summaryrefslogtreecommitdiffstats
path: root/WebCore/dom/Attr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/dom/Attr.cpp')
-rw-r--r--WebCore/dom/Attr.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/WebCore/dom/Attr.cpp b/WebCore/dom/Attr.cpp
index 59daa59..f497394 100644
--- a/WebCore/dom/Attr.cpp
+++ b/WebCore/dom/Attr.cpp
@@ -117,13 +117,21 @@ String Attr::nodeValue() const
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 @@ void Attr::childrenChanged(bool changedByParser, Node* beforeChange, Node* after
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());