WebCore/generated/JSElement.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 "JSElement.h"
       
    23 
       
    24 #include "Attr.h"
       
    25 #include "CSSMutableStyleDeclaration.h"
       
    26 #include "CSSStyleDeclaration.h"
       
    27 #include "ClientRect.h"
       
    28 #include "ClientRectList.h"
       
    29 #include "DOMStringMap.h"
       
    30 #include "Element.h"
       
    31 #include "EventListener.h"
       
    32 #include "JSAttr.h"
       
    33 #include "JSCSSStyleDeclaration.h"
       
    34 #include "JSClientRect.h"
       
    35 #include "JSClientRectList.h"
       
    36 #include "JSDOMStringMap.h"
       
    37 #include "JSElement.h"
       
    38 #include "JSEventListener.h"
       
    39 #include "JSNodeList.h"
       
    40 #include "KURL.h"
       
    41 #include "NameNodeList.h"
       
    42 #include "NodeList.h"
       
    43 #include <runtime/Error.h>
       
    44 #include <runtime/JSNumberCell.h>
       
    45 #include <runtime/JSString.h>
       
    46 #include <wtf/GetPtr.h>
       
    47 
       
    48 using namespace JSC;
       
    49 
       
    50 namespace WebCore {
       
    51 
       
    52 ASSERT_CLASS_FITS_IN_CELL(JSElement);
       
    53 
       
    54 /* Hash table */
       
    55 #if ENABLE(JIT)
       
    56 #define THUNK_GENERATOR(generator) , generator
       
    57 #else
       
    58 #define THUNK_GENERATOR(generator)
       
    59 #endif
       
    60 
       
    61 static const HashTableValue JSElementTableValues[69] =
       
    62 {
       
    63     { "tagName", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementTagName), (intptr_t)0 THUNK_GENERATOR(0) },
       
    64     { "style", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementStyle), (intptr_t)0 THUNK_GENERATOR(0) },
       
    65     { "offsetLeft", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOffsetLeft), (intptr_t)0 THUNK_GENERATOR(0) },
       
    66     { "offsetTop", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOffsetTop), (intptr_t)0 THUNK_GENERATOR(0) },
       
    67     { "offsetWidth", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOffsetWidth), (intptr_t)0 THUNK_GENERATOR(0) },
       
    68     { "offsetHeight", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOffsetHeight), (intptr_t)0 THUNK_GENERATOR(0) },
       
    69     { "offsetParent", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOffsetParent), (intptr_t)0 THUNK_GENERATOR(0) },
       
    70     { "clientLeft", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementClientLeft), (intptr_t)0 THUNK_GENERATOR(0) },
       
    71     { "clientTop", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementClientTop), (intptr_t)0 THUNK_GENERATOR(0) },
       
    72     { "clientWidth", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementClientWidth), (intptr_t)0 THUNK_GENERATOR(0) },
       
    73     { "clientHeight", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementClientHeight), (intptr_t)0 THUNK_GENERATOR(0) },
       
    74     { "scrollLeft", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementScrollLeft), (intptr_t)setJSElementScrollLeft THUNK_GENERATOR(0) },
       
    75     { "scrollTop", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementScrollTop), (intptr_t)setJSElementScrollTop THUNK_GENERATOR(0) },
       
    76     { "scrollWidth", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementScrollWidth), (intptr_t)0 THUNK_GENERATOR(0) },
       
    77     { "scrollHeight", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementScrollHeight), (intptr_t)0 THUNK_GENERATOR(0) },
       
    78     { "dataset", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementDataset), (intptr_t)0 THUNK_GENERATOR(0) },
       
    79     { "firstElementChild", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementFirstElementChild), (intptr_t)0 THUNK_GENERATOR(0) },
       
    80     { "lastElementChild", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementLastElementChild), (intptr_t)0 THUNK_GENERATOR(0) },
       
    81     { "previousElementSibling", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementPreviousElementSibling), (intptr_t)0 THUNK_GENERATOR(0) },
       
    82     { "nextElementSibling", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementNextElementSibling), (intptr_t)0 THUNK_GENERATOR(0) },
       
    83     { "childElementCount", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementChildElementCount), (intptr_t)0 THUNK_GENERATOR(0) },
       
    84     { "onabort", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnabort), (intptr_t)setJSElementOnabort THUNK_GENERATOR(0) },
       
    85     { "onblur", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnblur), (intptr_t)setJSElementOnblur THUNK_GENERATOR(0) },
       
    86     { "onchange", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnchange), (intptr_t)setJSElementOnchange THUNK_GENERATOR(0) },
       
    87     { "onclick", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnclick), (intptr_t)setJSElementOnclick THUNK_GENERATOR(0) },
       
    88     { "oncontextmenu", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOncontextmenu), (intptr_t)setJSElementOncontextmenu THUNK_GENERATOR(0) },
       
    89     { "ondblclick", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOndblclick), (intptr_t)setJSElementOndblclick THUNK_GENERATOR(0) },
       
    90     { "ondrag", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOndrag), (intptr_t)setJSElementOndrag THUNK_GENERATOR(0) },
       
    91     { "ondragend", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOndragend), (intptr_t)setJSElementOndragend THUNK_GENERATOR(0) },
       
    92     { "ondragenter", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOndragenter), (intptr_t)setJSElementOndragenter THUNK_GENERATOR(0) },
       
    93     { "ondragleave", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOndragleave), (intptr_t)setJSElementOndragleave THUNK_GENERATOR(0) },
       
    94     { "ondragover", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOndragover), (intptr_t)setJSElementOndragover THUNK_GENERATOR(0) },
       
    95     { "ondragstart", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOndragstart), (intptr_t)setJSElementOndragstart THUNK_GENERATOR(0) },
       
    96     { "ondrop", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOndrop), (intptr_t)setJSElementOndrop THUNK_GENERATOR(0) },
       
    97     { "onerror", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnerror), (intptr_t)setJSElementOnerror THUNK_GENERATOR(0) },
       
    98     { "onfocus", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnfocus), (intptr_t)setJSElementOnfocus THUNK_GENERATOR(0) },
       
    99     { "oninput", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOninput), (intptr_t)setJSElementOninput THUNK_GENERATOR(0) },
       
   100     { "oninvalid", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOninvalid), (intptr_t)setJSElementOninvalid THUNK_GENERATOR(0) },
       
   101     { "onkeydown", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnkeydown), (intptr_t)setJSElementOnkeydown THUNK_GENERATOR(0) },
       
   102     { "onkeypress", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnkeypress), (intptr_t)setJSElementOnkeypress THUNK_GENERATOR(0) },
       
   103     { "onkeyup", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnkeyup), (intptr_t)setJSElementOnkeyup THUNK_GENERATOR(0) },
       
   104     { "onload", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnload), (intptr_t)setJSElementOnload THUNK_GENERATOR(0) },
       
   105     { "onmousedown", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnmousedown), (intptr_t)setJSElementOnmousedown THUNK_GENERATOR(0) },
       
   106     { "onmousemove", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnmousemove), (intptr_t)setJSElementOnmousemove THUNK_GENERATOR(0) },
       
   107     { "onmouseout", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnmouseout), (intptr_t)setJSElementOnmouseout THUNK_GENERATOR(0) },
       
   108     { "onmouseover", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnmouseover), (intptr_t)setJSElementOnmouseover THUNK_GENERATOR(0) },
       
   109     { "onmouseup", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnmouseup), (intptr_t)setJSElementOnmouseup THUNK_GENERATOR(0) },
       
   110     { "onmousewheel", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnmousewheel), (intptr_t)setJSElementOnmousewheel THUNK_GENERATOR(0) },
       
   111     { "onscroll", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnscroll), (intptr_t)setJSElementOnscroll THUNK_GENERATOR(0) },
       
   112     { "onselect", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnselect), (intptr_t)setJSElementOnselect THUNK_GENERATOR(0) },
       
   113     { "onsubmit", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnsubmit), (intptr_t)setJSElementOnsubmit THUNK_GENERATOR(0) },
       
   114     { "onbeforecut", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnbeforecut), (intptr_t)setJSElementOnbeforecut THUNK_GENERATOR(0) },
       
   115     { "oncut", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOncut), (intptr_t)setJSElementOncut THUNK_GENERATOR(0) },
       
   116     { "onbeforecopy", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnbeforecopy), (intptr_t)setJSElementOnbeforecopy THUNK_GENERATOR(0) },
       
   117     { "oncopy", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOncopy), (intptr_t)setJSElementOncopy THUNK_GENERATOR(0) },
       
   118     { "onbeforepaste", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnbeforepaste), (intptr_t)setJSElementOnbeforepaste THUNK_GENERATOR(0) },
       
   119     { "onpaste", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnpaste), (intptr_t)setJSElementOnpaste THUNK_GENERATOR(0) },
       
   120     { "onreset", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnreset), (intptr_t)setJSElementOnreset THUNK_GENERATOR(0) },
       
   121     { "onsearch", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnsearch), (intptr_t)setJSElementOnsearch THUNK_GENERATOR(0) },
       
   122     { "onselectstart", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOnselectstart), (intptr_t)setJSElementOnselectstart THUNK_GENERATOR(0) },
       
   123 #if ENABLE(TOUCH_EVENTS)
       
   124     { "ontouchstart", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOntouchstart), (intptr_t)setJSElementOntouchstart THUNK_GENERATOR(0) },
       
   125 #endif
       
   126 #if ENABLE(TOUCH_EVENTS)
       
   127     { "ontouchmove", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOntouchmove), (intptr_t)setJSElementOntouchmove THUNK_GENERATOR(0) },
       
   128 #endif
       
   129 #if ENABLE(TOUCH_EVENTS)
       
   130     { "ontouchend", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOntouchend), (intptr_t)setJSElementOntouchend THUNK_GENERATOR(0) },
       
   131 #endif
       
   132 #if ENABLE(TOUCH_EVENTS)
       
   133     { "ontouchcancel", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOntouchcancel), (intptr_t)setJSElementOntouchcancel THUNK_GENERATOR(0) },
       
   134 #endif
       
   135 #if ENABLE(TRANSFORMACTION_EVENTS)
       
   136     { "ontransformactionstart", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOntransformactionstart), (intptr_t)setJSElementOntransformactionstart THUNK_GENERATOR(0) },
       
   137 #endif
       
   138 #if ENABLE(TRANSFORMACTION_EVENTS)
       
   139     { "ontransformactionupdate", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOntransformactionupdate), (intptr_t)setJSElementOntransformactionupdate THUNK_GENERATOR(0) },
       
   140 #endif
       
   141 #if ENABLE(TRANSFORMACTION_EVENTS)
       
   142     { "ontransformactionend", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementOntransformactionend), (intptr_t)setJSElementOntransformactionend THUNK_GENERATOR(0) },
       
   143 #endif
       
   144     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
   145     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   146 };
       
   147 
       
   148 #undef THUNK_GENERATOR
       
   149 static JSC_CONST_HASHTABLE HashTable JSElementTable = { 264, 255, JSElementTableValues, 0 };
       
   150 /* Hash table for constructor */
       
   151 #if ENABLE(JIT)
       
   152 #define THUNK_GENERATOR(generator) , generator
       
   153 #else
       
   154 #define THUNK_GENERATOR(generator)
       
   155 #endif
       
   156 
       
   157 static const HashTableValue JSElementConstructorTableValues[1] =
       
   158 {
       
   159     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   160 };
       
   161 
       
   162 #undef THUNK_GENERATOR
       
   163 static JSC_CONST_HASHTABLE HashTable JSElementConstructorTable = { 1, 0, JSElementConstructorTableValues, 0 };
       
   164 class JSElementConstructor : public DOMConstructorObject {
       
   165 public:
       
   166     JSElementConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
   167 
       
   168     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
   169     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
   170     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
   171     static const JSC::ClassInfo s_info;
       
   172     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
   173     {
       
   174         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
   175     }
       
   176 protected:
       
   177     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
   178 };
       
   179 
       
   180 const ClassInfo JSElementConstructor::s_info = { "ElementConstructor", 0, &JSElementConstructorTable, 0 };
       
   181 
       
   182 JSElementConstructor::JSElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
   183     : DOMConstructorObject(JSElementConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
   184 {
       
   185     putDirect(exec->propertyNames().prototype, JSElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
   186 }
       
   187 
       
   188 bool JSElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   189 {
       
   190     return getStaticValueSlot<JSElementConstructor, DOMObject>(exec, &JSElementConstructorTable, this, propertyName, slot);
       
   191 }
       
   192 
       
   193 bool JSElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   194 {
       
   195     return getStaticValueDescriptor<JSElementConstructor, DOMObject>(exec, &JSElementConstructorTable, this, propertyName, descriptor);
       
   196 }
       
   197 
       
   198 /* Hash table for prototype */
       
   199 #if ENABLE(JIT)
       
   200 #define THUNK_GENERATOR(generator) , generator
       
   201 #else
       
   202 #define THUNK_GENERATOR(generator)
       
   203 #endif
       
   204 
       
   205 static const HashTableValue JSElementPrototypeTableValues[29] =
       
   206 {
       
   207     { "getAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionGetAttribute), (intptr_t)1 THUNK_GENERATOR(0) },
       
   208     { "setAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionSetAttribute), (intptr_t)2 THUNK_GENERATOR(0) },
       
   209     { "removeAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionRemoveAttribute), (intptr_t)1 THUNK_GENERATOR(0) },
       
   210     { "getAttributeNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionGetAttributeNode), (intptr_t)1 THUNK_GENERATOR(0) },
       
   211     { "setAttributeNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionSetAttributeNode), (intptr_t)1 THUNK_GENERATOR(0) },
       
   212     { "removeAttributeNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionRemoveAttributeNode), (intptr_t)1 THUNK_GENERATOR(0) },
       
   213     { "getElementsByTagName", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionGetElementsByTagName), (intptr_t)1 THUNK_GENERATOR(0) },
       
   214     { "getAttributeNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionGetAttributeNS), (intptr_t)2 THUNK_GENERATOR(0) },
       
   215     { "setAttributeNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionSetAttributeNS), (intptr_t)3 THUNK_GENERATOR(0) },
       
   216     { "removeAttributeNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionRemoveAttributeNS), (intptr_t)2 THUNK_GENERATOR(0) },
       
   217     { "getElementsByTagNameNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionGetElementsByTagNameNS), (intptr_t)2 THUNK_GENERATOR(0) },
       
   218     { "getAttributeNodeNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionGetAttributeNodeNS), (intptr_t)2 THUNK_GENERATOR(0) },
       
   219     { "setAttributeNodeNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionSetAttributeNodeNS), (intptr_t)1 THUNK_GENERATOR(0) },
       
   220     { "hasAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionHasAttribute), (intptr_t)1 THUNK_GENERATOR(0) },
       
   221     { "hasAttributeNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionHasAttributeNS), (intptr_t)2 THUNK_GENERATOR(0) },
       
   222     { "focus", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionFocus), (intptr_t)0 THUNK_GENERATOR(0) },
       
   223     { "blur", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionBlur), (intptr_t)0 THUNK_GENERATOR(0) },
       
   224     { "scrollIntoView", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionScrollIntoView), (intptr_t)1 THUNK_GENERATOR(0) },
       
   225     { "contains", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionContains), (intptr_t)1 THUNK_GENERATOR(0) },
       
   226     { "scrollIntoViewIfNeeded", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionScrollIntoViewIfNeeded), (intptr_t)1 THUNK_GENERATOR(0) },
       
   227     { "scrollByLines", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionScrollByLines), (intptr_t)1 THUNK_GENERATOR(0) },
       
   228     { "scrollByPages", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionScrollByPages), (intptr_t)1 THUNK_GENERATOR(0) },
       
   229     { "getElementsByClassName", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionGetElementsByClassName), (intptr_t)1 THUNK_GENERATOR(0) },
       
   230     { "querySelector", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionQuerySelector), (intptr_t)1 THUNK_GENERATOR(0) },
       
   231     { "querySelectorAll", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionQuerySelectorAll), (intptr_t)1 THUNK_GENERATOR(0) },
       
   232     { "webkitMatchesSelector", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionWebkitMatchesSelector), (intptr_t)1 THUNK_GENERATOR(0) },
       
   233     { "getClientRects", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionGetClientRects), (intptr_t)0 THUNK_GENERATOR(0) },
       
   234     { "getBoundingClientRect", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsElementPrototypeFunctionGetBoundingClientRect), (intptr_t)0 THUNK_GENERATOR(0) },
       
   235     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   236 };
       
   237 
       
   238 #undef THUNK_GENERATOR
       
   239 static JSC_CONST_HASHTABLE HashTable JSElementPrototypeTable = { 69, 63, JSElementPrototypeTableValues, 0 };
       
   240 const ClassInfo JSElementPrototype::s_info = { "ElementPrototype", 0, &JSElementPrototypeTable, 0 };
       
   241 
       
   242 JSObject* JSElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   243 {
       
   244     return getDOMPrototype<JSElement>(exec, globalObject);
       
   245 }
       
   246 
       
   247 bool JSElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   248 {
       
   249     return getStaticFunctionSlot<JSObject>(exec, &JSElementPrototypeTable, this, propertyName, slot);
       
   250 }
       
   251 
       
   252 bool JSElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   253 {
       
   254     return getStaticFunctionDescriptor<JSObject>(exec, &JSElementPrototypeTable, this, propertyName, descriptor);
       
   255 }
       
   256 
       
   257 const ClassInfo JSElement::s_info = { "Element", &JSNode::s_info, &JSElementTable, 0 };
       
   258 
       
   259 JSElement::JSElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<Element> impl)
       
   260     : JSNode(structure, globalObject, impl)
       
   261 {
       
   262 }
       
   263 
       
   264 JSObject* JSElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   265 {
       
   266     return new (exec) JSElementPrototype(globalObject, JSElementPrototype::createStructure(JSNodePrototype::self(exec, globalObject)));
       
   267 }
       
   268 
       
   269 JSValue jsElementTagName(ExecState* exec, JSValue slotBase, const Identifier&)
       
   270 {
       
   271     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   272     UNUSED_PARAM(exec);
       
   273     Element* imp = static_cast<Element*>(castedThis->impl());
       
   274     JSValue result = jsStringOrNull(exec, imp->tagName());
       
   275     return result;
       
   276 }
       
   277 
       
   278 JSValue jsElementStyle(ExecState* exec, JSValue slotBase, const Identifier&)
       
   279 {
       
   280     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   281     UNUSED_PARAM(exec);
       
   282     Element* imp = static_cast<Element*>(castedThis->impl());
       
   283     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style()));
       
   284     return result;
       
   285 }
       
   286 
       
   287 JSValue jsElementOffsetLeft(ExecState* exec, JSValue slotBase, const Identifier&)
       
   288 {
       
   289     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   290     UNUSED_PARAM(exec);
       
   291     Element* imp = static_cast<Element*>(castedThis->impl());
       
   292     JSValue result = jsNumber(exec, imp->offsetLeft());
       
   293     return result;
       
   294 }
       
   295 
       
   296 JSValue jsElementOffsetTop(ExecState* exec, JSValue slotBase, const Identifier&)
       
   297 {
       
   298     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   299     UNUSED_PARAM(exec);
       
   300     Element* imp = static_cast<Element*>(castedThis->impl());
       
   301     JSValue result = jsNumber(exec, imp->offsetTop());
       
   302     return result;
       
   303 }
       
   304 
       
   305 JSValue jsElementOffsetWidth(ExecState* exec, JSValue slotBase, const Identifier&)
       
   306 {
       
   307     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   308     UNUSED_PARAM(exec);
       
   309     Element* imp = static_cast<Element*>(castedThis->impl());
       
   310     JSValue result = jsNumber(exec, imp->offsetWidth());
       
   311     return result;
       
   312 }
       
   313 
       
   314 JSValue jsElementOffsetHeight(ExecState* exec, JSValue slotBase, const Identifier&)
       
   315 {
       
   316     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   317     UNUSED_PARAM(exec);
       
   318     Element* imp = static_cast<Element*>(castedThis->impl());
       
   319     JSValue result = jsNumber(exec, imp->offsetHeight());
       
   320     return result;
       
   321 }
       
   322 
       
   323 JSValue jsElementOffsetParent(ExecState* exec, JSValue slotBase, const Identifier&)
       
   324 {
       
   325     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   326     UNUSED_PARAM(exec);
       
   327     Element* imp = static_cast<Element*>(castedThis->impl());
       
   328     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->offsetParent()));
       
   329     return result;
       
   330 }
       
   331 
       
   332 JSValue jsElementClientLeft(ExecState* exec, JSValue slotBase, const Identifier&)
       
   333 {
       
   334     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   335     UNUSED_PARAM(exec);
       
   336     Element* imp = static_cast<Element*>(castedThis->impl());
       
   337     JSValue result = jsNumber(exec, imp->clientLeft());
       
   338     return result;
       
   339 }
       
   340 
       
   341 JSValue jsElementClientTop(ExecState* exec, JSValue slotBase, const Identifier&)
       
   342 {
       
   343     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   344     UNUSED_PARAM(exec);
       
   345     Element* imp = static_cast<Element*>(castedThis->impl());
       
   346     JSValue result = jsNumber(exec, imp->clientTop());
       
   347     return result;
       
   348 }
       
   349 
       
   350 JSValue jsElementClientWidth(ExecState* exec, JSValue slotBase, const Identifier&)
       
   351 {
       
   352     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   353     UNUSED_PARAM(exec);
       
   354     Element* imp = static_cast<Element*>(castedThis->impl());
       
   355     JSValue result = jsNumber(exec, imp->clientWidth());
       
   356     return result;
       
   357 }
       
   358 
       
   359 JSValue jsElementClientHeight(ExecState* exec, JSValue slotBase, const Identifier&)
       
   360 {
       
   361     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   362     UNUSED_PARAM(exec);
       
   363     Element* imp = static_cast<Element*>(castedThis->impl());
       
   364     JSValue result = jsNumber(exec, imp->clientHeight());
       
   365     return result;
       
   366 }
       
   367 
       
   368 JSValue jsElementScrollLeft(ExecState* exec, JSValue slotBase, const Identifier&)
       
   369 {
       
   370     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   371     UNUSED_PARAM(exec);
       
   372     Element* imp = static_cast<Element*>(castedThis->impl());
       
   373     JSValue result = jsNumber(exec, imp->scrollLeft());
       
   374     return result;
       
   375 }
       
   376 
       
   377 JSValue jsElementScrollTop(ExecState* exec, JSValue slotBase, const Identifier&)
       
   378 {
       
   379     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   380     UNUSED_PARAM(exec);
       
   381     Element* imp = static_cast<Element*>(castedThis->impl());
       
   382     JSValue result = jsNumber(exec, imp->scrollTop());
       
   383     return result;
       
   384 }
       
   385 
       
   386 JSValue jsElementScrollWidth(ExecState* exec, JSValue slotBase, const Identifier&)
       
   387 {
       
   388     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   389     UNUSED_PARAM(exec);
       
   390     Element* imp = static_cast<Element*>(castedThis->impl());
       
   391     JSValue result = jsNumber(exec, imp->scrollWidth());
       
   392     return result;
       
   393 }
       
   394 
       
   395 JSValue jsElementScrollHeight(ExecState* exec, JSValue slotBase, const Identifier&)
       
   396 {
       
   397     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   398     UNUSED_PARAM(exec);
       
   399     Element* imp = static_cast<Element*>(castedThis->impl());
       
   400     JSValue result = jsNumber(exec, imp->scrollHeight());
       
   401     return result;
       
   402 }
       
   403 
       
   404 JSValue jsElementDataset(ExecState* exec, JSValue slotBase, const Identifier&)
       
   405 {
       
   406     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   407     UNUSED_PARAM(exec);
       
   408     Element* imp = static_cast<Element*>(castedThis->impl());
       
   409     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->dataset()));
       
   410     return result;
       
   411 }
       
   412 
       
   413 JSValue jsElementFirstElementChild(ExecState* exec, JSValue slotBase, const Identifier&)
       
   414 {
       
   415     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   416     UNUSED_PARAM(exec);
       
   417     Element* imp = static_cast<Element*>(castedThis->impl());
       
   418     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->firstElementChild()));
       
   419     return result;
       
   420 }
       
   421 
       
   422 JSValue jsElementLastElementChild(ExecState* exec, JSValue slotBase, const Identifier&)
       
   423 {
       
   424     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   425     UNUSED_PARAM(exec);
       
   426     Element* imp = static_cast<Element*>(castedThis->impl());
       
   427     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->lastElementChild()));
       
   428     return result;
       
   429 }
       
   430 
       
   431 JSValue jsElementPreviousElementSibling(ExecState* exec, JSValue slotBase, const Identifier&)
       
   432 {
       
   433     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   434     UNUSED_PARAM(exec);
       
   435     Element* imp = static_cast<Element*>(castedThis->impl());
       
   436     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->previousElementSibling()));
       
   437     return result;
       
   438 }
       
   439 
       
   440 JSValue jsElementNextElementSibling(ExecState* exec, JSValue slotBase, const Identifier&)
       
   441 {
       
   442     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   443     UNUSED_PARAM(exec);
       
   444     Element* imp = static_cast<Element*>(castedThis->impl());
       
   445     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->nextElementSibling()));
       
   446     return result;
       
   447 }
       
   448 
       
   449 JSValue jsElementChildElementCount(ExecState* exec, JSValue slotBase, const Identifier&)
       
   450 {
       
   451     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   452     UNUSED_PARAM(exec);
       
   453     Element* imp = static_cast<Element*>(castedThis->impl());
       
   454     JSValue result = jsNumber(exec, imp->childElementCount());
       
   455     return result;
       
   456 }
       
   457 
       
   458 JSValue jsElementOnabort(ExecState* exec, JSValue slotBase, const Identifier&)
       
   459 {
       
   460     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   461     UNUSED_PARAM(exec);
       
   462     Element* imp = static_cast<Element*>(castedThis->impl());
       
   463     if (EventListener* listener = imp->onabort()) {
       
   464         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   465             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   466                 return jsFunction;
       
   467         }
       
   468     }
       
   469     return jsNull();
       
   470 }
       
   471 
       
   472 JSValue jsElementOnblur(ExecState* exec, JSValue slotBase, const Identifier&)
       
   473 {
       
   474     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   475     UNUSED_PARAM(exec);
       
   476     Element* imp = static_cast<Element*>(castedThis->impl());
       
   477     if (EventListener* listener = imp->onblur()) {
       
   478         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   479             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   480                 return jsFunction;
       
   481         }
       
   482     }
       
   483     return jsNull();
       
   484 }
       
   485 
       
   486 JSValue jsElementOnchange(ExecState* exec, JSValue slotBase, const Identifier&)
       
   487 {
       
   488     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   489     UNUSED_PARAM(exec);
       
   490     Element* imp = static_cast<Element*>(castedThis->impl());
       
   491     if (EventListener* listener = imp->onchange()) {
       
   492         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   493             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   494                 return jsFunction;
       
   495         }
       
   496     }
       
   497     return jsNull();
       
   498 }
       
   499 
       
   500 JSValue jsElementOnclick(ExecState* exec, JSValue slotBase, const Identifier&)
       
   501 {
       
   502     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   503     UNUSED_PARAM(exec);
       
   504     Element* imp = static_cast<Element*>(castedThis->impl());
       
   505     if (EventListener* listener = imp->onclick()) {
       
   506         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   507             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   508                 return jsFunction;
       
   509         }
       
   510     }
       
   511     return jsNull();
       
   512 }
       
   513 
       
   514 JSValue jsElementOncontextmenu(ExecState* exec, JSValue slotBase, const Identifier&)
       
   515 {
       
   516     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   517     UNUSED_PARAM(exec);
       
   518     Element* imp = static_cast<Element*>(castedThis->impl());
       
   519     if (EventListener* listener = imp->oncontextmenu()) {
       
   520         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   521             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   522                 return jsFunction;
       
   523         }
       
   524     }
       
   525     return jsNull();
       
   526 }
       
   527 
       
   528 JSValue jsElementOndblclick(ExecState* exec, JSValue slotBase, const Identifier&)
       
   529 {
       
   530     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   531     UNUSED_PARAM(exec);
       
   532     Element* imp = static_cast<Element*>(castedThis->impl());
       
   533     if (EventListener* listener = imp->ondblclick()) {
       
   534         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   535             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   536                 return jsFunction;
       
   537         }
       
   538     }
       
   539     return jsNull();
       
   540 }
       
   541 
       
   542 JSValue jsElementOndrag(ExecState* exec, JSValue slotBase, const Identifier&)
       
   543 {
       
   544     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   545     UNUSED_PARAM(exec);
       
   546     Element* imp = static_cast<Element*>(castedThis->impl());
       
   547     if (EventListener* listener = imp->ondrag()) {
       
   548         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   549             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   550                 return jsFunction;
       
   551         }
       
   552     }
       
   553     return jsNull();
       
   554 }
       
   555 
       
   556 JSValue jsElementOndragend(ExecState* exec, JSValue slotBase, const Identifier&)
       
   557 {
       
   558     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   559     UNUSED_PARAM(exec);
       
   560     Element* imp = static_cast<Element*>(castedThis->impl());
       
   561     if (EventListener* listener = imp->ondragend()) {
       
   562         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   563             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   564                 return jsFunction;
       
   565         }
       
   566     }
       
   567     return jsNull();
       
   568 }
       
   569 
       
   570 JSValue jsElementOndragenter(ExecState* exec, JSValue slotBase, const Identifier&)
       
   571 {
       
   572     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   573     UNUSED_PARAM(exec);
       
   574     Element* imp = static_cast<Element*>(castedThis->impl());
       
   575     if (EventListener* listener = imp->ondragenter()) {
       
   576         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   577             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   578                 return jsFunction;
       
   579         }
       
   580     }
       
   581     return jsNull();
       
   582 }
       
   583 
       
   584 JSValue jsElementOndragleave(ExecState* exec, JSValue slotBase, const Identifier&)
       
   585 {
       
   586     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   587     UNUSED_PARAM(exec);
       
   588     Element* imp = static_cast<Element*>(castedThis->impl());
       
   589     if (EventListener* listener = imp->ondragleave()) {
       
   590         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   591             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   592                 return jsFunction;
       
   593         }
       
   594     }
       
   595     return jsNull();
       
   596 }
       
   597 
       
   598 JSValue jsElementOndragover(ExecState* exec, JSValue slotBase, const Identifier&)
       
   599 {
       
   600     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   601     UNUSED_PARAM(exec);
       
   602     Element* imp = static_cast<Element*>(castedThis->impl());
       
   603     if (EventListener* listener = imp->ondragover()) {
       
   604         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   605             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   606                 return jsFunction;
       
   607         }
       
   608     }
       
   609     return jsNull();
       
   610 }
       
   611 
       
   612 JSValue jsElementOndragstart(ExecState* exec, JSValue slotBase, const Identifier&)
       
   613 {
       
   614     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   615     UNUSED_PARAM(exec);
       
   616     Element* imp = static_cast<Element*>(castedThis->impl());
       
   617     if (EventListener* listener = imp->ondragstart()) {
       
   618         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   619             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   620                 return jsFunction;
       
   621         }
       
   622     }
       
   623     return jsNull();
       
   624 }
       
   625 
       
   626 JSValue jsElementOndrop(ExecState* exec, JSValue slotBase, const Identifier&)
       
   627 {
       
   628     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   629     UNUSED_PARAM(exec);
       
   630     Element* imp = static_cast<Element*>(castedThis->impl());
       
   631     if (EventListener* listener = imp->ondrop()) {
       
   632         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   633             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   634                 return jsFunction;
       
   635         }
       
   636     }
       
   637     return jsNull();
       
   638 }
       
   639 
       
   640 JSValue jsElementOnerror(ExecState* exec, JSValue slotBase, const Identifier&)
       
   641 {
       
   642     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   643     UNUSED_PARAM(exec);
       
   644     Element* imp = static_cast<Element*>(castedThis->impl());
       
   645     if (EventListener* listener = imp->onerror()) {
       
   646         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   647             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   648                 return jsFunction;
       
   649         }
       
   650     }
       
   651     return jsNull();
       
   652 }
       
   653 
       
   654 JSValue jsElementOnfocus(ExecState* exec, JSValue slotBase, const Identifier&)
       
   655 {
       
   656     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   657     UNUSED_PARAM(exec);
       
   658     Element* imp = static_cast<Element*>(castedThis->impl());
       
   659     if (EventListener* listener = imp->onfocus()) {
       
   660         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   661             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   662                 return jsFunction;
       
   663         }
       
   664     }
       
   665     return jsNull();
       
   666 }
       
   667 
       
   668 JSValue jsElementOninput(ExecState* exec, JSValue slotBase, const Identifier&)
       
   669 {
       
   670     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   671     UNUSED_PARAM(exec);
       
   672     Element* imp = static_cast<Element*>(castedThis->impl());
       
   673     if (EventListener* listener = imp->oninput()) {
       
   674         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   675             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   676                 return jsFunction;
       
   677         }
       
   678     }
       
   679     return jsNull();
       
   680 }
       
   681 
       
   682 JSValue jsElementOninvalid(ExecState* exec, JSValue slotBase, const Identifier&)
       
   683 {
       
   684     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   685     UNUSED_PARAM(exec);
       
   686     Element* imp = static_cast<Element*>(castedThis->impl());
       
   687     if (EventListener* listener = imp->oninvalid()) {
       
   688         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   689             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   690                 return jsFunction;
       
   691         }
       
   692     }
       
   693     return jsNull();
       
   694 }
       
   695 
       
   696 JSValue jsElementOnkeydown(ExecState* exec, JSValue slotBase, const Identifier&)
       
   697 {
       
   698     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   699     UNUSED_PARAM(exec);
       
   700     Element* imp = static_cast<Element*>(castedThis->impl());
       
   701     if (EventListener* listener = imp->onkeydown()) {
       
   702         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   703             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   704                 return jsFunction;
       
   705         }
       
   706     }
       
   707     return jsNull();
       
   708 }
       
   709 
       
   710 JSValue jsElementOnkeypress(ExecState* exec, JSValue slotBase, const Identifier&)
       
   711 {
       
   712     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   713     UNUSED_PARAM(exec);
       
   714     Element* imp = static_cast<Element*>(castedThis->impl());
       
   715     if (EventListener* listener = imp->onkeypress()) {
       
   716         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   717             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   718                 return jsFunction;
       
   719         }
       
   720     }
       
   721     return jsNull();
       
   722 }
       
   723 
       
   724 JSValue jsElementOnkeyup(ExecState* exec, JSValue slotBase, const Identifier&)
       
   725 {
       
   726     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   727     UNUSED_PARAM(exec);
       
   728     Element* imp = static_cast<Element*>(castedThis->impl());
       
   729     if (EventListener* listener = imp->onkeyup()) {
       
   730         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   731             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   732                 return jsFunction;
       
   733         }
       
   734     }
       
   735     return jsNull();
       
   736 }
       
   737 
       
   738 JSValue jsElementOnload(ExecState* exec, JSValue slotBase, const Identifier&)
       
   739 {
       
   740     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   741     UNUSED_PARAM(exec);
       
   742     Element* imp = static_cast<Element*>(castedThis->impl());
       
   743     if (EventListener* listener = imp->onload()) {
       
   744         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   745             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   746                 return jsFunction;
       
   747         }
       
   748     }
       
   749     return jsNull();
       
   750 }
       
   751 
       
   752 JSValue jsElementOnmousedown(ExecState* exec, JSValue slotBase, const Identifier&)
       
   753 {
       
   754     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   755     UNUSED_PARAM(exec);
       
   756     Element* imp = static_cast<Element*>(castedThis->impl());
       
   757     if (EventListener* listener = imp->onmousedown()) {
       
   758         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   759             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   760                 return jsFunction;
       
   761         }
       
   762     }
       
   763     return jsNull();
       
   764 }
       
   765 
       
   766 JSValue jsElementOnmousemove(ExecState* exec, JSValue slotBase, const Identifier&)
       
   767 {
       
   768     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   769     UNUSED_PARAM(exec);
       
   770     Element* imp = static_cast<Element*>(castedThis->impl());
       
   771     if (EventListener* listener = imp->onmousemove()) {
       
   772         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   773             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   774                 return jsFunction;
       
   775         }
       
   776     }
       
   777     return jsNull();
       
   778 }
       
   779 
       
   780 JSValue jsElementOnmouseout(ExecState* exec, JSValue slotBase, const Identifier&)
       
   781 {
       
   782     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   783     UNUSED_PARAM(exec);
       
   784     Element* imp = static_cast<Element*>(castedThis->impl());
       
   785     if (EventListener* listener = imp->onmouseout()) {
       
   786         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   787             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   788                 return jsFunction;
       
   789         }
       
   790     }
       
   791     return jsNull();
       
   792 }
       
   793 
       
   794 JSValue jsElementOnmouseover(ExecState* exec, JSValue slotBase, const Identifier&)
       
   795 {
       
   796     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   797     UNUSED_PARAM(exec);
       
   798     Element* imp = static_cast<Element*>(castedThis->impl());
       
   799     if (EventListener* listener = imp->onmouseover()) {
       
   800         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   801             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   802                 return jsFunction;
       
   803         }
       
   804     }
       
   805     return jsNull();
       
   806 }
       
   807 
       
   808 JSValue jsElementOnmouseup(ExecState* exec, JSValue slotBase, const Identifier&)
       
   809 {
       
   810     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   811     UNUSED_PARAM(exec);
       
   812     Element* imp = static_cast<Element*>(castedThis->impl());
       
   813     if (EventListener* listener = imp->onmouseup()) {
       
   814         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   815             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   816                 return jsFunction;
       
   817         }
       
   818     }
       
   819     return jsNull();
       
   820 }
       
   821 
       
   822 JSValue jsElementOnmousewheel(ExecState* exec, JSValue slotBase, const Identifier&)
       
   823 {
       
   824     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   825     UNUSED_PARAM(exec);
       
   826     Element* imp = static_cast<Element*>(castedThis->impl());
       
   827     if (EventListener* listener = imp->onmousewheel()) {
       
   828         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   829             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   830                 return jsFunction;
       
   831         }
       
   832     }
       
   833     return jsNull();
       
   834 }
       
   835 
       
   836 JSValue jsElementOnscroll(ExecState* exec, JSValue slotBase, const Identifier&)
       
   837 {
       
   838     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   839     UNUSED_PARAM(exec);
       
   840     Element* imp = static_cast<Element*>(castedThis->impl());
       
   841     if (EventListener* listener = imp->onscroll()) {
       
   842         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   843             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   844                 return jsFunction;
       
   845         }
       
   846     }
       
   847     return jsNull();
       
   848 }
       
   849 
       
   850 JSValue jsElementOnselect(ExecState* exec, JSValue slotBase, const Identifier&)
       
   851 {
       
   852     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   853     UNUSED_PARAM(exec);
       
   854     Element* imp = static_cast<Element*>(castedThis->impl());
       
   855     if (EventListener* listener = imp->onselect()) {
       
   856         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   857             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   858                 return jsFunction;
       
   859         }
       
   860     }
       
   861     return jsNull();
       
   862 }
       
   863 
       
   864 JSValue jsElementOnsubmit(ExecState* exec, JSValue slotBase, const Identifier&)
       
   865 {
       
   866     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   867     UNUSED_PARAM(exec);
       
   868     Element* imp = static_cast<Element*>(castedThis->impl());
       
   869     if (EventListener* listener = imp->onsubmit()) {
       
   870         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   871             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   872                 return jsFunction;
       
   873         }
       
   874     }
       
   875     return jsNull();
       
   876 }
       
   877 
       
   878 JSValue jsElementOnbeforecut(ExecState* exec, JSValue slotBase, const Identifier&)
       
   879 {
       
   880     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   881     UNUSED_PARAM(exec);
       
   882     Element* imp = static_cast<Element*>(castedThis->impl());
       
   883     if (EventListener* listener = imp->onbeforecut()) {
       
   884         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   885             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   886                 return jsFunction;
       
   887         }
       
   888     }
       
   889     return jsNull();
       
   890 }
       
   891 
       
   892 JSValue jsElementOncut(ExecState* exec, JSValue slotBase, const Identifier&)
       
   893 {
       
   894     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   895     UNUSED_PARAM(exec);
       
   896     Element* imp = static_cast<Element*>(castedThis->impl());
       
   897     if (EventListener* listener = imp->oncut()) {
       
   898         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   899             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   900                 return jsFunction;
       
   901         }
       
   902     }
       
   903     return jsNull();
       
   904 }
       
   905 
       
   906 JSValue jsElementOnbeforecopy(ExecState* exec, JSValue slotBase, const Identifier&)
       
   907 {
       
   908     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   909     UNUSED_PARAM(exec);
       
   910     Element* imp = static_cast<Element*>(castedThis->impl());
       
   911     if (EventListener* listener = imp->onbeforecopy()) {
       
   912         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   913             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   914                 return jsFunction;
       
   915         }
       
   916     }
       
   917     return jsNull();
       
   918 }
       
   919 
       
   920 JSValue jsElementOncopy(ExecState* exec, JSValue slotBase, const Identifier&)
       
   921 {
       
   922     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   923     UNUSED_PARAM(exec);
       
   924     Element* imp = static_cast<Element*>(castedThis->impl());
       
   925     if (EventListener* listener = imp->oncopy()) {
       
   926         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   927             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   928                 return jsFunction;
       
   929         }
       
   930     }
       
   931     return jsNull();
       
   932 }
       
   933 
       
   934 JSValue jsElementOnbeforepaste(ExecState* exec, JSValue slotBase, const Identifier&)
       
   935 {
       
   936     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   937     UNUSED_PARAM(exec);
       
   938     Element* imp = static_cast<Element*>(castedThis->impl());
       
   939     if (EventListener* listener = imp->onbeforepaste()) {
       
   940         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   941             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   942                 return jsFunction;
       
   943         }
       
   944     }
       
   945     return jsNull();
       
   946 }
       
   947 
       
   948 JSValue jsElementOnpaste(ExecState* exec, JSValue slotBase, const Identifier&)
       
   949 {
       
   950     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   951     UNUSED_PARAM(exec);
       
   952     Element* imp = static_cast<Element*>(castedThis->impl());
       
   953     if (EventListener* listener = imp->onpaste()) {
       
   954         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   955             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   956                 return jsFunction;
       
   957         }
       
   958     }
       
   959     return jsNull();
       
   960 }
       
   961 
       
   962 JSValue jsElementOnreset(ExecState* exec, JSValue slotBase, const Identifier&)
       
   963 {
       
   964     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   965     UNUSED_PARAM(exec);
       
   966     Element* imp = static_cast<Element*>(castedThis->impl());
       
   967     if (EventListener* listener = imp->onreset()) {
       
   968         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   969             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   970                 return jsFunction;
       
   971         }
       
   972     }
       
   973     return jsNull();
       
   974 }
       
   975 
       
   976 JSValue jsElementOnsearch(ExecState* exec, JSValue slotBase, const Identifier&)
       
   977 {
       
   978     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   979     UNUSED_PARAM(exec);
       
   980     Element* imp = static_cast<Element*>(castedThis->impl());
       
   981     if (EventListener* listener = imp->onsearch()) {
       
   982         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   983             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   984                 return jsFunction;
       
   985         }
       
   986     }
       
   987     return jsNull();
       
   988 }
       
   989 
       
   990 JSValue jsElementOnselectstart(ExecState* exec, JSValue slotBase, const Identifier&)
       
   991 {
       
   992     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
   993     UNUSED_PARAM(exec);
       
   994     Element* imp = static_cast<Element*>(castedThis->impl());
       
   995     if (EventListener* listener = imp->onselectstart()) {
       
   996         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   997             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
   998                 return jsFunction;
       
   999         }
       
  1000     }
       
  1001     return jsNull();
       
  1002 }
       
  1003 
       
  1004 #if ENABLE(TOUCH_EVENTS)
       
  1005 JSValue jsElementOntouchstart(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1006 {
       
  1007     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
  1008     UNUSED_PARAM(exec);
       
  1009     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1010     if (EventListener* listener = imp->ontouchstart()) {
       
  1011         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1012             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
  1013                 return jsFunction;
       
  1014         }
       
  1015     }
       
  1016     return jsNull();
       
  1017 }
       
  1018 #endif
       
  1019 
       
  1020 #if ENABLE(TOUCH_EVENTS)
       
  1021 JSValue jsElementOntouchmove(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1022 {
       
  1023     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
  1024     UNUSED_PARAM(exec);
       
  1025     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1026     if (EventListener* listener = imp->ontouchmove()) {
       
  1027         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1028             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
  1029                 return jsFunction;
       
  1030         }
       
  1031     }
       
  1032     return jsNull();
       
  1033 }
       
  1034 #endif
       
  1035 
       
  1036 #if ENABLE(TOUCH_EVENTS)
       
  1037 JSValue jsElementOntouchend(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1038 {
       
  1039     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
  1040     UNUSED_PARAM(exec);
       
  1041     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1042     if (EventListener* listener = imp->ontouchend()) {
       
  1043         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1044             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
  1045                 return jsFunction;
       
  1046         }
       
  1047     }
       
  1048     return jsNull();
       
  1049 }
       
  1050 #endif
       
  1051 
       
  1052 #if ENABLE(TOUCH_EVENTS)
       
  1053 JSValue jsElementOntouchcancel(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1054 {
       
  1055     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
  1056     UNUSED_PARAM(exec);
       
  1057     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1058     if (EventListener* listener = imp->ontouchcancel()) {
       
  1059         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1060             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
  1061                 return jsFunction;
       
  1062         }
       
  1063     }
       
  1064     return jsNull();
       
  1065 }
       
  1066 #endif
       
  1067 
       
  1068 #if ENABLE(TRANSFORMACTION_EVENTS)
       
  1069 JSValue jsElementOntransformactionstart(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1070 {
       
  1071     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
  1072     UNUSED_PARAM(exec);
       
  1073     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1074     if (EventListener* listener = imp->ontransformactionstart()) {
       
  1075         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1076             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
  1077                 return jsFunction;
       
  1078         }
       
  1079     }
       
  1080     return jsNull();
       
  1081 }
       
  1082 #endif
       
  1083 
       
  1084 #if ENABLE(TRANSFORMACTION_EVENTS)
       
  1085 JSValue jsElementOntransformactionupdate(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1086 {
       
  1087     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
  1088     UNUSED_PARAM(exec);
       
  1089     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1090     if (EventListener* listener = imp->ontransformactionupdate()) {
       
  1091         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1092             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
  1093                 return jsFunction;
       
  1094         }
       
  1095     }
       
  1096     return jsNull();
       
  1097 }
       
  1098 #endif
       
  1099 
       
  1100 #if ENABLE(TRANSFORMACTION_EVENTS)
       
  1101 JSValue jsElementOntransformactionend(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1102 {
       
  1103     JSElement* castedThis = static_cast<JSElement*>(asObject(slotBase));
       
  1104     UNUSED_PARAM(exec);
       
  1105     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1106     if (EventListener* listener = imp->ontransformactionend()) {
       
  1107         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1108             if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext()))
       
  1109                 return jsFunction;
       
  1110         }
       
  1111     }
       
  1112     return jsNull();
       
  1113 }
       
  1114 #endif
       
  1115 
       
  1116 JSValue jsElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1117 {
       
  1118     JSElement* domObject = static_cast<JSElement*>(asObject(slotBase));
       
  1119     return JSElement::getConstructor(exec, domObject->globalObject());
       
  1120 }
       
  1121 void JSElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
       
  1122 {
       
  1123     lookupPut<JSElement, Base>(exec, propertyName, value, &JSElementTable, this, slot);
       
  1124 }
       
  1125 
       
  1126 void setJSElementScrollLeft(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1127 {
       
  1128     JSElement* castedThis = static_cast<JSElement*>(thisObject);
       
  1129     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1130     imp->setScrollLeft(value.toInt32(exec));
       
  1131 }
       
  1132 
       
  1133 void setJSElementScrollTop(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1134 {
       
  1135     JSElement* castedThis = static_cast<JSElement*>(thisObject);
       
  1136     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1137     imp->setScrollTop(value.toInt32(exec));
       
  1138 }
       
  1139 
       
  1140 void setJSElementOnabort(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1141 {
       
  1142     UNUSED_PARAM(exec);
       
  1143     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1144     imp->setOnabort(createJSAttributeEventListener(exec, value, thisObject));
       
  1145 }
       
  1146 
       
  1147 void setJSElementOnblur(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1148 {
       
  1149     UNUSED_PARAM(exec);
       
  1150     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1151     imp->setOnblur(createJSAttributeEventListener(exec, value, thisObject));
       
  1152 }
       
  1153 
       
  1154 void setJSElementOnchange(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1155 {
       
  1156     UNUSED_PARAM(exec);
       
  1157     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1158     imp->setOnchange(createJSAttributeEventListener(exec, value, thisObject));
       
  1159 }
       
  1160 
       
  1161 void setJSElementOnclick(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1162 {
       
  1163     UNUSED_PARAM(exec);
       
  1164     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1165     imp->setOnclick(createJSAttributeEventListener(exec, value, thisObject));
       
  1166 }
       
  1167 
       
  1168 void setJSElementOncontextmenu(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1169 {
       
  1170     UNUSED_PARAM(exec);
       
  1171     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1172     imp->setOncontextmenu(createJSAttributeEventListener(exec, value, thisObject));
       
  1173 }
       
  1174 
       
  1175 void setJSElementOndblclick(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1176 {
       
  1177     UNUSED_PARAM(exec);
       
  1178     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1179     imp->setOndblclick(createJSAttributeEventListener(exec, value, thisObject));
       
  1180 }
       
  1181 
       
  1182 void setJSElementOndrag(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1183 {
       
  1184     UNUSED_PARAM(exec);
       
  1185     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1186     imp->setOndrag(createJSAttributeEventListener(exec, value, thisObject));
       
  1187 }
       
  1188 
       
  1189 void setJSElementOndragend(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1190 {
       
  1191     UNUSED_PARAM(exec);
       
  1192     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1193     imp->setOndragend(createJSAttributeEventListener(exec, value, thisObject));
       
  1194 }
       
  1195 
       
  1196 void setJSElementOndragenter(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1197 {
       
  1198     UNUSED_PARAM(exec);
       
  1199     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1200     imp->setOndragenter(createJSAttributeEventListener(exec, value, thisObject));
       
  1201 }
       
  1202 
       
  1203 void setJSElementOndragleave(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1204 {
       
  1205     UNUSED_PARAM(exec);
       
  1206     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1207     imp->setOndragleave(createJSAttributeEventListener(exec, value, thisObject));
       
  1208 }
       
  1209 
       
  1210 void setJSElementOndragover(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1211 {
       
  1212     UNUSED_PARAM(exec);
       
  1213     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1214     imp->setOndragover(createJSAttributeEventListener(exec, value, thisObject));
       
  1215 }
       
  1216 
       
  1217 void setJSElementOndragstart(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1218 {
       
  1219     UNUSED_PARAM(exec);
       
  1220     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1221     imp->setOndragstart(createJSAttributeEventListener(exec, value, thisObject));
       
  1222 }
       
  1223 
       
  1224 void setJSElementOndrop(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1225 {
       
  1226     UNUSED_PARAM(exec);
       
  1227     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1228     imp->setOndrop(createJSAttributeEventListener(exec, value, thisObject));
       
  1229 }
       
  1230 
       
  1231 void setJSElementOnerror(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1232 {
       
  1233     UNUSED_PARAM(exec);
       
  1234     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1235     imp->setOnerror(createJSAttributeEventListener(exec, value, thisObject));
       
  1236 }
       
  1237 
       
  1238 void setJSElementOnfocus(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1239 {
       
  1240     UNUSED_PARAM(exec);
       
  1241     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1242     imp->setOnfocus(createJSAttributeEventListener(exec, value, thisObject));
       
  1243 }
       
  1244 
       
  1245 void setJSElementOninput(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1246 {
       
  1247     UNUSED_PARAM(exec);
       
  1248     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1249     imp->setOninput(createJSAttributeEventListener(exec, value, thisObject));
       
  1250 }
       
  1251 
       
  1252 void setJSElementOninvalid(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1253 {
       
  1254     UNUSED_PARAM(exec);
       
  1255     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1256     imp->setOninvalid(createJSAttributeEventListener(exec, value, thisObject));
       
  1257 }
       
  1258 
       
  1259 void setJSElementOnkeydown(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1260 {
       
  1261     UNUSED_PARAM(exec);
       
  1262     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1263     imp->setOnkeydown(createJSAttributeEventListener(exec, value, thisObject));
       
  1264 }
       
  1265 
       
  1266 void setJSElementOnkeypress(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1267 {
       
  1268     UNUSED_PARAM(exec);
       
  1269     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1270     imp->setOnkeypress(createJSAttributeEventListener(exec, value, thisObject));
       
  1271 }
       
  1272 
       
  1273 void setJSElementOnkeyup(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1274 {
       
  1275     UNUSED_PARAM(exec);
       
  1276     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1277     imp->setOnkeyup(createJSAttributeEventListener(exec, value, thisObject));
       
  1278 }
       
  1279 
       
  1280 void setJSElementOnload(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1281 {
       
  1282     UNUSED_PARAM(exec);
       
  1283     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1284     imp->setOnload(createJSAttributeEventListener(exec, value, thisObject));
       
  1285 }
       
  1286 
       
  1287 void setJSElementOnmousedown(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1288 {
       
  1289     UNUSED_PARAM(exec);
       
  1290     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1291     imp->setOnmousedown(createJSAttributeEventListener(exec, value, thisObject));
       
  1292 }
       
  1293 
       
  1294 void setJSElementOnmousemove(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1295 {
       
  1296     UNUSED_PARAM(exec);
       
  1297     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1298     imp->setOnmousemove(createJSAttributeEventListener(exec, value, thisObject));
       
  1299 }
       
  1300 
       
  1301 void setJSElementOnmouseout(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1302 {
       
  1303     UNUSED_PARAM(exec);
       
  1304     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1305     imp->setOnmouseout(createJSAttributeEventListener(exec, value, thisObject));
       
  1306 }
       
  1307 
       
  1308 void setJSElementOnmouseover(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1309 {
       
  1310     UNUSED_PARAM(exec);
       
  1311     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1312     imp->setOnmouseover(createJSAttributeEventListener(exec, value, thisObject));
       
  1313 }
       
  1314 
       
  1315 void setJSElementOnmouseup(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1316 {
       
  1317     UNUSED_PARAM(exec);
       
  1318     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1319     imp->setOnmouseup(createJSAttributeEventListener(exec, value, thisObject));
       
  1320 }
       
  1321 
       
  1322 void setJSElementOnmousewheel(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1323 {
       
  1324     UNUSED_PARAM(exec);
       
  1325     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1326     imp->setOnmousewheel(createJSAttributeEventListener(exec, value, thisObject));
       
  1327 }
       
  1328 
       
  1329 void setJSElementOnscroll(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1330 {
       
  1331     UNUSED_PARAM(exec);
       
  1332     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1333     imp->setOnscroll(createJSAttributeEventListener(exec, value, thisObject));
       
  1334 }
       
  1335 
       
  1336 void setJSElementOnselect(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1337 {
       
  1338     UNUSED_PARAM(exec);
       
  1339     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1340     imp->setOnselect(createJSAttributeEventListener(exec, value, thisObject));
       
  1341 }
       
  1342 
       
  1343 void setJSElementOnsubmit(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1344 {
       
  1345     UNUSED_PARAM(exec);
       
  1346     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1347     imp->setOnsubmit(createJSAttributeEventListener(exec, value, thisObject));
       
  1348 }
       
  1349 
       
  1350 void setJSElementOnbeforecut(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1351 {
       
  1352     UNUSED_PARAM(exec);
       
  1353     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1354     imp->setOnbeforecut(createJSAttributeEventListener(exec, value, thisObject));
       
  1355 }
       
  1356 
       
  1357 void setJSElementOncut(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1358 {
       
  1359     UNUSED_PARAM(exec);
       
  1360     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1361     imp->setOncut(createJSAttributeEventListener(exec, value, thisObject));
       
  1362 }
       
  1363 
       
  1364 void setJSElementOnbeforecopy(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1365 {
       
  1366     UNUSED_PARAM(exec);
       
  1367     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1368     imp->setOnbeforecopy(createJSAttributeEventListener(exec, value, thisObject));
       
  1369 }
       
  1370 
       
  1371 void setJSElementOncopy(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1372 {
       
  1373     UNUSED_PARAM(exec);
       
  1374     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1375     imp->setOncopy(createJSAttributeEventListener(exec, value, thisObject));
       
  1376 }
       
  1377 
       
  1378 void setJSElementOnbeforepaste(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1379 {
       
  1380     UNUSED_PARAM(exec);
       
  1381     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1382     imp->setOnbeforepaste(createJSAttributeEventListener(exec, value, thisObject));
       
  1383 }
       
  1384 
       
  1385 void setJSElementOnpaste(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1386 {
       
  1387     UNUSED_PARAM(exec);
       
  1388     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1389     imp->setOnpaste(createJSAttributeEventListener(exec, value, thisObject));
       
  1390 }
       
  1391 
       
  1392 void setJSElementOnreset(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1393 {
       
  1394     UNUSED_PARAM(exec);
       
  1395     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1396     imp->setOnreset(createJSAttributeEventListener(exec, value, thisObject));
       
  1397 }
       
  1398 
       
  1399 void setJSElementOnsearch(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1400 {
       
  1401     UNUSED_PARAM(exec);
       
  1402     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1403     imp->setOnsearch(createJSAttributeEventListener(exec, value, thisObject));
       
  1404 }
       
  1405 
       
  1406 void setJSElementOnselectstart(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1407 {
       
  1408     UNUSED_PARAM(exec);
       
  1409     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1410     imp->setOnselectstart(createJSAttributeEventListener(exec, value, thisObject));
       
  1411 }
       
  1412 
       
  1413 #if ENABLE(TOUCH_EVENTS)
       
  1414 void setJSElementOntouchstart(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1415 {
       
  1416     UNUSED_PARAM(exec);
       
  1417     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1418     imp->setOntouchstart(createJSAttributeEventListener(exec, value, thisObject));
       
  1419 }
       
  1420 #endif
       
  1421 
       
  1422 #if ENABLE(TOUCH_EVENTS)
       
  1423 void setJSElementOntouchmove(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1424 {
       
  1425     UNUSED_PARAM(exec);
       
  1426     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1427     imp->setOntouchmove(createJSAttributeEventListener(exec, value, thisObject));
       
  1428 }
       
  1429 #endif
       
  1430 
       
  1431 #if ENABLE(TOUCH_EVENTS)
       
  1432 void setJSElementOntouchend(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1433 {
       
  1434     UNUSED_PARAM(exec);
       
  1435     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1436     imp->setOntouchend(createJSAttributeEventListener(exec, value, thisObject));
       
  1437 }
       
  1438 #endif
       
  1439 
       
  1440 #if ENABLE(TOUCH_EVENTS)
       
  1441 void setJSElementOntouchcancel(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1442 {
       
  1443     UNUSED_PARAM(exec);
       
  1444     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1445     imp->setOntouchcancel(createJSAttributeEventListener(exec, value, thisObject));
       
  1446 }
       
  1447 #endif
       
  1448 
       
  1449 #if ENABLE(TRANSFORMACTION_EVENTS)
       
  1450 void setJSElementOntransformactionstart(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1451 {
       
  1452     UNUSED_PARAM(exec);
       
  1453     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1454     imp->setOntransformactionstart(createJSAttributeEventListener(exec, value, thisObject));
       
  1455 }
       
  1456 #endif
       
  1457 
       
  1458 #if ENABLE(TRANSFORMACTION_EVENTS)
       
  1459 void setJSElementOntransformactionupdate(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1460 {
       
  1461     UNUSED_PARAM(exec);
       
  1462     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1463     imp->setOntransformactionupdate(createJSAttributeEventListener(exec, value, thisObject));
       
  1464 }
       
  1465 #endif
       
  1466 
       
  1467 #if ENABLE(TRANSFORMACTION_EVENTS)
       
  1468 void setJSElementOntransformactionend(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1469 {
       
  1470     UNUSED_PARAM(exec);
       
  1471     Element* imp = static_cast<Element*>(static_cast<JSElement*>(thisObject)->impl());
       
  1472     imp->setOntransformactionend(createJSAttributeEventListener(exec, value, thisObject));
       
  1473 }
       
  1474 #endif
       
  1475 
       
  1476 JSValue JSElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
  1477 {
       
  1478     return getDOMConstructor<JSElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
  1479 }
       
  1480 
       
  1481 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionGetAttribute(ExecState* exec)
       
  1482 {
       
  1483     JSValue thisValue = exec->hostThisValue();
       
  1484     if (!thisValue.inherits(&JSElement::s_info))
       
  1485         return throwVMTypeError(exec);
       
  1486     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1487     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1488     const String& name = ustringToString(exec->argument(0).toString(exec));
       
  1489 
       
  1490 
       
  1491     JSC::JSValue result = jsStringOrNull(exec, imp->getAttribute(name));
       
  1492     return JSValue::encode(result);
       
  1493 }
       
  1494 
       
  1495 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionSetAttribute(ExecState* exec)
       
  1496 {
       
  1497     JSValue thisValue = exec->hostThisValue();
       
  1498     if (!thisValue.inherits(&JSElement::s_info))
       
  1499         return throwVMTypeError(exec);
       
  1500     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1501     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1502     ExceptionCode ec = 0;
       
  1503     const String& name = ustringToString(exec->argument(0).toString(exec));
       
  1504     const String& value = ustringToString(exec->argument(1).toString(exec));
       
  1505 
       
  1506     imp->setAttribute(name, value, ec);
       
  1507     setDOMException(exec, ec);
       
  1508     return JSValue::encode(jsUndefined());
       
  1509 }
       
  1510 
       
  1511 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionRemoveAttribute(ExecState* exec)
       
  1512 {
       
  1513     JSValue thisValue = exec->hostThisValue();
       
  1514     if (!thisValue.inherits(&JSElement::s_info))
       
  1515         return throwVMTypeError(exec);
       
  1516     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1517     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1518     ExceptionCode ec = 0;
       
  1519     const String& name = ustringToString(exec->argument(0).toString(exec));
       
  1520 
       
  1521     imp->removeAttribute(name, ec);
       
  1522     setDOMException(exec, ec);
       
  1523     return JSValue::encode(jsUndefined());
       
  1524 }
       
  1525 
       
  1526 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionGetAttributeNode(ExecState* exec)
       
  1527 {
       
  1528     JSValue thisValue = exec->hostThisValue();
       
  1529     if (!thisValue.inherits(&JSElement::s_info))
       
  1530         return throwVMTypeError(exec);
       
  1531     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1532     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1533     const String& name = ustringToString(exec->argument(0).toString(exec));
       
  1534 
       
  1535 
       
  1536     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getAttributeNode(name)));
       
  1537     return JSValue::encode(result);
       
  1538 }
       
  1539 
       
  1540 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionSetAttributeNode(ExecState* exec)
       
  1541 {
       
  1542     JSValue thisValue = exec->hostThisValue();
       
  1543     if (!thisValue.inherits(&JSElement::s_info))
       
  1544         return throwVMTypeError(exec);
       
  1545     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1546     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1547     ExceptionCode ec = 0;
       
  1548     Attr* newAttr = toAttr(exec->argument(0));
       
  1549 
       
  1550 
       
  1551     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->setAttributeNode(newAttr, ec)));
       
  1552     setDOMException(exec, ec);
       
  1553     return JSValue::encode(result);
       
  1554 }
       
  1555 
       
  1556 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionRemoveAttributeNode(ExecState* exec)
       
  1557 {
       
  1558     JSValue thisValue = exec->hostThisValue();
       
  1559     if (!thisValue.inherits(&JSElement::s_info))
       
  1560         return throwVMTypeError(exec);
       
  1561     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1562     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1563     ExceptionCode ec = 0;
       
  1564     Attr* oldAttr = toAttr(exec->argument(0));
       
  1565 
       
  1566 
       
  1567     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->removeAttributeNode(oldAttr, ec)));
       
  1568     setDOMException(exec, ec);
       
  1569     return JSValue::encode(result);
       
  1570 }
       
  1571 
       
  1572 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionGetElementsByTagName(ExecState* exec)
       
  1573 {
       
  1574     JSValue thisValue = exec->hostThisValue();
       
  1575     if (!thisValue.inherits(&JSElement::s_info))
       
  1576         return throwVMTypeError(exec);
       
  1577     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1578     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1579     const String& name = ustringToString(exec->argument(0).toString(exec));
       
  1580 
       
  1581 
       
  1582     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getElementsByTagName(name)));
       
  1583     return JSValue::encode(result);
       
  1584 }
       
  1585 
       
  1586 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionGetAttributeNS(ExecState* exec)
       
  1587 {
       
  1588     JSValue thisValue = exec->hostThisValue();
       
  1589     if (!thisValue.inherits(&JSElement::s_info))
       
  1590         return throwVMTypeError(exec);
       
  1591     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1592     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1593     const String& namespaceURI = valueToStringWithNullCheck(exec, exec->argument(0));
       
  1594     const String& localName = ustringToString(exec->argument(1).toString(exec));
       
  1595 
       
  1596 
       
  1597     JSC::JSValue result = jsString(exec, imp->getAttributeNS(namespaceURI, localName));
       
  1598     return JSValue::encode(result);
       
  1599 }
       
  1600 
       
  1601 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionSetAttributeNS(ExecState* exec)
       
  1602 {
       
  1603     JSValue thisValue = exec->hostThisValue();
       
  1604     if (!thisValue.inherits(&JSElement::s_info))
       
  1605         return throwVMTypeError(exec);
       
  1606     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1607     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1608     ExceptionCode ec = 0;
       
  1609     const String& namespaceURI = valueToStringWithNullCheck(exec, exec->argument(0));
       
  1610     const String& qualifiedName = ustringToString(exec->argument(1).toString(exec));
       
  1611     const String& value = ustringToString(exec->argument(2).toString(exec));
       
  1612 
       
  1613     imp->setAttributeNS(namespaceURI, qualifiedName, value, ec);
       
  1614     setDOMException(exec, ec);
       
  1615     return JSValue::encode(jsUndefined());
       
  1616 }
       
  1617 
       
  1618 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionRemoveAttributeNS(ExecState* exec)
       
  1619 {
       
  1620     JSValue thisValue = exec->hostThisValue();
       
  1621     if (!thisValue.inherits(&JSElement::s_info))
       
  1622         return throwVMTypeError(exec);
       
  1623     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1624     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1625     ExceptionCode ec = 0;
       
  1626     const String& namespaceURI = valueToStringWithNullCheck(exec, exec->argument(0));
       
  1627     const String& localName = ustringToString(exec->argument(1).toString(exec));
       
  1628 
       
  1629     imp->removeAttributeNS(namespaceURI, localName, ec);
       
  1630     setDOMException(exec, ec);
       
  1631     return JSValue::encode(jsUndefined());
       
  1632 }
       
  1633 
       
  1634 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionGetElementsByTagNameNS(ExecState* exec)
       
  1635 {
       
  1636     JSValue thisValue = exec->hostThisValue();
       
  1637     if (!thisValue.inherits(&JSElement::s_info))
       
  1638         return throwVMTypeError(exec);
       
  1639     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1640     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1641     const String& namespaceURI = valueToStringWithNullCheck(exec, exec->argument(0));
       
  1642     const String& localName = ustringToString(exec->argument(1).toString(exec));
       
  1643 
       
  1644 
       
  1645     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getElementsByTagNameNS(namespaceURI, localName)));
       
  1646     return JSValue::encode(result);
       
  1647 }
       
  1648 
       
  1649 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionGetAttributeNodeNS(ExecState* exec)
       
  1650 {
       
  1651     JSValue thisValue = exec->hostThisValue();
       
  1652     if (!thisValue.inherits(&JSElement::s_info))
       
  1653         return throwVMTypeError(exec);
       
  1654     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1655     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1656     const String& namespaceURI = valueToStringWithNullCheck(exec, exec->argument(0));
       
  1657     const String& localName = ustringToString(exec->argument(1).toString(exec));
       
  1658 
       
  1659 
       
  1660     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getAttributeNodeNS(namespaceURI, localName)));
       
  1661     return JSValue::encode(result);
       
  1662 }
       
  1663 
       
  1664 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionSetAttributeNodeNS(ExecState* exec)
       
  1665 {
       
  1666     JSValue thisValue = exec->hostThisValue();
       
  1667     if (!thisValue.inherits(&JSElement::s_info))
       
  1668         return throwVMTypeError(exec);
       
  1669     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1670     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1671     ExceptionCode ec = 0;
       
  1672     Attr* newAttr = toAttr(exec->argument(0));
       
  1673 
       
  1674 
       
  1675     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->setAttributeNodeNS(newAttr, ec)));
       
  1676     setDOMException(exec, ec);
       
  1677     return JSValue::encode(result);
       
  1678 }
       
  1679 
       
  1680 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionHasAttribute(ExecState* exec)
       
  1681 {
       
  1682     JSValue thisValue = exec->hostThisValue();
       
  1683     if (!thisValue.inherits(&JSElement::s_info))
       
  1684         return throwVMTypeError(exec);
       
  1685     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1686     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1687     const String& name = ustringToString(exec->argument(0).toString(exec));
       
  1688 
       
  1689 
       
  1690     JSC::JSValue result = jsBoolean(imp->hasAttribute(name));
       
  1691     return JSValue::encode(result);
       
  1692 }
       
  1693 
       
  1694 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionHasAttributeNS(ExecState* exec)
       
  1695 {
       
  1696     JSValue thisValue = exec->hostThisValue();
       
  1697     if (!thisValue.inherits(&JSElement::s_info))
       
  1698         return throwVMTypeError(exec);
       
  1699     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1700     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1701     const String& namespaceURI = valueToStringWithNullCheck(exec, exec->argument(0));
       
  1702     const String& localName = ustringToString(exec->argument(1).toString(exec));
       
  1703 
       
  1704 
       
  1705     JSC::JSValue result = jsBoolean(imp->hasAttributeNS(namespaceURI, localName));
       
  1706     return JSValue::encode(result);
       
  1707 }
       
  1708 
       
  1709 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionFocus(ExecState* exec)
       
  1710 {
       
  1711     JSValue thisValue = exec->hostThisValue();
       
  1712     if (!thisValue.inherits(&JSElement::s_info))
       
  1713         return throwVMTypeError(exec);
       
  1714     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1715     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1716 
       
  1717     imp->focus();
       
  1718     return JSValue::encode(jsUndefined());
       
  1719 }
       
  1720 
       
  1721 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionBlur(ExecState* exec)
       
  1722 {
       
  1723     JSValue thisValue = exec->hostThisValue();
       
  1724     if (!thisValue.inherits(&JSElement::s_info))
       
  1725         return throwVMTypeError(exec);
       
  1726     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1727     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1728 
       
  1729     imp->blur();
       
  1730     return JSValue::encode(jsUndefined());
       
  1731 }
       
  1732 
       
  1733 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionScrollIntoView(ExecState* exec)
       
  1734 {
       
  1735     JSValue thisValue = exec->hostThisValue();
       
  1736     if (!thisValue.inherits(&JSElement::s_info))
       
  1737         return throwVMTypeError(exec);
       
  1738     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1739     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1740 
       
  1741     int argsCount = exec->argumentCount();
       
  1742     if (argsCount < 1) {
       
  1743         imp->scrollIntoView();
       
  1744         return JSValue::encode(jsUndefined());
       
  1745     }
       
  1746 
       
  1747     bool alignWithTop = exec->argument(0).toBoolean(exec);
       
  1748 
       
  1749     imp->scrollIntoView(alignWithTop);
       
  1750     return JSValue::encode(jsUndefined());
       
  1751 }
       
  1752 
       
  1753 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionContains(ExecState* exec)
       
  1754 {
       
  1755     JSValue thisValue = exec->hostThisValue();
       
  1756     if (!thisValue.inherits(&JSElement::s_info))
       
  1757         return throwVMTypeError(exec);
       
  1758     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1759     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1760     Element* element = toElement(exec->argument(0));
       
  1761 
       
  1762 
       
  1763     JSC::JSValue result = jsBoolean(imp->contains(element));
       
  1764     return JSValue::encode(result);
       
  1765 }
       
  1766 
       
  1767 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionScrollIntoViewIfNeeded(ExecState* exec)
       
  1768 {
       
  1769     JSValue thisValue = exec->hostThisValue();
       
  1770     if (!thisValue.inherits(&JSElement::s_info))
       
  1771         return throwVMTypeError(exec);
       
  1772     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1773     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1774 
       
  1775     int argsCount = exec->argumentCount();
       
  1776     if (argsCount < 1) {
       
  1777         imp->scrollIntoViewIfNeeded();
       
  1778         return JSValue::encode(jsUndefined());
       
  1779     }
       
  1780 
       
  1781     bool centerIfNeeded = exec->argument(0).toBoolean(exec);
       
  1782 
       
  1783     imp->scrollIntoViewIfNeeded(centerIfNeeded);
       
  1784     return JSValue::encode(jsUndefined());
       
  1785 }
       
  1786 
       
  1787 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionScrollByLines(ExecState* exec)
       
  1788 {
       
  1789     JSValue thisValue = exec->hostThisValue();
       
  1790     if (!thisValue.inherits(&JSElement::s_info))
       
  1791         return throwVMTypeError(exec);
       
  1792     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1793     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1794     int lines = exec->argument(0).toInt32(exec);
       
  1795 
       
  1796     imp->scrollByLines(lines);
       
  1797     return JSValue::encode(jsUndefined());
       
  1798 }
       
  1799 
       
  1800 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionScrollByPages(ExecState* exec)
       
  1801 {
       
  1802     JSValue thisValue = exec->hostThisValue();
       
  1803     if (!thisValue.inherits(&JSElement::s_info))
       
  1804         return throwVMTypeError(exec);
       
  1805     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1806     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1807     int pages = exec->argument(0).toInt32(exec);
       
  1808 
       
  1809     imp->scrollByPages(pages);
       
  1810     return JSValue::encode(jsUndefined());
       
  1811 }
       
  1812 
       
  1813 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionGetElementsByClassName(ExecState* exec)
       
  1814 {
       
  1815     JSValue thisValue = exec->hostThisValue();
       
  1816     if (!thisValue.inherits(&JSElement::s_info))
       
  1817         return throwVMTypeError(exec);
       
  1818     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1819     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1820     const String& name = ustringToString(exec->argument(0).toString(exec));
       
  1821 
       
  1822 
       
  1823     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getElementsByClassName(name)));
       
  1824     return JSValue::encode(result);
       
  1825 }
       
  1826 
       
  1827 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionQuerySelector(ExecState* exec)
       
  1828 {
       
  1829     JSValue thisValue = exec->hostThisValue();
       
  1830     if (!thisValue.inherits(&JSElement::s_info))
       
  1831         return throwVMTypeError(exec);
       
  1832     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1833     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1834     ExceptionCode ec = 0;
       
  1835     const String& selectors = ustringToString(exec->argument(0).toString(exec));
       
  1836 
       
  1837 
       
  1838     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->querySelector(selectors, ec)));
       
  1839     setDOMException(exec, ec);
       
  1840     return JSValue::encode(result);
       
  1841 }
       
  1842 
       
  1843 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionQuerySelectorAll(ExecState* exec)
       
  1844 {
       
  1845     JSValue thisValue = exec->hostThisValue();
       
  1846     if (!thisValue.inherits(&JSElement::s_info))
       
  1847         return throwVMTypeError(exec);
       
  1848     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1849     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1850     ExceptionCode ec = 0;
       
  1851     const String& selectors = ustringToString(exec->argument(0).toString(exec));
       
  1852 
       
  1853 
       
  1854     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->querySelectorAll(selectors, ec)));
       
  1855     setDOMException(exec, ec);
       
  1856     return JSValue::encode(result);
       
  1857 }
       
  1858 
       
  1859 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionWebkitMatchesSelector(ExecState* exec)
       
  1860 {
       
  1861     JSValue thisValue = exec->hostThisValue();
       
  1862     if (!thisValue.inherits(&JSElement::s_info))
       
  1863         return throwVMTypeError(exec);
       
  1864     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1865     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1866     ExceptionCode ec = 0;
       
  1867     const String& selectors = ustringToString(exec->argument(0).toString(exec));
       
  1868 
       
  1869 
       
  1870     JSC::JSValue result = jsBoolean(imp->webkitMatchesSelector(selectors, ec));
       
  1871     setDOMException(exec, ec);
       
  1872     return JSValue::encode(result);
       
  1873 }
       
  1874 
       
  1875 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionGetClientRects(ExecState* exec)
       
  1876 {
       
  1877     JSValue thisValue = exec->hostThisValue();
       
  1878     if (!thisValue.inherits(&JSElement::s_info))
       
  1879         return throwVMTypeError(exec);
       
  1880     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1881     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1882 
       
  1883 
       
  1884     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getClientRects()));
       
  1885     return JSValue::encode(result);
       
  1886 }
       
  1887 
       
  1888 EncodedJSValue JSC_HOST_CALL jsElementPrototypeFunctionGetBoundingClientRect(ExecState* exec)
       
  1889 {
       
  1890     JSValue thisValue = exec->hostThisValue();
       
  1891     if (!thisValue.inherits(&JSElement::s_info))
       
  1892         return throwVMTypeError(exec);
       
  1893     JSElement* castedThis = static_cast<JSElement*>(asObject(thisValue));
       
  1894     Element* imp = static_cast<Element*>(castedThis->impl());
       
  1895 
       
  1896 
       
  1897     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getBoundingClientRect()));
       
  1898     return JSValue::encode(result);
       
  1899 }
       
  1900 
       
  1901 Element* toElement(JSC::JSValue value)
       
  1902 {
       
  1903     return value.inherits(&JSElement::s_info) ? static_cast<JSElement*>(asObject(value))->impl() : 0;
       
  1904 }
       
  1905 
       
  1906 }