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

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/generated/JSSVGElementInstanceList.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:
20
20
 
21
21
#include "config.h"
22
22
 
23
 
 
24
23
#if ENABLE(SVG)
25
24
 
26
 
#include "SVGElement.h"
27
25
#include "JSSVGElementInstanceList.h"
28
26
 
29
 
#include <wtf/GetPtr.h>
30
 
 
31
27
#include "JSSVGElementInstance.h"
32
28
#include "SVGElementInstance.h"
33
29
#include "SVGElementInstanceList.h"
34
 
 
35
30
#include <runtime/Error.h>
36
31
#include <runtime/JSNumberCell.h>
 
32
#include <wtf/GetPtr.h>
37
33
 
38
34
using namespace JSC;
39
35
 
40
36
namespace WebCore {
41
37
 
42
 
ASSERT_CLASS_FITS_IN_CELL(JSSVGElementInstanceList)
 
38
ASSERT_CLASS_FITS_IN_CELL(JSSVGElementInstanceList);
43
39
 
44
40
/* Hash table */
45
41
 
49
45
    { 0, 0, 0, 0 }
50
46
};
51
47
 
52
 
static const HashTable JSSVGElementInstanceListTable =
 
48
static JSC_CONST_HASHTABLE HashTable JSSVGElementInstanceListTable =
53
49
#if ENABLE(PERFECT_HASH_SIZE)
54
50
    { 0, JSSVGElementInstanceListTableValues, 0 };
55
51
#else
64
60
    { 0, 0, 0, 0 }
65
61
};
66
62
 
67
 
static const HashTable JSSVGElementInstanceListPrototypeTable =
 
63
static JSC_CONST_HASHTABLE HashTable JSSVGElementInstanceListPrototypeTable =
68
64
#if ENABLE(PERFECT_HASH_SIZE)
69
65
    { 0, JSSVGElementInstanceListPrototypeTableValues, 0 };
70
66
#else
83
79
    return getStaticFunctionSlot<JSObject>(exec, &JSSVGElementInstanceListPrototypeTable, this, propertyName, slot);
84
80
}
85
81
 
 
82
bool JSSVGElementInstanceListPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
83
{
 
84
    return getStaticFunctionDescriptor<JSObject>(exec, &JSSVGElementInstanceListPrototypeTable, this, propertyName, descriptor);
 
85
}
 
86
 
86
87
const ClassInfo JSSVGElementInstanceList::s_info = { "SVGElementInstanceList", 0, &JSSVGElementInstanceListTable, 0 };
87
88
 
88
 
JSSVGElementInstanceList::JSSVGElementInstanceList(PassRefPtr<Structure> structure, PassRefPtr<SVGElementInstanceList> impl)
89
 
    : DOMObject(structure)
 
89
JSSVGElementInstanceList::JSSVGElementInstanceList(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGElementInstanceList> impl)
 
90
    : DOMObjectWithGlobalPointer(structure, globalObject)
90
91
    , m_impl(impl)
91
92
{
92
93
}
93
94
 
94
95
JSSVGElementInstanceList::~JSSVGElementInstanceList()
95
96
{
96
 
    forgetDOMObject(*Heap::heap(this)->globalData(), m_impl.get());
97
 
 
 
97
    forgetDOMObject(*Heap::heap(this)->globalData(), impl());
98
98
}
99
99
 
100
100
JSObject* JSSVGElementInstanceList::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
107
107
    return getStaticValueSlot<JSSVGElementInstanceList, Base>(exec, &JSSVGElementInstanceListTable, this, propertyName, slot);
108
108
}
109
109
 
110
 
JSValuePtr jsSVGElementInstanceListLength(ExecState* exec, const Identifier&, const PropertySlot& slot)
111
 
{
112
 
    SVGElementInstanceList* imp = static_cast<SVGElementInstanceList*>(static_cast<JSSVGElementInstanceList*>(asObject(slot.slotBase()))->impl());
 
110
bool JSSVGElementInstanceList::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
111
{
 
112
    return getStaticValueDescriptor<JSSVGElementInstanceList, Base>(exec, &JSSVGElementInstanceListTable, this, propertyName, descriptor);
 
113
}
 
114
 
 
115
JSValue jsSVGElementInstanceListLength(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
116
{
 
117
    JSSVGElementInstanceList* castedThis = static_cast<JSSVGElementInstanceList*>(asObject(slot.slotBase()));
 
118
    UNUSED_PARAM(exec);
 
119
    SVGElementInstanceList* imp = static_cast<SVGElementInstanceList*>(castedThis->impl());
113
120
    return jsNumber(exec, imp->length());
114
121
}
115
122
 
116
 
JSValuePtr jsSVGElementInstanceListPrototypeFunctionItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
 
123
JSValue JSC_HOST_CALL jsSVGElementInstanceListPrototypeFunctionItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
117
124
{
118
 
    if (!thisValue->isObject(&JSSVGElementInstanceList::s_info))
 
125
    UNUSED_PARAM(args);
 
126
    if (!thisValue.inherits(&JSSVGElementInstanceList::s_info))
119
127
        return throwError(exec, TypeError);
120
128
    JSSVGElementInstanceList* castedThisObj = static_cast<JSSVGElementInstanceList*>(asObject(thisValue));
121
129
    SVGElementInstanceList* imp = static_cast<SVGElementInstanceList*>(castedThisObj->impl());
122
 
    unsigned index = args.at(exec, 0)->toInt32(exec);
123
 
 
124
 
 
125
 
    JSC::JSValuePtr result = toJS(exec, WTF::getPtr(imp->item(index)));
 
130
    unsigned index = args.at(0).toInt32(exec);
 
131
 
 
132
 
 
133
    JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->item(index)));
126
134
    return result;
127
135
}
128
136
 
129
 
JSC::JSValuePtr toJS(JSC::ExecState* exec, SVGElementInstanceList* object)
 
137
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGElementInstanceList* object)
130
138
{
131
 
    return getDOMObjectWrapper<JSSVGElementInstanceList>(exec, object);
 
139
    return getDOMObjectWrapper<JSSVGElementInstanceList>(exec, globalObject, object);
132
140
}
133
 
SVGElementInstanceList* toSVGElementInstanceList(JSC::JSValuePtr value)
 
141
SVGElementInstanceList* toSVGElementInstanceList(JSC::JSValue value)
134
142
{
135
 
    return value->isObject(&JSSVGElementInstanceList::s_info) ? static_cast<JSSVGElementInstanceList*>(asObject(value))->impl() : 0;
 
143
    return value.inherits(&JSSVGElementInstanceList::s_info) ? static_cast<JSSVGElementInstanceList*>(asObject(value))->impl() : 0;
136
144
}
137
145
 
138
146
}