WebCore/generated/JSHTMLMediaElement.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 "JSHTMLMediaElement.h"
       
    26 
       
    27 #include "HTMLMediaElement.h"
       
    28 #include "HTMLNames.h"
       
    29 #include "JSMediaError.h"
       
    30 #include "JSTimeRanges.h"
       
    31 #include "KURL.h"
       
    32 #include "MediaError.h"
       
    33 #include "TimeRanges.h"
       
    34 #include <runtime/Error.h>
       
    35 #include <runtime/JSNumberCell.h>
       
    36 #include <runtime/JSString.h>
       
    37 #include <wtf/GetPtr.h>
       
    38 
       
    39 using namespace JSC;
       
    40 
       
    41 namespace WebCore {
       
    42 
       
    43 ASSERT_CLASS_FITS_IN_CELL(JSHTMLMediaElement);
       
    44 
       
    45 /* Hash table */
       
    46 #if ENABLE(JIT)
       
    47 #define THUNK_GENERATOR(generator) , generator
       
    48 #else
       
    49 #define THUNK_GENERATOR(generator)
       
    50 #endif
       
    51 
       
    52 static const HashTableValue JSHTMLMediaElementTableValues[27] =
       
    53 {
       
    54     { "error", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementError), (intptr_t)0 THUNK_GENERATOR(0) },
       
    55     { "src", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementSrc), (intptr_t)setJSHTMLMediaElementSrc THUNK_GENERATOR(0) },
       
    56     { "currentSrc", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementCurrentSrc), (intptr_t)0 THUNK_GENERATOR(0) },
       
    57     { "networkState", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementNetworkState), (intptr_t)0 THUNK_GENERATOR(0) },
       
    58     { "preload", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementPreload), (intptr_t)setJSHTMLMediaElementPreload THUNK_GENERATOR(0) },
       
    59     { "buffered", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementBuffered), (intptr_t)0 THUNK_GENERATOR(0) },
       
    60     { "readyState", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementReadyState), (intptr_t)0 THUNK_GENERATOR(0) },
       
    61     { "seeking", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementSeeking), (intptr_t)0 THUNK_GENERATOR(0) },
       
    62     { "currentTime", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementCurrentTime), (intptr_t)setJSHTMLMediaElementCurrentTime THUNK_GENERATOR(0) },
       
    63     { "startTime", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementStartTime), (intptr_t)0 THUNK_GENERATOR(0) },
       
    64     { "duration", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementDuration), (intptr_t)0 THUNK_GENERATOR(0) },
       
    65     { "paused", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementPaused), (intptr_t)0 THUNK_GENERATOR(0) },
       
    66     { "defaultPlaybackRate", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementDefaultPlaybackRate), (intptr_t)setJSHTMLMediaElementDefaultPlaybackRate THUNK_GENERATOR(0) },
       
    67     { "playbackRate", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementPlaybackRate), (intptr_t)setJSHTMLMediaElementPlaybackRate THUNK_GENERATOR(0) },
       
    68     { "played", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementPlayed), (intptr_t)0 THUNK_GENERATOR(0) },
       
    69     { "seekable", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementSeekable), (intptr_t)0 THUNK_GENERATOR(0) },
       
    70     { "ended", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementEnded), (intptr_t)0 THUNK_GENERATOR(0) },
       
    71     { "autoplay", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementAutoplay), (intptr_t)setJSHTMLMediaElementAutoplay THUNK_GENERATOR(0) },
       
    72     { "loop", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementLoop), (intptr_t)setJSHTMLMediaElementLoop THUNK_GENERATOR(0) },
       
    73     { "controls", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementControls), (intptr_t)setJSHTMLMediaElementControls THUNK_GENERATOR(0) },
       
    74     { "volume", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementVolume), (intptr_t)setJSHTMLMediaElementVolume THUNK_GENERATOR(0) },
       
    75     { "muted", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementMuted), (intptr_t)setJSHTMLMediaElementMuted THUNK_GENERATOR(0) },
       
    76     { "webkitPreservesPitch", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementWebkitPreservesPitch), (intptr_t)setJSHTMLMediaElementWebkitPreservesPitch THUNK_GENERATOR(0) },
       
    77     { "webkitHasClosedCaptions", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementWebkitHasClosedCaptions), (intptr_t)0 THUNK_GENERATOR(0) },
       
    78     { "webkitClosedCaptionsVisible", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementWebkitClosedCaptionsVisible), (intptr_t)setJSHTMLMediaElementWebkitClosedCaptionsVisible THUNK_GENERATOR(0) },
       
    79     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    80     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    81 };
       
    82 
       
    83 #undef THUNK_GENERATOR
       
    84 static JSC_CONST_HASHTABLE HashTable JSHTMLMediaElementTable = { 69, 63, JSHTMLMediaElementTableValues, 0 };
       
    85 /* Hash table for constructor */
       
    86 #if ENABLE(JIT)
       
    87 #define THUNK_GENERATOR(generator) , generator
       
    88 #else
       
    89 #define THUNK_GENERATOR(generator)
       
    90 #endif
       
    91 
       
    92 static const HashTableValue JSHTMLMediaElementConstructorTableValues[10] =
       
    93 {
       
    94     { "NETWORK_EMPTY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementNETWORK_EMPTY), (intptr_t)0 THUNK_GENERATOR(0) },
       
    95     { "NETWORK_IDLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementNETWORK_IDLE), (intptr_t)0 THUNK_GENERATOR(0) },
       
    96     { "NETWORK_LOADING", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementNETWORK_LOADING), (intptr_t)0 THUNK_GENERATOR(0) },
       
    97     { "NETWORK_NO_SOURCE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementNETWORK_NO_SOURCE), (intptr_t)0 THUNK_GENERATOR(0) },
       
    98     { "HAVE_NOTHING", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementHAVE_NOTHING), (intptr_t)0 THUNK_GENERATOR(0) },
       
    99     { "HAVE_METADATA", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementHAVE_METADATA), (intptr_t)0 THUNK_GENERATOR(0) },
       
   100     { "HAVE_CURRENT_DATA", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementHAVE_CURRENT_DATA), (intptr_t)0 THUNK_GENERATOR(0) },
       
   101     { "HAVE_FUTURE_DATA", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementHAVE_FUTURE_DATA), (intptr_t)0 THUNK_GENERATOR(0) },
       
   102     { "HAVE_ENOUGH_DATA", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementHAVE_ENOUGH_DATA), (intptr_t)0 THUNK_GENERATOR(0) },
       
   103     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   104 };
       
   105 
       
   106 #undef THUNK_GENERATOR
       
   107 static JSC_CONST_HASHTABLE HashTable JSHTMLMediaElementConstructorTable = { 32, 31, JSHTMLMediaElementConstructorTableValues, 0 };
       
   108 
       
   109 COMPILE_ASSERT(0 == HTMLMediaElement::NETWORK_EMPTY, HTMLMediaElementEnumNETWORK_EMPTYIsWrongUseDontCheckEnums);
       
   110 COMPILE_ASSERT(1 == HTMLMediaElement::NETWORK_IDLE, HTMLMediaElementEnumNETWORK_IDLEIsWrongUseDontCheckEnums);
       
   111 COMPILE_ASSERT(2 == HTMLMediaElement::NETWORK_LOADING, HTMLMediaElementEnumNETWORK_LOADINGIsWrongUseDontCheckEnums);
       
   112 COMPILE_ASSERT(3 == HTMLMediaElement::NETWORK_NO_SOURCE, HTMLMediaElementEnumNETWORK_NO_SOURCEIsWrongUseDontCheckEnums);
       
   113 COMPILE_ASSERT(0 == HTMLMediaElement::HAVE_NOTHING, HTMLMediaElementEnumHAVE_NOTHINGIsWrongUseDontCheckEnums);
       
   114 COMPILE_ASSERT(1 == HTMLMediaElement::HAVE_METADATA, HTMLMediaElementEnumHAVE_METADATAIsWrongUseDontCheckEnums);
       
   115 COMPILE_ASSERT(2 == HTMLMediaElement::HAVE_CURRENT_DATA, HTMLMediaElementEnumHAVE_CURRENT_DATAIsWrongUseDontCheckEnums);
       
   116 COMPILE_ASSERT(3 == HTMLMediaElement::HAVE_FUTURE_DATA, HTMLMediaElementEnumHAVE_FUTURE_DATAIsWrongUseDontCheckEnums);
       
   117 COMPILE_ASSERT(4 == HTMLMediaElement::HAVE_ENOUGH_DATA, HTMLMediaElementEnumHAVE_ENOUGH_DATAIsWrongUseDontCheckEnums);
       
   118 
       
   119 class JSHTMLMediaElementConstructor : public DOMConstructorObject {
       
   120 public:
       
   121     JSHTMLMediaElementConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
   122 
       
   123     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
   124     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
   125     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
   126     static const JSC::ClassInfo s_info;
       
   127     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
   128     {
       
   129         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
   130     }
       
   131 protected:
       
   132     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
   133 };
       
   134 
       
   135 const ClassInfo JSHTMLMediaElementConstructor::s_info = { "HTMLMediaElementConstructor", 0, &JSHTMLMediaElementConstructorTable, 0 };
       
   136 
       
   137 JSHTMLMediaElementConstructor::JSHTMLMediaElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
   138     : DOMConstructorObject(JSHTMLMediaElementConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
   139 {
       
   140     putDirect(exec->propertyNames().prototype, JSHTMLMediaElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
   141 }
       
   142 
       
   143 bool JSHTMLMediaElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   144 {
       
   145     return getStaticValueSlot<JSHTMLMediaElementConstructor, DOMObject>(exec, &JSHTMLMediaElementConstructorTable, this, propertyName, slot);
       
   146 }
       
   147 
       
   148 bool JSHTMLMediaElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   149 {
       
   150     return getStaticValueDescriptor<JSHTMLMediaElementConstructor, DOMObject>(exec, &JSHTMLMediaElementConstructorTable, this, propertyName, descriptor);
       
   151 }
       
   152 
       
   153 /* Hash table for prototype */
       
   154 #if ENABLE(JIT)
       
   155 #define THUNK_GENERATOR(generator) , generator
       
   156 #else
       
   157 #define THUNK_GENERATOR(generator)
       
   158 #endif
       
   159 
       
   160 static const HashTableValue JSHTMLMediaElementPrototypeTableValues[14] =
       
   161 {
       
   162     { "NETWORK_EMPTY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementNETWORK_EMPTY), (intptr_t)0 THUNK_GENERATOR(0) },
       
   163     { "NETWORK_IDLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementNETWORK_IDLE), (intptr_t)0 THUNK_GENERATOR(0) },
       
   164     { "NETWORK_LOADING", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementNETWORK_LOADING), (intptr_t)0 THUNK_GENERATOR(0) },
       
   165     { "NETWORK_NO_SOURCE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementNETWORK_NO_SOURCE), (intptr_t)0 THUNK_GENERATOR(0) },
       
   166     { "HAVE_NOTHING", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementHAVE_NOTHING), (intptr_t)0 THUNK_GENERATOR(0) },
       
   167     { "HAVE_METADATA", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementHAVE_METADATA), (intptr_t)0 THUNK_GENERATOR(0) },
       
   168     { "HAVE_CURRENT_DATA", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementHAVE_CURRENT_DATA), (intptr_t)0 THUNK_GENERATOR(0) },
       
   169     { "HAVE_FUTURE_DATA", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementHAVE_FUTURE_DATA), (intptr_t)0 THUNK_GENERATOR(0) },
       
   170     { "HAVE_ENOUGH_DATA", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementHAVE_ENOUGH_DATA), (intptr_t)0 THUNK_GENERATOR(0) },
       
   171     { "load", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLMediaElementPrototypeFunctionLoad), (intptr_t)0 THUNK_GENERATOR(0) },
       
   172     { "canPlayType", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLMediaElementPrototypeFunctionCanPlayType), (intptr_t)1 THUNK_GENERATOR(0) },
       
   173     { "play", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLMediaElementPrototypeFunctionPlay), (intptr_t)0 THUNK_GENERATOR(0) },
       
   174     { "pause", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLMediaElementPrototypeFunctionPause), (intptr_t)0 THUNK_GENERATOR(0) },
       
   175     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   176 };
       
   177 
       
   178 #undef THUNK_GENERATOR
       
   179 static JSC_CONST_HASHTABLE HashTable JSHTMLMediaElementPrototypeTable = { 32, 31, JSHTMLMediaElementPrototypeTableValues, 0 };
       
   180 const ClassInfo JSHTMLMediaElementPrototype::s_info = { "HTMLMediaElementPrototype", 0, &JSHTMLMediaElementPrototypeTable, 0 };
       
   181 
       
   182 JSObject* JSHTMLMediaElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   183 {
       
   184     return getDOMPrototype<JSHTMLMediaElement>(exec, globalObject);
       
   185 }
       
   186 
       
   187 bool JSHTMLMediaElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   188 {
       
   189     return getStaticPropertySlot<JSHTMLMediaElementPrototype, JSObject>(exec, &JSHTMLMediaElementPrototypeTable, this, propertyName, slot);
       
   190 }
       
   191 
       
   192 bool JSHTMLMediaElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   193 {
       
   194     return getStaticPropertyDescriptor<JSHTMLMediaElementPrototype, JSObject>(exec, &JSHTMLMediaElementPrototypeTable, this, propertyName, descriptor);
       
   195 }
       
   196 
       
   197 const ClassInfo JSHTMLMediaElement::s_info = { "HTMLMediaElement", &JSHTMLElement::s_info, &JSHTMLMediaElementTable, 0 };
       
   198 
       
   199 JSHTMLMediaElement::JSHTMLMediaElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLMediaElement> impl)
       
   200     : JSHTMLElement(structure, globalObject, impl)
       
   201 {
       
   202 }
       
   203 
       
   204 JSObject* JSHTMLMediaElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   205 {
       
   206     return new (exec) JSHTMLMediaElementPrototype(globalObject, JSHTMLMediaElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject)));
       
   207 }
       
   208 
       
   209 bool JSHTMLMediaElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   210 {
       
   211     return getStaticValueSlot<JSHTMLMediaElement, Base>(exec, &JSHTMLMediaElementTable, this, propertyName, slot);
       
   212 }
       
   213 
       
   214 bool JSHTMLMediaElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   215 {
       
   216     return getStaticValueDescriptor<JSHTMLMediaElement, Base>(exec, &JSHTMLMediaElementTable, this, propertyName, descriptor);
       
   217 }
       
   218 
       
   219 JSValue jsHTMLMediaElementError(ExecState* exec, JSValue slotBase, const Identifier&)
       
   220 {
       
   221     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   222     UNUSED_PARAM(exec);
       
   223     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   224     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->error()));
       
   225     return result;
       
   226 }
       
   227 
       
   228 JSValue jsHTMLMediaElementSrc(ExecState* exec, JSValue slotBase, const Identifier&)
       
   229 {
       
   230     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   231     UNUSED_PARAM(exec);
       
   232     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   233     JSValue result = jsString(exec, imp->getNonEmptyURLAttribute(WebCore::HTMLNames::srcAttr));
       
   234     return result;
       
   235 }
       
   236 
       
   237 JSValue jsHTMLMediaElementCurrentSrc(ExecState* exec, JSValue slotBase, const Identifier&)
       
   238 {
       
   239     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   240     UNUSED_PARAM(exec);
       
   241     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   242     JSValue result = jsString(exec, imp->currentSrc());
       
   243     return result;
       
   244 }
       
   245 
       
   246 JSValue jsHTMLMediaElementNetworkState(ExecState* exec, JSValue slotBase, const Identifier&)
       
   247 {
       
   248     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   249     UNUSED_PARAM(exec);
       
   250     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   251     JSValue result = jsNumber(exec, imp->networkState());
       
   252     return result;
       
   253 }
       
   254 
       
   255 JSValue jsHTMLMediaElementPreload(ExecState* exec, JSValue slotBase, const Identifier&)
       
   256 {
       
   257     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   258     UNUSED_PARAM(exec);
       
   259     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   260     JSValue result = jsString(exec, imp->preload());
       
   261     return result;
       
   262 }
       
   263 
       
   264 JSValue jsHTMLMediaElementBuffered(ExecState* exec, JSValue slotBase, const Identifier&)
       
   265 {
       
   266     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   267     UNUSED_PARAM(exec);
       
   268     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   269     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->buffered()));
       
   270     return result;
       
   271 }
       
   272 
       
   273 JSValue jsHTMLMediaElementReadyState(ExecState* exec, JSValue slotBase, const Identifier&)
       
   274 {
       
   275     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   276     UNUSED_PARAM(exec);
       
   277     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   278     JSValue result = jsNumber(exec, imp->readyState());
       
   279     return result;
       
   280 }
       
   281 
       
   282 JSValue jsHTMLMediaElementSeeking(ExecState* exec, JSValue slotBase, const Identifier&)
       
   283 {
       
   284     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   285     UNUSED_PARAM(exec);
       
   286     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   287     JSValue result = jsBoolean(imp->seeking());
       
   288     return result;
       
   289 }
       
   290 
       
   291 JSValue jsHTMLMediaElementCurrentTime(ExecState* exec, JSValue slotBase, const Identifier&)
       
   292 {
       
   293     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   294     UNUSED_PARAM(exec);
       
   295     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   296     JSValue result = jsNumber(exec, imp->currentTime());
       
   297     return result;
       
   298 }
       
   299 
       
   300 JSValue jsHTMLMediaElementStartTime(ExecState* exec, JSValue slotBase, const Identifier&)
       
   301 {
       
   302     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   303     UNUSED_PARAM(exec);
       
   304     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   305     JSValue result = jsNumber(exec, imp->startTime());
       
   306     return result;
       
   307 }
       
   308 
       
   309 JSValue jsHTMLMediaElementDuration(ExecState* exec, JSValue slotBase, const Identifier&)
       
   310 {
       
   311     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   312     UNUSED_PARAM(exec);
       
   313     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   314     JSValue result = jsNumber(exec, imp->duration());
       
   315     return result;
       
   316 }
       
   317 
       
   318 JSValue jsHTMLMediaElementPaused(ExecState* exec, JSValue slotBase, const Identifier&)
       
   319 {
       
   320     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   321     UNUSED_PARAM(exec);
       
   322     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   323     JSValue result = jsBoolean(imp->paused());
       
   324     return result;
       
   325 }
       
   326 
       
   327 JSValue jsHTMLMediaElementDefaultPlaybackRate(ExecState* exec, JSValue slotBase, const Identifier&)
       
   328 {
       
   329     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   330     UNUSED_PARAM(exec);
       
   331     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   332     JSValue result = jsNumber(exec, imp->defaultPlaybackRate());
       
   333     return result;
       
   334 }
       
   335 
       
   336 JSValue jsHTMLMediaElementPlaybackRate(ExecState* exec, JSValue slotBase, const Identifier&)
       
   337 {
       
   338     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   339     UNUSED_PARAM(exec);
       
   340     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   341     JSValue result = jsNumber(exec, imp->playbackRate());
       
   342     return result;
       
   343 }
       
   344 
       
   345 JSValue jsHTMLMediaElementPlayed(ExecState* exec, JSValue slotBase, const Identifier&)
       
   346 {
       
   347     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   348     UNUSED_PARAM(exec);
       
   349     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   350     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->played()));
       
   351     return result;
       
   352 }
       
   353 
       
   354 JSValue jsHTMLMediaElementSeekable(ExecState* exec, JSValue slotBase, const Identifier&)
       
   355 {
       
   356     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   357     UNUSED_PARAM(exec);
       
   358     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   359     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->seekable()));
       
   360     return result;
       
   361 }
       
   362 
       
   363 JSValue jsHTMLMediaElementEnded(ExecState* exec, JSValue slotBase, const Identifier&)
       
   364 {
       
   365     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   366     UNUSED_PARAM(exec);
       
   367     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   368     JSValue result = jsBoolean(imp->ended());
       
   369     return result;
       
   370 }
       
   371 
       
   372 JSValue jsHTMLMediaElementAutoplay(ExecState* exec, JSValue slotBase, const Identifier&)
       
   373 {
       
   374     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   375     UNUSED_PARAM(exec);
       
   376     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   377     JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::autoplayAttr));
       
   378     return result;
       
   379 }
       
   380 
       
   381 JSValue jsHTMLMediaElementLoop(ExecState* exec, JSValue slotBase, const Identifier&)
       
   382 {
       
   383     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   384     UNUSED_PARAM(exec);
       
   385     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   386     JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::loopAttr));
       
   387     return result;
       
   388 }
       
   389 
       
   390 JSValue jsHTMLMediaElementControls(ExecState* exec, JSValue slotBase, const Identifier&)
       
   391 {
       
   392     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   393     UNUSED_PARAM(exec);
       
   394     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   395     JSValue result = jsBoolean(imp->controls());
       
   396     return result;
       
   397 }
       
   398 
       
   399 JSValue jsHTMLMediaElementVolume(ExecState* exec, JSValue slotBase, const Identifier&)
       
   400 {
       
   401     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   402     UNUSED_PARAM(exec);
       
   403     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   404     JSValue result = jsNumber(exec, imp->volume());
       
   405     return result;
       
   406 }
       
   407 
       
   408 JSValue jsHTMLMediaElementMuted(ExecState* exec, JSValue slotBase, const Identifier&)
       
   409 {
       
   410     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   411     UNUSED_PARAM(exec);
       
   412     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   413     JSValue result = jsBoolean(imp->muted());
       
   414     return result;
       
   415 }
       
   416 
       
   417 JSValue jsHTMLMediaElementWebkitPreservesPitch(ExecState* exec, JSValue slotBase, const Identifier&)
       
   418 {
       
   419     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   420     UNUSED_PARAM(exec);
       
   421     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   422     JSValue result = jsBoolean(imp->webkitPreservesPitch());
       
   423     return result;
       
   424 }
       
   425 
       
   426 JSValue jsHTMLMediaElementWebkitHasClosedCaptions(ExecState* exec, JSValue slotBase, const Identifier&)
       
   427 {
       
   428     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   429     UNUSED_PARAM(exec);
       
   430     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   431     JSValue result = jsBoolean(imp->webkitHasClosedCaptions());
       
   432     return result;
       
   433 }
       
   434 
       
   435 JSValue jsHTMLMediaElementWebkitClosedCaptionsVisible(ExecState* exec, JSValue slotBase, const Identifier&)
       
   436 {
       
   437     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   438     UNUSED_PARAM(exec);
       
   439     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   440     JSValue result = jsBoolean(imp->webkitClosedCaptionsVisible());
       
   441     return result;
       
   442 }
       
   443 
       
   444 JSValue jsHTMLMediaElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   445 {
       
   446     JSHTMLMediaElement* domObject = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
       
   447     return JSHTMLMediaElement::getConstructor(exec, domObject->globalObject());
       
   448 }
       
   449 void JSHTMLMediaElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
       
   450 {
       
   451     lookupPut<JSHTMLMediaElement, Base>(exec, propertyName, value, &JSHTMLMediaElementTable, this, slot);
       
   452 }
       
   453 
       
   454 void setJSHTMLMediaElementSrc(ExecState* exec, JSObject* thisObject, JSValue value)
       
   455 {
       
   456     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
       
   457     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   458     imp->setAttribute(WebCore::HTMLNames::srcAttr, valueToStringWithNullCheck(exec, value));
       
   459 }
       
   460 
       
   461 void setJSHTMLMediaElementPreload(ExecState* exec, JSObject* thisObject, JSValue value)
       
   462 {
       
   463     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
       
   464     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   465     imp->setPreload(ustringToString(value.toString(exec)));
       
   466 }
       
   467 
       
   468 void setJSHTMLMediaElementCurrentTime(ExecState* exec, JSObject* thisObject, JSValue value)
       
   469 {
       
   470     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
       
   471     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   472     ExceptionCode ec = 0;
       
   473     imp->setCurrentTime(value.toFloat(exec), ec);
       
   474     setDOMException(exec, ec);
       
   475 }
       
   476 
       
   477 void setJSHTMLMediaElementDefaultPlaybackRate(ExecState* exec, JSObject* thisObject, JSValue value)
       
   478 {
       
   479     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
       
   480     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   481     imp->setDefaultPlaybackRate(value.toFloat(exec));
       
   482 }
       
   483 
       
   484 void setJSHTMLMediaElementPlaybackRate(ExecState* exec, JSObject* thisObject, JSValue value)
       
   485 {
       
   486     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
       
   487     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   488     imp->setPlaybackRate(value.toFloat(exec));
       
   489 }
       
   490 
       
   491 void setJSHTMLMediaElementAutoplay(ExecState* exec, JSObject* thisObject, JSValue value)
       
   492 {
       
   493     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
       
   494     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   495     imp->setBooleanAttribute(WebCore::HTMLNames::autoplayAttr, value.toBoolean(exec));
       
   496 }
       
   497 
       
   498 void setJSHTMLMediaElementLoop(ExecState* exec, JSObject* thisObject, JSValue value)
       
   499 {
       
   500     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
       
   501     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   502     imp->setBooleanAttribute(WebCore::HTMLNames::loopAttr, value.toBoolean(exec));
       
   503 }
       
   504 
       
   505 void setJSHTMLMediaElementControls(ExecState* exec, JSObject* thisObject, JSValue value)
       
   506 {
       
   507     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
       
   508     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   509     imp->setControls(value.toBoolean(exec));
       
   510 }
       
   511 
       
   512 void setJSHTMLMediaElementVolume(ExecState* exec, JSObject* thisObject, JSValue value)
       
   513 {
       
   514     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
       
   515     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   516     ExceptionCode ec = 0;
       
   517     imp->setVolume(value.toFloat(exec), ec);
       
   518     setDOMException(exec, ec);
       
   519 }
       
   520 
       
   521 void setJSHTMLMediaElementMuted(ExecState* exec, JSObject* thisObject, JSValue value)
       
   522 {
       
   523     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
       
   524     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   525     imp->setMuted(value.toBoolean(exec));
       
   526 }
       
   527 
       
   528 void setJSHTMLMediaElementWebkitPreservesPitch(ExecState* exec, JSObject* thisObject, JSValue value)
       
   529 {
       
   530     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
       
   531     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   532     imp->setWebkitPreservesPitch(value.toBoolean(exec));
       
   533 }
       
   534 
       
   535 void setJSHTMLMediaElementWebkitClosedCaptionsVisible(ExecState* exec, JSObject* thisObject, JSValue value)
       
   536 {
       
   537     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
       
   538     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   539     imp->setWebkitClosedCaptionsVisible(value.toBoolean(exec));
       
   540 }
       
   541 
       
   542 JSValue JSHTMLMediaElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   543 {
       
   544     return getDOMConstructor<JSHTMLMediaElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   545 }
       
   546 
       
   547 EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionLoad(ExecState* exec)
       
   548 {
       
   549     JSValue thisValue = exec->hostThisValue();
       
   550     if (!thisValue.inherits(&JSHTMLMediaElement::s_info))
       
   551         return throwVMTypeError(exec);
       
   552     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(thisValue));
       
   553     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   554     ExceptionCode ec = 0;
       
   555 
       
   556     imp->load(processingUserGesture(exec), ec);
       
   557     setDOMException(exec, ec);
       
   558     return JSValue::encode(jsUndefined());
       
   559 }
       
   560 
       
   561 EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionCanPlayType(ExecState* exec)
       
   562 {
       
   563     JSValue thisValue = exec->hostThisValue();
       
   564     if (!thisValue.inherits(&JSHTMLMediaElement::s_info))
       
   565         return throwVMTypeError(exec);
       
   566     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(thisValue));
       
   567     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   568     const String& type = ustringToString(exec->argument(0).toString(exec));
       
   569 
       
   570 
       
   571     JSC::JSValue result = jsString(exec, imp->canPlayType(type));
       
   572     return JSValue::encode(result);
       
   573 }
       
   574 
       
   575 EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionPlay(ExecState* exec)
       
   576 {
       
   577     JSValue thisValue = exec->hostThisValue();
       
   578     if (!thisValue.inherits(&JSHTMLMediaElement::s_info))
       
   579         return throwVMTypeError(exec);
       
   580     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(thisValue));
       
   581     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   582 
       
   583     imp->play(processingUserGesture(exec));
       
   584     return JSValue::encode(jsUndefined());
       
   585 }
       
   586 
       
   587 EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionPause(ExecState* exec)
       
   588 {
       
   589     JSValue thisValue = exec->hostThisValue();
       
   590     if (!thisValue.inherits(&JSHTMLMediaElement::s_info))
       
   591         return throwVMTypeError(exec);
       
   592     JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(thisValue));
       
   593     HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
       
   594 
       
   595     imp->pause(processingUserGesture(exec));
       
   596     return JSValue::encode(jsUndefined());
       
   597 }
       
   598 
       
   599 // Constant getters
       
   600 
       
   601 JSValue jsHTMLMediaElementNETWORK_EMPTY(ExecState* exec, JSValue, const Identifier&)
       
   602 {
       
   603     return jsNumber(exec, static_cast<int>(0));
       
   604 }
       
   605 
       
   606 JSValue jsHTMLMediaElementNETWORK_IDLE(ExecState* exec, JSValue, const Identifier&)
       
   607 {
       
   608     return jsNumber(exec, static_cast<int>(1));
       
   609 }
       
   610 
       
   611 JSValue jsHTMLMediaElementNETWORK_LOADING(ExecState* exec, JSValue, const Identifier&)
       
   612 {
       
   613     return jsNumber(exec, static_cast<int>(2));
       
   614 }
       
   615 
       
   616 JSValue jsHTMLMediaElementNETWORK_NO_SOURCE(ExecState* exec, JSValue, const Identifier&)
       
   617 {
       
   618     return jsNumber(exec, static_cast<int>(3));
       
   619 }
       
   620 
       
   621 JSValue jsHTMLMediaElementHAVE_NOTHING(ExecState* exec, JSValue, const Identifier&)
       
   622 {
       
   623     return jsNumber(exec, static_cast<int>(0));
       
   624 }
       
   625 
       
   626 JSValue jsHTMLMediaElementHAVE_METADATA(ExecState* exec, JSValue, const Identifier&)
       
   627 {
       
   628     return jsNumber(exec, static_cast<int>(1));
       
   629 }
       
   630 
       
   631 JSValue jsHTMLMediaElementHAVE_CURRENT_DATA(ExecState* exec, JSValue, const Identifier&)
       
   632 {
       
   633     return jsNumber(exec, static_cast<int>(2));
       
   634 }
       
   635 
       
   636 JSValue jsHTMLMediaElementHAVE_FUTURE_DATA(ExecState* exec, JSValue, const Identifier&)
       
   637 {
       
   638     return jsNumber(exec, static_cast<int>(3));
       
   639 }
       
   640 
       
   641 JSValue jsHTMLMediaElementHAVE_ENOUGH_DATA(ExecState* exec, JSValue, const Identifier&)
       
   642 {
       
   643     return jsNumber(exec, static_cast<int>(4));
       
   644 }
       
   645 
       
   646 
       
   647 }
       
   648 
       
   649 #endif // ENABLE(VIDEO)