tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSHTMLFieldSetElement.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 "JSHTMLFieldSetElement.h"
23
24 #include "ExceptionCode.h"
25 #include "HTMLFieldSetElement.h"
26 #include "HTMLFormElement.h"
27 #include "JSDOMBinding.h"
28 #include "JSHTMLFormElement.h"
29 #include "JSValidityState.h"
30 #include "KURL.h"
31 #include "ValidityState.h"
32 #include <runtime/Error.h>
33 #include <runtime/JSString.h>
34 #include <wtf/GetPtr.h>
35
36 using namespace JSC;
37
38 namespace WebCore {
39
40 ASSERT_CLASS_FITS_IN_CELL(JSHTMLFieldSetElement);
41
42 /* Hash table */
43 #if ENABLE(JIT)
44 #define THUNK_GENERATOR(generator) , generator
45 #else
46 #define THUNK_GENERATOR(generator)
47 #endif
48 #if ENABLE(DFG_JIT)
49 #define INTRINSIC(intrinsic) , intrinsic
50 #else
51 #define INTRINSIC(intrinsic)
52 #endif
53
54 static const HashTableValue JSHTMLFieldSetElementTableValues[] =
55 {
56     { "form", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementForm), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57     { "validity", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementValidity), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58     { "willValidate", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementWillValidate), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59     { "validationMessage", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementValidationMessage), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
61     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
62 };
63
64 #undef THUNK_GENERATOR
65 static const HashTable JSHTMLFieldSetElementTable = { 16, 15, JSHTMLFieldSetElementTableValues, 0 };
66 /* Hash table for constructor */
67 #if ENABLE(JIT)
68 #define THUNK_GENERATOR(generator) , generator
69 #else
70 #define THUNK_GENERATOR(generator)
71 #endif
72 #if ENABLE(DFG_JIT)
73 #define INTRINSIC(intrinsic) , intrinsic
74 #else
75 #define INTRINSIC(intrinsic)
76 #endif
77
78 static const HashTableValue JSHTMLFieldSetElementConstructorTableValues[] =
79 {
80     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
81 };
82
83 #undef THUNK_GENERATOR
84 static const HashTable JSHTMLFieldSetElementConstructorTable = { 1, 0, JSHTMLFieldSetElementConstructorTableValues, 0 };
85 const ClassInfo JSHTMLFieldSetElementConstructor::s_info = { "HTMLFieldSetElementConstructor", &DOMConstructorObject::s_info, &JSHTMLFieldSetElementConstructorTable, 0, CREATE_METHOD_TABLE(JSHTMLFieldSetElementConstructor) };
86
87 JSHTMLFieldSetElementConstructor::JSHTMLFieldSetElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
88     : DOMConstructorObject(structure, globalObject)
89 {
90 }
91
92 void JSHTMLFieldSetElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
93 {
94     Base::finishCreation(exec->globalData());
95     ASSERT(inherits(&s_info));
96     putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLFieldSetElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
97 }
98
99 bool JSHTMLFieldSetElementConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
100 {
101     return getStaticValueSlot<JSHTMLFieldSetElementConstructor, JSDOMWrapper>(exec, &JSHTMLFieldSetElementConstructorTable, static_cast<JSHTMLFieldSetElementConstructor*>(cell), propertyName, slot);
102 }
103
104 bool JSHTMLFieldSetElementConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
105 {
106     return getStaticValueDescriptor<JSHTMLFieldSetElementConstructor, JSDOMWrapper>(exec, &JSHTMLFieldSetElementConstructorTable, static_cast<JSHTMLFieldSetElementConstructor*>(object), propertyName, descriptor);
107 }
108
109 /* Hash table for prototype */
110 #if ENABLE(JIT)
111 #define THUNK_GENERATOR(generator) , generator
112 #else
113 #define THUNK_GENERATOR(generator)
114 #endif
115 #if ENABLE(DFG_JIT)
116 #define INTRINSIC(intrinsic) , intrinsic
117 #else
118 #define INTRINSIC(intrinsic)
119 #endif
120
121 static const HashTableValue JSHTMLFieldSetElementPrototypeTableValues[] =
122 {
123     { "checkValidity", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLFieldSetElementPrototypeFunctionCheckValidity), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
124     { "setCustomValidity", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLFieldSetElementPrototypeFunctionSetCustomValidity), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
125     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
126 };
127
128 #undef THUNK_GENERATOR
129 static const HashTable JSHTMLFieldSetElementPrototypeTable = { 4, 3, JSHTMLFieldSetElementPrototypeTableValues, 0 };
130 const ClassInfo JSHTMLFieldSetElementPrototype::s_info = { "HTMLFieldSetElementPrototype", &JSC::JSNonFinalObject::s_info, &JSHTMLFieldSetElementPrototypeTable, 0, CREATE_METHOD_TABLE(JSHTMLFieldSetElementPrototype) };
131
132 JSObject* JSHTMLFieldSetElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
133 {
134     return getDOMPrototype<JSHTMLFieldSetElement>(exec, globalObject);
135 }
136
137 bool JSHTMLFieldSetElementPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
138 {
139     JSHTMLFieldSetElementPrototype* thisObject = jsCast<JSHTMLFieldSetElementPrototype*>(cell);
140     return getStaticFunctionSlot<JSObject>(exec, &JSHTMLFieldSetElementPrototypeTable, thisObject, propertyName, slot);
141 }
142
143 bool JSHTMLFieldSetElementPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
144 {
145     JSHTMLFieldSetElementPrototype* thisObject = jsCast<JSHTMLFieldSetElementPrototype*>(object);
146     return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLFieldSetElementPrototypeTable, thisObject, propertyName, descriptor);
147 }
148
149 const ClassInfo JSHTMLFieldSetElement::s_info = { "HTMLFieldSetElement", &JSHTMLElement::s_info, &JSHTMLFieldSetElementTable, 0 , CREATE_METHOD_TABLE(JSHTMLFieldSetElement) };
150
151 JSHTMLFieldSetElement::JSHTMLFieldSetElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLFieldSetElement> impl)
152     : JSHTMLElement(structure, globalObject, impl)
153 {
154 }
155
156 void JSHTMLFieldSetElement::finishCreation(JSGlobalData& globalData)
157 {
158     Base::finishCreation(globalData);
159     ASSERT(inherits(&s_info));
160 }
161
162 JSObject* JSHTMLFieldSetElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
163 {
164     return JSHTMLFieldSetElementPrototype::create(exec->globalData(), globalObject, JSHTMLFieldSetElementPrototype::createStructure(exec->globalData(), globalObject, JSHTMLElementPrototype::self(exec, globalObject)));
165 }
166
167 bool JSHTMLFieldSetElement::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
168 {
169     JSHTMLFieldSetElement* thisObject = jsCast<JSHTMLFieldSetElement*>(cell);
170     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
171     return getStaticValueSlot<JSHTMLFieldSetElement, Base>(exec, &JSHTMLFieldSetElementTable, thisObject, propertyName, slot);
172 }
173
174 bool JSHTMLFieldSetElement::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
175 {
176     JSHTMLFieldSetElement* thisObject = jsCast<JSHTMLFieldSetElement*>(object);
177     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
178     return getStaticValueDescriptor<JSHTMLFieldSetElement, Base>(exec, &JSHTMLFieldSetElementTable, thisObject, propertyName, descriptor);
179 }
180
181 JSValue jsHTMLFieldSetElementForm(ExecState* exec, JSValue slotBase, const Identifier&)
182 {
183     JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
184     UNUSED_PARAM(exec);
185     HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
186     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->form()));
187     return result;
188 }
189
190
191 JSValue jsHTMLFieldSetElementValidity(ExecState* exec, JSValue slotBase, const Identifier&)
192 {
193     JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
194     UNUSED_PARAM(exec);
195     HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
196     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->validity()));
197     return result;
198 }
199
200
201 JSValue jsHTMLFieldSetElementWillValidate(ExecState* exec, JSValue slotBase, const Identifier&)
202 {
203     JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
204     UNUSED_PARAM(exec);
205     HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
206     JSValue result = jsBoolean(imp->willValidate());
207     return result;
208 }
209
210
211 JSValue jsHTMLFieldSetElementValidationMessage(ExecState* exec, JSValue slotBase, const Identifier&)
212 {
213     JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
214     UNUSED_PARAM(exec);
215     HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
216     JSValue result = jsString(exec, imp->validationMessage());
217     return result;
218 }
219
220
221 JSValue jsHTMLFieldSetElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
222 {
223     JSHTMLFieldSetElement* domObject = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
224     return JSHTMLFieldSetElement::getConstructor(exec, domObject->globalObject());
225 }
226
227 JSValue JSHTMLFieldSetElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
228 {
229     return getDOMConstructor<JSHTMLFieldSetElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
230 }
231
232 EncodedJSValue JSC_HOST_CALL jsHTMLFieldSetElementPrototypeFunctionCheckValidity(ExecState* exec)
233 {
234     JSValue thisValue = exec->hostThisValue();
235     if (!thisValue.inherits(&JSHTMLFieldSetElement::s_info))
236         return throwVMTypeError(exec);
237     JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(thisValue));
238     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLFieldSetElement::s_info);
239     HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
240
241     JSC::JSValue result = jsBoolean(imp->checkValidity());
242     return JSValue::encode(result);
243 }
244
245 EncodedJSValue JSC_HOST_CALL jsHTMLFieldSetElementPrototypeFunctionSetCustomValidity(ExecState* exec)
246 {
247     JSValue thisValue = exec->hostThisValue();
248     if (!thisValue.inherits(&JSHTMLFieldSetElement::s_info))
249         return throwVMTypeError(exec);
250     JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(thisValue));
251     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLFieldSetElement::s_info);
252     HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
253     if (exec->argumentCount() < 1)
254         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
255     const String& error(valueToStringWithUndefinedOrNullCheck(exec, MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined)));
256     if (exec->hadException())
257         return JSValue::encode(jsUndefined());
258     imp->setCustomValidity(error);
259     return JSValue::encode(jsUndefined());
260 }
261
262
263 }