|
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(PROGRESS_TAG) |
|
24 |
|
25 #include "JSHTMLProgressElement.h" |
|
26 |
|
27 #include "HTMLFormElement.h" |
|
28 #include "HTMLProgressElement.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(JSHTMLProgressElement); |
|
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 JSHTMLProgressElementTableValues[7] = |
|
50 { |
|
51 { "value", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLProgressElementValue), (intptr_t)setJSHTMLProgressElementValue THUNK_GENERATOR(0) }, |
|
52 { "max", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLProgressElementMax), (intptr_t)setJSHTMLProgressElementMax THUNK_GENERATOR(0) }, |
|
53 { "position", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLProgressElementPosition), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
54 { "form", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLProgressElementForm), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
55 { "labels", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLProgressElementLabels), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
56 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLProgressElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
57 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
58 }; |
|
59 |
|
60 #undef THUNK_GENERATOR |
|
61 static JSC_CONST_HASHTABLE HashTable JSHTMLProgressElementTable = { 16, 15, JSHTMLProgressElementTableValues, 0 }; |
|
62 /* Hash table for constructor */ |
|
63 #if ENABLE(JIT) |
|
64 #define THUNK_GENERATOR(generator) , generator |
|
65 #else |
|
66 #define THUNK_GENERATOR(generator) |
|
67 #endif |
|
68 |
|
69 static const HashTableValue JSHTMLProgressElementConstructorTableValues[1] = |
|
70 { |
|
71 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
72 }; |
|
73 |
|
74 #undef THUNK_GENERATOR |
|
75 static JSC_CONST_HASHTABLE HashTable JSHTMLProgressElementConstructorTable = { 1, 0, JSHTMLProgressElementConstructorTableValues, 0 }; |
|
76 class JSHTMLProgressElementConstructor : public DOMConstructorObject { |
|
77 public: |
|
78 JSHTMLProgressElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
79 |
|
80 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
81 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
82 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
83 static const JSC::ClassInfo s_info; |
|
84 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
85 { |
|
86 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
87 } |
|
88 protected: |
|
89 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
90 }; |
|
91 |
|
92 const ClassInfo JSHTMLProgressElementConstructor::s_info = { "HTMLProgressElementConstructor", 0, &JSHTMLProgressElementConstructorTable, 0 }; |
|
93 |
|
94 JSHTMLProgressElementConstructor::JSHTMLProgressElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
95 : DOMConstructorObject(JSHTMLProgressElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
96 { |
|
97 putDirect(exec->propertyNames().prototype, JSHTMLProgressElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
98 } |
|
99 |
|
100 bool JSHTMLProgressElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
101 { |
|
102 return getStaticValueSlot<JSHTMLProgressElementConstructor, DOMObject>(exec, &JSHTMLProgressElementConstructorTable, this, propertyName, slot); |
|
103 } |
|
104 |
|
105 bool JSHTMLProgressElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
106 { |
|
107 return getStaticValueDescriptor<JSHTMLProgressElementConstructor, DOMObject>(exec, &JSHTMLProgressElementConstructorTable, this, propertyName, descriptor); |
|
108 } |
|
109 |
|
110 /* Hash table for prototype */ |
|
111 #if ENABLE(JIT) |
|
112 #define THUNK_GENERATOR(generator) , generator |
|
113 #else |
|
114 #define THUNK_GENERATOR(generator) |
|
115 #endif |
|
116 |
|
117 static const HashTableValue JSHTMLProgressElementPrototypeTableValues[1] = |
|
118 { |
|
119 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
120 }; |
|
121 |
|
122 #undef THUNK_GENERATOR |
|
123 static JSC_CONST_HASHTABLE HashTable JSHTMLProgressElementPrototypeTable = { 1, 0, JSHTMLProgressElementPrototypeTableValues, 0 }; |
|
124 const ClassInfo JSHTMLProgressElementPrototype::s_info = { "HTMLProgressElementPrototype", 0, &JSHTMLProgressElementPrototypeTable, 0 }; |
|
125 |
|
126 JSObject* JSHTMLProgressElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
127 { |
|
128 return getDOMPrototype<JSHTMLProgressElement>(exec, globalObject); |
|
129 } |
|
130 |
|
131 const ClassInfo JSHTMLProgressElement::s_info = { "HTMLProgressElement", &JSHTMLElement::s_info, &JSHTMLProgressElementTable, 0 }; |
|
132 |
|
133 JSHTMLProgressElement::JSHTMLProgressElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLProgressElement> impl) |
|
134 : JSHTMLElement(structure, globalObject, impl) |
|
135 { |
|
136 } |
|
137 |
|
138 JSObject* JSHTMLProgressElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
139 { |
|
140 return new (exec) JSHTMLProgressElementPrototype(globalObject, JSHTMLProgressElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
141 } |
|
142 |
|
143 bool JSHTMLProgressElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
144 { |
|
145 return getStaticValueSlot<JSHTMLProgressElement, Base>(exec, &JSHTMLProgressElementTable, this, propertyName, slot); |
|
146 } |
|
147 |
|
148 bool JSHTMLProgressElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
149 { |
|
150 return getStaticValueDescriptor<JSHTMLProgressElement, Base>(exec, &JSHTMLProgressElementTable, this, propertyName, descriptor); |
|
151 } |
|
152 |
|
153 JSValue jsHTMLProgressElementValue(ExecState* exec, JSValue slotBase, const Identifier&) |
|
154 { |
|
155 JSHTMLProgressElement* castedThis = static_cast<JSHTMLProgressElement*>(asObject(slotBase)); |
|
156 UNUSED_PARAM(exec); |
|
157 HTMLProgressElement* imp = static_cast<HTMLProgressElement*>(castedThis->impl()); |
|
158 JSValue result = jsNumber(exec, imp->value()); |
|
159 return result; |
|
160 } |
|
161 |
|
162 JSValue jsHTMLProgressElementMax(ExecState* exec, JSValue slotBase, const Identifier&) |
|
163 { |
|
164 JSHTMLProgressElement* castedThis = static_cast<JSHTMLProgressElement*>(asObject(slotBase)); |
|
165 UNUSED_PARAM(exec); |
|
166 HTMLProgressElement* imp = static_cast<HTMLProgressElement*>(castedThis->impl()); |
|
167 JSValue result = jsNumber(exec, imp->max()); |
|
168 return result; |
|
169 } |
|
170 |
|
171 JSValue jsHTMLProgressElementPosition(ExecState* exec, JSValue slotBase, const Identifier&) |
|
172 { |
|
173 JSHTMLProgressElement* castedThis = static_cast<JSHTMLProgressElement*>(asObject(slotBase)); |
|
174 UNUSED_PARAM(exec); |
|
175 HTMLProgressElement* imp = static_cast<HTMLProgressElement*>(castedThis->impl()); |
|
176 JSValue result = jsNumber(exec, imp->position()); |
|
177 return result; |
|
178 } |
|
179 |
|
180 JSValue jsHTMLProgressElementForm(ExecState* exec, JSValue slotBase, const Identifier&) |
|
181 { |
|
182 JSHTMLProgressElement* castedThis = static_cast<JSHTMLProgressElement*>(asObject(slotBase)); |
|
183 UNUSED_PARAM(exec); |
|
184 HTMLProgressElement* imp = static_cast<HTMLProgressElement*>(castedThis->impl()); |
|
185 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->form())); |
|
186 return result; |
|
187 } |
|
188 |
|
189 JSValue jsHTMLProgressElementLabels(ExecState* exec, JSValue slotBase, const Identifier&) |
|
190 { |
|
191 JSHTMLProgressElement* castedThis = static_cast<JSHTMLProgressElement*>(asObject(slotBase)); |
|
192 UNUSED_PARAM(exec); |
|
193 HTMLProgressElement* imp = static_cast<HTMLProgressElement*>(castedThis->impl()); |
|
194 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->labels())); |
|
195 return result; |
|
196 } |
|
197 |
|
198 JSValue jsHTMLProgressElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
199 { |
|
200 JSHTMLProgressElement* domObject = static_cast<JSHTMLProgressElement*>(asObject(slotBase)); |
|
201 return JSHTMLProgressElement::getConstructor(exec, domObject->globalObject()); |
|
202 } |
|
203 void JSHTMLProgressElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
204 { |
|
205 lookupPut<JSHTMLProgressElement, Base>(exec, propertyName, value, &JSHTMLProgressElementTable, this, slot); |
|
206 } |
|
207 |
|
208 void setJSHTMLProgressElementValue(ExecState* exec, JSObject* thisObject, JSValue value) |
|
209 { |
|
210 JSHTMLProgressElement* castedThis = static_cast<JSHTMLProgressElement*>(thisObject); |
|
211 HTMLProgressElement* imp = static_cast<HTMLProgressElement*>(castedThis->impl()); |
|
212 ExceptionCode ec = 0; |
|
213 imp->setValue(value.toNumber(exec), ec); |
|
214 setDOMException(exec, ec); |
|
215 } |
|
216 |
|
217 void setJSHTMLProgressElementMax(ExecState* exec, JSObject* thisObject, JSValue value) |
|
218 { |
|
219 JSHTMLProgressElement* castedThis = static_cast<JSHTMLProgressElement*>(thisObject); |
|
220 HTMLProgressElement* imp = static_cast<HTMLProgressElement*>(castedThis->impl()); |
|
221 ExceptionCode ec = 0; |
|
222 imp->setMax(value.toNumber(exec), ec); |
|
223 setDOMException(exec, ec); |
|
224 } |
|
225 |
|
226 JSValue JSHTMLProgressElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
227 { |
|
228 return getDOMConstructor<JSHTMLProgressElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
229 } |
|
230 |
|
231 |
|
232 } |
|
233 |
|
234 #endif // ENABLE(PROGRESS_TAG) |