|
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(METER_TAG) |
|
24 |
|
25 #include "JSHTMLMeterElement.h" |
|
26 |
|
27 #include "HTMLFormElement.h" |
|
28 #include "HTMLMeterElement.h" |
|
29 #include "JSHTMLFormElement.h" |
|
30 #include "JSNodeList.h" |
|
31 #include "NameNodeList.h" |
|
32 #include "NodeList.h" |
|
33 #include <runtime/JSNumberCell.h> |
|
34 #include <wtf/GetPtr.h> |
|
35 |
|
36 using namespace JSC; |
|
37 |
|
38 namespace WebCore { |
|
39 |
|
40 ASSERT_CLASS_FITS_IN_CELL(JSHTMLMeterElement); |
|
41 |
|
42 /* Hash table */ |
|
43 #if ENABLE(JIT) |
|
44 #define THUNK_GENERATOR(generator) , generator |
|
45 #else |
|
46 #define THUNK_GENERATOR(generator) |
|
47 #endif |
|
48 |
|
49 static const HashTableValue JSHTMLMeterElementTableValues[10] = |
|
50 { |
|
51 { "value", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMeterElementValue), (intptr_t)setJSHTMLMeterElementValue THUNK_GENERATOR(0) }, |
|
52 { "min", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMeterElementMin), (intptr_t)setJSHTMLMeterElementMin THUNK_GENERATOR(0) }, |
|
53 { "max", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMeterElementMax), (intptr_t)setJSHTMLMeterElementMax THUNK_GENERATOR(0) }, |
|
54 { "low", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMeterElementLow), (intptr_t)setJSHTMLMeterElementLow THUNK_GENERATOR(0) }, |
|
55 { "high", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMeterElementHigh), (intptr_t)setJSHTMLMeterElementHigh THUNK_GENERATOR(0) }, |
|
56 { "optimum", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMeterElementOptimum), (intptr_t)setJSHTMLMeterElementOptimum THUNK_GENERATOR(0) }, |
|
57 { "form", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMeterElementForm), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
58 { "labels", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMeterElementLabels), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
59 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMeterElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
60 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
61 }; |
|
62 |
|
63 #undef THUNK_GENERATOR |
|
64 static JSC_CONST_HASHTABLE HashTable JSHTMLMeterElementTable = { 32, 31, JSHTMLMeterElementTableValues, 0 }; |
|
65 /* Hash table for constructor */ |
|
66 #if ENABLE(JIT) |
|
67 #define THUNK_GENERATOR(generator) , generator |
|
68 #else |
|
69 #define THUNK_GENERATOR(generator) |
|
70 #endif |
|
71 |
|
72 static const HashTableValue JSHTMLMeterElementConstructorTableValues[1] = |
|
73 { |
|
74 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
75 }; |
|
76 |
|
77 #undef THUNK_GENERATOR |
|
78 static JSC_CONST_HASHTABLE HashTable JSHTMLMeterElementConstructorTable = { 1, 0, JSHTMLMeterElementConstructorTableValues, 0 }; |
|
79 class JSHTMLMeterElementConstructor : public DOMConstructorObject { |
|
80 public: |
|
81 JSHTMLMeterElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
82 |
|
83 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
84 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
85 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
86 static const JSC::ClassInfo s_info; |
|
87 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
88 { |
|
89 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
90 } |
|
91 protected: |
|
92 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
93 }; |
|
94 |
|
95 const ClassInfo JSHTMLMeterElementConstructor::s_info = { "HTMLMeterElementConstructor", 0, &JSHTMLMeterElementConstructorTable, 0 }; |
|
96 |
|
97 JSHTMLMeterElementConstructor::JSHTMLMeterElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
98 : DOMConstructorObject(JSHTMLMeterElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
99 { |
|
100 putDirect(exec->propertyNames().prototype, JSHTMLMeterElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
101 } |
|
102 |
|
103 bool JSHTMLMeterElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
104 { |
|
105 return getStaticValueSlot<JSHTMLMeterElementConstructor, DOMObject>(exec, &JSHTMLMeterElementConstructorTable, this, propertyName, slot); |
|
106 } |
|
107 |
|
108 bool JSHTMLMeterElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
109 { |
|
110 return getStaticValueDescriptor<JSHTMLMeterElementConstructor, DOMObject>(exec, &JSHTMLMeterElementConstructorTable, this, propertyName, descriptor); |
|
111 } |
|
112 |
|
113 /* Hash table for prototype */ |
|
114 #if ENABLE(JIT) |
|
115 #define THUNK_GENERATOR(generator) , generator |
|
116 #else |
|
117 #define THUNK_GENERATOR(generator) |
|
118 #endif |
|
119 |
|
120 static const HashTableValue JSHTMLMeterElementPrototypeTableValues[1] = |
|
121 { |
|
122 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
123 }; |
|
124 |
|
125 #undef THUNK_GENERATOR |
|
126 static JSC_CONST_HASHTABLE HashTable JSHTMLMeterElementPrototypeTable = { 1, 0, JSHTMLMeterElementPrototypeTableValues, 0 }; |
|
127 const ClassInfo JSHTMLMeterElementPrototype::s_info = { "HTMLMeterElementPrototype", 0, &JSHTMLMeterElementPrototypeTable, 0 }; |
|
128 |
|
129 JSObject* JSHTMLMeterElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
130 { |
|
131 return getDOMPrototype<JSHTMLMeterElement>(exec, globalObject); |
|
132 } |
|
133 |
|
134 const ClassInfo JSHTMLMeterElement::s_info = { "HTMLMeterElement", &JSHTMLElement::s_info, &JSHTMLMeterElementTable, 0 }; |
|
135 |
|
136 JSHTMLMeterElement::JSHTMLMeterElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLMeterElement> impl) |
|
137 : JSHTMLElement(structure, globalObject, impl) |
|
138 { |
|
139 } |
|
140 |
|
141 JSObject* JSHTMLMeterElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
142 { |
|
143 return new (exec) JSHTMLMeterElementPrototype(globalObject, JSHTMLMeterElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
144 } |
|
145 |
|
146 bool JSHTMLMeterElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
147 { |
|
148 return getStaticValueSlot<JSHTMLMeterElement, Base>(exec, &JSHTMLMeterElementTable, this, propertyName, slot); |
|
149 } |
|
150 |
|
151 bool JSHTMLMeterElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
152 { |
|
153 return getStaticValueDescriptor<JSHTMLMeterElement, Base>(exec, &JSHTMLMeterElementTable, this, propertyName, descriptor); |
|
154 } |
|
155 |
|
156 JSValue jsHTMLMeterElementValue(ExecState* exec, JSValue slotBase, const Identifier&) |
|
157 { |
|
158 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(asObject(slotBase)); |
|
159 UNUSED_PARAM(exec); |
|
160 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
161 JSValue result = jsNumber(exec, imp->value()); |
|
162 return result; |
|
163 } |
|
164 |
|
165 JSValue jsHTMLMeterElementMin(ExecState* exec, JSValue slotBase, const Identifier&) |
|
166 { |
|
167 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(asObject(slotBase)); |
|
168 UNUSED_PARAM(exec); |
|
169 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
170 JSValue result = jsNumber(exec, imp->min()); |
|
171 return result; |
|
172 } |
|
173 |
|
174 JSValue jsHTMLMeterElementMax(ExecState* exec, JSValue slotBase, const Identifier&) |
|
175 { |
|
176 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(asObject(slotBase)); |
|
177 UNUSED_PARAM(exec); |
|
178 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
179 JSValue result = jsNumber(exec, imp->max()); |
|
180 return result; |
|
181 } |
|
182 |
|
183 JSValue jsHTMLMeterElementLow(ExecState* exec, JSValue slotBase, const Identifier&) |
|
184 { |
|
185 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(asObject(slotBase)); |
|
186 UNUSED_PARAM(exec); |
|
187 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
188 JSValue result = jsNumber(exec, imp->low()); |
|
189 return result; |
|
190 } |
|
191 |
|
192 JSValue jsHTMLMeterElementHigh(ExecState* exec, JSValue slotBase, const Identifier&) |
|
193 { |
|
194 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(asObject(slotBase)); |
|
195 UNUSED_PARAM(exec); |
|
196 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
197 JSValue result = jsNumber(exec, imp->high()); |
|
198 return result; |
|
199 } |
|
200 |
|
201 JSValue jsHTMLMeterElementOptimum(ExecState* exec, JSValue slotBase, const Identifier&) |
|
202 { |
|
203 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(asObject(slotBase)); |
|
204 UNUSED_PARAM(exec); |
|
205 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
206 JSValue result = jsNumber(exec, imp->optimum()); |
|
207 return result; |
|
208 } |
|
209 |
|
210 JSValue jsHTMLMeterElementForm(ExecState* exec, JSValue slotBase, const Identifier&) |
|
211 { |
|
212 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(asObject(slotBase)); |
|
213 UNUSED_PARAM(exec); |
|
214 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
215 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->form())); |
|
216 return result; |
|
217 } |
|
218 |
|
219 JSValue jsHTMLMeterElementLabels(ExecState* exec, JSValue slotBase, const Identifier&) |
|
220 { |
|
221 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(asObject(slotBase)); |
|
222 UNUSED_PARAM(exec); |
|
223 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
224 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->labels())); |
|
225 return result; |
|
226 } |
|
227 |
|
228 JSValue jsHTMLMeterElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
229 { |
|
230 JSHTMLMeterElement* domObject = static_cast<JSHTMLMeterElement*>(asObject(slotBase)); |
|
231 return JSHTMLMeterElement::getConstructor(exec, domObject->globalObject()); |
|
232 } |
|
233 void JSHTMLMeterElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
234 { |
|
235 lookupPut<JSHTMLMeterElement, Base>(exec, propertyName, value, &JSHTMLMeterElementTable, this, slot); |
|
236 } |
|
237 |
|
238 void setJSHTMLMeterElementValue(ExecState* exec, JSObject* thisObject, JSValue value) |
|
239 { |
|
240 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(thisObject); |
|
241 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
242 ExceptionCode ec = 0; |
|
243 imp->setValue(value.toNumber(exec), ec); |
|
244 setDOMException(exec, ec); |
|
245 } |
|
246 |
|
247 void setJSHTMLMeterElementMin(ExecState* exec, JSObject* thisObject, JSValue value) |
|
248 { |
|
249 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(thisObject); |
|
250 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
251 ExceptionCode ec = 0; |
|
252 imp->setMin(value.toNumber(exec), ec); |
|
253 setDOMException(exec, ec); |
|
254 } |
|
255 |
|
256 void setJSHTMLMeterElementMax(ExecState* exec, JSObject* thisObject, JSValue value) |
|
257 { |
|
258 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(thisObject); |
|
259 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
260 ExceptionCode ec = 0; |
|
261 imp->setMax(value.toNumber(exec), ec); |
|
262 setDOMException(exec, ec); |
|
263 } |
|
264 |
|
265 void setJSHTMLMeterElementLow(ExecState* exec, JSObject* thisObject, JSValue value) |
|
266 { |
|
267 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(thisObject); |
|
268 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
269 ExceptionCode ec = 0; |
|
270 imp->setLow(value.toNumber(exec), ec); |
|
271 setDOMException(exec, ec); |
|
272 } |
|
273 |
|
274 void setJSHTMLMeterElementHigh(ExecState* exec, JSObject* thisObject, JSValue value) |
|
275 { |
|
276 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(thisObject); |
|
277 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
278 ExceptionCode ec = 0; |
|
279 imp->setHigh(value.toNumber(exec), ec); |
|
280 setDOMException(exec, ec); |
|
281 } |
|
282 |
|
283 void setJSHTMLMeterElementOptimum(ExecState* exec, JSObject* thisObject, JSValue value) |
|
284 { |
|
285 JSHTMLMeterElement* castedThis = static_cast<JSHTMLMeterElement*>(thisObject); |
|
286 HTMLMeterElement* imp = static_cast<HTMLMeterElement*>(castedThis->impl()); |
|
287 ExceptionCode ec = 0; |
|
288 imp->setOptimum(value.toNumber(exec), ec); |
|
289 setDOMException(exec, ec); |
|
290 } |
|
291 |
|
292 JSValue JSHTMLMeterElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
293 { |
|
294 return getDOMConstructor<JSHTMLMeterElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
295 } |
|
296 |
|
297 |
|
298 } |
|
299 |
|
300 #endif // ENABLE(METER_TAG) |