~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/wml/WMLPostfieldElement.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
{
40
40
}
41
41
 
42
 
void WMLPostfieldElement::parseMappedAttribute(MappedAttribute* attr)
43
 
{
44
 
    if (attr->name() == HTMLNames::nameAttr)
45
 
        m_name = parseValueSubstitutingVariableReferences(attr->value());
46
 
    else if (attr->name() == HTMLNames::valueAttr)
47
 
        m_value = parseValueSubstitutingVariableReferences(attr->value());
48
 
    else
49
 
        WMLElement::parseMappedAttribute(attr);
50
 
}
51
 
 
52
42
void WMLPostfieldElement::insertedIntoDocument()
53
43
{
54
44
    WMLElement::insertedIntoDocument();
55
45
 
56
46
    Node* parent = parentNode();
57
 
    ASSERT(parent);
58
 
 
59
 
    if (!parent->hasTagName(goTag))
60
 
        return;
61
 
 
62
 
    static_cast<WMLGoElement*>(parent)->registerPostfieldElement(this);
 
47
    if (parent && parent->hasTagName(goTag))
 
48
        static_cast<WMLGoElement*>(parent)->registerPostfieldElement(this);
 
49
}
 
50
 
 
51
void WMLPostfieldElement::removedFromDocument()
 
52
{
 
53
    Node* parent = parentNode();
 
54
    if (parent && parent->hasTagName(goTag))
 
55
        static_cast<WMLGoElement*>(parent)->deregisterPostfieldElement(this);
 
56
 
 
57
    WMLElement::removedFromDocument();
 
58
}
 
59
 
 
60
String WMLPostfieldElement::name() const
 
61
{
 
62
    return parseValueSubstitutingVariableReferences(getAttribute(HTMLNames::nameAttr));
 
63
}
 
64
 
 
65
String WMLPostfieldElement::value() const
 
66
{
 
67
    return parseValueSubstitutingVariableReferences(getAttribute(HTMLNames::valueAttr));
63
68
}
64
69
 
65
70
static inline CString encodedString(const TextEncoding& encoding, const String& data)
69
74
 
70
75
void WMLPostfieldElement::encodeData(const TextEncoding& encoding, CString& name, CString& value)
71
76
{
72
 
    name = encodedString(encoding, m_name);
73
 
    value = encodedString(encoding, m_value);
 
77
    name = encodedString(encoding, this->name());
 
78
    value = encodedString(encoding, this->value());
74
79
}
75
80
 
76
81
}