tizen beta release
[framework/web/webkit-efl.git] / DerivedSources / WebCore / JSHTMLScriptElement.cpp
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 "JSHTMLScriptElement.h"
23
24 #include "HTMLNames.h"
25 #include "HTMLScriptElement.h"
26 #include "KURL.h"
27 #include <runtime/JSString.h>
28 #include <wtf/GetPtr.h>
29
30 using namespace JSC;
31
32 namespace WebCore {
33
34 ASSERT_CLASS_FITS_IN_CELL(JSHTMLScriptElement);
35
36 /* Hash table */
37 #if ENABLE(JIT)
38 #define THUNK_GENERATOR(generator) , generator
39 #else
40 #define THUNK_GENERATOR(generator)
41 #endif
42 #if ENABLE(DFG_JIT)
43 #define INTRINSIC(intrinsic) , intrinsic
44 #else
45 #define INTRINSIC(intrinsic)
46 #endif
47
48 static const HashTableValue JSHTMLScriptElementTableValues[] =
49 {
50     { "text", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementText), (intptr_t)setJSHTMLScriptElementText THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51     { "htmlFor", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementHtmlFor), (intptr_t)setJSHTMLScriptElementHtmlFor THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52     { "event", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementEvent), (intptr_t)setJSHTMLScriptElementEvent THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53     { "charset", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementCharset), (intptr_t)setJSHTMLScriptElementCharset THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54     { "async", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementAsync), (intptr_t)setJSHTMLScriptElementAsync THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55     { "defer", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementDefer), (intptr_t)setJSHTMLScriptElementDefer THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56     { "src", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementSrc), (intptr_t)setJSHTMLScriptElementSrc THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57     { "type", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementType), (intptr_t)setJSHTMLScriptElementType THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
60 };
61
62 #undef THUNK_GENERATOR
63 static const HashTable JSHTMLScriptElementTable = { 32, 31, JSHTMLScriptElementTableValues, 0 };
64 /* Hash table for constructor */
65 #if ENABLE(JIT)
66 #define THUNK_GENERATOR(generator) , generator
67 #else
68 #define THUNK_GENERATOR(generator)
69 #endif
70 #if ENABLE(DFG_JIT)
71 #define INTRINSIC(intrinsic) , intrinsic
72 #else
73 #define INTRINSIC(intrinsic)
74 #endif
75
76 static const HashTableValue JSHTMLScriptElementConstructorTableValues[] =
77 {
78     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
79 };
80
81 #undef THUNK_GENERATOR
82 static const HashTable JSHTMLScriptElementConstructorTable = { 1, 0, JSHTMLScriptElementConstructorTableValues, 0 };
83 const ClassInfo JSHTMLScriptElementConstructor::s_info = { "HTMLScriptElementConstructor", &DOMConstructorObject::s_info, &JSHTMLScriptElementConstructorTable, 0, CREATE_METHOD_TABLE(JSHTMLScriptElementConstructor) };
84
85 JSHTMLScriptElementConstructor::JSHTMLScriptElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
86     : DOMConstructorObject(structure, globalObject)
87 {
88 }
89
90 void JSHTMLScriptElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
91 {
92     Base::finishCreation(exec->globalData());
93     ASSERT(inherits(&s_info));
94     putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLScriptElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
95 }
96
97 bool JSHTMLScriptElementConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
98 {
99     return getStaticValueSlot<JSHTMLScriptElementConstructor, JSDOMWrapper>(exec, &JSHTMLScriptElementConstructorTable, static_cast<JSHTMLScriptElementConstructor*>(cell), propertyName, slot);
100 }
101
102 bool JSHTMLScriptElementConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
103 {
104     return getStaticValueDescriptor<JSHTMLScriptElementConstructor, JSDOMWrapper>(exec, &JSHTMLScriptElementConstructorTable, static_cast<JSHTMLScriptElementConstructor*>(object), propertyName, descriptor);
105 }
106
107 /* Hash table for prototype */
108 #if ENABLE(JIT)
109 #define THUNK_GENERATOR(generator) , generator
110 #else
111 #define THUNK_GENERATOR(generator)
112 #endif
113 #if ENABLE(DFG_JIT)
114 #define INTRINSIC(intrinsic) , intrinsic
115 #else
116 #define INTRINSIC(intrinsic)
117 #endif
118
119 static const HashTableValue JSHTMLScriptElementPrototypeTableValues[] =
120 {
121     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
122 };
123
124 #undef THUNK_GENERATOR
125 static const HashTable JSHTMLScriptElementPrototypeTable = { 1, 0, JSHTMLScriptElementPrototypeTableValues, 0 };
126 const ClassInfo JSHTMLScriptElementPrototype::s_info = { "HTMLScriptElementPrototype", &JSC::JSNonFinalObject::s_info, &JSHTMLScriptElementPrototypeTable, 0, CREATE_METHOD_TABLE(JSHTMLScriptElementPrototype) };
127
128 JSObject* JSHTMLScriptElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
129 {
130     return getDOMPrototype<JSHTMLScriptElement>(exec, globalObject);
131 }
132
133 const ClassInfo JSHTMLScriptElement::s_info = { "HTMLScriptElement", &JSHTMLElement::s_info, &JSHTMLScriptElementTable, 0 , CREATE_METHOD_TABLE(JSHTMLScriptElement) };
134
135 JSHTMLScriptElement::JSHTMLScriptElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLScriptElement> impl)
136     : JSHTMLElement(structure, globalObject, impl)
137 {
138 }
139
140 void JSHTMLScriptElement::finishCreation(JSGlobalData& globalData)
141 {
142     Base::finishCreation(globalData);
143     ASSERT(inherits(&s_info));
144 }
145
146 JSObject* JSHTMLScriptElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
147 {
148     return JSHTMLScriptElementPrototype::create(exec->globalData(), globalObject, JSHTMLScriptElementPrototype::createStructure(exec->globalData(), globalObject, JSHTMLElementPrototype::self(exec, globalObject)));
149 }
150
151 bool JSHTMLScriptElement::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
152 {
153     JSHTMLScriptElement* thisObject = jsCast<JSHTMLScriptElement*>(cell);
154     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
155     return getStaticValueSlot<JSHTMLScriptElement, Base>(exec, &JSHTMLScriptElementTable, thisObject, propertyName, slot);
156 }
157
158 bool JSHTMLScriptElement::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
159 {
160     JSHTMLScriptElement* thisObject = jsCast<JSHTMLScriptElement*>(object);
161     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
162     return getStaticValueDescriptor<JSHTMLScriptElement, Base>(exec, &JSHTMLScriptElementTable, thisObject, propertyName, descriptor);
163 }
164
165 JSValue jsHTMLScriptElementText(ExecState* exec, JSValue slotBase, const Identifier&)
166 {
167     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase));
168     UNUSED_PARAM(exec);
169     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
170     JSValue result = jsString(exec, imp->text());
171     return result;
172 }
173
174
175 JSValue jsHTMLScriptElementHtmlFor(ExecState* exec, JSValue slotBase, const Identifier&)
176 {
177     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase));
178     UNUSED_PARAM(exec);
179     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
180     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::forAttr));
181     return result;
182 }
183
184
185 JSValue jsHTMLScriptElementEvent(ExecState* exec, JSValue slotBase, const Identifier&)
186 {
187     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase));
188     UNUSED_PARAM(exec);
189     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
190     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::eventAttr));
191     return result;
192 }
193
194
195 JSValue jsHTMLScriptElementCharset(ExecState* exec, JSValue slotBase, const Identifier&)
196 {
197     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase));
198     UNUSED_PARAM(exec);
199     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
200     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::charsetAttr));
201     return result;
202 }
203
204
205 JSValue jsHTMLScriptElementAsync(ExecState* exec, JSValue slotBase, const Identifier&)
206 {
207     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase));
208     UNUSED_PARAM(exec);
209     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
210     JSValue result = jsBoolean(imp->async());
211     return result;
212 }
213
214
215 JSValue jsHTMLScriptElementDefer(ExecState* exec, JSValue slotBase, const Identifier&)
216 {
217     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase));
218     UNUSED_PARAM(exec);
219     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
220     JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::deferAttr));
221     return result;
222 }
223
224
225 JSValue jsHTMLScriptElementSrc(ExecState* exec, JSValue slotBase, const Identifier&)
226 {
227     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase));
228     UNUSED_PARAM(exec);
229     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
230     JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::srcAttr));
231     return result;
232 }
233
234
235 JSValue jsHTMLScriptElementType(ExecState* exec, JSValue slotBase, const Identifier&)
236 {
237     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase));
238     UNUSED_PARAM(exec);
239     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
240     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::typeAttr));
241     return result;
242 }
243
244
245 JSValue jsHTMLScriptElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
246 {
247     JSHTMLScriptElement* domObject = static_cast<JSHTMLScriptElement*>(asObject(slotBase));
248     return JSHTMLScriptElement::getConstructor(exec, domObject->globalObject());
249 }
250
251 void JSHTMLScriptElement::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
252 {
253     JSHTMLScriptElement* thisObject = jsCast<JSHTMLScriptElement*>(cell);
254     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
255     lookupPut<JSHTMLScriptElement, Base>(exec, propertyName, value, &JSHTMLScriptElementTable, thisObject, slot);
256 }
257
258 void setJSHTMLScriptElementText(ExecState* exec, JSObject* thisObject, JSValue value)
259 {
260     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject);
261     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
262     imp->setText(valueToStringWithNullCheck(exec, value));
263 }
264
265
266 void setJSHTMLScriptElementHtmlFor(ExecState* exec, JSObject* thisObject, JSValue value)
267 {
268     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject);
269     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
270     imp->setAttribute(WebCore::HTMLNames::forAttr, valueToStringWithNullCheck(exec, value));
271 }
272
273
274 void setJSHTMLScriptElementEvent(ExecState* exec, JSObject* thisObject, JSValue value)
275 {
276     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject);
277     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
278     imp->setAttribute(WebCore::HTMLNames::eventAttr, valueToStringWithNullCheck(exec, value));
279 }
280
281
282 void setJSHTMLScriptElementCharset(ExecState* exec, JSObject* thisObject, JSValue value)
283 {
284     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject);
285     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
286     imp->setAttribute(WebCore::HTMLNames::charsetAttr, valueToStringWithNullCheck(exec, value));
287 }
288
289
290 void setJSHTMLScriptElementAsync(ExecState* exec, JSObject* thisObject, JSValue value)
291 {
292     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject);
293     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
294     imp->setAsync(value.toBoolean(exec));
295 }
296
297
298 void setJSHTMLScriptElementDefer(ExecState* exec, JSObject* thisObject, JSValue value)
299 {
300     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject);
301     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
302     imp->setBooleanAttribute(WebCore::HTMLNames::deferAttr, value.toBoolean(exec));
303 }
304
305
306 void setJSHTMLScriptElementSrc(ExecState* exec, JSObject* thisObject, JSValue value)
307 {
308     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject);
309     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
310     imp->setAttribute(WebCore::HTMLNames::srcAttr, valueToStringWithNullCheck(exec, value));
311 }
312
313
314 void setJSHTMLScriptElementType(ExecState* exec, JSObject* thisObject, JSValue value)
315 {
316     JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject);
317     HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl());
318     imp->setAttribute(WebCore::HTMLNames::typeAttr, valueToStringWithNullCheck(exec, value));
319 }
320
321
322 JSValue JSHTMLScriptElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
323 {
324     return getDOMConstructor<JSHTMLScriptElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
325 }
326
327
328 }