WebCore/generated/JSHTMLFieldSetElement.cpp
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     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 "HTMLFieldSetElement.h"
       
    25 #include "HTMLFormElement.h"
       
    26 #include "JSHTMLFormElement.h"
       
    27 #include "JSValidityState.h"
       
    28 #include "KURL.h"
       
    29 #include "ValidityState.h"
       
    30 #include <runtime/Error.h>
       
    31 #include <runtime/JSString.h>
       
    32 #include <wtf/GetPtr.h>
       
    33 
       
    34 using namespace JSC;
       
    35 
       
    36 namespace WebCore {
       
    37 
       
    38 ASSERT_CLASS_FITS_IN_CELL(JSHTMLFieldSetElement);
       
    39 
       
    40 /* Hash table */
       
    41 #if ENABLE(JIT)
       
    42 #define THUNK_GENERATOR(generator) , generator
       
    43 #else
       
    44 #define THUNK_GENERATOR(generator)
       
    45 #endif
       
    46 
       
    47 static const HashTableValue JSHTMLFieldSetElementTableValues[6] =
       
    48 {
       
    49     { "form", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementForm), (intptr_t)0 THUNK_GENERATOR(0) },
       
    50     { "validity", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementValidity), (intptr_t)0 THUNK_GENERATOR(0) },
       
    51     { "willValidate", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementWillValidate), (intptr_t)0 THUNK_GENERATOR(0) },
       
    52     { "validationMessage", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementValidationMessage), (intptr_t)0 THUNK_GENERATOR(0) },
       
    53     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    54     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    55 };
       
    56 
       
    57 #undef THUNK_GENERATOR
       
    58 static JSC_CONST_HASHTABLE HashTable JSHTMLFieldSetElementTable = { 16, 15, JSHTMLFieldSetElementTableValues, 0 };
       
    59 /* Hash table for constructor */
       
    60 #if ENABLE(JIT)
       
    61 #define THUNK_GENERATOR(generator) , generator
       
    62 #else
       
    63 #define THUNK_GENERATOR(generator)
       
    64 #endif
       
    65 
       
    66 static const HashTableValue JSHTMLFieldSetElementConstructorTableValues[1] =
       
    67 {
       
    68     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    69 };
       
    70 
       
    71 #undef THUNK_GENERATOR
       
    72 static JSC_CONST_HASHTABLE HashTable JSHTMLFieldSetElementConstructorTable = { 1, 0, JSHTMLFieldSetElementConstructorTableValues, 0 };
       
    73 class JSHTMLFieldSetElementConstructor : public DOMConstructorObject {
       
    74 public:
       
    75     JSHTMLFieldSetElementConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    76 
       
    77     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    78     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    79     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    80     static const JSC::ClassInfo s_info;
       
    81     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    82     {
       
    83         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    84     }
       
    85 protected:
       
    86     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    87 };
       
    88 
       
    89 const ClassInfo JSHTMLFieldSetElementConstructor::s_info = { "HTMLFieldSetElementConstructor", 0, &JSHTMLFieldSetElementConstructorTable, 0 };
       
    90 
       
    91 JSHTMLFieldSetElementConstructor::JSHTMLFieldSetElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    92     : DOMConstructorObject(JSHTMLFieldSetElementConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    93 {
       
    94     putDirect(exec->propertyNames().prototype, JSHTMLFieldSetElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    95 }
       
    96 
       
    97 bool JSHTMLFieldSetElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    98 {
       
    99     return getStaticValueSlot<JSHTMLFieldSetElementConstructor, DOMObject>(exec, &JSHTMLFieldSetElementConstructorTable, this, propertyName, slot);
       
   100 }
       
   101 
       
   102 bool JSHTMLFieldSetElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   103 {
       
   104     return getStaticValueDescriptor<JSHTMLFieldSetElementConstructor, DOMObject>(exec, &JSHTMLFieldSetElementConstructorTable, this, propertyName, descriptor);
       
   105 }
       
   106 
       
   107 /* Hash table for prototype */
       
   108 #if ENABLE(JIT)
       
   109 #define THUNK_GENERATOR(generator) , generator
       
   110 #else
       
   111 #define THUNK_GENERATOR(generator)
       
   112 #endif
       
   113 
       
   114 static const HashTableValue JSHTMLFieldSetElementPrototypeTableValues[3] =
       
   115 {
       
   116     { "checkValidity", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLFieldSetElementPrototypeFunctionCheckValidity), (intptr_t)0 THUNK_GENERATOR(0) },
       
   117     { "setCustomValidity", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLFieldSetElementPrototypeFunctionSetCustomValidity), (intptr_t)1 THUNK_GENERATOR(0) },
       
   118     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   119 };
       
   120 
       
   121 #undef THUNK_GENERATOR
       
   122 static JSC_CONST_HASHTABLE HashTable JSHTMLFieldSetElementPrototypeTable = { 4, 3, JSHTMLFieldSetElementPrototypeTableValues, 0 };
       
   123 const ClassInfo JSHTMLFieldSetElementPrototype::s_info = { "HTMLFieldSetElementPrototype", 0, &JSHTMLFieldSetElementPrototypeTable, 0 };
       
   124 
       
   125 JSObject* JSHTMLFieldSetElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   126 {
       
   127     return getDOMPrototype<JSHTMLFieldSetElement>(exec, globalObject);
       
   128 }
       
   129 
       
   130 bool JSHTMLFieldSetElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   131 {
       
   132     return getStaticFunctionSlot<JSObject>(exec, &JSHTMLFieldSetElementPrototypeTable, this, propertyName, slot);
       
   133 }
       
   134 
       
   135 bool JSHTMLFieldSetElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   136 {
       
   137     return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLFieldSetElementPrototypeTable, this, propertyName, descriptor);
       
   138 }
       
   139 
       
   140 const ClassInfo JSHTMLFieldSetElement::s_info = { "HTMLFieldSetElement", &JSHTMLElement::s_info, &JSHTMLFieldSetElementTable, 0 };
       
   141 
       
   142 JSHTMLFieldSetElement::JSHTMLFieldSetElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLFieldSetElement> impl)
       
   143     : JSHTMLElement(structure, globalObject, impl)
       
   144 {
       
   145 }
       
   146 
       
   147 JSObject* JSHTMLFieldSetElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   148 {
       
   149     return new (exec) JSHTMLFieldSetElementPrototype(globalObject, JSHTMLFieldSetElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject)));
       
   150 }
       
   151 
       
   152 bool JSHTMLFieldSetElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   153 {
       
   154     return getStaticValueSlot<JSHTMLFieldSetElement, Base>(exec, &JSHTMLFieldSetElementTable, this, propertyName, slot);
       
   155 }
       
   156 
       
   157 bool JSHTMLFieldSetElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   158 {
       
   159     return getStaticValueDescriptor<JSHTMLFieldSetElement, Base>(exec, &JSHTMLFieldSetElementTable, this, propertyName, descriptor);
       
   160 }
       
   161 
       
   162 JSValue jsHTMLFieldSetElementForm(ExecState* exec, JSValue slotBase, const Identifier&)
       
   163 {
       
   164     JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
       
   165     UNUSED_PARAM(exec);
       
   166     HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
       
   167     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->form()));
       
   168     return result;
       
   169 }
       
   170 
       
   171 JSValue jsHTMLFieldSetElementValidity(ExecState* exec, JSValue slotBase, const Identifier&)
       
   172 {
       
   173     JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
       
   174     UNUSED_PARAM(exec);
       
   175     HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
       
   176     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->validity()));
       
   177     return result;
       
   178 }
       
   179 
       
   180 JSValue jsHTMLFieldSetElementWillValidate(ExecState* exec, JSValue slotBase, const Identifier&)
       
   181 {
       
   182     JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
       
   183     UNUSED_PARAM(exec);
       
   184     HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
       
   185     JSValue result = jsBoolean(imp->willValidate());
       
   186     return result;
       
   187 }
       
   188 
       
   189 JSValue jsHTMLFieldSetElementValidationMessage(ExecState* exec, JSValue slotBase, const Identifier&)
       
   190 {
       
   191     JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
       
   192     UNUSED_PARAM(exec);
       
   193     HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
       
   194     JSValue result = jsString(exec, imp->validationMessage());
       
   195     return result;
       
   196 }
       
   197 
       
   198 JSValue jsHTMLFieldSetElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   199 {
       
   200     JSHTMLFieldSetElement* domObject = static_cast<JSHTMLFieldSetElement*>(asObject(slotBase));
       
   201     return JSHTMLFieldSetElement::getConstructor(exec, domObject->globalObject());
       
   202 }
       
   203 JSValue JSHTMLFieldSetElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   204 {
       
   205     return getDOMConstructor<JSHTMLFieldSetElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   206 }
       
   207 
       
   208 EncodedJSValue JSC_HOST_CALL jsHTMLFieldSetElementPrototypeFunctionCheckValidity(ExecState* exec)
       
   209 {
       
   210     JSValue thisValue = exec->hostThisValue();
       
   211     if (!thisValue.inherits(&JSHTMLFieldSetElement::s_info))
       
   212         return throwVMTypeError(exec);
       
   213     JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(thisValue));
       
   214     HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
       
   215 
       
   216 
       
   217     JSC::JSValue result = jsBoolean(imp->checkValidity());
       
   218     return JSValue::encode(result);
       
   219 }
       
   220 
       
   221 EncodedJSValue JSC_HOST_CALL jsHTMLFieldSetElementPrototypeFunctionSetCustomValidity(ExecState* exec)
       
   222 {
       
   223     JSValue thisValue = exec->hostThisValue();
       
   224     if (!thisValue.inherits(&JSHTMLFieldSetElement::s_info))
       
   225         return throwVMTypeError(exec);
       
   226     JSHTMLFieldSetElement* castedThis = static_cast<JSHTMLFieldSetElement*>(asObject(thisValue));
       
   227     HTMLFieldSetElement* imp = static_cast<HTMLFieldSetElement*>(castedThis->impl());
       
   228     const String& error = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
       
   229 
       
   230     imp->setCustomValidity(error);
       
   231     return JSValue::encode(jsUndefined());
       
   232 }
       
   233 
       
   234 
       
   235 }