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 "JSHTMLFieldSetElement.h"
24 #include "ExceptionCode.h"
25 #include "HTMLFieldSetElement.h"
26 #include "HTMLFormElement.h"
27 #include "JSDOMBinding.h"
28 #include "JSHTMLFormElement.h"
29 #include "JSValidityState.h"
31 #include "ValidityState.h"
32 #include <runtime/Error.h>
33 #include <runtime/JSString.h>
34 #include <wtf/GetPtr.h>
40 ASSERT_CLASS_FITS_IN_CELL(JSHTMLFieldSetElement);
44 #define THUNK_GENERATOR(generator) , generator
46 #define THUNK_GENERATOR(generator)
49 #define INTRINSIC(intrinsic) , intrinsic
51 #define INTRINSIC(intrinsic)
54 static const HashTableValue JSHTMLFieldSetElementTableValues[] =
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) }
64 #undef THUNK_GENERATOR
65 static const HashTable JSHTMLFieldSetElementTable = { 16, 15, JSHTMLFieldSetElementTableValues, 0 };
66 /* Hash table for constructor */
68 #define THUNK_GENERATOR(generator) , generator
70 #define THUNK_GENERATOR(generator)
73 #define INTRINSIC(intrinsic) , intrinsic
75 #define INTRINSIC(intrinsic)
78 static const HashTableValue JSHTMLFieldSetElementConstructorTableValues[] =
80 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
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) };
87 JSHTMLFieldSetElementConstructor::JSHTMLFieldSetElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
88 : DOMConstructorObject(structure, globalObject)
92 void JSHTMLFieldSetElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
94 Base::finishCreation(exec->globalData());
95 ASSERT(inherits(&s_info));
96 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLFieldSetElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
99 bool JSHTMLFieldSetElementConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
101 return getStaticValueSlot<JSHTMLFieldSetElementConstructor, JSDOMWrapper>(exec, &JSHTMLFieldSetElementConstructorTable, static_cast<JSHTMLFieldSetElementConstructor*>(cell), propertyName, slot);
104 bool JSHTMLFieldSetElementConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
106 return getStaticValueDescriptor<JSHTMLFieldSetElementConstructor, JSDOMWrapper>(exec, &JSHTMLFieldSetElementConstructorTable, static_cast<JSHTMLFieldSetElementConstructor*>(object), propertyName, descriptor);
109 /* Hash table for prototype */
111 #define THUNK_GENERATOR(generator) , generator
113 #define THUNK_GENERATOR(generator)
116 #define INTRINSIC(intrinsic) , intrinsic
118 #define INTRINSIC(intrinsic)
121 static const HashTableValue JSHTMLFieldSetElementPrototypeTableValues[] =
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) }
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) };
132 JSObject* JSHTMLFieldSetElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
134 return getDOMPrototype<JSHTMLFieldSetElement>(exec, globalObject);
137 bool JSHTMLFieldSetElementPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
139 JSHTMLFieldSetElementPrototype* thisObject = jsCast<JSHTMLFieldSetElementPrototype*>(cell);
140 return getStaticFunctionSlot<JSObject>(exec, &JSHTMLFieldSetElementPrototypeTable, thisObject, propertyName, slot);
143 bool JSHTMLFieldSetElementPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
145 JSHTMLFieldSetElementPrototype* thisObject = jsCast<JSHTMLFieldSetElementPrototype*>(object);
146 return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLFieldSetElementPrototypeTable, thisObject, propertyName, descriptor);
149 const ClassInfo JSHTMLFieldSetElement::s_info = { "HTMLFieldSetElement", &JSHTMLElement::s_info, &JSHTMLFieldSetElementTable, 0 , CREATE_METHOD_TABLE(JSHTMLFieldSetElement) };
151 JSHTMLFieldSetElement::JSHTMLFieldSetElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLFieldSetElement> impl)
152 : JSHTMLElement(structure, globalObject, impl)
156 void JSHTMLFieldSetElement::finishCreation(JSGlobalData& globalData)
158 Base::finishCreation(globalData);
159 ASSERT(inherits(&s_info));
162 JSObject* JSHTMLFieldSetElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
164 return JSHTMLFieldSetElementPrototype::create(exec->globalData(), globalObject, JSHTMLFieldSetElementPrototype::createStructure(exec->globalData(), globalObject, JSHTMLElementPrototype::self(exec, globalObject)));
167 bool JSHTMLFieldSetElement::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
169 JSHTMLFieldSetElement* thisObject = jsCast<JSHTMLFieldSetElement*>(cell);
170 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
171 return getStaticValueSlot<JSHTMLFieldSetElement, Base>(exec, &JSHTMLFieldSetElementTable, thisObject, propertyName, slot);
174 bool JSHTMLFieldSetElement::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
176 JSHTMLFieldSetElement* thisObject = jsCast<JSHTMLFieldSetElement*>(object);
177 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
178 return getStaticValueDescriptor<JSHTMLFieldSetElement, Base>(exec, &JSHTMLFieldSetElementTable, thisObject, propertyName, descriptor);
181 JSValue jsHTMLFieldSetElementForm(ExecState* exec, JSValue slotBase, const Identifier&)
183 JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
185 HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
186 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->form()));
191 JSValue jsHTMLFieldSetElementValidity(ExecState* exec, JSValue slotBase, const Identifier&)
193 JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
195 HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
196 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->validity()));
201 JSValue jsHTMLFieldSetElementWillValidate(ExecState* exec, JSValue slotBase, const Identifier&)
203 JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
205 HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
206 JSValue result = jsBoolean(imp->willValidate());
211 JSValue jsHTMLFieldSetElementValidationMessage(ExecState* exec, JSValue slotBase, const Identifier&)
213 JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
215 HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
216 JSValue result = jsString(exec, imp->validationMessage());
221 JSValue jsHTMLFieldSetElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
223 JSHTMLFieldSetElement* domObject = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
224 return JSHTMLFieldSetElement::getConstructor(exec, domObject->globalObject());
227 JSValue JSHTMLFieldSetElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
229 return getDOMConstructor<JSHTMLFieldSetElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
232 EncodedJSValue JSC_HOST_CALL jsHTMLFieldSetElementPrototypeFunctionCheckValidity(ExecState* exec)
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());
241 JSC::JSValue result = jsBoolean(imp->checkValidity());
242 return JSValue::encode(result);
245 EncodedJSValue JSC_HOST_CALL jsHTMLFieldSetElementPrototypeFunctionSetCustomValidity(ExecState* exec)
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());