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 "JSOverflowEvent.h"
24 #include "JSDictionary.h"
25 #include "OverflowEvent.h"
26 #include <runtime/Error.h>
27 #include <wtf/GetPtr.h>
33 ASSERT_CLASS_FITS_IN_CELL(JSOverflowEvent);
37 #define THUNK_GENERATOR(generator) , generator
39 #define THUNK_GENERATOR(generator)
42 #define INTRINSIC(intrinsic) , intrinsic
44 #define INTRINSIC(intrinsic)
47 static const HashTableValue JSOverflowEventTableValues[] =
49 { "orient", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventOrient), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
50 { "horizontalOverflow", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventHorizontalOverflow), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51 { "verticalOverflow", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventVerticalOverflow), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
56 #undef THUNK_GENERATOR
57 static const HashTable JSOverflowEventTable = { 9, 7, JSOverflowEventTableValues, 0 };
58 /* Hash table for constructor */
60 #define THUNK_GENERATOR(generator) , generator
62 #define THUNK_GENERATOR(generator)
65 #define INTRINSIC(intrinsic) , intrinsic
67 #define INTRINSIC(intrinsic)
70 static const HashTableValue JSOverflowEventConstructorTableValues[] =
72 { "HORIZONTAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventHORIZONTAL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
73 { "VERTICAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventVERTICAL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
74 { "BOTH", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventBOTH), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
75 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
78 #undef THUNK_GENERATOR
79 static const HashTable JSOverflowEventConstructorTable = { 9, 7, JSOverflowEventConstructorTableValues, 0 };
81 COMPILE_ASSERT(0 == OverflowEvent::HORIZONTAL, OverflowEventEnumHORIZONTALIsWrongUseDontCheckEnums);
82 COMPILE_ASSERT(1 == OverflowEvent::VERTICAL, OverflowEventEnumVERTICALIsWrongUseDontCheckEnums);
83 COMPILE_ASSERT(2 == OverflowEvent::BOTH, OverflowEventEnumBOTHIsWrongUseDontCheckEnums);
85 const ClassInfo JSOverflowEventConstructor::s_info = { "OverflowEventConstructor", &DOMConstructorObject::s_info, &JSOverflowEventConstructorTable, 0, CREATE_METHOD_TABLE(JSOverflowEventConstructor) };
87 JSOverflowEventConstructor::JSOverflowEventConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
88 : DOMConstructorObject(structure, globalObject)
92 void JSOverflowEventConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
94 Base::finishCreation(exec->globalData());
95 ASSERT(inherits(&s_info));
96 putDirect(exec->globalData(), exec->propertyNames().prototype, JSOverflowEventPrototype::self(exec, globalObject), DontDelete | ReadOnly);
99 bool JSOverflowEventConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
101 return getStaticValueSlot<JSOverflowEventConstructor, JSDOMWrapper>(exec, &JSOverflowEventConstructorTable, static_cast<JSOverflowEventConstructor*>(cell), propertyName, slot);
104 bool JSOverflowEventConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
106 return getStaticValueDescriptor<JSOverflowEventConstructor, JSDOMWrapper>(exec, &JSOverflowEventConstructorTable, static_cast<JSOverflowEventConstructor*>(object), propertyName, descriptor);
109 EncodedJSValue JSC_HOST_CALL JSOverflowEventConstructor::constructJSOverflowEvent(ExecState* exec)
111 JSOverflowEventConstructor* jsConstructor = static_cast<JSOverflowEventConstructor*>(exec->callee());
113 ScriptExecutionContext* executionContext = jsConstructor->scriptExecutionContext();
114 if (!executionContext)
115 return throwVMError(exec, createReferenceError(exec, "Constructor associated execution context is unavailable"));
117 AtomicString eventType = ustringToAtomicString(exec->argument(0).toString(exec));
118 if (exec->hadException())
119 return JSValue::encode(jsUndefined());
121 OverflowEventInit eventInit;
123 JSValue initializerValue = exec->argument(1);
124 if (!initializerValue.isUndefinedOrNull()) {
125 // Given the above test, this will always yield an object.
126 JSObject* initializerObject = initializerValue.toObject(exec);
128 // Create the dictionary wrapper from the initializer object.
129 JSDictionary dictionary(exec, initializerObject);
131 // Attempt to fill in the EventInit.
132 if (!fillOverflowEventInit(eventInit, dictionary))
133 return JSValue::encode(jsUndefined());
136 RefPtr<OverflowEvent> event = OverflowEvent::create(eventType, eventInit);
137 return JSValue::encode(toJS(exec, jsConstructor->globalObject(), event.get()));
140 bool fillOverflowEventInit(OverflowEventInit& eventInit, JSDictionary& dictionary)
142 if (!fillEventInit(eventInit, dictionary))
145 if (!dictionary.tryGetProperty("orient", eventInit.orient))
147 if (!dictionary.tryGetProperty("horizontalOverflow", eventInit.horizontalOverflow))
149 if (!dictionary.tryGetProperty("verticalOverflow", eventInit.verticalOverflow))
154 ConstructType JSOverflowEventConstructor::getConstructData(JSCell*, ConstructData& constructData)
156 constructData.native.function = constructJSOverflowEvent;
157 return ConstructTypeHost;
160 /* Hash table for prototype */
162 #define THUNK_GENERATOR(generator) , generator
164 #define THUNK_GENERATOR(generator)
167 #define INTRINSIC(intrinsic) , intrinsic
169 #define INTRINSIC(intrinsic)
172 static const HashTableValue JSOverflowEventPrototypeTableValues[] =
174 { "HORIZONTAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventHORIZONTAL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
175 { "VERTICAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventVERTICAL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
176 { "BOTH", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventBOTH), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
177 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
180 #undef THUNK_GENERATOR
181 static const HashTable JSOverflowEventPrototypeTable = { 9, 7, JSOverflowEventPrototypeTableValues, 0 };
182 const ClassInfo JSOverflowEventPrototype::s_info = { "OverflowEventPrototype", &JSC::JSNonFinalObject::s_info, &JSOverflowEventPrototypeTable, 0, CREATE_METHOD_TABLE(JSOverflowEventPrototype) };
184 JSObject* JSOverflowEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
186 return getDOMPrototype<JSOverflowEvent>(exec, globalObject);
189 bool JSOverflowEventPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
191 JSOverflowEventPrototype* thisObject = jsCast<JSOverflowEventPrototype*>(cell);
192 return getStaticValueSlot<JSOverflowEventPrototype, JSObject>(exec, &JSOverflowEventPrototypeTable, thisObject, propertyName, slot);
195 bool JSOverflowEventPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
197 JSOverflowEventPrototype* thisObject = jsCast<JSOverflowEventPrototype*>(object);
198 return getStaticValueDescriptor<JSOverflowEventPrototype, JSObject>(exec, &JSOverflowEventPrototypeTable, thisObject, propertyName, descriptor);
201 const ClassInfo JSOverflowEvent::s_info = { "OverflowEvent", &JSEvent::s_info, &JSOverflowEventTable, 0 , CREATE_METHOD_TABLE(JSOverflowEvent) };
203 JSOverflowEvent::JSOverflowEvent(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<OverflowEvent> impl)
204 : JSEvent(structure, globalObject, impl)
208 void JSOverflowEvent::finishCreation(JSGlobalData& globalData)
210 Base::finishCreation(globalData);
211 ASSERT(inherits(&s_info));
214 JSObject* JSOverflowEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
216 return JSOverflowEventPrototype::create(exec->globalData(), globalObject, JSOverflowEventPrototype::createStructure(exec->globalData(), globalObject, JSEventPrototype::self(exec, globalObject)));
219 bool JSOverflowEvent::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
221 JSOverflowEvent* thisObject = jsCast<JSOverflowEvent*>(cell);
222 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
223 return getStaticValueSlot<JSOverflowEvent, Base>(exec, &JSOverflowEventTable, thisObject, propertyName, slot);
226 bool JSOverflowEvent::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
228 JSOverflowEvent* thisObject = jsCast<JSOverflowEvent*>(object);
229 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
230 return getStaticValueDescriptor<JSOverflowEvent, Base>(exec, &JSOverflowEventTable, thisObject, propertyName, descriptor);
233 JSValue jsOverflowEventOrient(ExecState* exec, JSValue slotBase, const Identifier&)
235 JSOverflowEvent* castedThis = static_cast<JSOverflowEvent*>(asObject(slotBase));
237 OverflowEvent* imp = static_cast<OverflowEvent*>(castedThis->impl());
238 JSValue result = jsNumber(imp->orient());
243 JSValue jsOverflowEventHorizontalOverflow(ExecState* exec, JSValue slotBase, const Identifier&)
245 JSOverflowEvent* castedThis = static_cast<JSOverflowEvent*>(asObject(slotBase));
247 OverflowEvent* imp = static_cast<OverflowEvent*>(castedThis->impl());
248 JSValue result = jsBoolean(imp->horizontalOverflow());
253 JSValue jsOverflowEventVerticalOverflow(ExecState* exec, JSValue slotBase, const Identifier&)
255 JSOverflowEvent* castedThis = static_cast<JSOverflowEvent*>(asObject(slotBase));
257 OverflowEvent* imp = static_cast<OverflowEvent*>(castedThis->impl());
258 JSValue result = jsBoolean(imp->verticalOverflow());
263 JSValue jsOverflowEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
265 JSOverflowEvent* domObject = static_cast<JSOverflowEvent*>(asObject(slotBase));
266 return JSOverflowEvent::getConstructor(exec, domObject->globalObject());
269 JSValue JSOverflowEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
271 return getDOMConstructor<JSOverflowEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
276 JSValue jsOverflowEventHORIZONTAL(ExecState* exec, JSValue, const Identifier&)
279 return jsNumber(static_cast<int>(0));
282 JSValue jsOverflowEventVERTICAL(ExecState* exec, JSValue, const Identifier&)
285 return jsNumber(static_cast<int>(1));
288 JSValue jsOverflowEventBOTH(ExecState* exec, JSValue, const Identifier&)
291 return jsNumber(static_cast<int>(2));