WebCore/generated/JSHTMLTableRowElement.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 "JSHTMLTableRowElement.h"
       
    23 
       
    24 #include "HTMLCollection.h"
       
    25 #include "HTMLElement.h"
       
    26 #include "HTMLNames.h"
       
    27 #include "HTMLTableRowElement.h"
       
    28 #include "JSHTMLCollection.h"
       
    29 #include "JSHTMLElement.h"
       
    30 #include "KURL.h"
       
    31 #include <runtime/Error.h>
       
    32 #include <runtime/JSNumberCell.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(JSHTMLTableRowElement);
       
    41 
       
    42 /* Hash table */
       
    43 #if ENABLE(JIT)
       
    44 #define THUNK_GENERATOR(generator) , generator
       
    45 #else
       
    46 #define THUNK_GENERATOR(generator)
       
    47 #endif
       
    48 
       
    49 static const HashTableValue JSHTMLTableRowElementTableValues[10] =
       
    50 {
       
    51     { "rowIndex", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableRowElementRowIndex), (intptr_t)0 THUNK_GENERATOR(0) },
       
    52     { "sectionRowIndex", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableRowElementSectionRowIndex), (intptr_t)0 THUNK_GENERATOR(0) },
       
    53     { "cells", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableRowElementCells), (intptr_t)0 THUNK_GENERATOR(0) },
       
    54     { "align", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableRowElementAlign), (intptr_t)setJSHTMLTableRowElementAlign THUNK_GENERATOR(0) },
       
    55     { "bgColor", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableRowElementBgColor), (intptr_t)setJSHTMLTableRowElementBgColor THUNK_GENERATOR(0) },
       
    56     { "ch", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableRowElementCh), (intptr_t)setJSHTMLTableRowElementCh THUNK_GENERATOR(0) },
       
    57     { "chOff", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableRowElementChOff), (intptr_t)setJSHTMLTableRowElementChOff THUNK_GENERATOR(0) },
       
    58     { "vAlign", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableRowElementVAlign), (intptr_t)setJSHTMLTableRowElementVAlign THUNK_GENERATOR(0) },
       
    59     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableRowElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    60     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    61 };
       
    62 
       
    63 #undef THUNK_GENERATOR
       
    64 static JSC_CONST_HASHTABLE HashTable JSHTMLTableRowElementTable = { 33, 31, JSHTMLTableRowElementTableValues, 0 };
       
    65 /* Hash table for constructor */
       
    66 #if ENABLE(JIT)
       
    67 #define THUNK_GENERATOR(generator) , generator
       
    68 #else
       
    69 #define THUNK_GENERATOR(generator)
       
    70 #endif
       
    71 
       
    72 static const HashTableValue JSHTMLTableRowElementConstructorTableValues[1] =
       
    73 {
       
    74     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    75 };
       
    76 
       
    77 #undef THUNK_GENERATOR
       
    78 static JSC_CONST_HASHTABLE HashTable JSHTMLTableRowElementConstructorTable = { 1, 0, JSHTMLTableRowElementConstructorTableValues, 0 };
       
    79 class JSHTMLTableRowElementConstructor : public DOMConstructorObject {
       
    80 public:
       
    81     JSHTMLTableRowElementConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    82 
       
    83     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    84     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    85     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    86     static const JSC::ClassInfo s_info;
       
    87     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    88     {
       
    89         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    90     }
       
    91 protected:
       
    92     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    93 };
       
    94 
       
    95 const ClassInfo JSHTMLTableRowElementConstructor::s_info = { "HTMLTableRowElementConstructor", 0, &JSHTMLTableRowElementConstructorTable, 0 };
       
    96 
       
    97 JSHTMLTableRowElementConstructor::JSHTMLTableRowElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    98     : DOMConstructorObject(JSHTMLTableRowElementConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    99 {
       
   100     putDirect(exec->propertyNames().prototype, JSHTMLTableRowElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
   101 }
       
   102 
       
   103 bool JSHTMLTableRowElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   104 {
       
   105     return getStaticValueSlot<JSHTMLTableRowElementConstructor, DOMObject>(exec, &JSHTMLTableRowElementConstructorTable, this, propertyName, slot);
       
   106 }
       
   107 
       
   108 bool JSHTMLTableRowElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   109 {
       
   110     return getStaticValueDescriptor<JSHTMLTableRowElementConstructor, DOMObject>(exec, &JSHTMLTableRowElementConstructorTable, this, propertyName, descriptor);
       
   111 }
       
   112 
       
   113 /* Hash table for prototype */
       
   114 #if ENABLE(JIT)
       
   115 #define THUNK_GENERATOR(generator) , generator
       
   116 #else
       
   117 #define THUNK_GENERATOR(generator)
       
   118 #endif
       
   119 
       
   120 static const HashTableValue JSHTMLTableRowElementPrototypeTableValues[3] =
       
   121 {
       
   122     { "insertCell", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLTableRowElementPrototypeFunctionInsertCell), (intptr_t)1 THUNK_GENERATOR(0) },
       
   123     { "deleteCell", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLTableRowElementPrototypeFunctionDeleteCell), (intptr_t)1 THUNK_GENERATOR(0) },
       
   124     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   125 };
       
   126 
       
   127 #undef THUNK_GENERATOR
       
   128 static JSC_CONST_HASHTABLE HashTable JSHTMLTableRowElementPrototypeTable = { 4, 3, JSHTMLTableRowElementPrototypeTableValues, 0 };
       
   129 const ClassInfo JSHTMLTableRowElementPrototype::s_info = { "HTMLTableRowElementPrototype", 0, &JSHTMLTableRowElementPrototypeTable, 0 };
       
   130 
       
   131 JSObject* JSHTMLTableRowElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   132 {
       
   133     return getDOMPrototype<JSHTMLTableRowElement>(exec, globalObject);
       
   134 }
       
   135 
       
   136 bool JSHTMLTableRowElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   137 {
       
   138     return getStaticFunctionSlot<JSObject>(exec, &JSHTMLTableRowElementPrototypeTable, this, propertyName, slot);
       
   139 }
       
   140 
       
   141 bool JSHTMLTableRowElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   142 {
       
   143     return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLTableRowElementPrototypeTable, this, propertyName, descriptor);
       
   144 }
       
   145 
       
   146 const ClassInfo JSHTMLTableRowElement::s_info = { "HTMLTableRowElement", &JSHTMLElement::s_info, &JSHTMLTableRowElementTable, 0 };
       
   147 
       
   148 JSHTMLTableRowElement::JSHTMLTableRowElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLTableRowElement> impl)
       
   149     : JSHTMLElement(structure, globalObject, impl)
       
   150 {
       
   151 }
       
   152 
       
   153 JSObject* JSHTMLTableRowElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   154 {
       
   155     return new (exec) JSHTMLTableRowElementPrototype(globalObject, JSHTMLTableRowElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject)));
       
   156 }
       
   157 
       
   158 bool JSHTMLTableRowElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   159 {
       
   160     return getStaticValueSlot<JSHTMLTableRowElement, Base>(exec, &JSHTMLTableRowElementTable, this, propertyName, slot);
       
   161 }
       
   162 
       
   163 bool JSHTMLTableRowElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   164 {
       
   165     return getStaticValueDescriptor<JSHTMLTableRowElement, Base>(exec, &JSHTMLTableRowElementTable, this, propertyName, descriptor);
       
   166 }
       
   167 
       
   168 JSValue jsHTMLTableRowElementRowIndex(ExecState* exec, JSValue slotBase, const Identifier&)
       
   169 {
       
   170     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(asObject(slotBase));
       
   171     UNUSED_PARAM(exec);
       
   172     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   173     JSValue result = jsNumber(exec, imp->rowIndex());
       
   174     return result;
       
   175 }
       
   176 
       
   177 JSValue jsHTMLTableRowElementSectionRowIndex(ExecState* exec, JSValue slotBase, const Identifier&)
       
   178 {
       
   179     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(asObject(slotBase));
       
   180     UNUSED_PARAM(exec);
       
   181     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   182     JSValue result = jsNumber(exec, imp->sectionRowIndex());
       
   183     return result;
       
   184 }
       
   185 
       
   186 JSValue jsHTMLTableRowElementCells(ExecState* exec, JSValue slotBase, const Identifier&)
       
   187 {
       
   188     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(asObject(slotBase));
       
   189     UNUSED_PARAM(exec);
       
   190     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   191     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->cells()));
       
   192     return result;
       
   193 }
       
   194 
       
   195 JSValue jsHTMLTableRowElementAlign(ExecState* exec, JSValue slotBase, const Identifier&)
       
   196 {
       
   197     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(asObject(slotBase));
       
   198     UNUSED_PARAM(exec);
       
   199     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   200     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::alignAttr));
       
   201     return result;
       
   202 }
       
   203 
       
   204 JSValue jsHTMLTableRowElementBgColor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   205 {
       
   206     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(asObject(slotBase));
       
   207     UNUSED_PARAM(exec);
       
   208     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   209     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::bgcolorAttr));
       
   210     return result;
       
   211 }
       
   212 
       
   213 JSValue jsHTMLTableRowElementCh(ExecState* exec, JSValue slotBase, const Identifier&)
       
   214 {
       
   215     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(asObject(slotBase));
       
   216     UNUSED_PARAM(exec);
       
   217     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   218     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::charAttr));
       
   219     return result;
       
   220 }
       
   221 
       
   222 JSValue jsHTMLTableRowElementChOff(ExecState* exec, JSValue slotBase, const Identifier&)
       
   223 {
       
   224     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(asObject(slotBase));
       
   225     UNUSED_PARAM(exec);
       
   226     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   227     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::charoffAttr));
       
   228     return result;
       
   229 }
       
   230 
       
   231 JSValue jsHTMLTableRowElementVAlign(ExecState* exec, JSValue slotBase, const Identifier&)
       
   232 {
       
   233     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(asObject(slotBase));
       
   234     UNUSED_PARAM(exec);
       
   235     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   236     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::valignAttr));
       
   237     return result;
       
   238 }
       
   239 
       
   240 JSValue jsHTMLTableRowElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   241 {
       
   242     JSHTMLTableRowElement* domObject = static_cast<JSHTMLTableRowElement*>(asObject(slotBase));
       
   243     return JSHTMLTableRowElement::getConstructor(exec, domObject->globalObject());
       
   244 }
       
   245 void JSHTMLTableRowElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
       
   246 {
       
   247     lookupPut<JSHTMLTableRowElement, Base>(exec, propertyName, value, &JSHTMLTableRowElementTable, this, slot);
       
   248 }
       
   249 
       
   250 void setJSHTMLTableRowElementAlign(ExecState* exec, JSObject* thisObject, JSValue value)
       
   251 {
       
   252     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(thisObject);
       
   253     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   254     imp->setAttribute(WebCore::HTMLNames::alignAttr, valueToStringWithNullCheck(exec, value));
       
   255 }
       
   256 
       
   257 void setJSHTMLTableRowElementBgColor(ExecState* exec, JSObject* thisObject, JSValue value)
       
   258 {
       
   259     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(thisObject);
       
   260     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   261     imp->setAttribute(WebCore::HTMLNames::bgcolorAttr, valueToStringWithNullCheck(exec, value));
       
   262 }
       
   263 
       
   264 void setJSHTMLTableRowElementCh(ExecState* exec, JSObject* thisObject, JSValue value)
       
   265 {
       
   266     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(thisObject);
       
   267     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   268     imp->setAttribute(WebCore::HTMLNames::charAttr, valueToStringWithNullCheck(exec, value));
       
   269 }
       
   270 
       
   271 void setJSHTMLTableRowElementChOff(ExecState* exec, JSObject* thisObject, JSValue value)
       
   272 {
       
   273     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(thisObject);
       
   274     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   275     imp->setAttribute(WebCore::HTMLNames::charoffAttr, valueToStringWithNullCheck(exec, value));
       
   276 }
       
   277 
       
   278 void setJSHTMLTableRowElementVAlign(ExecState* exec, JSObject* thisObject, JSValue value)
       
   279 {
       
   280     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(thisObject);
       
   281     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   282     imp->setAttribute(WebCore::HTMLNames::valignAttr, valueToStringWithNullCheck(exec, value));
       
   283 }
       
   284 
       
   285 JSValue JSHTMLTableRowElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   286 {
       
   287     return getDOMConstructor<JSHTMLTableRowElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   288 }
       
   289 
       
   290 EncodedJSValue JSC_HOST_CALL jsHTMLTableRowElementPrototypeFunctionInsertCell(ExecState* exec)
       
   291 {
       
   292     JSValue thisValue = exec->hostThisValue();
       
   293     if (!thisValue.inherits(&JSHTMLTableRowElement::s_info))
       
   294         return throwVMTypeError(exec);
       
   295     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(asObject(thisValue));
       
   296     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   297     ExceptionCode ec = 0;
       
   298     int index = exec->argument(0).toInt32(exec);
       
   299 
       
   300 
       
   301     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->insertCell(index, ec)));
       
   302     setDOMException(exec, ec);
       
   303     return JSValue::encode(result);
       
   304 }
       
   305 
       
   306 EncodedJSValue JSC_HOST_CALL jsHTMLTableRowElementPrototypeFunctionDeleteCell(ExecState* exec)
       
   307 {
       
   308     JSValue thisValue = exec->hostThisValue();
       
   309     if (!thisValue.inherits(&JSHTMLTableRowElement::s_info))
       
   310         return throwVMTypeError(exec);
       
   311     JSHTMLTableRowElement* castedThis = static_cast<JSHTMLTableRowElement*>(asObject(thisValue));
       
   312     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThis->impl());
       
   313     ExceptionCode ec = 0;
       
   314     int index = exec->argument(0).toInt32(exec);
       
   315 
       
   316     imp->deleteCell(index, ec);
       
   317     setDOMException(exec, ec);
       
   318     return JSValue::encode(jsUndefined());
       
   319 }
       
   320 
       
   321 
       
   322 }