tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSDOMSettableTokenList.cpp
1 /*
2     This file is part of the WebKit open source project.
3     This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Library General Public
7     License as published by the Free Software Foundation; either
8     version 2 of the License, or (at your option) any later version.
9
10     This library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13     Library General Public License for more details.
14
15     You should have received a copy of the GNU Library General Public License
16     along with this library; see the file COPYING.LIB.  If not, write to
17     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18     Boston, MA 02110-1301, USA.
19 */
20
21 #include "config.h"
22 #include "JSDOMSettableTokenList.h"
23
24 #include "DOMSettableTokenList.h"
25 #include "KURL.h"
26 #include <runtime/JSString.h>
27 #include <runtime/PropertyNameArray.h>
28 #include <wtf/GetPtr.h>
29
30 using namespace JSC;
31
32 namespace WebCore {
33
34 ASSERT_CLASS_FITS_IN_CELL(JSDOMSettableTokenList);
35
36 /* Hash table */
37 #if ENABLE(JIT)
38 #define THUNK_GENERATOR(generator) , generator
39 #else
40 #define THUNK_GENERATOR(generator)
41 #endif
42 #if ENABLE(DFG_JIT)
43 #define INTRINSIC(intrinsic) , intrinsic
44 #else
45 #define INTRINSIC(intrinsic)
46 #endif
47
48 static const HashTableValue JSDOMSettableTokenListTableValues[] =
49 {
50     { "value", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMSettableTokenListValue), (intptr_t)setJSDOMSettableTokenListValue THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMSettableTokenListConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
53 };
54
55 #undef THUNK_GENERATOR
56 static const HashTable JSDOMSettableTokenListTable = { 4, 3, JSDOMSettableTokenListTableValues, 0 };
57 /* Hash table for constructor */
58 #if ENABLE(JIT)
59 #define THUNK_GENERATOR(generator) , generator
60 #else
61 #define THUNK_GENERATOR(generator)
62 #endif
63 #if ENABLE(DFG_JIT)
64 #define INTRINSIC(intrinsic) , intrinsic
65 #else
66 #define INTRINSIC(intrinsic)
67 #endif
68
69 static const HashTableValue JSDOMSettableTokenListConstructorTableValues[] =
70 {
71     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
72 };
73
74 #undef THUNK_GENERATOR
75 static const HashTable JSDOMSettableTokenListConstructorTable = { 1, 0, JSDOMSettableTokenListConstructorTableValues, 0 };
76 const ClassInfo JSDOMSettableTokenListConstructor::s_info = { "DOMSettableTokenListConstructor", &DOMConstructorObject::s_info, &JSDOMSettableTokenListConstructorTable, 0, CREATE_METHOD_TABLE(JSDOMSettableTokenListConstructor) };
77
78 JSDOMSettableTokenListConstructor::JSDOMSettableTokenListConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
79     : DOMConstructorObject(structure, globalObject)
80 {
81 }
82
83 void JSDOMSettableTokenListConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
84 {
85     Base::finishCreation(exec->globalData());
86     ASSERT(inherits(&s_info));
87     putDirect(exec->globalData(), exec->propertyNames().prototype, JSDOMSettableTokenListPrototype::self(exec, globalObject), DontDelete | ReadOnly);
88 }
89
90 bool JSDOMSettableTokenListConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
91 {
92     return getStaticValueSlot<JSDOMSettableTokenListConstructor, JSDOMWrapper>(exec, &JSDOMSettableTokenListConstructorTable, static_cast<JSDOMSettableTokenListConstructor*>(cell), propertyName, slot);
93 }
94
95 bool JSDOMSettableTokenListConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
96 {
97     return getStaticValueDescriptor<JSDOMSettableTokenListConstructor, JSDOMWrapper>(exec, &JSDOMSettableTokenListConstructorTable, static_cast<JSDOMSettableTokenListConstructor*>(object), propertyName, descriptor);
98 }
99
100 /* Hash table for prototype */
101 #if ENABLE(JIT)
102 #define THUNK_GENERATOR(generator) , generator
103 #else
104 #define THUNK_GENERATOR(generator)
105 #endif
106 #if ENABLE(DFG_JIT)
107 #define INTRINSIC(intrinsic) , intrinsic
108 #else
109 #define INTRINSIC(intrinsic)
110 #endif
111
112 static const HashTableValue JSDOMSettableTokenListPrototypeTableValues[] =
113 {
114     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
115 };
116
117 #undef THUNK_GENERATOR
118 static const HashTable JSDOMSettableTokenListPrototypeTable = { 1, 0, JSDOMSettableTokenListPrototypeTableValues, 0 };
119 const ClassInfo JSDOMSettableTokenListPrototype::s_info = { "DOMSettableTokenListPrototype", &JSC::JSNonFinalObject::s_info, &JSDOMSettableTokenListPrototypeTable, 0, CREATE_METHOD_TABLE(JSDOMSettableTokenListPrototype) };
120
121 JSObject* JSDOMSettableTokenListPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
122 {
123     return getDOMPrototype<JSDOMSettableTokenList>(exec, globalObject);
124 }
125
126 const ClassInfo JSDOMSettableTokenList::s_info = { "DOMSettableTokenList", &JSDOMTokenList::s_info, &JSDOMSettableTokenListTable, 0 , CREATE_METHOD_TABLE(JSDOMSettableTokenList) };
127
128 JSDOMSettableTokenList::JSDOMSettableTokenList(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<DOMSettableTokenList> impl)
129     : JSDOMTokenList(structure, globalObject, impl)
130 {
131 }
132
133 void JSDOMSettableTokenList::finishCreation(JSGlobalData& globalData)
134 {
135     Base::finishCreation(globalData);
136     ASSERT(inherits(&s_info));
137 }
138
139 JSObject* JSDOMSettableTokenList::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
140 {
141     return JSDOMSettableTokenListPrototype::create(exec->globalData(), globalObject, JSDOMSettableTokenListPrototype::createStructure(exec->globalData(), globalObject, JSDOMTokenListPrototype::self(exec, globalObject)));
142 }
143
144 bool JSDOMSettableTokenList::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
145 {
146     JSDOMSettableTokenList* thisObject = jsCast<JSDOMSettableTokenList*>(cell);
147     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
148     const HashEntry* entry = JSDOMSettableTokenListTable.entry(exec, propertyName);
149     if (entry) {
150         slot.setCustom(thisObject, entry->propertyGetter());
151         return true;
152     }
153     bool ok;
154     unsigned index = propertyName.toUInt32(ok);
155     if (ok) {
156         slot.setCustomIndex(thisObject, index, indexGetter);
157         return true;
158     }
159     return getStaticValueSlot<JSDOMSettableTokenList, Base>(exec, &JSDOMSettableTokenListTable, thisObject, propertyName, slot);
160 }
161
162 bool JSDOMSettableTokenList::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
163 {
164     JSDOMSettableTokenList* thisObject = jsCast<JSDOMSettableTokenList*>(object);
165     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
166     const HashEntry* entry = JSDOMSettableTokenListTable.entry(exec, propertyName);
167     if (entry) {
168         PropertySlot slot;
169         slot.setCustom(thisObject, entry->propertyGetter());
170         descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
171         return true;
172     }
173     bool ok;
174     unsigned index = propertyName.toUInt32(ok);
175     if (ok && index < static_cast<DOMSettableTokenList*>(thisObject->impl())->length()) {
176         PropertySlot slot;
177         slot.setCustomIndex(thisObject, index, indexGetter);
178         descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly);
179         return true;
180     }
181     return getStaticValueDescriptor<JSDOMSettableTokenList, Base>(exec, &JSDOMSettableTokenListTable, thisObject, propertyName, descriptor);
182 }
183
184 bool JSDOMSettableTokenList::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
185 {
186     JSDOMSettableTokenList* thisObject = jsCast<JSDOMSettableTokenList*>(cell);
187     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
188     if (propertyName < static_cast<DOMSettableTokenList*>(thisObject->impl())->length()) {
189         slot.setCustomIndex(thisObject, propertyName, thisObject->indexGetter);
190         return true;
191     }
192     return thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
193 }
194
195 JSValue jsDOMSettableTokenListValue(ExecState* exec, JSValue slotBase, const Identifier&)
196 {
197     JSDOMSettableTokenList* castedThis = static_cast<JSDOMSettableTokenList*>(asObject(slotBase));
198     UNUSED_PARAM(exec);
199     DOMSettableTokenList* imp = static_cast<DOMSettableTokenList*>(castedThis->impl());
200     JSValue result = jsString(exec, imp->value());
201     return result;
202 }
203
204
205 JSValue jsDOMSettableTokenListConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
206 {
207     JSDOMSettableTokenList* domObject = static_cast<JSDOMSettableTokenList*>(asObject(slotBase));
208     return JSDOMSettableTokenList::getConstructor(exec, domObject->globalObject());
209 }
210
211 void JSDOMSettableTokenList::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
212 {
213     JSDOMSettableTokenList* thisObject = jsCast<JSDOMSettableTokenList*>(cell);
214     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
215     lookupPut<JSDOMSettableTokenList, Base>(exec, propertyName, value, &JSDOMSettableTokenListTable, thisObject, slot);
216 }
217
218 void setJSDOMSettableTokenListValue(ExecState* exec, JSObject* thisObject, JSValue value)
219 {
220     JSDOMSettableTokenList* castedThis = static_cast<JSDOMSettableTokenList*>(thisObject);
221     DOMSettableTokenList* imp = static_cast<DOMSettableTokenList*>(castedThis->impl());
222     imp->setValue(ustringToString(value.isEmpty() ? UString() : value.toString(exec)));
223 }
224
225
226 void JSDOMSettableTokenList::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
227 {
228     JSDOMSettableTokenList* thisObject = jsCast<JSDOMSettableTokenList*>(object);
229     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
230     for (unsigned i = 0; i < static_cast<DOMSettableTokenList*>(thisObject->impl())->length(); ++i)
231         propertyNames.add(Identifier::from(exec, i));
232      Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
233 }
234
235 JSValue JSDOMSettableTokenList::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
236 {
237     return getDOMConstructor<JSDOMSettableTokenListConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
238 }
239
240
241 JSValue JSDOMSettableTokenList::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
242 {
243     JSDOMSettableTokenList* thisObj = static_cast<JSDOMSettableTokenList*>(asObject(slotBase));
244     ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info);
245     return jsStringOrNull(exec, thisObj->impl()->item(index));
246 }
247
248 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMSettableTokenList* impl)
249 {
250     return wrap<JSDOMSettableTokenList>(exec, globalObject, impl);
251 }
252
253
254 }