|
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 "JSHTMLMapElement.h" |
|
23 |
|
24 #include "HTMLCollection.h" |
|
25 #include "HTMLMapElement.h" |
|
26 #include "HTMLNames.h" |
|
27 #include "JSHTMLCollection.h" |
|
28 #include "KURL.h" |
|
29 #include <runtime/JSString.h> |
|
30 #include <wtf/GetPtr.h> |
|
31 |
|
32 using namespace JSC; |
|
33 |
|
34 namespace WebCore { |
|
35 |
|
36 ASSERT_CLASS_FITS_IN_CELL(JSHTMLMapElement); |
|
37 |
|
38 /* Hash table */ |
|
39 #if ENABLE(JIT) |
|
40 #define THUNK_GENERATOR(generator) , generator |
|
41 #else |
|
42 #define THUNK_GENERATOR(generator) |
|
43 #endif |
|
44 |
|
45 static const HashTableValue JSHTMLMapElementTableValues[4] = |
|
46 { |
|
47 { "areas", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMapElementAreas), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
48 { "name", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMapElementName), (intptr_t)setJSHTMLMapElementName THUNK_GENERATOR(0) }, |
|
49 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMapElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
50 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
51 }; |
|
52 |
|
53 #undef THUNK_GENERATOR |
|
54 static JSC_CONST_HASHTABLE HashTable JSHTMLMapElementTable = { 9, 7, JSHTMLMapElementTableValues, 0 }; |
|
55 /* Hash table for constructor */ |
|
56 #if ENABLE(JIT) |
|
57 #define THUNK_GENERATOR(generator) , generator |
|
58 #else |
|
59 #define THUNK_GENERATOR(generator) |
|
60 #endif |
|
61 |
|
62 static const HashTableValue JSHTMLMapElementConstructorTableValues[1] = |
|
63 { |
|
64 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
65 }; |
|
66 |
|
67 #undef THUNK_GENERATOR |
|
68 static JSC_CONST_HASHTABLE HashTable JSHTMLMapElementConstructorTable = { 1, 0, JSHTMLMapElementConstructorTableValues, 0 }; |
|
69 class JSHTMLMapElementConstructor : public DOMConstructorObject { |
|
70 public: |
|
71 JSHTMLMapElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
72 |
|
73 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
74 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
75 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
76 static const JSC::ClassInfo s_info; |
|
77 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
78 { |
|
79 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
80 } |
|
81 protected: |
|
82 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
83 }; |
|
84 |
|
85 const ClassInfo JSHTMLMapElementConstructor::s_info = { "HTMLMapElementConstructor", 0, &JSHTMLMapElementConstructorTable, 0 }; |
|
86 |
|
87 JSHTMLMapElementConstructor::JSHTMLMapElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
88 : DOMConstructorObject(JSHTMLMapElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
89 { |
|
90 putDirect(exec->propertyNames().prototype, JSHTMLMapElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
91 } |
|
92 |
|
93 bool JSHTMLMapElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
94 { |
|
95 return getStaticValueSlot<JSHTMLMapElementConstructor, DOMObject>(exec, &JSHTMLMapElementConstructorTable, this, propertyName, slot); |
|
96 } |
|
97 |
|
98 bool JSHTMLMapElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
99 { |
|
100 return getStaticValueDescriptor<JSHTMLMapElementConstructor, DOMObject>(exec, &JSHTMLMapElementConstructorTable, this, propertyName, descriptor); |
|
101 } |
|
102 |
|
103 /* Hash table for prototype */ |
|
104 #if ENABLE(JIT) |
|
105 #define THUNK_GENERATOR(generator) , generator |
|
106 #else |
|
107 #define THUNK_GENERATOR(generator) |
|
108 #endif |
|
109 |
|
110 static const HashTableValue JSHTMLMapElementPrototypeTableValues[1] = |
|
111 { |
|
112 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
113 }; |
|
114 |
|
115 #undef THUNK_GENERATOR |
|
116 static JSC_CONST_HASHTABLE HashTable JSHTMLMapElementPrototypeTable = { 1, 0, JSHTMLMapElementPrototypeTableValues, 0 }; |
|
117 const ClassInfo JSHTMLMapElementPrototype::s_info = { "HTMLMapElementPrototype", 0, &JSHTMLMapElementPrototypeTable, 0 }; |
|
118 |
|
119 JSObject* JSHTMLMapElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
120 { |
|
121 return getDOMPrototype<JSHTMLMapElement>(exec, globalObject); |
|
122 } |
|
123 |
|
124 const ClassInfo JSHTMLMapElement::s_info = { "HTMLMapElement", &JSHTMLElement::s_info, &JSHTMLMapElementTable, 0 }; |
|
125 |
|
126 JSHTMLMapElement::JSHTMLMapElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLMapElement> impl) |
|
127 : JSHTMLElement(structure, globalObject, impl) |
|
128 { |
|
129 } |
|
130 |
|
131 JSObject* JSHTMLMapElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
132 { |
|
133 return new (exec) JSHTMLMapElementPrototype(globalObject, JSHTMLMapElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
134 } |
|
135 |
|
136 bool JSHTMLMapElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
137 { |
|
138 return getStaticValueSlot<JSHTMLMapElement, Base>(exec, &JSHTMLMapElementTable, this, propertyName, slot); |
|
139 } |
|
140 |
|
141 bool JSHTMLMapElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
142 { |
|
143 return getStaticValueDescriptor<JSHTMLMapElement, Base>(exec, &JSHTMLMapElementTable, this, propertyName, descriptor); |
|
144 } |
|
145 |
|
146 JSValue jsHTMLMapElementAreas(ExecState* exec, JSValue slotBase, const Identifier&) |
|
147 { |
|
148 JSHTMLMapElement* castedThis = static_cast<JSHTMLMapElement*>(asObject(slotBase)); |
|
149 UNUSED_PARAM(exec); |
|
150 HTMLMapElement* imp = static_cast<HTMLMapElement*>(castedThis->impl()); |
|
151 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->areas())); |
|
152 return result; |
|
153 } |
|
154 |
|
155 JSValue jsHTMLMapElementName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
156 { |
|
157 JSHTMLMapElement* castedThis = static_cast<JSHTMLMapElement*>(asObject(slotBase)); |
|
158 UNUSED_PARAM(exec); |
|
159 HTMLMapElement* imp = static_cast<HTMLMapElement*>(castedThis->impl()); |
|
160 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::nameAttr)); |
|
161 return result; |
|
162 } |
|
163 |
|
164 JSValue jsHTMLMapElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
165 { |
|
166 JSHTMLMapElement* domObject = static_cast<JSHTMLMapElement*>(asObject(slotBase)); |
|
167 return JSHTMLMapElement::getConstructor(exec, domObject->globalObject()); |
|
168 } |
|
169 void JSHTMLMapElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
170 { |
|
171 lookupPut<JSHTMLMapElement, Base>(exec, propertyName, value, &JSHTMLMapElementTable, this, slot); |
|
172 } |
|
173 |
|
174 void setJSHTMLMapElementName(ExecState* exec, JSObject* thisObject, JSValue value) |
|
175 { |
|
176 JSHTMLMapElement* castedThis = static_cast<JSHTMLMapElement*>(thisObject); |
|
177 HTMLMapElement* imp = static_cast<HTMLMapElement*>(castedThis->impl()); |
|
178 imp->setAttribute(WebCore::HTMLNames::nameAttr, valueToStringWithNullCheck(exec, value)); |
|
179 } |
|
180 |
|
181 JSValue JSHTMLMapElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
182 { |
|
183 return getDOMConstructor<JSHTMLMapElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
184 } |
|
185 |
|
186 |
|
187 } |