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

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/bindings/js/JSHTMLSelectElementCustom.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:
32
32
using namespace JSC;
33
33
using namespace HTMLNames;
34
34
 
35
 
JSValuePtr JSHTMLSelectElement::remove(ExecState* exec, const ArgList& args)
 
35
JSValue JSHTMLSelectElement::remove(ExecState* exec, const ArgList& args)
36
36
{
37
37
    HTMLSelectElement& select = *static_cast<HTMLSelectElement*>(impl());
38
38
 
39
39
    // we support both options index and options objects
40
 
    HTMLElement* element = toHTMLElement(args.at(exec, 0));
 
40
    HTMLElement* element = toHTMLElement(args.at(0));
41
41
    if (element && element->hasTagName(optionTag))
42
42
        select.remove(static_cast<HTMLOptionElement*>(element)->index());
43
43
    else
44
 
        select.remove(args.at(exec, 0)->toInt32(exec));
 
44
        select.remove(args.at(0).toInt32(exec));
45
45
 
46
46
    return jsUndefined();
47
47
}
48
48
 
49
 
void selectIndexSetter(HTMLSelectElement* select, JSC::ExecState* exec, unsigned index, JSC::JSValuePtr value)
 
49
void selectIndexSetter(HTMLSelectElement* select, JSC::ExecState* exec, unsigned index, JSC::JSValue value)
50
50
{
51
 
    if (value->isUndefinedOrNull())
 
51
    if (value.isUndefinedOrNull())
52
52
        select->remove(index);
53
53
    else {
54
54
        ExceptionCode ec = 0;
61
61
    }
62
62
}
63
63
 
64
 
void JSHTMLSelectElement::indexSetter(JSC::ExecState* exec, unsigned index, JSC::JSValuePtr value)
 
64
void JSHTMLSelectElement::indexSetter(JSC::ExecState* exec, unsigned index, JSC::JSValue value)
65
65
{
66
66
    selectIndexSetter(static_cast<HTMLSelectElement*>(impl()), exec, index, value);
67
67
}