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