2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
22 #include "JSClientRectList.h"
24 #include "ClientRect.h"
25 #include "ClientRectList.h"
26 #include "ExceptionCode.h"
27 #include "JSClientRect.h"
28 #include "JSDOMBinding.h"
29 #include <runtime/Error.h>
30 #include <runtime/PropertyNameArray.h>
31 #include <wtf/GetPtr.h>
37 ASSERT_CLASS_FITS_IN_CELL(JSClientRectList);
41 #define THUNK_GENERATOR(generator) , generator
43 #define THUNK_GENERATOR(generator)
46 #define INTRINSIC(intrinsic) , intrinsic
48 #define INTRINSIC(intrinsic)
51 static const HashTableValue JSClientRectListTableValues[] =
53 { "length", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsClientRectListLength), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsClientRectListConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
58 #undef THUNK_GENERATOR
59 static const HashTable JSClientRectListTable = { 5, 3, JSClientRectListTableValues, 0 };
60 /* Hash table for constructor */
62 #define THUNK_GENERATOR(generator) , generator
64 #define THUNK_GENERATOR(generator)
67 #define INTRINSIC(intrinsic) , intrinsic
69 #define INTRINSIC(intrinsic)
72 static const HashTableValue JSClientRectListConstructorTableValues[] =
74 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
77 #undef THUNK_GENERATOR
78 static const HashTable JSClientRectListConstructorTable = { 1, 0, JSClientRectListConstructorTableValues, 0 };
79 const ClassInfo JSClientRectListConstructor::s_info = { "ClientRectListConstructor", &DOMConstructorObject::s_info, &JSClientRectListConstructorTable, 0, CREATE_METHOD_TABLE(JSClientRectListConstructor) };
81 JSClientRectListConstructor::JSClientRectListConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
82 : DOMConstructorObject(structure, globalObject)
86 void JSClientRectListConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
88 Base::finishCreation(exec->globalData());
89 ASSERT(inherits(&s_info));
90 putDirect(exec->globalData(), exec->propertyNames().prototype, JSClientRectListPrototype::self(exec, globalObject), DontDelete | ReadOnly);
93 bool JSClientRectListConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
95 return getStaticValueSlot<JSClientRectListConstructor, JSDOMWrapper>(exec, &JSClientRectListConstructorTable, static_cast<JSClientRectListConstructor*>(cell), propertyName, slot);
98 bool JSClientRectListConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
100 return getStaticValueDescriptor<JSClientRectListConstructor, JSDOMWrapper>(exec, &JSClientRectListConstructorTable, static_cast<JSClientRectListConstructor*>(object), propertyName, descriptor);
103 /* Hash table for prototype */
105 #define THUNK_GENERATOR(generator) , generator
107 #define THUNK_GENERATOR(generator)
110 #define INTRINSIC(intrinsic) , intrinsic
112 #define INTRINSIC(intrinsic)
115 static const HashTableValue JSClientRectListPrototypeTableValues[] =
117 { "item", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsClientRectListPrototypeFunctionItem), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
118 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
121 #undef THUNK_GENERATOR
122 static const HashTable JSClientRectListPrototypeTable = { 2, 1, JSClientRectListPrototypeTableValues, 0 };
123 const ClassInfo JSClientRectListPrototype::s_info = { "ClientRectListPrototype", &JSC::JSNonFinalObject::s_info, &JSClientRectListPrototypeTable, 0, CREATE_METHOD_TABLE(JSClientRectListPrototype) };
125 JSObject* JSClientRectListPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
127 return getDOMPrototype<JSClientRectList>(exec, globalObject);
130 bool JSClientRectListPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
132 JSClientRectListPrototype* thisObject = jsCast<JSClientRectListPrototype*>(cell);
133 return getStaticFunctionSlot<JSObject>(exec, &JSClientRectListPrototypeTable, thisObject, propertyName, slot);
136 bool JSClientRectListPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
138 JSClientRectListPrototype* thisObject = jsCast<JSClientRectListPrototype*>(object);
139 return getStaticFunctionDescriptor<JSObject>(exec, &JSClientRectListPrototypeTable, thisObject, propertyName, descriptor);
142 const ClassInfo JSClientRectList::s_info = { "ClientRectList", &JSDOMWrapper::s_info, &JSClientRectListTable, 0 , CREATE_METHOD_TABLE(JSClientRectList) };
144 JSClientRectList::JSClientRectList(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<ClientRectList> impl)
145 : JSDOMWrapper(structure, globalObject)
146 , m_impl(impl.leakRef())
150 void JSClientRectList::finishCreation(JSGlobalData& globalData)
152 Base::finishCreation(globalData);
153 ASSERT(inherits(&s_info));
156 JSObject* JSClientRectList::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
158 return JSClientRectListPrototype::create(exec->globalData(), globalObject, JSClientRectListPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
161 bool JSClientRectList::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
163 JSClientRectList* thisObject = jsCast<JSClientRectList*>(cell);
164 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
165 const HashEntry* entry = JSClientRectListTable.entry(exec, propertyName);
167 slot.setCustom(thisObject, entry->propertyGetter());
171 unsigned index = propertyName.toUInt32(ok);
172 if (ok && index < static_cast<ClientRectList*>(thisObject->impl())->length()) {
173 slot.setCustomIndex(thisObject, index, indexGetter);
176 return getStaticValueSlot<JSClientRectList, Base>(exec, &JSClientRectListTable, thisObject, propertyName, slot);
179 bool JSClientRectList::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
181 JSClientRectList* thisObject = jsCast<JSClientRectList*>(object);
182 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
183 const HashEntry* entry = JSClientRectListTable.entry(exec, propertyName);
186 slot.setCustom(thisObject, entry->propertyGetter());
187 descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
191 unsigned index = propertyName.toUInt32(ok);
192 if (ok && index < static_cast<ClientRectList*>(thisObject->impl())->length()) {
194 slot.setCustomIndex(thisObject, index, indexGetter);
195 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly);
198 return getStaticValueDescriptor<JSClientRectList, Base>(exec, &JSClientRectListTable, thisObject, propertyName, descriptor);
201 bool JSClientRectList::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
203 JSClientRectList* thisObject = jsCast<JSClientRectList*>(cell);
204 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
205 if (propertyName < static_cast<ClientRectList*>(thisObject->impl())->length()) {
206 slot.setCustomIndex(thisObject, propertyName, thisObject->indexGetter);
209 return thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
212 JSValue jsClientRectListLength(ExecState* exec, JSValue slotBase, const Identifier&)
214 JSClientRectList* castedThis = static_cast<JSClientRectList*>(asObject(slotBase));
216 ClientRectList* imp = static_cast<ClientRectList*>(castedThis->impl());
217 JSValue result = jsNumber(imp->length());
222 JSValue jsClientRectListConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
224 JSClientRectList* domObject = static_cast<JSClientRectList*>(asObject(slotBase));
225 return JSClientRectList::getConstructor(exec, domObject->globalObject());
228 void JSClientRectList::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
230 JSClientRectList* thisObject = jsCast<JSClientRectList*>(object);
231 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
232 for (unsigned i = 0; i < static_cast<ClientRectList*>(thisObject->impl())->length(); ++i)
233 propertyNames.add(Identifier::from(exec, i));
234 Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
237 JSValue JSClientRectList::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
239 return getDOMConstructor<JSClientRectListConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
242 EncodedJSValue JSC_HOST_CALL jsClientRectListPrototypeFunctionItem(ExecState* exec)
244 JSValue thisValue = exec->hostThisValue();
245 if (!thisValue.inherits(&JSClientRectList::s_info))
246 return throwVMTypeError(exec);
247 JSClientRectList* castedThis = static_cast<JSClientRectList*>(asObject(thisValue));
248 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSClientRectList::s_info);
249 ClientRectList* imp = static_cast<ClientRectList*>(castedThis->impl());
250 int index(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toUInt32(exec));
252 setDOMException(exec, INDEX_SIZE_ERR);
253 return JSValue::encode(jsUndefined());
255 if (exec->hadException())
256 return JSValue::encode(jsUndefined());
258 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->item(index)));
259 return JSValue::encode(result);
263 JSValue JSClientRectList::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
265 JSClientRectList* thisObj = static_cast<JSClientRectList*>(asObject(slotBase));
266 ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info);
267 return toJS(exec, thisObj->globalObject(), static_cast<ClientRectList*>(thisObj->impl())->item(index));
270 static inline bool isObservable(JSClientRectList* jsClientRectList)
272 if (jsClientRectList->hasCustomProperties())
277 bool JSClientRectListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
279 JSClientRectList* jsClientRectList = static_cast<JSClientRectList*>(handle.get().asCell());
280 if (!isObservable(jsClientRectList))
282 UNUSED_PARAM(visitor);
286 void JSClientRectListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
288 JSClientRectList* jsClientRectList = static_cast<JSClientRectList*>(handle.get().asCell());
289 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
290 uncacheWrapper(world, jsClientRectList->impl(), jsClientRectList);
291 jsClientRectList->releaseImpl();
294 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, ClientRectList* impl)
296 return wrap<JSClientRectList>(exec, globalObject, impl);
299 ClientRectList* toClientRectList(JSC::JSValue value)
301 return value.inherits(&JSClientRectList::s_info) ? static_cast<JSClientRectList*>(asObject(value))->impl() : 0;