diff options
Diffstat (limited to 'WebCore/wml/WMLSetvarElement.cpp')
-rw-r--r-- | WebCore/wml/WMLSetvarElement.cpp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/WebCore/wml/WMLSetvarElement.cpp b/WebCore/wml/WMLSetvarElement.cpp index da9a1f4..5e10ca8 100644 --- a/WebCore/wml/WMLSetvarElement.cpp +++ b/WebCore/wml/WMLSetvarElement.cpp @@ -43,16 +43,11 @@ WMLSetvarElement::~WMLSetvarElement() void WMLSetvarElement::parseMappedAttribute(MappedAttribute* attr) { if (attr->name() == HTMLNames::nameAttr) { - String name = parseValueSubstitutingVariableReferences(attr->value(), WMLErrorInvalidVariableName); - if (!isValidVariableName(name)) { + if (!isValidVariableName(parseValueSubstitutingVariableReferences(attr->value(), WMLErrorInvalidVariableName))) { reportWMLError(document(), WMLErrorInvalidVariableName); return; } - - m_name = name; - } else if (attr->name() == HTMLNames::valueAttr) - m_value = parseValueSubstitutingVariableReferences(attr->value()); - else + } else WMLElement::parseMappedAttribute(attr); } @@ -61,8 +56,6 @@ void WMLSetvarElement::insertedIntoDocument() WMLElement::insertedIntoDocument(); Node* parent = parentNode(); - ASSERT(parent); - if (!parent || !parent->isWMLElement()) return; @@ -70,6 +63,27 @@ void WMLSetvarElement::insertedIntoDocument() static_cast<WMLTaskElement*>(parent)->registerVariableSetter(this); } +void WMLSetvarElement::removedFromDocument() +{ + Node* parent = parentNode(); + if (parent && parent->isWMLElement()) { + if (static_cast<WMLElement*>(parent)->isWMLTaskElement()) + static_cast<WMLTaskElement*>(parent)->deregisterVariableSetter(this); + } + + WMLElement::removedFromDocument(); +} + +String WMLSetvarElement::name() const +{ + return parseValueSubstitutingVariableReferences(getAttribute(HTMLNames::nameAttr), WMLErrorInvalidVariableName); +} + +String WMLSetvarElement::value() const +{ + return parseValueSubstitutingVariableReferences(getAttribute(HTMLNames::valueAttr)); +} + } #endif |