WebCore/generated/JSHTMLSourceElement.cpp
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     1 /*
       
     2     This file is part of the WebKit open source project.
       
     3     This file has been generated by generate-bindings.pl. DO NOT MODIFY!
       
     4 
       
     5     This library is free software; you can redistribute it and/or
       
     6     modify it under the terms of the GNU Library General Public
       
     7     License as published by the Free Software Foundation; either
       
     8     version 2 of the License, or (at your option) any later version.
       
     9 
       
    10     This library is distributed in the hope that it will be useful,
       
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    13     Library General Public License for more details.
       
    14 
       
    15     You should have received a copy of the GNU Library General Public License
       
    16     along with this library; see the file COPYING.LIB.  If not, write to
       
    17     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
       
    18     Boston, MA 02110-1301, USA.
       
    19 */
       
    20 
       
    21 #include "config.h"
       
    22 
       
    23 #if ENABLE(VIDEO)
       
    24 
       
    25 #include "JSHTMLSourceElement.h"
       
    26 
       
    27 #include "HTMLNames.h"
       
    28 #include "HTMLSourceElement.h"
       
    29 #include "KURL.h"
       
    30 #include <runtime/JSString.h>
       
    31 #include <wtf/GetPtr.h>
       
    32 
       
    33 using namespace JSC;
       
    34 
       
    35 namespace WebCore {
       
    36 
       
    37 ASSERT_CLASS_FITS_IN_CELL(JSHTMLSourceElement);
       
    38 
       
    39 /* Hash table */
       
    40 #if ENABLE(JIT)
       
    41 #define THUNK_GENERATOR(generator) , generator
       
    42 #else
       
    43 #define THUNK_GENERATOR(generator)
       
    44 #endif
       
    45 
       
    46 static const HashTableValue JSHTMLSourceElementTableValues[5] =
       
    47 {
       
    48     { "src", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLSourceElementSrc), (intptr_t)setJSHTMLSourceElementSrc THUNK_GENERATOR(0) },
       
    49     { "type", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLSourceElementType), (intptr_t)setJSHTMLSourceElementType THUNK_GENERATOR(0) },
       
    50     { "media", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLSourceElementMedia), (intptr_t)setJSHTMLSourceElementMedia THUNK_GENERATOR(0) },
       
    51     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLSourceElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    52     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    53 };
       
    54 
       
    55 #undef THUNK_GENERATOR
       
    56 static JSC_CONST_HASHTABLE HashTable JSHTMLSourceElementTable = { 9, 7, JSHTMLSourceElementTableValues, 0 };
       
    57 /* Hash table for constructor */
       
    58 #if ENABLE(JIT)
       
    59 #define THUNK_GENERATOR(generator) , generator
       
    60 #else
       
    61 #define THUNK_GENERATOR(generator)
       
    62 #endif
       
    63 
       
    64 static const HashTableValue JSHTMLSourceElementConstructorTableValues[1] =
       
    65 {
       
    66     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    67 };
       
    68 
       
    69 #undef THUNK_GENERATOR
       
    70 static JSC_CONST_HASHTABLE HashTable JSHTMLSourceElementConstructorTable = { 1, 0, JSHTMLSourceElementConstructorTableValues, 0 };
       
    71 class JSHTMLSourceElementConstructor : public DOMConstructorObject {
       
    72 public:
       
    73     JSHTMLSourceElementConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    74 
       
    75     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    76     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    77     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    78     static const JSC::ClassInfo s_info;
       
    79     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    80     {
       
    81         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    82     }
       
    83 protected:
       
    84     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    85 };
       
    86 
       
    87 const ClassInfo JSHTMLSourceElementConstructor::s_info = { "HTMLSourceElementConstructor", 0, &JSHTMLSourceElementConstructorTable, 0 };
       
    88 
       
    89 JSHTMLSourceElementConstructor::JSHTMLSourceElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    90     : DOMConstructorObject(JSHTMLSourceElementConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    91 {
       
    92     putDirect(exec->propertyNames().prototype, JSHTMLSourceElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    93 }
       
    94 
       
    95 bool JSHTMLSourceElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    96 {
       
    97     return getStaticValueSlot<JSHTMLSourceElementConstructor, DOMObject>(exec, &JSHTMLSourceElementConstructorTable, this, propertyName, slot);
       
    98 }
       
    99 
       
   100 bool JSHTMLSourceElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   101 {
       
   102     return getStaticValueDescriptor<JSHTMLSourceElementConstructor, DOMObject>(exec, &JSHTMLSourceElementConstructorTable, this, propertyName, descriptor);
       
   103 }
       
   104 
       
   105 /* Hash table for prototype */
       
   106 #if ENABLE(JIT)
       
   107 #define THUNK_GENERATOR(generator) , generator
       
   108 #else
       
   109 #define THUNK_GENERATOR(generator)
       
   110 #endif
       
   111 
       
   112 static const HashTableValue JSHTMLSourceElementPrototypeTableValues[1] =
       
   113 {
       
   114     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   115 };
       
   116 
       
   117 #undef THUNK_GENERATOR
       
   118 static JSC_CONST_HASHTABLE HashTable JSHTMLSourceElementPrototypeTable = { 1, 0, JSHTMLSourceElementPrototypeTableValues, 0 };
       
   119 const ClassInfo JSHTMLSourceElementPrototype::s_info = { "HTMLSourceElementPrototype", 0, &JSHTMLSourceElementPrototypeTable, 0 };
       
   120 
       
   121 JSObject* JSHTMLSourceElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   122 {
       
   123     return getDOMPrototype<JSHTMLSourceElement>(exec, globalObject);
       
   124 }
       
   125 
       
   126 const ClassInfo JSHTMLSourceElement::s_info = { "HTMLSourceElement", &JSHTMLElement::s_info, &JSHTMLSourceElementTable, 0 };
       
   127 
       
   128 JSHTMLSourceElement::JSHTMLSourceElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLSourceElement> impl)
       
   129     : JSHTMLElement(structure, globalObject, impl)
       
   130 {
       
   131 }
       
   132 
       
   133 JSObject* JSHTMLSourceElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   134 {
       
   135     return new (exec) JSHTMLSourceElementPrototype(globalObject, JSHTMLSourceElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject)));
       
   136 }
       
   137 
       
   138 bool JSHTMLSourceElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   139 {
       
   140     return getStaticValueSlot<JSHTMLSourceElement, Base>(exec, &JSHTMLSourceElementTable, this, propertyName, slot);
       
   141 }
       
   142 
       
   143 bool JSHTMLSourceElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   144 {
       
   145     return getStaticValueDescriptor<JSHTMLSourceElement, Base>(exec, &JSHTMLSourceElementTable, this, propertyName, descriptor);
       
   146 }
       
   147 
       
   148 JSValue jsHTMLSourceElementSrc(ExecState* exec, JSValue slotBase, const Identifier&)
       
   149 {
       
   150     JSHTMLSourceElement* castedThis = static_cast<JSHTMLSourceElement*>(asObject(slotBase));
       
   151     UNUSED_PARAM(exec);
       
   152     HTMLSourceElement* imp = static_cast<HTMLSourceElement*>(castedThis->impl());
       
   153     JSValue result = jsString(exec, imp->getNonEmptyURLAttribute(WebCore::HTMLNames::srcAttr));
       
   154     return result;
       
   155 }
       
   156 
       
   157 JSValue jsHTMLSourceElementType(ExecState* exec, JSValue slotBase, const Identifier&)
       
   158 {
       
   159     JSHTMLSourceElement* castedThis = static_cast<JSHTMLSourceElement*>(asObject(slotBase));
       
   160     UNUSED_PARAM(exec);
       
   161     HTMLSourceElement* imp = static_cast<HTMLSourceElement*>(castedThis->impl());
       
   162     JSValue result = jsString(exec, imp->type());
       
   163     return result;
       
   164 }
       
   165 
       
   166 JSValue jsHTMLSourceElementMedia(ExecState* exec, JSValue slotBase, const Identifier&)
       
   167 {
       
   168     JSHTMLSourceElement* castedThis = static_cast<JSHTMLSourceElement*>(asObject(slotBase));
       
   169     UNUSED_PARAM(exec);
       
   170     HTMLSourceElement* imp = static_cast<HTMLSourceElement*>(castedThis->impl());
       
   171     JSValue result = jsString(exec, imp->media());
       
   172     return result;
       
   173 }
       
   174 
       
   175 JSValue jsHTMLSourceElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   176 {
       
   177     JSHTMLSourceElement* domObject = static_cast<JSHTMLSourceElement*>(asObject(slotBase));
       
   178     return JSHTMLSourceElement::getConstructor(exec, domObject->globalObject());
       
   179 }
       
   180 void JSHTMLSourceElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
       
   181 {
       
   182     lookupPut<JSHTMLSourceElement, Base>(exec, propertyName, value, &JSHTMLSourceElementTable, this, slot);
       
   183 }
       
   184 
       
   185 void setJSHTMLSourceElementSrc(ExecState* exec, JSObject* thisObject, JSValue value)
       
   186 {
       
   187     JSHTMLSourceElement* castedThis = static_cast<JSHTMLSourceElement*>(thisObject);
       
   188     HTMLSourceElement* imp = static_cast<HTMLSourceElement*>(castedThis->impl());
       
   189     imp->setAttribute(WebCore::HTMLNames::srcAttr, valueToStringWithNullCheck(exec, value));
       
   190 }
       
   191 
       
   192 void setJSHTMLSourceElementType(ExecState* exec, JSObject* thisObject, JSValue value)
       
   193 {
       
   194     JSHTMLSourceElement* castedThis = static_cast<JSHTMLSourceElement*>(thisObject);
       
   195     HTMLSourceElement* imp = static_cast<HTMLSourceElement*>(castedThis->impl());
       
   196     imp->setType(ustringToString(value.toString(exec)));
       
   197 }
       
   198 
       
   199 void setJSHTMLSourceElementMedia(ExecState* exec, JSObject* thisObject, JSValue value)
       
   200 {
       
   201     JSHTMLSourceElement* castedThis = static_cast<JSHTMLSourceElement*>(thisObject);
       
   202     HTMLSourceElement* imp = static_cast<HTMLSourceElement*>(castedThis->impl());
       
   203     imp->setMedia(ustringToString(value.toString(exec)));
       
   204 }
       
   205 
       
   206 JSValue JSHTMLSourceElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   207 {
       
   208     return getDOMConstructor<JSHTMLSourceElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   209 }
       
   210 
       
   211 
       
   212 }
       
   213 
       
   214 #endif // ENABLE(VIDEO)