WebCore/generated/JSDocument.cpp
changeset 0 4f2f89ce4247
child 2 303757a437d3
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 "JSDocument.h"
       
    23 
       
    24 #include "Attr.h"
       
    25 #include "CDATASection.h"
       
    26 #include "CSSMutableStyleDeclaration.h"
       
    27 #include "CSSStyleDeclaration.h"
       
    28 #include "Comment.h"
       
    29 #include "DOMImplementation.h"
       
    30 #include "DOMSelection.h"
       
    31 #include "DOMWindow.h"
       
    32 #include "Document.h"
       
    33 #include "DocumentFragment.h"
       
    34 #include "DocumentType.h"
       
    35 #include "Element.h"
       
    36 #include "EntityReference.h"
       
    37 #include "Event.h"
       
    38 #include "EventListener.h"
       
    39 #include "HTMLCollection.h"
       
    40 #include "HTMLElement.h"
       
    41 #include "HTMLHeadElement.h"
       
    42 #include "JSAttr.h"
       
    43 #include "JSCDATASection.h"
       
    44 #include "JSCSSStyleDeclaration.h"
       
    45 #include "JSCanvasRenderingContext2D.h"
       
    46 #include "JSComment.h"
       
    47 #include "JSCustomXPathNSResolver.h"
       
    48 #include "JSDOMImplementation.h"
       
    49 #include "JSDOMSelection.h"
       
    50 #include "JSDOMWindow.h"
       
    51 #include "JSDocumentFragment.h"
       
    52 #include "JSDocumentType.h"
       
    53 #include "JSElement.h"
       
    54 #include "JSEntityReference.h"
       
    55 #include "JSEvent.h"
       
    56 #include "JSEventListener.h"
       
    57 #include "JSHTMLCollection.h"
       
    58 #include "JSHTMLElement.h"
       
    59 #include "JSHTMLHeadElement.h"
       
    60 #include "JSNode.h"
       
    61 #include "JSNodeFilter.h"
       
    62 #include "JSNodeIterator.h"
       
    63 #include "JSNodeList.h"
       
    64 #include "JSProcessingInstruction.h"
       
    65 #include "JSRange.h"
       
    66 #include "JSStyleSheetList.h"
       
    67 #include "JSText.h"
       
    68 #include "JSTreeWalker.h"
       
    69 #include "JSXPathExpression.h"
       
    70 #include "JSXPathNSResolver.h"
       
    71 #include "JSXPathResult.h"
       
    72 #include "KURL.h"
       
    73 #include "NameNodeList.h"
       
    74 #include "Node.h"
       
    75 #include "NodeFilter.h"
       
    76 #include "NodeIterator.h"
       
    77 #include "NodeList.h"
       
    78 #include "PlatformString.h"
       
    79 #include "ProcessingInstruction.h"
       
    80 #include "Range.h"
       
    81 #include "StyleSheetList.h"
       
    82 #include "Text.h"
       
    83 #include "TreeWalker.h"
       
    84 #include "XPathExpression.h"
       
    85 #include "XPathNSResolver.h"
       
    86 #include "XPathResult.h"
       
    87 #include <runtime/Error.h>
       
    88 #include <runtime/JSString.h>
       
    89 #include <wtf/GetPtr.h>
       
    90 
       
    91 using namespace JSC;
       
    92 
       
    93 namespace WebCore {
       
    94 
       
    95 ASSERT_CLASS_FITS_IN_CELL(JSDocument);
       
    96 
       
    97 /* Hash table */
       
    98 #if ENABLE(JIT)
       
    99 #define THUNK_GENERATOR(generator) , generator
       
   100 #else
       
   101 #define THUNK_GENERATOR(generator)
       
   102 #endif
       
   103 
       
   104 static const HashTableValue JSDocumentTableValues[78] =
       
   105 {
       
   106     { "doctype", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentDoctype), (intptr_t)0 THUNK_GENERATOR(0) },
       
   107     { "implementation", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentImplementation), (intptr_t)0 THUNK_GENERATOR(0) },
       
   108     { "documentElement", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentDocumentElement), (intptr_t)0 THUNK_GENERATOR(0) },
       
   109     { "inputEncoding", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentInputEncoding), (intptr_t)0 THUNK_GENERATOR(0) },
       
   110     { "xmlEncoding", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentXMLEncoding), (intptr_t)0 THUNK_GENERATOR(0) },
       
   111     { "xmlVersion", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentXMLVersion), (intptr_t)setJSDocumentXMLVersion THUNK_GENERATOR(0) },
       
   112     { "xmlStandalone", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentXMLStandalone), (intptr_t)setJSDocumentXMLStandalone THUNK_GENERATOR(0) },
       
   113     { "documentURI", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentDocumentURI), (intptr_t)setJSDocumentDocumentURI THUNK_GENERATOR(0) },
       
   114     { "defaultView", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentDefaultView), (intptr_t)0 THUNK_GENERATOR(0) },
       
   115     { "styleSheets", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentStyleSheets), (intptr_t)0 THUNK_GENERATOR(0) },
       
   116     { "title", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentTitle), (intptr_t)setJSDocumentTitle THUNK_GENERATOR(0) },
       
   117     { "referrer", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentReferrer), (intptr_t)0 THUNK_GENERATOR(0) },
       
   118     { "domain", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentDomain), (intptr_t)setJSDocumentDomain THUNK_GENERATOR(0) },
       
   119     { "URL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentURL), (intptr_t)0 THUNK_GENERATOR(0) },
       
   120     { "cookie", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentCookie), (intptr_t)setJSDocumentCookie THUNK_GENERATOR(0) },
       
   121     { "body", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentBody), (intptr_t)setJSDocumentBody THUNK_GENERATOR(0) },
       
   122     { "head", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentHead), (intptr_t)0 THUNK_GENERATOR(0) },
       
   123     { "images", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentImages), (intptr_t)0 THUNK_GENERATOR(0) },
       
   124     { "applets", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentApplets), (intptr_t)0 THUNK_GENERATOR(0) },
       
   125     { "links", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentLinks), (intptr_t)0 THUNK_GENERATOR(0) },
       
   126     { "forms", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentForms), (intptr_t)0 THUNK_GENERATOR(0) },
       
   127     { "anchors", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentAnchors), (intptr_t)0 THUNK_GENERATOR(0) },
       
   128     { "lastModified", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentLastModified), (intptr_t)0 THUNK_GENERATOR(0) },
       
   129     { "location", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentLocation), (intptr_t)setJSDocumentLocation THUNK_GENERATOR(0) },
       
   130     { "charset", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentCharset), (intptr_t)setJSDocumentCharset THUNK_GENERATOR(0) },
       
   131     { "defaultCharset", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentDefaultCharset), (intptr_t)0 THUNK_GENERATOR(0) },
       
   132     { "readyState", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentReadyState), (intptr_t)0 THUNK_GENERATOR(0) },
       
   133     { "characterSet", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentCharacterSet), (intptr_t)0 THUNK_GENERATOR(0) },
       
   134     { "preferredStylesheetSet", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentPreferredStylesheetSet), (intptr_t)0 THUNK_GENERATOR(0) },
       
   135     { "selectedStylesheetSet", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentSelectedStylesheetSet), (intptr_t)setJSDocumentSelectedStylesheetSet THUNK_GENERATOR(0) },
       
   136     { "onabort", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnabort), (intptr_t)setJSDocumentOnabort THUNK_GENERATOR(0) },
       
   137     { "onblur", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnblur), (intptr_t)setJSDocumentOnblur THUNK_GENERATOR(0) },
       
   138     { "onchange", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnchange), (intptr_t)setJSDocumentOnchange THUNK_GENERATOR(0) },
       
   139     { "onclick", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnclick), (intptr_t)setJSDocumentOnclick THUNK_GENERATOR(0) },
       
   140     { "oncontextmenu", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOncontextmenu), (intptr_t)setJSDocumentOncontextmenu THUNK_GENERATOR(0) },
       
   141     { "ondblclick", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOndblclick), (intptr_t)setJSDocumentOndblclick THUNK_GENERATOR(0) },
       
   142     { "ondrag", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOndrag), (intptr_t)setJSDocumentOndrag THUNK_GENERATOR(0) },
       
   143     { "ondragend", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOndragend), (intptr_t)setJSDocumentOndragend THUNK_GENERATOR(0) },
       
   144     { "ondragenter", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOndragenter), (intptr_t)setJSDocumentOndragenter THUNK_GENERATOR(0) },
       
   145     { "ondragleave", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOndragleave), (intptr_t)setJSDocumentOndragleave THUNK_GENERATOR(0) },
       
   146     { "ondragover", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOndragover), (intptr_t)setJSDocumentOndragover THUNK_GENERATOR(0) },
       
   147     { "ondragstart", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOndragstart), (intptr_t)setJSDocumentOndragstart THUNK_GENERATOR(0) },
       
   148     { "ondrop", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOndrop), (intptr_t)setJSDocumentOndrop THUNK_GENERATOR(0) },
       
   149     { "onerror", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnerror), (intptr_t)setJSDocumentOnerror THUNK_GENERATOR(0) },
       
   150     { "onfocus", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnfocus), (intptr_t)setJSDocumentOnfocus THUNK_GENERATOR(0) },
       
   151     { "oninput", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOninput), (intptr_t)setJSDocumentOninput THUNK_GENERATOR(0) },
       
   152     { "oninvalid", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOninvalid), (intptr_t)setJSDocumentOninvalid THUNK_GENERATOR(0) },
       
   153     { "onkeydown", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnkeydown), (intptr_t)setJSDocumentOnkeydown THUNK_GENERATOR(0) },
       
   154     { "onkeypress", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnkeypress), (intptr_t)setJSDocumentOnkeypress THUNK_GENERATOR(0) },
       
   155     { "onkeyup", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnkeyup), (intptr_t)setJSDocumentOnkeyup THUNK_GENERATOR(0) },
       
   156     { "onload", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnload), (intptr_t)setJSDocumentOnload THUNK_GENERATOR(0) },
       
   157     { "onmousedown", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnmousedown), (intptr_t)setJSDocumentOnmousedown THUNK_GENERATOR(0) },
       
   158     { "onmousemove", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnmousemove), (intptr_t)setJSDocumentOnmousemove THUNK_GENERATOR(0) },
       
   159     { "onmouseout", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnmouseout), (intptr_t)setJSDocumentOnmouseout THUNK_GENERATOR(0) },
       
   160     { "onmouseover", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnmouseover), (intptr_t)setJSDocumentOnmouseover THUNK_GENERATOR(0) },
       
   161     { "onmouseup", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnmouseup), (intptr_t)setJSDocumentOnmouseup THUNK_GENERATOR(0) },
       
   162     { "onmousewheel", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnmousewheel), (intptr_t)setJSDocumentOnmousewheel THUNK_GENERATOR(0) },
       
   163     { "onscroll", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnscroll), (intptr_t)setJSDocumentOnscroll THUNK_GENERATOR(0) },
       
   164     { "onselect", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnselect), (intptr_t)setJSDocumentOnselect THUNK_GENERATOR(0) },
       
   165     { "onsubmit", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnsubmit), (intptr_t)setJSDocumentOnsubmit THUNK_GENERATOR(0) },
       
   166     { "onbeforecut", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnbeforecut), (intptr_t)setJSDocumentOnbeforecut THUNK_GENERATOR(0) },
       
   167     { "oncut", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOncut), (intptr_t)setJSDocumentOncut THUNK_GENERATOR(0) },
       
   168     { "onbeforecopy", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnbeforecopy), (intptr_t)setJSDocumentOnbeforecopy THUNK_GENERATOR(0) },
       
   169     { "oncopy", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOncopy), (intptr_t)setJSDocumentOncopy THUNK_GENERATOR(0) },
       
   170     { "onbeforepaste", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnbeforepaste), (intptr_t)setJSDocumentOnbeforepaste THUNK_GENERATOR(0) },
       
   171     { "onpaste", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnpaste), (intptr_t)setJSDocumentOnpaste THUNK_GENERATOR(0) },
       
   172     { "onreset", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnreset), (intptr_t)setJSDocumentOnreset THUNK_GENERATOR(0) },
       
   173     { "onsearch", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnsearch), (intptr_t)setJSDocumentOnsearch THUNK_GENERATOR(0) },
       
   174     { "onselectstart", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOnselectstart), (intptr_t)setJSDocumentOnselectstart THUNK_GENERATOR(0) },
       
   175 #if ENABLE(TOUCH_EVENTS)
       
   176     { "ontouchstart", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOntouchstart), (intptr_t)setJSDocumentOntouchstart THUNK_GENERATOR(0) },
       
   177 #endif
       
   178 #if ENABLE(TOUCH_EVENTS)
       
   179     { "ontouchmove", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOntouchmove), (intptr_t)setJSDocumentOntouchmove THUNK_GENERATOR(0) },
       
   180 #endif
       
   181 #if ENABLE(TOUCH_EVENTS)
       
   182     { "ontouchend", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOntouchend), (intptr_t)setJSDocumentOntouchend THUNK_GENERATOR(0) },
       
   183 #endif
       
   184 #if ENABLE(TOUCH_EVENTS)
       
   185     { "ontouchcancel", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOntouchcancel), (intptr_t)setJSDocumentOntouchcancel THUNK_GENERATOR(0) },
       
   186 #endif
       
   187 #if ENABLE(TRANSFORMACTION_EVENTS)
       
   188     { "ontransformactionstart", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOntransformactionstart), (intptr_t)setJSDocumentOntransformactionstart THUNK_GENERATOR(0) },
       
   189 #endif
       
   190 #if ENABLE(TRANSFORMACTION_EVENTS)
       
   191     { "ontransformactionupdate", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOntransformactionupdate), (intptr_t)setJSDocumentOntransformactionupdate THUNK_GENERATOR(0) },
       
   192 #endif
       
   193 #if ENABLE(TRANSFORMACTION_EVENTS)
       
   194     { "ontransformactionend", DontDelete | DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentOntransformactionend), (intptr_t)setJSDocumentOntransformactionend THUNK_GENERATOR(0) },
       
   195 #endif
       
   196     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDocumentConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
   197     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   198 };
       
   199 
       
   200 #undef THUNK_GENERATOR
       
   201 static JSC_CONST_HASHTABLE HashTable JSDocumentTable = { 262, 255, JSDocumentTableValues, 0 };
       
   202 /* Hash table for constructor */
       
   203 #if ENABLE(JIT)
       
   204 #define THUNK_GENERATOR(generator) , generator
       
   205 #else
       
   206 #define THUNK_GENERATOR(generator)
       
   207 #endif
       
   208 
       
   209 static const HashTableValue JSDocumentConstructorTableValues[1] =
       
   210 {
       
   211     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   212 };
       
   213 
       
   214 #undef THUNK_GENERATOR
       
   215 static JSC_CONST_HASHTABLE HashTable JSDocumentConstructorTable = { 1, 0, JSDocumentConstructorTableValues, 0 };
       
   216 class JSDocumentConstructor : public DOMConstructorObject {
       
   217 public:
       
   218     JSDocumentConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
   219 
       
   220     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
   221     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
   222     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
   223     static const JSC::ClassInfo s_info;
       
   224     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
   225     {
       
   226         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
   227     }
       
   228 protected:
       
   229     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
   230 };
       
   231 
       
   232 const ClassInfo JSDocumentConstructor::s_info = { "DocumentConstructor", 0, &JSDocumentConstructorTable, 0 };
       
   233 
       
   234 JSDocumentConstructor::JSDocumentConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
   235     : DOMConstructorObject(JSDocumentConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
   236 {
       
   237     putDirect(exec->propertyNames().prototype, JSDocumentPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
   238 }
       
   239 
       
   240 bool JSDocumentConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   241 {
       
   242     return getStaticValueSlot<JSDocumentConstructor, DOMObject>(exec, &JSDocumentConstructorTable, this, propertyName, slot);
       
   243 }
       
   244 
       
   245 bool JSDocumentConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   246 {
       
   247     return getStaticValueDescriptor<JSDocumentConstructor, DOMObject>(exec, &JSDocumentConstructorTable, this, propertyName, descriptor);
       
   248 }
       
   249 
       
   250 /* Hash table for prototype */
       
   251 #if ENABLE(JIT)
       
   252 #define THUNK_GENERATOR(generator) , generator
       
   253 #else
       
   254 #define THUNK_GENERATOR(generator)
       
   255 #endif
       
   256 
       
   257 static const HashTableValue JSDocumentPrototypeTableValues[38] =
       
   258 {
       
   259     { "createElement", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateElement), (intptr_t)1 THUNK_GENERATOR(0) },
       
   260     { "createDocumentFragment", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateDocumentFragment), (intptr_t)0 THUNK_GENERATOR(0) },
       
   261     { "createTextNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateTextNode), (intptr_t)1 THUNK_GENERATOR(0) },
       
   262     { "createComment", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateComment), (intptr_t)1 THUNK_GENERATOR(0) },
       
   263     { "createCDATASection", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateCDATASection), (intptr_t)1 THUNK_GENERATOR(0) },
       
   264     { "createProcessingInstruction", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateProcessingInstruction), (intptr_t)2 THUNK_GENERATOR(0) },
       
   265     { "createAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateAttribute), (intptr_t)1 THUNK_GENERATOR(0) },
       
   266     { "createEntityReference", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateEntityReference), (intptr_t)1 THUNK_GENERATOR(0) },
       
   267     { "getElementsByTagName", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionGetElementsByTagName), (intptr_t)1 THUNK_GENERATOR(0) },
       
   268     { "importNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionImportNode), (intptr_t)2 THUNK_GENERATOR(0) },
       
   269     { "createElementNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateElementNS), (intptr_t)2 THUNK_GENERATOR(0) },
       
   270     { "createAttributeNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateAttributeNS), (intptr_t)2 THUNK_GENERATOR(0) },
       
   271     { "getElementsByTagNameNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionGetElementsByTagNameNS), (intptr_t)2 THUNK_GENERATOR(0) },
       
   272     { "getElementById", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionGetElementById), (intptr_t)1 THUNK_GENERATOR(0) },
       
   273     { "adoptNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionAdoptNode), (intptr_t)1 THUNK_GENERATOR(0) },
       
   274     { "createEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateEvent), (intptr_t)1 THUNK_GENERATOR(0) },
       
   275     { "createRange", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateRange), (intptr_t)0 THUNK_GENERATOR(0) },
       
   276     { "createNodeIterator", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateNodeIterator), (intptr_t)4 THUNK_GENERATOR(0) },
       
   277     { "createTreeWalker", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateTreeWalker), (intptr_t)4 THUNK_GENERATOR(0) },
       
   278     { "getOverrideStyle", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionGetOverrideStyle), (intptr_t)2 THUNK_GENERATOR(0) },
       
   279     { "createExpression", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateExpression), (intptr_t)2 THUNK_GENERATOR(0) },
       
   280     { "createNSResolver", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCreateNSResolver), (intptr_t)1 THUNK_GENERATOR(0) },
       
   281     { "evaluate", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionEvaluate), (intptr_t)5 THUNK_GENERATOR(0) },
       
   282     { "execCommand", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionExecCommand), (intptr_t)3 THUNK_GENERATOR(0) },
       
   283     { "queryCommandEnabled", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionQueryCommandEnabled), (intptr_t)1 THUNK_GENERATOR(0) },
       
   284     { "queryCommandIndeterm", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionQueryCommandIndeterm), (intptr_t)1 THUNK_GENERATOR(0) },
       
   285     { "queryCommandState", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionQueryCommandState), (intptr_t)1 THUNK_GENERATOR(0) },
       
   286     { "queryCommandSupported", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionQueryCommandSupported), (intptr_t)1 THUNK_GENERATOR(0) },
       
   287     { "queryCommandValue", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionQueryCommandValue), (intptr_t)1 THUNK_GENERATOR(0) },
       
   288     { "getElementsByName", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionGetElementsByName), (intptr_t)1 THUNK_GENERATOR(0) },
       
   289     { "elementFromPoint", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionElementFromPoint), (intptr_t)2 THUNK_GENERATOR(0) },
       
   290     { "caretRangeFromPoint", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionCaretRangeFromPoint), (intptr_t)2 THUNK_GENERATOR(0) },
       
   291     { "getSelection", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionGetSelection), (intptr_t)0 THUNK_GENERATOR(0) },
       
   292     { "getCSSCanvasContext", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionGetCSSCanvasContext), (intptr_t)4 THUNK_GENERATOR(0) },
       
   293     { "getElementsByClassName", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionGetElementsByClassName), (intptr_t)1 THUNK_GENERATOR(0) },
       
   294     { "querySelector", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionQuerySelector), (intptr_t)1 THUNK_GENERATOR(0) },
       
   295     { "querySelectorAll", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDocumentPrototypeFunctionQuerySelectorAll), (intptr_t)1 THUNK_GENERATOR(0) },
       
   296     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   297 };
       
   298 
       
   299 #undef THUNK_GENERATOR
       
   300 static JSC_CONST_HASHTABLE HashTable JSDocumentPrototypeTable = { 135, 127, JSDocumentPrototypeTableValues, 0 };
       
   301 const ClassInfo JSDocumentPrototype::s_info = { "DocumentPrototype", 0, &JSDocumentPrototypeTable, 0 };
       
   302 
       
   303 JSObject* JSDocumentPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   304 {
       
   305     return getDOMPrototype<JSDocument>(exec, globalObject);
       
   306 }
       
   307 
       
   308 bool JSDocumentPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   309 {
       
   310     return getStaticFunctionSlot<JSObject>(exec, &JSDocumentPrototypeTable, this, propertyName, slot);
       
   311 }
       
   312 
       
   313 bool JSDocumentPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   314 {
       
   315     return getStaticFunctionDescriptor<JSObject>(exec, &JSDocumentPrototypeTable, this, propertyName, descriptor);
       
   316 }
       
   317 
       
   318 const ClassInfo JSDocument::s_info = { "Document", &JSNode::s_info, &JSDocumentTable, 0 };
       
   319 
       
   320 JSDocument::JSDocument(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<Document> impl)
       
   321     : JSNode(structure, globalObject, impl)
       
   322 {
       
   323 }
       
   324 
       
   325 JSObject* JSDocument::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   326 {
       
   327     return new (exec) JSDocumentPrototype(globalObject, JSDocumentPrototype::createStructure(JSNodePrototype::self(exec, globalObject)));
       
   328 }
       
   329 
       
   330 JSValue jsDocumentDoctype(ExecState* exec, JSValue slotBase, const Identifier&)
       
   331 {
       
   332     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   333     UNUSED_PARAM(exec);
       
   334     Document* imp = static_cast<Document*>(castedThis->impl());
       
   335     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->doctype()));
       
   336     return result;
       
   337 }
       
   338 
       
   339 JSValue jsDocumentImplementation(ExecState* exec, JSValue slotBase, const Identifier&)
       
   340 {
       
   341     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   342     UNUSED_PARAM(exec);
       
   343     Document* imp = static_cast<Document*>(castedThis->impl());
       
   344     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->implementation()));
       
   345     return result;
       
   346 }
       
   347 
       
   348 JSValue jsDocumentDocumentElement(ExecState* exec, JSValue slotBase, const Identifier&)
       
   349 {
       
   350     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   351     UNUSED_PARAM(exec);
       
   352     Document* imp = static_cast<Document*>(castedThis->impl());
       
   353     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->documentElement()));
       
   354     return result;
       
   355 }
       
   356 
       
   357 JSValue jsDocumentInputEncoding(ExecState* exec, JSValue slotBase, const Identifier&)
       
   358 {
       
   359     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   360     UNUSED_PARAM(exec);
       
   361     Document* imp = static_cast<Document*>(castedThis->impl());
       
   362     JSValue result = jsStringOrNull(exec, imp->inputEncoding());
       
   363     return result;
       
   364 }
       
   365 
       
   366 JSValue jsDocumentXMLEncoding(ExecState* exec, JSValue slotBase, const Identifier&)
       
   367 {
       
   368     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   369     UNUSED_PARAM(exec);
       
   370     Document* imp = static_cast<Document*>(castedThis->impl());
       
   371     JSValue result = jsStringOrNull(exec, imp->xmlEncoding());
       
   372     return result;
       
   373 }
       
   374 
       
   375 JSValue jsDocumentXMLVersion(ExecState* exec, JSValue slotBase, const Identifier&)
       
   376 {
       
   377     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   378     UNUSED_PARAM(exec);
       
   379     Document* imp = static_cast<Document*>(castedThis->impl());
       
   380     JSValue result = jsStringOrNull(exec, imp->xmlVersion());
       
   381     return result;
       
   382 }
       
   383 
       
   384 JSValue jsDocumentXMLStandalone(ExecState* exec, JSValue slotBase, const Identifier&)
       
   385 {
       
   386     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   387     UNUSED_PARAM(exec);
       
   388     Document* imp = static_cast<Document*>(castedThis->impl());
       
   389     JSValue result = jsBoolean(imp->xmlStandalone());
       
   390     return result;
       
   391 }
       
   392 
       
   393 JSValue jsDocumentDocumentURI(ExecState* exec, JSValue slotBase, const Identifier&)
       
   394 {
       
   395     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   396     UNUSED_PARAM(exec);
       
   397     Document* imp = static_cast<Document*>(castedThis->impl());
       
   398     JSValue result = jsStringOrNull(exec, imp->documentURI());
       
   399     return result;
       
   400 }
       
   401 
       
   402 JSValue jsDocumentDefaultView(ExecState* exec, JSValue slotBase, const Identifier&)
       
   403 {
       
   404     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   405     UNUSED_PARAM(exec);
       
   406     Document* imp = static_cast<Document*>(castedThis->impl());
       
   407     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->defaultView()));
       
   408     return result;
       
   409 }
       
   410 
       
   411 JSValue jsDocumentStyleSheets(ExecState* exec, JSValue slotBase, const Identifier&)
       
   412 {
       
   413     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   414     UNUSED_PARAM(exec);
       
   415     Document* imp = static_cast<Document*>(castedThis->impl());
       
   416     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->styleSheets()));
       
   417     return result;
       
   418 }
       
   419 
       
   420 JSValue jsDocumentTitle(ExecState* exec, JSValue slotBase, const Identifier&)
       
   421 {
       
   422     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   423     UNUSED_PARAM(exec);
       
   424     Document* imp = static_cast<Document*>(castedThis->impl());
       
   425     JSValue result = jsString(exec, imp->title());
       
   426     return result;
       
   427 }
       
   428 
       
   429 JSValue jsDocumentReferrer(ExecState* exec, JSValue slotBase, const Identifier&)
       
   430 {
       
   431     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   432     UNUSED_PARAM(exec);
       
   433     Document* imp = static_cast<Document*>(castedThis->impl());
       
   434     JSValue result = jsString(exec, imp->referrer());
       
   435     return result;
       
   436 }
       
   437 
       
   438 JSValue jsDocumentDomain(ExecState* exec, JSValue slotBase, const Identifier&)
       
   439 {
       
   440     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   441     UNUSED_PARAM(exec);
       
   442     Document* imp = static_cast<Document*>(castedThis->impl());
       
   443     JSValue result = jsString(exec, imp->domain());
       
   444     return result;
       
   445 }
       
   446 
       
   447 JSValue jsDocumentURL(ExecState* exec, JSValue slotBase, const Identifier&)
       
   448 {
       
   449     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   450     UNUSED_PARAM(exec);
       
   451     Document* imp = static_cast<Document*>(castedThis->impl());
       
   452     JSValue result = jsString(exec, imp->url());
       
   453     return result;
       
   454 }
       
   455 
       
   456 JSValue jsDocumentCookie(ExecState* exec, JSValue slotBase, const Identifier&)
       
   457 {
       
   458     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   459     ExceptionCode ec = 0;
       
   460     Document* imp = static_cast<Document*>(castedThis->impl());
       
   461     JSC::JSValue result = jsString(exec, imp->cookie(ec));
       
   462     setDOMException(exec, ec);
       
   463     return result;
       
   464 }
       
   465 
       
   466 JSValue jsDocumentBody(ExecState* exec, JSValue slotBase, const Identifier&)
       
   467 {
       
   468     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   469     UNUSED_PARAM(exec);
       
   470     Document* imp = static_cast<Document*>(castedThis->impl());
       
   471     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->body()));
       
   472     return result;
       
   473 }
       
   474 
       
   475 JSValue jsDocumentHead(ExecState* exec, JSValue slotBase, const Identifier&)
       
   476 {
       
   477     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   478     UNUSED_PARAM(exec);
       
   479     Document* imp = static_cast<Document*>(castedThis->impl());
       
   480     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->head()));
       
   481     return result;
       
   482 }
       
   483 
       
   484 JSValue jsDocumentImages(ExecState* exec, JSValue slotBase, const Identifier&)
       
   485 {
       
   486     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   487     UNUSED_PARAM(exec);
       
   488     Document* imp = static_cast<Document*>(castedThis->impl());
       
   489     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->images()));
       
   490     return result;
       
   491 }
       
   492 
       
   493 JSValue jsDocumentApplets(ExecState* exec, JSValue slotBase, const Identifier&)
       
   494 {
       
   495     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   496     UNUSED_PARAM(exec);
       
   497     Document* imp = static_cast<Document*>(castedThis->impl());
       
   498     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->applets()));
       
   499     return result;
       
   500 }
       
   501 
       
   502 JSValue jsDocumentLinks(ExecState* exec, JSValue slotBase, const Identifier&)
       
   503 {
       
   504     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   505     UNUSED_PARAM(exec);
       
   506     Document* imp = static_cast<Document*>(castedThis->impl());
       
   507     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->links()));
       
   508     return result;
       
   509 }
       
   510 
       
   511 JSValue jsDocumentForms(ExecState* exec, JSValue slotBase, const Identifier&)
       
   512 {
       
   513     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   514     UNUSED_PARAM(exec);
       
   515     Document* imp = static_cast<Document*>(castedThis->impl());
       
   516     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->forms()));
       
   517     return result;
       
   518 }
       
   519 
       
   520 JSValue jsDocumentAnchors(ExecState* exec, JSValue slotBase, const Identifier&)
       
   521 {
       
   522     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   523     UNUSED_PARAM(exec);
       
   524     Document* imp = static_cast<Document*>(castedThis->impl());
       
   525     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->anchors()));
       
   526     return result;
       
   527 }
       
   528 
       
   529 JSValue jsDocumentLastModified(ExecState* exec, JSValue slotBase, const Identifier&)
       
   530 {
       
   531     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   532     UNUSED_PARAM(exec);
       
   533     Document* imp = static_cast<Document*>(castedThis->impl());
       
   534     JSValue result = jsString(exec, imp->lastModified());
       
   535     return result;
       
   536 }
       
   537 
       
   538 JSValue jsDocumentLocation(ExecState* exec, JSValue slotBase, const Identifier&)
       
   539 {
       
   540     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   541     return castedThis->location(exec);
       
   542 }
       
   543 
       
   544 JSValue jsDocumentCharset(ExecState* exec, JSValue slotBase, const Identifier&)
       
   545 {
       
   546     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   547     UNUSED_PARAM(exec);
       
   548     Document* imp = static_cast<Document*>(castedThis->impl());
       
   549     JSValue result = jsStringOrUndefined(exec, imp->charset());
       
   550     return result;
       
   551 }
       
   552 
       
   553 JSValue jsDocumentDefaultCharset(ExecState* exec, JSValue slotBase, const Identifier&)
       
   554 {
       
   555     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   556     UNUSED_PARAM(exec);
       
   557     Document* imp = static_cast<Document*>(castedThis->impl());
       
   558     JSValue result = jsStringOrUndefined(exec, imp->defaultCharset());
       
   559     return result;
       
   560 }
       
   561 
       
   562 JSValue jsDocumentReadyState(ExecState* exec, JSValue slotBase, const Identifier&)
       
   563 {
       
   564     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   565     UNUSED_PARAM(exec);
       
   566     Document* imp = static_cast<Document*>(castedThis->impl());
       
   567     JSValue result = jsStringOrUndefined(exec, imp->readyState());
       
   568     return result;
       
   569 }
       
   570 
       
   571 JSValue jsDocumentCharacterSet(ExecState* exec, JSValue slotBase, const Identifier&)
       
   572 {
       
   573     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   574     UNUSED_PARAM(exec);
       
   575     Document* imp = static_cast<Document*>(castedThis->impl());
       
   576     JSValue result = jsStringOrNull(exec, imp->characterSet());
       
   577     return result;
       
   578 }
       
   579 
       
   580 JSValue jsDocumentPreferredStylesheetSet(ExecState* exec, JSValue slotBase, const Identifier&)
       
   581 {
       
   582     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   583     UNUSED_PARAM(exec);
       
   584     Document* imp = static_cast<Document*>(castedThis->impl());
       
   585     JSValue result = jsStringOrNull(exec, imp->preferredStylesheetSet());
       
   586     return result;
       
   587 }
       
   588 
       
   589 JSValue jsDocumentSelectedStylesheetSet(ExecState* exec, JSValue slotBase, const Identifier&)
       
   590 {
       
   591     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   592     UNUSED_PARAM(exec);
       
   593     Document* imp = static_cast<Document*>(castedThis->impl());
       
   594     JSValue result = jsStringOrNull(exec, imp->selectedStylesheetSet());
       
   595     return result;
       
   596 }
       
   597 
       
   598 JSValue jsDocumentOnabort(ExecState* exec, JSValue slotBase, const Identifier&)
       
   599 {
       
   600     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   601     UNUSED_PARAM(exec);
       
   602     Document* imp = static_cast<Document*>(castedThis->impl());
       
   603     if (EventListener* listener = imp->onabort()) {
       
   604         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   605             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   606                 return jsFunction;
       
   607         }
       
   608     }
       
   609     return jsNull();
       
   610 }
       
   611 
       
   612 JSValue jsDocumentOnblur(ExecState* exec, JSValue slotBase, const Identifier&)
       
   613 {
       
   614     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   615     UNUSED_PARAM(exec);
       
   616     Document* imp = static_cast<Document*>(castedThis->impl());
       
   617     if (EventListener* listener = imp->onblur()) {
       
   618         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   619             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   620                 return jsFunction;
       
   621         }
       
   622     }
       
   623     return jsNull();
       
   624 }
       
   625 
       
   626 JSValue jsDocumentOnchange(ExecState* exec, JSValue slotBase, const Identifier&)
       
   627 {
       
   628     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   629     UNUSED_PARAM(exec);
       
   630     Document* imp = static_cast<Document*>(castedThis->impl());
       
   631     if (EventListener* listener = imp->onchange()) {
       
   632         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   633             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   634                 return jsFunction;
       
   635         }
       
   636     }
       
   637     return jsNull();
       
   638 }
       
   639 
       
   640 JSValue jsDocumentOnclick(ExecState* exec, JSValue slotBase, const Identifier&)
       
   641 {
       
   642     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   643     UNUSED_PARAM(exec);
       
   644     Document* imp = static_cast<Document*>(castedThis->impl());
       
   645     if (EventListener* listener = imp->onclick()) {
       
   646         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   647             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   648                 return jsFunction;
       
   649         }
       
   650     }
       
   651     return jsNull();
       
   652 }
       
   653 
       
   654 JSValue jsDocumentOncontextmenu(ExecState* exec, JSValue slotBase, const Identifier&)
       
   655 {
       
   656     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   657     UNUSED_PARAM(exec);
       
   658     Document* imp = static_cast<Document*>(castedThis->impl());
       
   659     if (EventListener* listener = imp->oncontextmenu()) {
       
   660         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   661             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   662                 return jsFunction;
       
   663         }
       
   664     }
       
   665     return jsNull();
       
   666 }
       
   667 
       
   668 JSValue jsDocumentOndblclick(ExecState* exec, JSValue slotBase, const Identifier&)
       
   669 {
       
   670     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   671     UNUSED_PARAM(exec);
       
   672     Document* imp = static_cast<Document*>(castedThis->impl());
       
   673     if (EventListener* listener = imp->ondblclick()) {
       
   674         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   675             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   676                 return jsFunction;
       
   677         }
       
   678     }
       
   679     return jsNull();
       
   680 }
       
   681 
       
   682 JSValue jsDocumentOndrag(ExecState* exec, JSValue slotBase, const Identifier&)
       
   683 {
       
   684     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   685     UNUSED_PARAM(exec);
       
   686     Document* imp = static_cast<Document*>(castedThis->impl());
       
   687     if (EventListener* listener = imp->ondrag()) {
       
   688         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   689             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   690                 return jsFunction;
       
   691         }
       
   692     }
       
   693     return jsNull();
       
   694 }
       
   695 
       
   696 JSValue jsDocumentOndragend(ExecState* exec, JSValue slotBase, const Identifier&)
       
   697 {
       
   698     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   699     UNUSED_PARAM(exec);
       
   700     Document* imp = static_cast<Document*>(castedThis->impl());
       
   701     if (EventListener* listener = imp->ondragend()) {
       
   702         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   703             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   704                 return jsFunction;
       
   705         }
       
   706     }
       
   707     return jsNull();
       
   708 }
       
   709 
       
   710 JSValue jsDocumentOndragenter(ExecState* exec, JSValue slotBase, const Identifier&)
       
   711 {
       
   712     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   713     UNUSED_PARAM(exec);
       
   714     Document* imp = static_cast<Document*>(castedThis->impl());
       
   715     if (EventListener* listener = imp->ondragenter()) {
       
   716         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   717             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   718                 return jsFunction;
       
   719         }
       
   720     }
       
   721     return jsNull();
       
   722 }
       
   723 
       
   724 JSValue jsDocumentOndragleave(ExecState* exec, JSValue slotBase, const Identifier&)
       
   725 {
       
   726     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   727     UNUSED_PARAM(exec);
       
   728     Document* imp = static_cast<Document*>(castedThis->impl());
       
   729     if (EventListener* listener = imp->ondragleave()) {
       
   730         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   731             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   732                 return jsFunction;
       
   733         }
       
   734     }
       
   735     return jsNull();
       
   736 }
       
   737 
       
   738 JSValue jsDocumentOndragover(ExecState* exec, JSValue slotBase, const Identifier&)
       
   739 {
       
   740     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   741     UNUSED_PARAM(exec);
       
   742     Document* imp = static_cast<Document*>(castedThis->impl());
       
   743     if (EventListener* listener = imp->ondragover()) {
       
   744         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   745             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   746                 return jsFunction;
       
   747         }
       
   748     }
       
   749     return jsNull();
       
   750 }
       
   751 
       
   752 JSValue jsDocumentOndragstart(ExecState* exec, JSValue slotBase, const Identifier&)
       
   753 {
       
   754     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   755     UNUSED_PARAM(exec);
       
   756     Document* imp = static_cast<Document*>(castedThis->impl());
       
   757     if (EventListener* listener = imp->ondragstart()) {
       
   758         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   759             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   760                 return jsFunction;
       
   761         }
       
   762     }
       
   763     return jsNull();
       
   764 }
       
   765 
       
   766 JSValue jsDocumentOndrop(ExecState* exec, JSValue slotBase, const Identifier&)
       
   767 {
       
   768     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   769     UNUSED_PARAM(exec);
       
   770     Document* imp = static_cast<Document*>(castedThis->impl());
       
   771     if (EventListener* listener = imp->ondrop()) {
       
   772         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   773             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   774                 return jsFunction;
       
   775         }
       
   776     }
       
   777     return jsNull();
       
   778 }
       
   779 
       
   780 JSValue jsDocumentOnerror(ExecState* exec, JSValue slotBase, const Identifier&)
       
   781 {
       
   782     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   783     UNUSED_PARAM(exec);
       
   784     Document* imp = static_cast<Document*>(castedThis->impl());
       
   785     if (EventListener* listener = imp->onerror()) {
       
   786         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   787             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   788                 return jsFunction;
       
   789         }
       
   790     }
       
   791     return jsNull();
       
   792 }
       
   793 
       
   794 JSValue jsDocumentOnfocus(ExecState* exec, JSValue slotBase, const Identifier&)
       
   795 {
       
   796     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   797     UNUSED_PARAM(exec);
       
   798     Document* imp = static_cast<Document*>(castedThis->impl());
       
   799     if (EventListener* listener = imp->onfocus()) {
       
   800         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   801             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   802                 return jsFunction;
       
   803         }
       
   804     }
       
   805     return jsNull();
       
   806 }
       
   807 
       
   808 JSValue jsDocumentOninput(ExecState* exec, JSValue slotBase, const Identifier&)
       
   809 {
       
   810     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   811     UNUSED_PARAM(exec);
       
   812     Document* imp = static_cast<Document*>(castedThis->impl());
       
   813     if (EventListener* listener = imp->oninput()) {
       
   814         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   815             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   816                 return jsFunction;
       
   817         }
       
   818     }
       
   819     return jsNull();
       
   820 }
       
   821 
       
   822 JSValue jsDocumentOninvalid(ExecState* exec, JSValue slotBase, const Identifier&)
       
   823 {
       
   824     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   825     UNUSED_PARAM(exec);
       
   826     Document* imp = static_cast<Document*>(castedThis->impl());
       
   827     if (EventListener* listener = imp->oninvalid()) {
       
   828         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   829             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   830                 return jsFunction;
       
   831         }
       
   832     }
       
   833     return jsNull();
       
   834 }
       
   835 
       
   836 JSValue jsDocumentOnkeydown(ExecState* exec, JSValue slotBase, const Identifier&)
       
   837 {
       
   838     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   839     UNUSED_PARAM(exec);
       
   840     Document* imp = static_cast<Document*>(castedThis->impl());
       
   841     if (EventListener* listener = imp->onkeydown()) {
       
   842         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   843             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   844                 return jsFunction;
       
   845         }
       
   846     }
       
   847     return jsNull();
       
   848 }
       
   849 
       
   850 JSValue jsDocumentOnkeypress(ExecState* exec, JSValue slotBase, const Identifier&)
       
   851 {
       
   852     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   853     UNUSED_PARAM(exec);
       
   854     Document* imp = static_cast<Document*>(castedThis->impl());
       
   855     if (EventListener* listener = imp->onkeypress()) {
       
   856         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   857             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   858                 return jsFunction;
       
   859         }
       
   860     }
       
   861     return jsNull();
       
   862 }
       
   863 
       
   864 JSValue jsDocumentOnkeyup(ExecState* exec, JSValue slotBase, const Identifier&)
       
   865 {
       
   866     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   867     UNUSED_PARAM(exec);
       
   868     Document* imp = static_cast<Document*>(castedThis->impl());
       
   869     if (EventListener* listener = imp->onkeyup()) {
       
   870         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   871             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   872                 return jsFunction;
       
   873         }
       
   874     }
       
   875     return jsNull();
       
   876 }
       
   877 
       
   878 JSValue jsDocumentOnload(ExecState* exec, JSValue slotBase, const Identifier&)
       
   879 {
       
   880     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   881     UNUSED_PARAM(exec);
       
   882     Document* imp = static_cast<Document*>(castedThis->impl());
       
   883     if (EventListener* listener = imp->onload()) {
       
   884         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   885             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   886                 return jsFunction;
       
   887         }
       
   888     }
       
   889     return jsNull();
       
   890 }
       
   891 
       
   892 JSValue jsDocumentOnmousedown(ExecState* exec, JSValue slotBase, const Identifier&)
       
   893 {
       
   894     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   895     UNUSED_PARAM(exec);
       
   896     Document* imp = static_cast<Document*>(castedThis->impl());
       
   897     if (EventListener* listener = imp->onmousedown()) {
       
   898         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   899             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   900                 return jsFunction;
       
   901         }
       
   902     }
       
   903     return jsNull();
       
   904 }
       
   905 
       
   906 JSValue jsDocumentOnmousemove(ExecState* exec, JSValue slotBase, const Identifier&)
       
   907 {
       
   908     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   909     UNUSED_PARAM(exec);
       
   910     Document* imp = static_cast<Document*>(castedThis->impl());
       
   911     if (EventListener* listener = imp->onmousemove()) {
       
   912         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   913             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   914                 return jsFunction;
       
   915         }
       
   916     }
       
   917     return jsNull();
       
   918 }
       
   919 
       
   920 JSValue jsDocumentOnmouseout(ExecState* exec, JSValue slotBase, const Identifier&)
       
   921 {
       
   922     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   923     UNUSED_PARAM(exec);
       
   924     Document* imp = static_cast<Document*>(castedThis->impl());
       
   925     if (EventListener* listener = imp->onmouseout()) {
       
   926         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   927             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   928                 return jsFunction;
       
   929         }
       
   930     }
       
   931     return jsNull();
       
   932 }
       
   933 
       
   934 JSValue jsDocumentOnmouseover(ExecState* exec, JSValue slotBase, const Identifier&)
       
   935 {
       
   936     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   937     UNUSED_PARAM(exec);
       
   938     Document* imp = static_cast<Document*>(castedThis->impl());
       
   939     if (EventListener* listener = imp->onmouseover()) {
       
   940         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   941             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   942                 return jsFunction;
       
   943         }
       
   944     }
       
   945     return jsNull();
       
   946 }
       
   947 
       
   948 JSValue jsDocumentOnmouseup(ExecState* exec, JSValue slotBase, const Identifier&)
       
   949 {
       
   950     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   951     UNUSED_PARAM(exec);
       
   952     Document* imp = static_cast<Document*>(castedThis->impl());
       
   953     if (EventListener* listener = imp->onmouseup()) {
       
   954         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   955             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   956                 return jsFunction;
       
   957         }
       
   958     }
       
   959     return jsNull();
       
   960 }
       
   961 
       
   962 JSValue jsDocumentOnmousewheel(ExecState* exec, JSValue slotBase, const Identifier&)
       
   963 {
       
   964     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   965     UNUSED_PARAM(exec);
       
   966     Document* imp = static_cast<Document*>(castedThis->impl());
       
   967     if (EventListener* listener = imp->onmousewheel()) {
       
   968         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   969             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   970                 return jsFunction;
       
   971         }
       
   972     }
       
   973     return jsNull();
       
   974 }
       
   975 
       
   976 JSValue jsDocumentOnscroll(ExecState* exec, JSValue slotBase, const Identifier&)
       
   977 {
       
   978     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   979     UNUSED_PARAM(exec);
       
   980     Document* imp = static_cast<Document*>(castedThis->impl());
       
   981     if (EventListener* listener = imp->onscroll()) {
       
   982         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   983             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   984                 return jsFunction;
       
   985         }
       
   986     }
       
   987     return jsNull();
       
   988 }
       
   989 
       
   990 JSValue jsDocumentOnselect(ExecState* exec, JSValue slotBase, const Identifier&)
       
   991 {
       
   992     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
   993     UNUSED_PARAM(exec);
       
   994     Document* imp = static_cast<Document*>(castedThis->impl());
       
   995     if (EventListener* listener = imp->onselect()) {
       
   996         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
   997             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
   998                 return jsFunction;
       
   999         }
       
  1000     }
       
  1001     return jsNull();
       
  1002 }
       
  1003 
       
  1004 JSValue jsDocumentOnsubmit(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1005 {
       
  1006     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1007     UNUSED_PARAM(exec);
       
  1008     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1009     if (EventListener* listener = imp->onsubmit()) {
       
  1010         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1011             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1012                 return jsFunction;
       
  1013         }
       
  1014     }
       
  1015     return jsNull();
       
  1016 }
       
  1017 
       
  1018 JSValue jsDocumentOnbeforecut(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1019 {
       
  1020     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1021     UNUSED_PARAM(exec);
       
  1022     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1023     if (EventListener* listener = imp->onbeforecut()) {
       
  1024         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1025             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1026                 return jsFunction;
       
  1027         }
       
  1028     }
       
  1029     return jsNull();
       
  1030 }
       
  1031 
       
  1032 JSValue jsDocumentOncut(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1033 {
       
  1034     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1035     UNUSED_PARAM(exec);
       
  1036     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1037     if (EventListener* listener = imp->oncut()) {
       
  1038         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1039             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1040                 return jsFunction;
       
  1041         }
       
  1042     }
       
  1043     return jsNull();
       
  1044 }
       
  1045 
       
  1046 JSValue jsDocumentOnbeforecopy(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1047 {
       
  1048     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1049     UNUSED_PARAM(exec);
       
  1050     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1051     if (EventListener* listener = imp->onbeforecopy()) {
       
  1052         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1053             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1054                 return jsFunction;
       
  1055         }
       
  1056     }
       
  1057     return jsNull();
       
  1058 }
       
  1059 
       
  1060 JSValue jsDocumentOncopy(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1061 {
       
  1062     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1063     UNUSED_PARAM(exec);
       
  1064     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1065     if (EventListener* listener = imp->oncopy()) {
       
  1066         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1067             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1068                 return jsFunction;
       
  1069         }
       
  1070     }
       
  1071     return jsNull();
       
  1072 }
       
  1073 
       
  1074 JSValue jsDocumentOnbeforepaste(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1075 {
       
  1076     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1077     UNUSED_PARAM(exec);
       
  1078     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1079     if (EventListener* listener = imp->onbeforepaste()) {
       
  1080         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1081             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1082                 return jsFunction;
       
  1083         }
       
  1084     }
       
  1085     return jsNull();
       
  1086 }
       
  1087 
       
  1088 JSValue jsDocumentOnpaste(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1089 {
       
  1090     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1091     UNUSED_PARAM(exec);
       
  1092     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1093     if (EventListener* listener = imp->onpaste()) {
       
  1094         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1095             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1096                 return jsFunction;
       
  1097         }
       
  1098     }
       
  1099     return jsNull();
       
  1100 }
       
  1101 
       
  1102 JSValue jsDocumentOnreset(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1103 {
       
  1104     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1105     UNUSED_PARAM(exec);
       
  1106     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1107     if (EventListener* listener = imp->onreset()) {
       
  1108         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1109             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1110                 return jsFunction;
       
  1111         }
       
  1112     }
       
  1113     return jsNull();
       
  1114 }
       
  1115 
       
  1116 JSValue jsDocumentOnsearch(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1117 {
       
  1118     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1119     UNUSED_PARAM(exec);
       
  1120     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1121     if (EventListener* listener = imp->onsearch()) {
       
  1122         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1123             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1124                 return jsFunction;
       
  1125         }
       
  1126     }
       
  1127     return jsNull();
       
  1128 }
       
  1129 
       
  1130 JSValue jsDocumentOnselectstart(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1131 {
       
  1132     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1133     UNUSED_PARAM(exec);
       
  1134     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1135     if (EventListener* listener = imp->onselectstart()) {
       
  1136         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1137             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1138                 return jsFunction;
       
  1139         }
       
  1140     }
       
  1141     return jsNull();
       
  1142 }
       
  1143 
       
  1144 #if ENABLE(TOUCH_EVENTS)
       
  1145 JSValue jsDocumentOntouchstart(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1146 {
       
  1147     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1148     UNUSED_PARAM(exec);
       
  1149     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1150     if (EventListener* listener = imp->ontouchstart()) {
       
  1151         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1152             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1153                 return jsFunction;
       
  1154         }
       
  1155     }
       
  1156     return jsNull();
       
  1157 }
       
  1158 #endif
       
  1159 
       
  1160 #if ENABLE(TOUCH_EVENTS)
       
  1161 JSValue jsDocumentOntouchmove(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1162 {
       
  1163     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1164     UNUSED_PARAM(exec);
       
  1165     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1166     if (EventListener* listener = imp->ontouchmove()) {
       
  1167         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1168             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1169                 return jsFunction;
       
  1170         }
       
  1171     }
       
  1172     return jsNull();
       
  1173 }
       
  1174 #endif
       
  1175 
       
  1176 #if ENABLE(TOUCH_EVENTS)
       
  1177 JSValue jsDocumentOntouchend(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1178 {
       
  1179     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1180     UNUSED_PARAM(exec);
       
  1181     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1182     if (EventListener* listener = imp->ontouchend()) {
       
  1183         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1184             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1185                 return jsFunction;
       
  1186         }
       
  1187     }
       
  1188     return jsNull();
       
  1189 }
       
  1190 #endif
       
  1191 
       
  1192 #if ENABLE(TOUCH_EVENTS)
       
  1193 JSValue jsDocumentOntouchcancel(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1194 {
       
  1195     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1196     UNUSED_PARAM(exec);
       
  1197     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1198     if (EventListener* listener = imp->ontouchcancel()) {
       
  1199         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1200             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1201                 return jsFunction;
       
  1202         }
       
  1203     }
       
  1204     return jsNull();
       
  1205 }
       
  1206 #endif
       
  1207 
       
  1208 #if ENABLE(TRANSFORMACTION_EVENTS)
       
  1209 JSValue jsDocumentOntransformactionstart(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1210 {
       
  1211     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1212     UNUSED_PARAM(exec);
       
  1213     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1214     if (EventListener* listener = imp->ontransformactionstart()) {
       
  1215         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1216             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1217                 return jsFunction;
       
  1218         }
       
  1219     }
       
  1220     return jsNull();
       
  1221 }
       
  1222 #endif
       
  1223 
       
  1224 #if ENABLE(TRANSFORMACTION_EVENTS)
       
  1225 JSValue jsDocumentOntransformactionupdate(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1226 {
       
  1227     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1228     UNUSED_PARAM(exec);
       
  1229     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1230     if (EventListener* listener = imp->ontransformactionupdate()) {
       
  1231         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1232             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1233                 return jsFunction;
       
  1234         }
       
  1235     }
       
  1236     return jsNull();
       
  1237 }
       
  1238 #endif
       
  1239 
       
  1240 #if ENABLE(TRANSFORMACTION_EVENTS)
       
  1241 JSValue jsDocumentOntransformactionend(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1242 {
       
  1243     JSDocument* castedThis = static_cast<JSDocument*>(asObject(slotBase));
       
  1244     UNUSED_PARAM(exec);
       
  1245     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1246     if (EventListener* listener = imp->ontransformactionend()) {
       
  1247         if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
       
  1248             if (JSObject* jsFunction = jsListener->jsFunction(imp))
       
  1249                 return jsFunction;
       
  1250         }
       
  1251     }
       
  1252     return jsNull();
       
  1253 }
       
  1254 #endif
       
  1255 
       
  1256 JSValue jsDocumentConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
  1257 {
       
  1258     JSDocument* domObject = static_cast<JSDocument*>(asObject(slotBase));
       
  1259     return JSDocument::getConstructor(exec, domObject->globalObject());
       
  1260 }
       
  1261 void JSDocument::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
       
  1262 {
       
  1263     lookupPut<JSDocument, Base>(exec, propertyName, value, &JSDocumentTable, this, slot);
       
  1264 }
       
  1265 
       
  1266 void setJSDocumentXMLVersion(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1267 {
       
  1268     JSDocument* castedThis = static_cast<JSDocument*>(thisObject);
       
  1269     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1270     ExceptionCode ec = 0;
       
  1271     imp->setXMLVersion(valueToStringWithNullCheck(exec, value), ec);
       
  1272     setDOMException(exec, ec);
       
  1273 }
       
  1274 
       
  1275 void setJSDocumentXMLStandalone(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1276 {
       
  1277     JSDocument* castedThis = static_cast<JSDocument*>(thisObject);
       
  1278     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1279     ExceptionCode ec = 0;
       
  1280     imp->setXMLStandalone(value.toBoolean(exec), ec);
       
  1281     setDOMException(exec, ec);
       
  1282 }
       
  1283 
       
  1284 void setJSDocumentDocumentURI(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1285 {
       
  1286     JSDocument* castedThis = static_cast<JSDocument*>(thisObject);
       
  1287     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1288     imp->setDocumentURI(valueToStringWithNullCheck(exec, value));
       
  1289 }
       
  1290 
       
  1291 void setJSDocumentTitle(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1292 {
       
  1293     JSDocument* castedThis = static_cast<JSDocument*>(thisObject);
       
  1294     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1295     imp->setTitle(valueToStringWithNullCheck(exec, value));
       
  1296 }
       
  1297 
       
  1298 void setJSDocumentDomain(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1299 {
       
  1300     JSDocument* castedThis = static_cast<JSDocument*>(thisObject);
       
  1301     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1302     ExceptionCode ec = 0;
       
  1303     imp->setDomain(valueToStringWithNullCheck(exec, value), ec);
       
  1304     setDOMException(exec, ec);
       
  1305 }
       
  1306 
       
  1307 void setJSDocumentCookie(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1308 {
       
  1309     JSDocument* castedThis = static_cast<JSDocument*>(thisObject);
       
  1310     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1311     ExceptionCode ec = 0;
       
  1312     imp->setCookie(valueToStringWithNullCheck(exec, value), ec);
       
  1313     setDOMException(exec, ec);
       
  1314 }
       
  1315 
       
  1316 void setJSDocumentBody(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1317 {
       
  1318     JSDocument* castedThis = static_cast<JSDocument*>(thisObject);
       
  1319     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1320     ExceptionCode ec = 0;
       
  1321     imp->setBody(toHTMLElement(value), ec);
       
  1322     setDOMException(exec, ec);
       
  1323 }
       
  1324 
       
  1325 void setJSDocumentLocation(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1326 {
       
  1327     static_cast<JSDocument*>(thisObject)->setLocation(exec, value);
       
  1328 }
       
  1329 
       
  1330 void setJSDocumentCharset(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1331 {
       
  1332     JSDocument* castedThis = static_cast<JSDocument*>(thisObject);
       
  1333     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1334     imp->setCharset(valueToStringWithNullCheck(exec, value));
       
  1335 }
       
  1336 
       
  1337 void setJSDocumentSelectedStylesheetSet(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1338 {
       
  1339     JSDocument* castedThis = static_cast<JSDocument*>(thisObject);
       
  1340     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1341     imp->setSelectedStylesheetSet(valueToStringWithNullCheck(exec, value));
       
  1342 }
       
  1343 
       
  1344 void setJSDocumentOnabort(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1345 {
       
  1346     UNUSED_PARAM(exec);
       
  1347     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1348     imp->setOnabort(createJSAttributeEventListener(exec, value, thisObject));
       
  1349 }
       
  1350 
       
  1351 void setJSDocumentOnblur(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1352 {
       
  1353     UNUSED_PARAM(exec);
       
  1354     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1355     imp->setOnblur(createJSAttributeEventListener(exec, value, thisObject));
       
  1356 }
       
  1357 
       
  1358 void setJSDocumentOnchange(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1359 {
       
  1360     UNUSED_PARAM(exec);
       
  1361     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1362     imp->setOnchange(createJSAttributeEventListener(exec, value, thisObject));
       
  1363 }
       
  1364 
       
  1365 void setJSDocumentOnclick(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1366 {
       
  1367     UNUSED_PARAM(exec);
       
  1368     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1369     imp->setOnclick(createJSAttributeEventListener(exec, value, thisObject));
       
  1370 }
       
  1371 
       
  1372 void setJSDocumentOncontextmenu(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1373 {
       
  1374     UNUSED_PARAM(exec);
       
  1375     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1376     imp->setOncontextmenu(createJSAttributeEventListener(exec, value, thisObject));
       
  1377 }
       
  1378 
       
  1379 void setJSDocumentOndblclick(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1380 {
       
  1381     UNUSED_PARAM(exec);
       
  1382     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1383     imp->setOndblclick(createJSAttributeEventListener(exec, value, thisObject));
       
  1384 }
       
  1385 
       
  1386 void setJSDocumentOndrag(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1387 {
       
  1388     UNUSED_PARAM(exec);
       
  1389     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1390     imp->setOndrag(createJSAttributeEventListener(exec, value, thisObject));
       
  1391 }
       
  1392 
       
  1393 void setJSDocumentOndragend(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1394 {
       
  1395     UNUSED_PARAM(exec);
       
  1396     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1397     imp->setOndragend(createJSAttributeEventListener(exec, value, thisObject));
       
  1398 }
       
  1399 
       
  1400 void setJSDocumentOndragenter(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1401 {
       
  1402     UNUSED_PARAM(exec);
       
  1403     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1404     imp->setOndragenter(createJSAttributeEventListener(exec, value, thisObject));
       
  1405 }
       
  1406 
       
  1407 void setJSDocumentOndragleave(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1408 {
       
  1409     UNUSED_PARAM(exec);
       
  1410     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1411     imp->setOndragleave(createJSAttributeEventListener(exec, value, thisObject));
       
  1412 }
       
  1413 
       
  1414 void setJSDocumentOndragover(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1415 {
       
  1416     UNUSED_PARAM(exec);
       
  1417     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1418     imp->setOndragover(createJSAttributeEventListener(exec, value, thisObject));
       
  1419 }
       
  1420 
       
  1421 void setJSDocumentOndragstart(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1422 {
       
  1423     UNUSED_PARAM(exec);
       
  1424     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1425     imp->setOndragstart(createJSAttributeEventListener(exec, value, thisObject));
       
  1426 }
       
  1427 
       
  1428 void setJSDocumentOndrop(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1429 {
       
  1430     UNUSED_PARAM(exec);
       
  1431     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1432     imp->setOndrop(createJSAttributeEventListener(exec, value, thisObject));
       
  1433 }
       
  1434 
       
  1435 void setJSDocumentOnerror(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1436 {
       
  1437     UNUSED_PARAM(exec);
       
  1438     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1439     imp->setOnerror(createJSAttributeEventListener(exec, value, thisObject));
       
  1440 }
       
  1441 
       
  1442 void setJSDocumentOnfocus(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1443 {
       
  1444     UNUSED_PARAM(exec);
       
  1445     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1446     imp->setOnfocus(createJSAttributeEventListener(exec, value, thisObject));
       
  1447 }
       
  1448 
       
  1449 void setJSDocumentOninput(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1450 {
       
  1451     UNUSED_PARAM(exec);
       
  1452     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1453     imp->setOninput(createJSAttributeEventListener(exec, value, thisObject));
       
  1454 }
       
  1455 
       
  1456 void setJSDocumentOninvalid(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1457 {
       
  1458     UNUSED_PARAM(exec);
       
  1459     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1460     imp->setOninvalid(createJSAttributeEventListener(exec, value, thisObject));
       
  1461 }
       
  1462 
       
  1463 void setJSDocumentOnkeydown(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1464 {
       
  1465     UNUSED_PARAM(exec);
       
  1466     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1467     imp->setOnkeydown(createJSAttributeEventListener(exec, value, thisObject));
       
  1468 }
       
  1469 
       
  1470 void setJSDocumentOnkeypress(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1471 {
       
  1472     UNUSED_PARAM(exec);
       
  1473     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1474     imp->setOnkeypress(createJSAttributeEventListener(exec, value, thisObject));
       
  1475 }
       
  1476 
       
  1477 void setJSDocumentOnkeyup(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1478 {
       
  1479     UNUSED_PARAM(exec);
       
  1480     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1481     imp->setOnkeyup(createJSAttributeEventListener(exec, value, thisObject));
       
  1482 }
       
  1483 
       
  1484 void setJSDocumentOnload(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1485 {
       
  1486     UNUSED_PARAM(exec);
       
  1487     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1488     imp->setOnload(createJSAttributeEventListener(exec, value, thisObject));
       
  1489 }
       
  1490 
       
  1491 void setJSDocumentOnmousedown(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1492 {
       
  1493     UNUSED_PARAM(exec);
       
  1494     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1495     imp->setOnmousedown(createJSAttributeEventListener(exec, value, thisObject));
       
  1496 }
       
  1497 
       
  1498 void setJSDocumentOnmousemove(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1499 {
       
  1500     UNUSED_PARAM(exec);
       
  1501     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1502     imp->setOnmousemove(createJSAttributeEventListener(exec, value, thisObject));
       
  1503 }
       
  1504 
       
  1505 void setJSDocumentOnmouseout(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1506 {
       
  1507     UNUSED_PARAM(exec);
       
  1508     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1509     imp->setOnmouseout(createJSAttributeEventListener(exec, value, thisObject));
       
  1510 }
       
  1511 
       
  1512 void setJSDocumentOnmouseover(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1513 {
       
  1514     UNUSED_PARAM(exec);
       
  1515     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1516     imp->setOnmouseover(createJSAttributeEventListener(exec, value, thisObject));
       
  1517 }
       
  1518 
       
  1519 void setJSDocumentOnmouseup(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1520 {
       
  1521     UNUSED_PARAM(exec);
       
  1522     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1523     imp->setOnmouseup(createJSAttributeEventListener(exec, value, thisObject));
       
  1524 }
       
  1525 
       
  1526 void setJSDocumentOnmousewheel(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1527 {
       
  1528     UNUSED_PARAM(exec);
       
  1529     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1530     imp->setOnmousewheel(createJSAttributeEventListener(exec, value, thisObject));
       
  1531 }
       
  1532 
       
  1533 void setJSDocumentOnscroll(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1534 {
       
  1535     UNUSED_PARAM(exec);
       
  1536     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1537     imp->setOnscroll(createJSAttributeEventListener(exec, value, thisObject));
       
  1538 }
       
  1539 
       
  1540 void setJSDocumentOnselect(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1541 {
       
  1542     UNUSED_PARAM(exec);
       
  1543     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1544     imp->setOnselect(createJSAttributeEventListener(exec, value, thisObject));
       
  1545 }
       
  1546 
       
  1547 void setJSDocumentOnsubmit(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1548 {
       
  1549     UNUSED_PARAM(exec);
       
  1550     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1551     imp->setOnsubmit(createJSAttributeEventListener(exec, value, thisObject));
       
  1552 }
       
  1553 
       
  1554 void setJSDocumentOnbeforecut(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1555 {
       
  1556     UNUSED_PARAM(exec);
       
  1557     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1558     imp->setOnbeforecut(createJSAttributeEventListener(exec, value, thisObject));
       
  1559 }
       
  1560 
       
  1561 void setJSDocumentOncut(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1562 {
       
  1563     UNUSED_PARAM(exec);
       
  1564     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1565     imp->setOncut(createJSAttributeEventListener(exec, value, thisObject));
       
  1566 }
       
  1567 
       
  1568 void setJSDocumentOnbeforecopy(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1569 {
       
  1570     UNUSED_PARAM(exec);
       
  1571     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1572     imp->setOnbeforecopy(createJSAttributeEventListener(exec, value, thisObject));
       
  1573 }
       
  1574 
       
  1575 void setJSDocumentOncopy(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1576 {
       
  1577     UNUSED_PARAM(exec);
       
  1578     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1579     imp->setOncopy(createJSAttributeEventListener(exec, value, thisObject));
       
  1580 }
       
  1581 
       
  1582 void setJSDocumentOnbeforepaste(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1583 {
       
  1584     UNUSED_PARAM(exec);
       
  1585     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1586     imp->setOnbeforepaste(createJSAttributeEventListener(exec, value, thisObject));
       
  1587 }
       
  1588 
       
  1589 void setJSDocumentOnpaste(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1590 {
       
  1591     UNUSED_PARAM(exec);
       
  1592     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1593     imp->setOnpaste(createJSAttributeEventListener(exec, value, thisObject));
       
  1594 }
       
  1595 
       
  1596 void setJSDocumentOnreset(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1597 {
       
  1598     UNUSED_PARAM(exec);
       
  1599     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1600     imp->setOnreset(createJSAttributeEventListener(exec, value, thisObject));
       
  1601 }
       
  1602 
       
  1603 void setJSDocumentOnsearch(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1604 {
       
  1605     UNUSED_PARAM(exec);
       
  1606     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1607     imp->setOnsearch(createJSAttributeEventListener(exec, value, thisObject));
       
  1608 }
       
  1609 
       
  1610 void setJSDocumentOnselectstart(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1611 {
       
  1612     UNUSED_PARAM(exec);
       
  1613     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1614     imp->setOnselectstart(createJSAttributeEventListener(exec, value, thisObject));
       
  1615 }
       
  1616 
       
  1617 #if ENABLE(TOUCH_EVENTS)
       
  1618 void setJSDocumentOntouchstart(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1619 {
       
  1620     UNUSED_PARAM(exec);
       
  1621     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1622     imp->setOntouchstart(createJSAttributeEventListener(exec, value, thisObject));
       
  1623 }
       
  1624 #endif
       
  1625 
       
  1626 #if ENABLE(TOUCH_EVENTS)
       
  1627 void setJSDocumentOntouchmove(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1628 {
       
  1629     UNUSED_PARAM(exec);
       
  1630     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1631     imp->setOntouchmove(createJSAttributeEventListener(exec, value, thisObject));
       
  1632 }
       
  1633 #endif
       
  1634 
       
  1635 #if ENABLE(TOUCH_EVENTS)
       
  1636 void setJSDocumentOntouchend(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1637 {
       
  1638     UNUSED_PARAM(exec);
       
  1639     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1640     imp->setOntouchend(createJSAttributeEventListener(exec, value, thisObject));
       
  1641 }
       
  1642 #endif
       
  1643 
       
  1644 #if ENABLE(TOUCH_EVENTS)
       
  1645 void setJSDocumentOntouchcancel(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1646 {
       
  1647     UNUSED_PARAM(exec);
       
  1648     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1649     imp->setOntouchcancel(createJSAttributeEventListener(exec, value, thisObject));
       
  1650 }
       
  1651 #endif
       
  1652 
       
  1653 #if ENABLE(TRANSFORMACTION_EVENTS)
       
  1654 void setJSDocumentOntransformactionstart(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1655 {
       
  1656     UNUSED_PARAM(exec);
       
  1657     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1658     imp->setOntransformactionstart(createJSAttributeEventListener(exec, value, thisObject));
       
  1659 }
       
  1660 #endif
       
  1661 
       
  1662 #if ENABLE(TRANSFORMACTION_EVENTS)
       
  1663 void setJSDocumentOntransformactionupdate(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1664 {
       
  1665     UNUSED_PARAM(exec);
       
  1666     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1667     imp->setOntransformactionupdate(createJSAttributeEventListener(exec, value, thisObject));
       
  1668 }
       
  1669 #endif
       
  1670 
       
  1671 #if ENABLE(TRANSFORMACTION_EVENTS)
       
  1672 void setJSDocumentOntransformactionend(ExecState* exec, JSObject* thisObject, JSValue value)
       
  1673 {
       
  1674     UNUSED_PARAM(exec);
       
  1675     Document* imp = static_cast<Document*>(static_cast<JSDocument*>(thisObject)->impl());
       
  1676     imp->setOntransformactionend(createJSAttributeEventListener(exec, value, thisObject));
       
  1677 }
       
  1678 #endif
       
  1679 
       
  1680 JSValue JSDocument::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
  1681 {
       
  1682     return getDOMConstructor<JSDocumentConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
  1683 }
       
  1684 
       
  1685 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateElement(ExecState* exec)
       
  1686 {
       
  1687     JSValue thisValue = exec->hostThisValue();
       
  1688     if (!thisValue.inherits(&JSDocument::s_info))
       
  1689         return throwVMTypeError(exec);
       
  1690     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1691     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1692     ExceptionCode ec = 0;
       
  1693     const String& tagName = valueToStringWithNullCheck(exec, exec->argument(0));
       
  1694 
       
  1695 
       
  1696     JSC::JSValue result = toJSNewlyCreated(exec, castedThis->globalObject(), WTF::getPtr(imp->createElement(tagName, ec)));
       
  1697     setDOMException(exec, ec);
       
  1698     return JSValue::encode(result);
       
  1699 }
       
  1700 
       
  1701 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateDocumentFragment(ExecState* exec)
       
  1702 {
       
  1703     JSValue thisValue = exec->hostThisValue();
       
  1704     if (!thisValue.inherits(&JSDocument::s_info))
       
  1705         return throwVMTypeError(exec);
       
  1706     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1707     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1708 
       
  1709 
       
  1710     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createDocumentFragment()));
       
  1711     return JSValue::encode(result);
       
  1712 }
       
  1713 
       
  1714 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateTextNode(ExecState* exec)
       
  1715 {
       
  1716     JSValue thisValue = exec->hostThisValue();
       
  1717     if (!thisValue.inherits(&JSDocument::s_info))
       
  1718         return throwVMTypeError(exec);
       
  1719     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1720     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1721     const String& data = ustringToString(exec->argument(0).toString(exec));
       
  1722 
       
  1723 
       
  1724     JSC::JSValue result = toJSNewlyCreated(exec, castedThis->globalObject(), WTF::getPtr(imp->createTextNode(data)));
       
  1725     return JSValue::encode(result);
       
  1726 }
       
  1727 
       
  1728 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateComment(ExecState* exec)
       
  1729 {
       
  1730     JSValue thisValue = exec->hostThisValue();
       
  1731     if (!thisValue.inherits(&JSDocument::s_info))
       
  1732         return throwVMTypeError(exec);
       
  1733     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1734     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1735     const String& data = ustringToString(exec->argument(0).toString(exec));
       
  1736 
       
  1737 
       
  1738     JSC::JSValue result = toJSNewlyCreated(exec, castedThis->globalObject(), WTF::getPtr(imp->createComment(data)));
       
  1739     return JSValue::encode(result);
       
  1740 }
       
  1741 
       
  1742 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateCDATASection(ExecState* exec)
       
  1743 {
       
  1744     JSValue thisValue = exec->hostThisValue();
       
  1745     if (!thisValue.inherits(&JSDocument::s_info))
       
  1746         return throwVMTypeError(exec);
       
  1747     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1748     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1749     ExceptionCode ec = 0;
       
  1750     const String& data = ustringToString(exec->argument(0).toString(exec));
       
  1751 
       
  1752 
       
  1753     JSC::JSValue result = toJSNewlyCreated(exec, castedThis->globalObject(), WTF::getPtr(imp->createCDATASection(data, ec)));
       
  1754     setDOMException(exec, ec);
       
  1755     return JSValue::encode(result);
       
  1756 }
       
  1757 
       
  1758 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateProcessingInstruction(ExecState* exec)
       
  1759 {
       
  1760     JSValue thisValue = exec->hostThisValue();
       
  1761     if (!thisValue.inherits(&JSDocument::s_info))
       
  1762         return throwVMTypeError(exec);
       
  1763     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1764     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1765     ExceptionCode ec = 0;
       
  1766     const String& target = ustringToString(exec->argument(0).toString(exec));
       
  1767     const String& data = ustringToString(exec->argument(1).toString(exec));
       
  1768 
       
  1769 
       
  1770     JSC::JSValue result = toJSNewlyCreated(exec, castedThis->globalObject(), WTF::getPtr(imp->createProcessingInstruction(target, data, ec)));
       
  1771     setDOMException(exec, ec);
       
  1772     return JSValue::encode(result);
       
  1773 }
       
  1774 
       
  1775 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateAttribute(ExecState* exec)
       
  1776 {
       
  1777     JSValue thisValue = exec->hostThisValue();
       
  1778     if (!thisValue.inherits(&JSDocument::s_info))
       
  1779         return throwVMTypeError(exec);
       
  1780     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1781     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1782     ExceptionCode ec = 0;
       
  1783     const String& name = ustringToString(exec->argument(0).toString(exec));
       
  1784 
       
  1785 
       
  1786     JSC::JSValue result = toJSNewlyCreated(exec, castedThis->globalObject(), WTF::getPtr(imp->createAttribute(name, ec)));
       
  1787     setDOMException(exec, ec);
       
  1788     return JSValue::encode(result);
       
  1789 }
       
  1790 
       
  1791 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateEntityReference(ExecState* exec)
       
  1792 {
       
  1793     JSValue thisValue = exec->hostThisValue();
       
  1794     if (!thisValue.inherits(&JSDocument::s_info))
       
  1795         return throwVMTypeError(exec);
       
  1796     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1797     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1798     ExceptionCode ec = 0;
       
  1799     const String& name = ustringToString(exec->argument(0).toString(exec));
       
  1800 
       
  1801 
       
  1802     JSC::JSValue result = toJSNewlyCreated(exec, castedThis->globalObject(), WTF::getPtr(imp->createEntityReference(name, ec)));
       
  1803     setDOMException(exec, ec);
       
  1804     return JSValue::encode(result);
       
  1805 }
       
  1806 
       
  1807 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionGetElementsByTagName(ExecState* exec)
       
  1808 {
       
  1809     JSValue thisValue = exec->hostThisValue();
       
  1810     if (!thisValue.inherits(&JSDocument::s_info))
       
  1811         return throwVMTypeError(exec);
       
  1812     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1813     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1814     const String& tagname = ustringToString(exec->argument(0).toString(exec));
       
  1815 
       
  1816 
       
  1817     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getElementsByTagName(tagname)));
       
  1818     return JSValue::encode(result);
       
  1819 }
       
  1820 
       
  1821 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionImportNode(ExecState* exec)
       
  1822 {
       
  1823     JSValue thisValue = exec->hostThisValue();
       
  1824     if (!thisValue.inherits(&JSDocument::s_info))
       
  1825         return throwVMTypeError(exec);
       
  1826     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1827     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1828     ExceptionCode ec = 0;
       
  1829     Node* importedNode = toNode(exec->argument(0));
       
  1830     bool deep = exec->argument(1).toBoolean(exec);
       
  1831 
       
  1832 
       
  1833     JSC::JSValue result = toJSNewlyCreated(exec, castedThis->globalObject(), WTF::getPtr(imp->importNode(importedNode, deep, ec)));
       
  1834     setDOMException(exec, ec);
       
  1835     return JSValue::encode(result);
       
  1836 }
       
  1837 
       
  1838 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateElementNS(ExecState* exec)
       
  1839 {
       
  1840     JSValue thisValue = exec->hostThisValue();
       
  1841     if (!thisValue.inherits(&JSDocument::s_info))
       
  1842         return throwVMTypeError(exec);
       
  1843     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1844     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1845     ExceptionCode ec = 0;
       
  1846     const String& namespaceURI = valueToStringWithNullCheck(exec, exec->argument(0));
       
  1847     const String& qualifiedName = valueToStringWithNullCheck(exec, exec->argument(1));
       
  1848 
       
  1849 
       
  1850     JSC::JSValue result = toJSNewlyCreated(exec, castedThis->globalObject(), WTF::getPtr(imp->createElementNS(namespaceURI, qualifiedName, ec)));
       
  1851     setDOMException(exec, ec);
       
  1852     return JSValue::encode(result);
       
  1853 }
       
  1854 
       
  1855 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateAttributeNS(ExecState* exec)
       
  1856 {
       
  1857     JSValue thisValue = exec->hostThisValue();
       
  1858     if (!thisValue.inherits(&JSDocument::s_info))
       
  1859         return throwVMTypeError(exec);
       
  1860     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1861     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1862     ExceptionCode ec = 0;
       
  1863     const String& namespaceURI = valueToStringWithNullCheck(exec, exec->argument(0));
       
  1864     const String& qualifiedName = valueToStringWithNullCheck(exec, exec->argument(1));
       
  1865 
       
  1866 
       
  1867     JSC::JSValue result = toJSNewlyCreated(exec, castedThis->globalObject(), WTF::getPtr(imp->createAttributeNS(namespaceURI, qualifiedName, ec)));
       
  1868     setDOMException(exec, ec);
       
  1869     return JSValue::encode(result);
       
  1870 }
       
  1871 
       
  1872 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionGetElementsByTagNameNS(ExecState* exec)
       
  1873 {
       
  1874     JSValue thisValue = exec->hostThisValue();
       
  1875     if (!thisValue.inherits(&JSDocument::s_info))
       
  1876         return throwVMTypeError(exec);
       
  1877     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1878     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1879     const String& namespaceURI = valueToStringWithNullCheck(exec, exec->argument(0));
       
  1880     const String& localName = ustringToString(exec->argument(1).toString(exec));
       
  1881 
       
  1882 
       
  1883     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getElementsByTagNameNS(namespaceURI, localName)));
       
  1884     return JSValue::encode(result);
       
  1885 }
       
  1886 
       
  1887 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionGetElementById(ExecState* exec)
       
  1888 {
       
  1889     JSValue thisValue = exec->hostThisValue();
       
  1890     if (!thisValue.inherits(&JSDocument::s_info))
       
  1891         return throwVMTypeError(exec);
       
  1892     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1893     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1894     const String& elementId = ustringToString(exec->argument(0).toString(exec));
       
  1895 
       
  1896 
       
  1897     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getElementById(elementId)));
       
  1898     return JSValue::encode(result);
       
  1899 }
       
  1900 
       
  1901 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionAdoptNode(ExecState* exec)
       
  1902 {
       
  1903     JSValue thisValue = exec->hostThisValue();
       
  1904     if (!thisValue.inherits(&JSDocument::s_info))
       
  1905         return throwVMTypeError(exec);
       
  1906     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1907     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1908     ExceptionCode ec = 0;
       
  1909     Node* source = toNode(exec->argument(0));
       
  1910 
       
  1911 
       
  1912     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->adoptNode(source, ec)));
       
  1913     setDOMException(exec, ec);
       
  1914     return JSValue::encode(result);
       
  1915 }
       
  1916 
       
  1917 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateEvent(ExecState* exec)
       
  1918 {
       
  1919     JSValue thisValue = exec->hostThisValue();
       
  1920     if (!thisValue.inherits(&JSDocument::s_info))
       
  1921         return throwVMTypeError(exec);
       
  1922     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1923     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1924     ExceptionCode ec = 0;
       
  1925     const String& eventType = ustringToString(exec->argument(0).toString(exec));
       
  1926 
       
  1927 
       
  1928     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createEvent(eventType, ec)));
       
  1929     setDOMException(exec, ec);
       
  1930     return JSValue::encode(result);
       
  1931 }
       
  1932 
       
  1933 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateRange(ExecState* exec)
       
  1934 {
       
  1935     JSValue thisValue = exec->hostThisValue();
       
  1936     if (!thisValue.inherits(&JSDocument::s_info))
       
  1937         return throwVMTypeError(exec);
       
  1938     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1939     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1940 
       
  1941 
       
  1942     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createRange()));
       
  1943     return JSValue::encode(result);
       
  1944 }
       
  1945 
       
  1946 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateNodeIterator(ExecState* exec)
       
  1947 {
       
  1948     JSValue thisValue = exec->hostThisValue();
       
  1949     if (!thisValue.inherits(&JSDocument::s_info))
       
  1950         return throwVMTypeError(exec);
       
  1951     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1952     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1953     ExceptionCode ec = 0;
       
  1954     Node* root = toNode(exec->argument(0));
       
  1955     unsigned whatToShow = exec->argument(1).toInt32(exec);
       
  1956     RefPtr<NodeFilter> filter = toNodeFilter(exec->argument(2));
       
  1957     bool expandEntityReferences = exec->argument(3).toBoolean(exec);
       
  1958 
       
  1959 
       
  1960     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createNodeIterator(root, whatToShow, filter.get(), expandEntityReferences, ec)));
       
  1961     setDOMException(exec, ec);
       
  1962     return JSValue::encode(result);
       
  1963 }
       
  1964 
       
  1965 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateTreeWalker(ExecState* exec)
       
  1966 {
       
  1967     JSValue thisValue = exec->hostThisValue();
       
  1968     if (!thisValue.inherits(&JSDocument::s_info))
       
  1969         return throwVMTypeError(exec);
       
  1970     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1971     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1972     ExceptionCode ec = 0;
       
  1973     Node* root = toNode(exec->argument(0));
       
  1974     unsigned whatToShow = exec->argument(1).toInt32(exec);
       
  1975     RefPtr<NodeFilter> filter = toNodeFilter(exec->argument(2));
       
  1976     bool expandEntityReferences = exec->argument(3).toBoolean(exec);
       
  1977 
       
  1978 
       
  1979     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createTreeWalker(root, whatToShow, filter.get(), expandEntityReferences, ec)));
       
  1980     setDOMException(exec, ec);
       
  1981     return JSValue::encode(result);
       
  1982 }
       
  1983 
       
  1984 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionGetOverrideStyle(ExecState* exec)
       
  1985 {
       
  1986     JSValue thisValue = exec->hostThisValue();
       
  1987     if (!thisValue.inherits(&JSDocument::s_info))
       
  1988         return throwVMTypeError(exec);
       
  1989     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  1990     Document* imp = static_cast<Document*>(castedThis->impl());
       
  1991     Element* element = toElement(exec->argument(0));
       
  1992     const String& pseudoElement = ustringToString(exec->argument(1).toString(exec));
       
  1993 
       
  1994 
       
  1995     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getOverrideStyle(element, pseudoElement)));
       
  1996     return JSValue::encode(result);
       
  1997 }
       
  1998 
       
  1999 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateExpression(ExecState* exec)
       
  2000 {
       
  2001     JSValue thisValue = exec->hostThisValue();
       
  2002     if (!thisValue.inherits(&JSDocument::s_info))
       
  2003         return throwVMTypeError(exec);
       
  2004     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2005     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2006     ExceptionCode ec = 0;
       
  2007     const String& expression = ustringToString(exec->argument(0).toString(exec));
       
  2008     RefPtr<XPathNSResolver> customResolver;
       
  2009     XPathNSResolver* resolver = toXPathNSResolver(exec->argument(1));
       
  2010     if (!resolver) {
       
  2011         customResolver = JSCustomXPathNSResolver::create(exec, exec->argument(1));
       
  2012         if (exec->hadException())
       
  2013             return JSValue::encode(jsUndefined());
       
  2014         resolver = customResolver.get();
       
  2015     }
       
  2016 
       
  2017 
       
  2018     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createExpression(expression, resolver, ec)));
       
  2019     setDOMException(exec, ec);
       
  2020     return JSValue::encode(result);
       
  2021 }
       
  2022 
       
  2023 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCreateNSResolver(ExecState* exec)
       
  2024 {
       
  2025     JSValue thisValue = exec->hostThisValue();
       
  2026     if (!thisValue.inherits(&JSDocument::s_info))
       
  2027         return throwVMTypeError(exec);
       
  2028     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2029     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2030     Node* nodeResolver = toNode(exec->argument(0));
       
  2031 
       
  2032 
       
  2033     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createNSResolver(nodeResolver)));
       
  2034     return JSValue::encode(result);
       
  2035 }
       
  2036 
       
  2037 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionEvaluate(ExecState* exec)
       
  2038 {
       
  2039     JSValue thisValue = exec->hostThisValue();
       
  2040     if (!thisValue.inherits(&JSDocument::s_info))
       
  2041         return throwVMTypeError(exec);
       
  2042     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2043     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2044     ExceptionCode ec = 0;
       
  2045     const String& expression = ustringToString(exec->argument(0).toString(exec));
       
  2046     Node* contextNode = toNode(exec->argument(1));
       
  2047     RefPtr<XPathNSResolver> customResolver;
       
  2048     XPathNSResolver* resolver = toXPathNSResolver(exec->argument(2));
       
  2049     if (!resolver) {
       
  2050         customResolver = JSCustomXPathNSResolver::create(exec, exec->argument(2));
       
  2051         if (exec->hadException())
       
  2052             return JSValue::encode(jsUndefined());
       
  2053         resolver = customResolver.get();
       
  2054     }
       
  2055     unsigned short type = exec->argument(3).toInt32(exec);
       
  2056     XPathResult* inResult = toXPathResult(exec->argument(4));
       
  2057 
       
  2058 
       
  2059     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->evaluate(expression, contextNode, resolver, type, inResult, ec)));
       
  2060     setDOMException(exec, ec);
       
  2061     return JSValue::encode(result);
       
  2062 }
       
  2063 
       
  2064 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionExecCommand(ExecState* exec)
       
  2065 {
       
  2066     JSValue thisValue = exec->hostThisValue();
       
  2067     if (!thisValue.inherits(&JSDocument::s_info))
       
  2068         return throwVMTypeError(exec);
       
  2069     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2070     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2071     const String& command = ustringToString(exec->argument(0).toString(exec));
       
  2072     bool userInterface = exec->argument(1).toBoolean(exec);
       
  2073     const String& value = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(2));
       
  2074 
       
  2075 
       
  2076     JSC::JSValue result = jsBoolean(imp->execCommand(command, userInterface, value));
       
  2077     return JSValue::encode(result);
       
  2078 }
       
  2079 
       
  2080 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionQueryCommandEnabled(ExecState* exec)
       
  2081 {
       
  2082     JSValue thisValue = exec->hostThisValue();
       
  2083     if (!thisValue.inherits(&JSDocument::s_info))
       
  2084         return throwVMTypeError(exec);
       
  2085     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2086     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2087     const String& command = ustringToString(exec->argument(0).toString(exec));
       
  2088 
       
  2089 
       
  2090     JSC::JSValue result = jsBoolean(imp->queryCommandEnabled(command));
       
  2091     return JSValue::encode(result);
       
  2092 }
       
  2093 
       
  2094 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionQueryCommandIndeterm(ExecState* exec)
       
  2095 {
       
  2096     JSValue thisValue = exec->hostThisValue();
       
  2097     if (!thisValue.inherits(&JSDocument::s_info))
       
  2098         return throwVMTypeError(exec);
       
  2099     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2100     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2101     const String& command = ustringToString(exec->argument(0).toString(exec));
       
  2102 
       
  2103 
       
  2104     JSC::JSValue result = jsBoolean(imp->queryCommandIndeterm(command));
       
  2105     return JSValue::encode(result);
       
  2106 }
       
  2107 
       
  2108 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionQueryCommandState(ExecState* exec)
       
  2109 {
       
  2110     JSValue thisValue = exec->hostThisValue();
       
  2111     if (!thisValue.inherits(&JSDocument::s_info))
       
  2112         return throwVMTypeError(exec);
       
  2113     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2114     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2115     const String& command = ustringToString(exec->argument(0).toString(exec));
       
  2116 
       
  2117 
       
  2118     JSC::JSValue result = jsBoolean(imp->queryCommandState(command));
       
  2119     return JSValue::encode(result);
       
  2120 }
       
  2121 
       
  2122 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionQueryCommandSupported(ExecState* exec)
       
  2123 {
       
  2124     JSValue thisValue = exec->hostThisValue();
       
  2125     if (!thisValue.inherits(&JSDocument::s_info))
       
  2126         return throwVMTypeError(exec);
       
  2127     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2128     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2129     const String& command = ustringToString(exec->argument(0).toString(exec));
       
  2130 
       
  2131 
       
  2132     JSC::JSValue result = jsBoolean(imp->queryCommandSupported(command));
       
  2133     return JSValue::encode(result);
       
  2134 }
       
  2135 
       
  2136 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionQueryCommandValue(ExecState* exec)
       
  2137 {
       
  2138     JSValue thisValue = exec->hostThisValue();
       
  2139     if (!thisValue.inherits(&JSDocument::s_info))
       
  2140         return throwVMTypeError(exec);
       
  2141     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2142     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2143     const String& command = ustringToString(exec->argument(0).toString(exec));
       
  2144 
       
  2145 
       
  2146     JSC::JSValue result = jsStringOrFalse(exec, imp->queryCommandValue(command));
       
  2147     return JSValue::encode(result);
       
  2148 }
       
  2149 
       
  2150 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionGetElementsByName(ExecState* exec)
       
  2151 {
       
  2152     JSValue thisValue = exec->hostThisValue();
       
  2153     if (!thisValue.inherits(&JSDocument::s_info))
       
  2154         return throwVMTypeError(exec);
       
  2155     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2156     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2157     const String& elementName = ustringToString(exec->argument(0).toString(exec));
       
  2158 
       
  2159 
       
  2160     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getElementsByName(elementName)));
       
  2161     return JSValue::encode(result);
       
  2162 }
       
  2163 
       
  2164 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionElementFromPoint(ExecState* exec)
       
  2165 {
       
  2166     JSValue thisValue = exec->hostThisValue();
       
  2167     if (!thisValue.inherits(&JSDocument::s_info))
       
  2168         return throwVMTypeError(exec);
       
  2169     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2170     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2171     int x = exec->argument(0).toInt32(exec);
       
  2172     int y = exec->argument(1).toInt32(exec);
       
  2173 
       
  2174 
       
  2175     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->elementFromPoint(x, y)));
       
  2176     return JSValue::encode(result);
       
  2177 }
       
  2178 
       
  2179 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionCaretRangeFromPoint(ExecState* exec)
       
  2180 {
       
  2181     JSValue thisValue = exec->hostThisValue();
       
  2182     if (!thisValue.inherits(&JSDocument::s_info))
       
  2183         return throwVMTypeError(exec);
       
  2184     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2185     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2186     int x = exec->argument(0).toInt32(exec);
       
  2187     int y = exec->argument(1).toInt32(exec);
       
  2188 
       
  2189 
       
  2190     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->caretRangeFromPoint(x, y)));
       
  2191     return JSValue::encode(result);
       
  2192 }
       
  2193 
       
  2194 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionGetSelection(ExecState* exec)
       
  2195 {
       
  2196     JSValue thisValue = exec->hostThisValue();
       
  2197     if (!thisValue.inherits(&JSDocument::s_info))
       
  2198         return throwVMTypeError(exec);
       
  2199     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2200     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2201 
       
  2202 
       
  2203     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getSelection()));
       
  2204     return JSValue::encode(result);
       
  2205 }
       
  2206 
       
  2207 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionGetCSSCanvasContext(ExecState* exec)
       
  2208 {
       
  2209     JSValue thisValue = exec->hostThisValue();
       
  2210     if (!thisValue.inherits(&JSDocument::s_info))
       
  2211         return throwVMTypeError(exec);
       
  2212     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2213     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2214     const String& contextId = ustringToString(exec->argument(0).toString(exec));
       
  2215     const String& name = ustringToString(exec->argument(1).toString(exec));
       
  2216     int width = exec->argument(2).toInt32(exec);
       
  2217     int height = exec->argument(3).toInt32(exec);
       
  2218 
       
  2219 
       
  2220     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getCSSCanvasContext(contextId, name, width, height)));
       
  2221     return JSValue::encode(result);
       
  2222 }
       
  2223 
       
  2224 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionGetElementsByClassName(ExecState* exec)
       
  2225 {
       
  2226     JSValue thisValue = exec->hostThisValue();
       
  2227     if (!thisValue.inherits(&JSDocument::s_info))
       
  2228         return throwVMTypeError(exec);
       
  2229     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2230     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2231     const String& tagname = ustringToString(exec->argument(0).toString(exec));
       
  2232 
       
  2233 
       
  2234     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getElementsByClassName(tagname)));
       
  2235     return JSValue::encode(result);
       
  2236 }
       
  2237 
       
  2238 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionQuerySelector(ExecState* exec)
       
  2239 {
       
  2240     JSValue thisValue = exec->hostThisValue();
       
  2241     if (!thisValue.inherits(&JSDocument::s_info))
       
  2242         return throwVMTypeError(exec);
       
  2243     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2244     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2245     ExceptionCode ec = 0;
       
  2246     const String& selectors = ustringToString(exec->argument(0).toString(exec));
       
  2247 
       
  2248 
       
  2249     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->querySelector(selectors, ec)));
       
  2250     setDOMException(exec, ec);
       
  2251     return JSValue::encode(result);
       
  2252 }
       
  2253 
       
  2254 EncodedJSValue JSC_HOST_CALL jsDocumentPrototypeFunctionQuerySelectorAll(ExecState* exec)
       
  2255 {
       
  2256     JSValue thisValue = exec->hostThisValue();
       
  2257     if (!thisValue.inherits(&JSDocument::s_info))
       
  2258         return throwVMTypeError(exec);
       
  2259     JSDocument* castedThis = static_cast<JSDocument*>(asObject(thisValue));
       
  2260     Document* imp = static_cast<Document*>(castedThis->impl());
       
  2261     ExceptionCode ec = 0;
       
  2262     const String& selectors = ustringToString(exec->argument(0).toString(exec));
       
  2263 
       
  2264 
       
  2265     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->querySelectorAll(selectors, ec)));
       
  2266     setDOMException(exec, ec);
       
  2267     return JSValue::encode(result);
       
  2268 }
       
  2269 
       
  2270 Document* toDocument(JSC::JSValue value)
       
  2271 {
       
  2272     return value.inherits(&JSDocument::s_info) ? static_cast<JSDocument*>(asObject(value))->impl() : 0;
       
  2273 }
       
  2274 
       
  2275 }