~ubuntu-branches/ubuntu/karmic/webkit/karmic-proposed

« back to all changes in this revision

Viewing changes to WebCore/bindings/js/JSElementCustom.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-05-15 18:30:58 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090515183058-50q5exjo9b1kxy9s
Tags: 1.1.7-1
* New upstream release
* debian/libwebkit-1.0-2.symbols:
- updated with the new symbols in 1.1.7
* debian/libwebkit-dev.install, debian/libwebkit-dev.links,
  debian/rules:
- Build, and ship gtk-doc documentation (Closes: #526683)
* debian/copyright:
- updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    return true;
62
62
63
63
 
64
 
JSValuePtr JSElement::setAttribute(ExecState* exec, const ArgList& args)
 
64
JSValue JSElement::setAttribute(ExecState* exec, const ArgList& args)
65
65
{
66
66
    ExceptionCode ec = 0;
67
 
    AtomicString name = args.at(exec, 0).toString(exec);
68
 
    AtomicString value = args.at(exec, 1).toString(exec);
 
67
    AtomicString name = args.at(0).toString(exec);
 
68
    AtomicString value = args.at(1).toString(exec);
69
69
 
70
70
    Element* imp = impl();
71
71
    if (!allowSettingSrcToJavascriptURL(exec, imp, name, value))
76
76
    return jsUndefined();
77
77
}
78
78
 
79
 
JSValuePtr JSElement::setAttributeNode(ExecState* exec, const ArgList& args)
 
79
JSValue JSElement::setAttributeNode(ExecState* exec, const ArgList& args)
80
80
{
81
81
    ExceptionCode ec = 0;
82
 
    Attr* newAttr = toAttr(args.at(exec, 0));
 
82
    Attr* newAttr = toAttr(args.at(0));
83
83
    if (!newAttr) {
84
84
        setDOMException(exec, TYPE_MISMATCH_ERR);
85
85
        return jsUndefined();
89
89
    if (!allowSettingSrcToJavascriptURL(exec, imp, newAttr->name(), newAttr->value()))
90
90
        return jsUndefined();
91
91
 
92
 
    JSValuePtr result = toJS(exec, WTF::getPtr(imp->setAttributeNode(newAttr, ec)));
 
92
    JSValue result = toJS(exec, WTF::getPtr(imp->setAttributeNode(newAttr, ec)));
93
93
    setDOMException(exec, ec);
94
94
    return result;
95
95
}
96
96
 
97
 
JSValuePtr JSElement::setAttributeNS(ExecState* exec, const ArgList& args)
 
97
JSValue JSElement::setAttributeNS(ExecState* exec, const ArgList& args)
98
98
{
99
99
    ExceptionCode ec = 0;
100
 
    AtomicString namespaceURI = valueToStringWithNullCheck(exec, args.at(exec, 0));
101
 
    AtomicString qualifiedName = args.at(exec, 1).toString(exec);
102
 
    AtomicString value = args.at(exec, 2).toString(exec);
 
100
    AtomicString namespaceURI = valueToStringWithNullCheck(exec, args.at(0));
 
101
    AtomicString qualifiedName = args.at(1).toString(exec);
 
102
    AtomicString value = args.at(2).toString(exec);
103
103
 
104
104
    Element* imp = impl();
105
105
    if (!allowSettingSrcToJavascriptURL(exec, imp, qualifiedName, value))
110
110
    return jsUndefined();
111
111
}
112
112
 
113
 
JSValuePtr JSElement::setAttributeNodeNS(ExecState* exec, const ArgList& args)
 
113
JSValue JSElement::setAttributeNodeNS(ExecState* exec, const ArgList& args)
114
114
{
115
115
    ExceptionCode ec = 0;
116
 
    Attr* newAttr = toAttr(args.at(exec, 0));
 
116
    Attr* newAttr = toAttr(args.at(0));
117
117
    if (!newAttr) {
118
118
        setDOMException(exec, TYPE_MISMATCH_ERR);
119
119
        return jsUndefined();
123
123
    if (!allowSettingSrcToJavascriptURL(exec, imp, newAttr->name(), newAttr->value()))
124
124
        return jsUndefined();
125
125
 
126
 
    JSValuePtr result = toJS(exec, WTF::getPtr(imp->setAttributeNodeNS(newAttr, ec)));
 
126
    JSValue result = toJS(exec, WTF::getPtr(imp->setAttributeNodeNS(newAttr, ec)));
127
127
    setDOMException(exec, ec);
128
128
    return result;
129
129
}
130
130
 
131
 
JSValuePtr toJSNewlyCreated(ExecState* exec, Element* element)
 
131
JSValue toJSNewlyCreated(ExecState* exec, Element* element)
132
132
{
133
133
    if (!element)
134
134
        return jsNull();