21
21
#include "config.h"
26
25
#include "JSHTMLAudioElement.h"
27
#include "HTMLAudioElement.h"
28
28
#include <wtf/GetPtr.h>
30
#include "HTMLAudioElement.h"
32
#include <runtime/JSNumberCell.h>
34
30
using namespace JSC;
36
32
namespace WebCore {
38
ASSERT_CLASS_FITS_IN_CELL(JSHTMLAudioElement)
34
ASSERT_CLASS_FITS_IN_CELL(JSHTMLAudioElement);
48
static const HashTable JSHTMLAudioElementTable =
44
static JSC_CONST_HASHTABLE HashTable JSHTMLAudioElementTable =
49
45
#if ENABLE(PERFECT_HASH_SIZE)
50
46
{ 0, JSHTMLAudioElementTableValues, 0 };
62
static const HashTable JSHTMLAudioElementConstructorTable =
58
static JSC_CONST_HASHTABLE HashTable JSHTMLAudioElementConstructorTable =
63
59
#if ENABLE(PERFECT_HASH_SIZE)
64
60
{ 0, JSHTMLAudioElementConstructorTableValues, 0 };
66
62
{ 1, 0, JSHTMLAudioElementConstructorTableValues, 0 };
69
class JSHTMLAudioElementConstructor : public DOMObject {
65
class JSHTMLAudioElementConstructor : public DOMConstructorObject {
71
JSHTMLAudioElementConstructor(ExecState* exec)
72
: DOMObject(JSHTMLAudioElementConstructor::createStructure(exec->lexicalGlobalObject()->objectPrototype()))
67
JSHTMLAudioElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
68
: DOMConstructorObject(JSHTMLAudioElementConstructor::createStructure(globalObject->objectPrototype()), globalObject)
74
putDirect(exec->propertyNames().prototype, JSHTMLAudioElementPrototype::self(exec, exec->lexicalGlobalObject()), None);
70
putDirect(exec->propertyNames().prototype, JSHTMLAudioElementPrototype::self(exec, globalObject), None);
76
72
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
73
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
77
74
virtual const ClassInfo* classInfo() const { return &s_info; }
78
75
static const ClassInfo s_info;
80
static PassRefPtr<Structure> createStructure(JSValuePtr proto)
77
static PassRefPtr<Structure> createStructure(JSValue proto)
82
79
return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance));
90
87
return getStaticValueSlot<JSHTMLAudioElementConstructor, DOMObject>(exec, &JSHTMLAudioElementConstructorTable, this, propertyName, slot);
90
bool JSHTMLAudioElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
92
return getStaticValueDescriptor<JSHTMLAudioElementConstructor, DOMObject>(exec, &JSHTMLAudioElementConstructorTable, this, propertyName, descriptor);
93
95
/* Hash table for prototype */
95
97
static const HashTableValue JSHTMLAudioElementPrototypeTableValues[1] =
100
static const HashTable JSHTMLAudioElementPrototypeTable =
102
static JSC_CONST_HASHTABLE HashTable JSHTMLAudioElementPrototypeTable =
101
103
#if ENABLE(PERFECT_HASH_SIZE)
102
104
{ 0, JSHTMLAudioElementPrototypeTableValues, 0 };
114
116
const ClassInfo JSHTMLAudioElement::s_info = { "HTMLAudioElement", &JSHTMLMediaElement::s_info, &JSHTMLAudioElementTable, 0 };
116
JSHTMLAudioElement::JSHTMLAudioElement(PassRefPtr<Structure> structure, PassRefPtr<HTMLAudioElement> impl)
117
: JSHTMLMediaElement(structure, impl)
118
JSHTMLAudioElement::JSHTMLAudioElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLAudioElement> impl)
119
: JSHTMLMediaElement(structure, globalObject, impl)
128
130
return getStaticValueSlot<JSHTMLAudioElement, Base>(exec, &JSHTMLAudioElementTable, this, propertyName, slot);
131
JSValuePtr jsHTMLAudioElementConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
133
return static_cast<JSHTMLAudioElement*>(asObject(slot.slotBase()))->getConstructor(exec);
135
JSValuePtr JSHTMLAudioElement::getConstructor(ExecState* exec)
137
return getDOMConstructor<JSHTMLAudioElementConstructor>(exec);
133
bool JSHTMLAudioElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
135
return getStaticValueDescriptor<JSHTMLAudioElement, Base>(exec, &JSHTMLAudioElementTable, this, propertyName, descriptor);
138
JSValue jsHTMLAudioElementConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
140
JSHTMLAudioElement* domObject = static_cast<JSHTMLAudioElement*>(asObject(slot.slotBase()));
141
return JSHTMLAudioElement::getConstructor(exec, domObject->globalObject());
143
JSValue JSHTMLAudioElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
145
return getDOMConstructor<JSHTMLAudioElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));