tizen beta release
[framework/web/webkit-efl.git] / DerivedSources / WebCore / JSHTMLTableSectionElement.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 "JSHTMLTableSectionElement.h"
23
24 #include "ExceptionCode.h"
25 #include "HTMLCollection.h"
26 #include "HTMLElement.h"
27 #include "HTMLNames.h"
28 #include "HTMLTableSectionElement.h"
29 #include "JSDOMBinding.h"
30 #include "JSHTMLCollection.h"
31 #include "JSHTMLElement.h"
32 #include "KURL.h"
33 #include <runtime/Error.h>
34 #include <runtime/JSString.h>
35 #include <wtf/GetPtr.h>
36
37 using namespace JSC;
38
39 namespace WebCore {
40
41 ASSERT_CLASS_FITS_IN_CELL(JSHTMLTableSectionElement);
42
43 /* Hash table */
44 #if ENABLE(JIT)
45 #define THUNK_GENERATOR(generator) , generator
46 #else
47 #define THUNK_GENERATOR(generator)
48 #endif
49 #if ENABLE(DFG_JIT)
50 #define INTRINSIC(intrinsic) , intrinsic
51 #else
52 #define INTRINSIC(intrinsic)
53 #endif
54
55 static const HashTableValue JSHTMLTableSectionElementTableValues[] =
56 {
57     { "align", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableSectionElementAlign), (intptr_t)setJSHTMLTableSectionElementAlign THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58     { "ch", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableSectionElementCh), (intptr_t)setJSHTMLTableSectionElementCh THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59     { "chOff", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableSectionElementChOff), (intptr_t)setJSHTMLTableSectionElementChOff THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60     { "vAlign", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableSectionElementVAlign), (intptr_t)setJSHTMLTableSectionElementVAlign THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
61     { "rows", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableSectionElementRows), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
62     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableSectionElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
63     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
64 };
65
66 #undef THUNK_GENERATOR
67 static const HashTable JSHTMLTableSectionElementTable = { 16, 15, JSHTMLTableSectionElementTableValues, 0 };
68 /* Hash table for constructor */
69 #if ENABLE(JIT)
70 #define THUNK_GENERATOR(generator) , generator
71 #else
72 #define THUNK_GENERATOR(generator)
73 #endif
74 #if ENABLE(DFG_JIT)
75 #define INTRINSIC(intrinsic) , intrinsic
76 #else
77 #define INTRINSIC(intrinsic)
78 #endif
79
80 static const HashTableValue JSHTMLTableSectionElementConstructorTableValues[] =
81 {
82     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
83 };
84
85 #undef THUNK_GENERATOR
86 static const HashTable JSHTMLTableSectionElementConstructorTable = { 1, 0, JSHTMLTableSectionElementConstructorTableValues, 0 };
87 const ClassInfo JSHTMLTableSectionElementConstructor::s_info = { "HTMLTableSectionElementConstructor", &DOMConstructorObject::s_info, &JSHTMLTableSectionElementConstructorTable, 0, CREATE_METHOD_TABLE(JSHTMLTableSectionElementConstructor) };
88
89 JSHTMLTableSectionElementConstructor::JSHTMLTableSectionElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
90     : DOMConstructorObject(structure, globalObject)
91 {
92 }
93
94 void JSHTMLTableSectionElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
95 {
96     Base::finishCreation(exec->globalData());
97     ASSERT(inherits(&s_info));
98     putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLTableSectionElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
99 }
100
101 bool JSHTMLTableSectionElementConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
102 {
103     return getStaticValueSlot<JSHTMLTableSectionElementConstructor, JSDOMWrapper>(exec, &JSHTMLTableSectionElementConstructorTable, static_cast<JSHTMLTableSectionElementConstructor*>(cell), propertyName, slot);
104 }
105
106 bool JSHTMLTableSectionElementConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
107 {
108     return getStaticValueDescriptor<JSHTMLTableSectionElementConstructor, JSDOMWrapper>(exec, &JSHTMLTableSectionElementConstructorTable, static_cast<JSHTMLTableSectionElementConstructor*>(object), propertyName, descriptor);
109 }
110
111 /* Hash table for prototype */
112 #if ENABLE(JIT)
113 #define THUNK_GENERATOR(generator) , generator
114 #else
115 #define THUNK_GENERATOR(generator)
116 #endif
117 #if ENABLE(DFG_JIT)
118 #define INTRINSIC(intrinsic) , intrinsic
119 #else
120 #define INTRINSIC(intrinsic)
121 #endif
122
123 static const HashTableValue JSHTMLTableSectionElementPrototypeTableValues[] =
124 {
125     { "insertRow", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLTableSectionElementPrototypeFunctionInsertRow), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
126     { "deleteRow", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLTableSectionElementPrototypeFunctionDeleteRow), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
127     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
128 };
129
130 #undef THUNK_GENERATOR
131 static const HashTable JSHTMLTableSectionElementPrototypeTable = { 5, 3, JSHTMLTableSectionElementPrototypeTableValues, 0 };
132 const ClassInfo JSHTMLTableSectionElementPrototype::s_info = { "HTMLTableSectionElementPrototype", &JSC::JSNonFinalObject::s_info, &JSHTMLTableSectionElementPrototypeTable, 0, CREATE_METHOD_TABLE(JSHTMLTableSectionElementPrototype) };
133
134 JSObject* JSHTMLTableSectionElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
135 {
136     return getDOMPrototype<JSHTMLTableSectionElement>(exec, globalObject);
137 }
138
139 bool JSHTMLTableSectionElementPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
140 {
141     JSHTMLTableSectionElementPrototype* thisObject = jsCast<JSHTMLTableSectionElementPrototype*>(cell);
142     return getStaticFunctionSlot<JSObject>(exec, &JSHTMLTableSectionElementPrototypeTable, thisObject, propertyName, slot);
143 }
144
145 bool JSHTMLTableSectionElementPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
146 {
147     JSHTMLTableSectionElementPrototype* thisObject = jsCast<JSHTMLTableSectionElementPrototype*>(object);
148     return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLTableSectionElementPrototypeTable, thisObject, propertyName, descriptor);
149 }
150
151 const ClassInfo JSHTMLTableSectionElement::s_info = { "HTMLTableSectionElement", &JSHTMLElement::s_info, &JSHTMLTableSectionElementTable, 0 , CREATE_METHOD_TABLE(JSHTMLTableSectionElement) };
152
153 JSHTMLTableSectionElement::JSHTMLTableSectionElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLTableSectionElement> impl)
154     : JSHTMLElement(structure, globalObject, impl)
155 {
156 }
157
158 void JSHTMLTableSectionElement::finishCreation(JSGlobalData& globalData)
159 {
160     Base::finishCreation(globalData);
161     ASSERT(inherits(&s_info));
162 }
163
164 JSObject* JSHTMLTableSectionElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
165 {
166     return JSHTMLTableSectionElementPrototype::create(exec->globalData(), globalObject, JSHTMLTableSectionElementPrototype::createStructure(exec->globalData(), globalObject, JSHTMLElementPrototype::self(exec, globalObject)));
167 }
168
169 bool JSHTMLTableSectionElement::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
170 {
171     JSHTMLTableSectionElement* thisObject = jsCast<JSHTMLTableSectionElement*>(cell);
172     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
173     return getStaticValueSlot<JSHTMLTableSectionElement, Base>(exec, &JSHTMLTableSectionElementTable, thisObject, propertyName, slot);
174 }
175
176 bool JSHTMLTableSectionElement::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
177 {
178     JSHTMLTableSectionElement* thisObject = jsCast<JSHTMLTableSectionElement*>(object);
179     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
180     return getStaticValueDescriptor<JSHTMLTableSectionElement, Base>(exec, &JSHTMLTableSectionElementTable, thisObject, propertyName, descriptor);
181 }
182
183 JSValue jsHTMLTableSectionElementAlign(ExecState* exec, JSValue slotBase, const Identifier&)
184 {
185     JSHTMLTableSectionElement* castedThis = static_cast<JSHTMLTableSectionElement*>(asObject(slotBase));
186     UNUSED_PARAM(exec);
187     HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThis->impl());
188     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::alignAttr));
189     return result;
190 }
191
192
193 JSValue jsHTMLTableSectionElementCh(ExecState* exec, JSValue slotBase, const Identifier&)
194 {
195     JSHTMLTableSectionElement* castedThis = static_cast<JSHTMLTableSectionElement*>(asObject(slotBase));
196     UNUSED_PARAM(exec);
197     HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThis->impl());
198     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::charAttr));
199     return result;
200 }
201
202
203 JSValue jsHTMLTableSectionElementChOff(ExecState* exec, JSValue slotBase, const Identifier&)
204 {
205     JSHTMLTableSectionElement* castedThis = static_cast<JSHTMLTableSectionElement*>(asObject(slotBase));
206     UNUSED_PARAM(exec);
207     HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThis->impl());
208     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::charoffAttr));
209     return result;
210 }
211
212
213 JSValue jsHTMLTableSectionElementVAlign(ExecState* exec, JSValue slotBase, const Identifier&)
214 {
215     JSHTMLTableSectionElement* castedThis = static_cast<JSHTMLTableSectionElement*>(asObject(slotBase));
216     UNUSED_PARAM(exec);
217     HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThis->impl());
218     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::valignAttr));
219     return result;
220 }
221
222
223 JSValue jsHTMLTableSectionElementRows(ExecState* exec, JSValue slotBase, const Identifier&)
224 {
225     JSHTMLTableSectionElement* castedThis = static_cast<JSHTMLTableSectionElement*>(asObject(slotBase));
226     UNUSED_PARAM(exec);
227     HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThis->impl());
228     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->rows()));
229     return result;
230 }
231
232
233 JSValue jsHTMLTableSectionElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
234 {
235     JSHTMLTableSectionElement* domObject = static_cast<JSHTMLTableSectionElement*>(asObject(slotBase));
236     return JSHTMLTableSectionElement::getConstructor(exec, domObject->globalObject());
237 }
238
239 void JSHTMLTableSectionElement::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
240 {
241     JSHTMLTableSectionElement* thisObject = jsCast<JSHTMLTableSectionElement*>(cell);
242     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
243     lookupPut<JSHTMLTableSectionElement, Base>(exec, propertyName, value, &JSHTMLTableSectionElementTable, thisObject, slot);
244 }
245
246 void setJSHTMLTableSectionElementAlign(ExecState* exec, JSObject* thisObject, JSValue value)
247 {
248     JSHTMLTableSectionElement* castedThis = static_cast<JSHTMLTableSectionElement*>(thisObject);
249     HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThis->impl());
250     imp->setAttribute(WebCore::HTMLNames::alignAttr, valueToStringWithNullCheck(exec, value));
251 }
252
253
254 void setJSHTMLTableSectionElementCh(ExecState* exec, JSObject* thisObject, JSValue value)
255 {
256     JSHTMLTableSectionElement* castedThis = static_cast<JSHTMLTableSectionElement*>(thisObject);
257     HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThis->impl());
258     imp->setAttribute(WebCore::HTMLNames::charAttr, valueToStringWithNullCheck(exec, value));
259 }
260
261
262 void setJSHTMLTableSectionElementChOff(ExecState* exec, JSObject* thisObject, JSValue value)
263 {
264     JSHTMLTableSectionElement* castedThis = static_cast<JSHTMLTableSectionElement*>(thisObject);
265     HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThis->impl());
266     imp->setAttribute(WebCore::HTMLNames::charoffAttr, valueToStringWithNullCheck(exec, value));
267 }
268
269
270 void setJSHTMLTableSectionElementVAlign(ExecState* exec, JSObject* thisObject, JSValue value)
271 {
272     JSHTMLTableSectionElement* castedThis = static_cast<JSHTMLTableSectionElement*>(thisObject);
273     HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThis->impl());
274     imp->setAttribute(WebCore::HTMLNames::valignAttr, valueToStringWithNullCheck(exec, value));
275 }
276
277
278 JSValue JSHTMLTableSectionElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
279 {
280     return getDOMConstructor<JSHTMLTableSectionElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
281 }
282
283 EncodedJSValue JSC_HOST_CALL jsHTMLTableSectionElementPrototypeFunctionInsertRow(ExecState* exec)
284 {
285     JSValue thisValue = exec->hostThisValue();
286     if (!thisValue.inherits(&JSHTMLTableSectionElement::s_info))
287         return throwVMTypeError(exec);
288     JSHTMLTableSectionElement* castedThis = static_cast<JSHTMLTableSectionElement*>(asObject(thisValue));
289     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLTableSectionElement::s_info);
290     HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThis->impl());
291     ExceptionCode ec = 0;
292     int index(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec));
293     if (exec->hadException())
294         return JSValue::encode(jsUndefined());
295
296     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->insertRow(index, ec)));
297     setDOMException(exec, ec);
298     return JSValue::encode(result);
299 }
300
301 EncodedJSValue JSC_HOST_CALL jsHTMLTableSectionElementPrototypeFunctionDeleteRow(ExecState* exec)
302 {
303     JSValue thisValue = exec->hostThisValue();
304     if (!thisValue.inherits(&JSHTMLTableSectionElement::s_info))
305         return throwVMTypeError(exec);
306     JSHTMLTableSectionElement* castedThis = static_cast<JSHTMLTableSectionElement*>(asObject(thisValue));
307     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLTableSectionElement::s_info);
308     HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThis->impl());
309     ExceptionCode ec = 0;
310     int index(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec));
311     if (exec->hadException())
312         return JSValue::encode(jsUndefined());
313     imp->deleteRow(index, ec);
314     setDOMException(exec, ec);
315     return JSValue::encode(jsUndefined());
316 }
317
318 HTMLTableSectionElement* toHTMLTableSectionElement(JSC::JSValue value)
319 {
320     return value.inherits(&JSHTMLTableSectionElement::s_info) ? static_cast<JSHTMLTableSectionElement*>(asObject(value))->impl() : 0;
321 }
322
323 }