|
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 |
|
43 static const HashTableValue JSHTMLScriptElementTableValues[10] = |
|
44 { |
|
45 { "text", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementText), (intptr_t)setJSHTMLScriptElementText THUNK_GENERATOR(0) }, |
|
46 { "htmlFor", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementHtmlFor), (intptr_t)setJSHTMLScriptElementHtmlFor THUNK_GENERATOR(0) }, |
|
47 { "event", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementEvent), (intptr_t)setJSHTMLScriptElementEvent THUNK_GENERATOR(0) }, |
|
48 { "charset", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementCharset), (intptr_t)setJSHTMLScriptElementCharset THUNK_GENERATOR(0) }, |
|
49 { "async", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementAsync), (intptr_t)setJSHTMLScriptElementAsync THUNK_GENERATOR(0) }, |
|
50 { "defer", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementDefer), (intptr_t)setJSHTMLScriptElementDefer THUNK_GENERATOR(0) }, |
|
51 { "src", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementSrc), (intptr_t)setJSHTMLScriptElementSrc THUNK_GENERATOR(0) }, |
|
52 { "type", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementType), (intptr_t)setJSHTMLScriptElementType THUNK_GENERATOR(0) }, |
|
53 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLScriptElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
54 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
55 }; |
|
56 |
|
57 #undef THUNK_GENERATOR |
|
58 static JSC_CONST_HASHTABLE HashTable JSHTMLScriptElementTable = { 32, 31, JSHTMLScriptElementTableValues, 0 }; |
|
59 /* Hash table for constructor */ |
|
60 #if ENABLE(JIT) |
|
61 #define THUNK_GENERATOR(generator) , generator |
|
62 #else |
|
63 #define THUNK_GENERATOR(generator) |
|
64 #endif |
|
65 |
|
66 static const HashTableValue JSHTMLScriptElementConstructorTableValues[1] = |
|
67 { |
|
68 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
69 }; |
|
70 |
|
71 #undef THUNK_GENERATOR |
|
72 static JSC_CONST_HASHTABLE HashTable JSHTMLScriptElementConstructorTable = { 1, 0, JSHTMLScriptElementConstructorTableValues, 0 }; |
|
73 class JSHTMLScriptElementConstructor : public DOMConstructorObject { |
|
74 public: |
|
75 JSHTMLScriptElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
76 |
|
77 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
78 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
79 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
80 static const JSC::ClassInfo s_info; |
|
81 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
82 { |
|
83 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
84 } |
|
85 protected: |
|
86 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
87 }; |
|
88 |
|
89 const ClassInfo JSHTMLScriptElementConstructor::s_info = { "HTMLScriptElementConstructor", 0, &JSHTMLScriptElementConstructorTable, 0 }; |
|
90 |
|
91 JSHTMLScriptElementConstructor::JSHTMLScriptElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
92 : DOMConstructorObject(JSHTMLScriptElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
93 { |
|
94 putDirect(exec->propertyNames().prototype, JSHTMLScriptElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
95 } |
|
96 |
|
97 bool JSHTMLScriptElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
98 { |
|
99 return getStaticValueSlot<JSHTMLScriptElementConstructor, DOMObject>(exec, &JSHTMLScriptElementConstructorTable, this, propertyName, slot); |
|
100 } |
|
101 |
|
102 bool JSHTMLScriptElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
103 { |
|
104 return getStaticValueDescriptor<JSHTMLScriptElementConstructor, DOMObject>(exec, &JSHTMLScriptElementConstructorTable, this, 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 |
|
114 static const HashTableValue JSHTMLScriptElementPrototypeTableValues[1] = |
|
115 { |
|
116 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
117 }; |
|
118 |
|
119 #undef THUNK_GENERATOR |
|
120 static JSC_CONST_HASHTABLE HashTable JSHTMLScriptElementPrototypeTable = { 1, 0, JSHTMLScriptElementPrototypeTableValues, 0 }; |
|
121 const ClassInfo JSHTMLScriptElementPrototype::s_info = { "HTMLScriptElementPrototype", 0, &JSHTMLScriptElementPrototypeTable, 0 }; |
|
122 |
|
123 JSObject* JSHTMLScriptElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
124 { |
|
125 return getDOMPrototype<JSHTMLScriptElement>(exec, globalObject); |
|
126 } |
|
127 |
|
128 const ClassInfo JSHTMLScriptElement::s_info = { "HTMLScriptElement", &JSHTMLElement::s_info, &JSHTMLScriptElementTable, 0 }; |
|
129 |
|
130 JSHTMLScriptElement::JSHTMLScriptElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLScriptElement> impl) |
|
131 : JSHTMLElement(structure, globalObject, impl) |
|
132 { |
|
133 } |
|
134 |
|
135 JSObject* JSHTMLScriptElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
136 { |
|
137 return new (exec) JSHTMLScriptElementPrototype(globalObject, JSHTMLScriptElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
138 } |
|
139 |
|
140 bool JSHTMLScriptElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
141 { |
|
142 return getStaticValueSlot<JSHTMLScriptElement, Base>(exec, &JSHTMLScriptElementTable, this, propertyName, slot); |
|
143 } |
|
144 |
|
145 bool JSHTMLScriptElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
146 { |
|
147 return getStaticValueDescriptor<JSHTMLScriptElement, Base>(exec, &JSHTMLScriptElementTable, this, propertyName, descriptor); |
|
148 } |
|
149 |
|
150 JSValue jsHTMLScriptElementText(ExecState* exec, JSValue slotBase, const Identifier&) |
|
151 { |
|
152 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase)); |
|
153 UNUSED_PARAM(exec); |
|
154 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
155 JSValue result = jsString(exec, imp->text()); |
|
156 return result; |
|
157 } |
|
158 |
|
159 JSValue jsHTMLScriptElementHtmlFor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
160 { |
|
161 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase)); |
|
162 UNUSED_PARAM(exec); |
|
163 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
164 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::forAttr)); |
|
165 return result; |
|
166 } |
|
167 |
|
168 JSValue jsHTMLScriptElementEvent(ExecState* exec, JSValue slotBase, const Identifier&) |
|
169 { |
|
170 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase)); |
|
171 UNUSED_PARAM(exec); |
|
172 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
173 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::eventAttr)); |
|
174 return result; |
|
175 } |
|
176 |
|
177 JSValue jsHTMLScriptElementCharset(ExecState* exec, JSValue slotBase, const Identifier&) |
|
178 { |
|
179 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase)); |
|
180 UNUSED_PARAM(exec); |
|
181 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
182 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::charsetAttr)); |
|
183 return result; |
|
184 } |
|
185 |
|
186 JSValue jsHTMLScriptElementAsync(ExecState* exec, JSValue slotBase, const Identifier&) |
|
187 { |
|
188 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase)); |
|
189 UNUSED_PARAM(exec); |
|
190 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
191 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::asyncAttr)); |
|
192 return result; |
|
193 } |
|
194 |
|
195 JSValue jsHTMLScriptElementDefer(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 = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::deferAttr)); |
|
201 return result; |
|
202 } |
|
203 |
|
204 JSValue jsHTMLScriptElementSrc(ExecState* exec, JSValue slotBase, const Identifier&) |
|
205 { |
|
206 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase)); |
|
207 UNUSED_PARAM(exec); |
|
208 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
209 JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::srcAttr)); |
|
210 return result; |
|
211 } |
|
212 |
|
213 JSValue jsHTMLScriptElementType(ExecState* exec, JSValue slotBase, const Identifier&) |
|
214 { |
|
215 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(asObject(slotBase)); |
|
216 UNUSED_PARAM(exec); |
|
217 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
218 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::typeAttr)); |
|
219 return result; |
|
220 } |
|
221 |
|
222 JSValue jsHTMLScriptElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
223 { |
|
224 JSHTMLScriptElement* domObject = static_cast<JSHTMLScriptElement*>(asObject(slotBase)); |
|
225 return JSHTMLScriptElement::getConstructor(exec, domObject->globalObject()); |
|
226 } |
|
227 void JSHTMLScriptElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
228 { |
|
229 lookupPut<JSHTMLScriptElement, Base>(exec, propertyName, value, &JSHTMLScriptElementTable, this, slot); |
|
230 } |
|
231 |
|
232 void setJSHTMLScriptElementText(ExecState* exec, JSObject* thisObject, JSValue value) |
|
233 { |
|
234 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject); |
|
235 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
236 imp->setText(valueToStringWithNullCheck(exec, value)); |
|
237 } |
|
238 |
|
239 void setJSHTMLScriptElementHtmlFor(ExecState* exec, JSObject* thisObject, JSValue value) |
|
240 { |
|
241 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject); |
|
242 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
243 imp->setAttribute(WebCore::HTMLNames::forAttr, valueToStringWithNullCheck(exec, value)); |
|
244 } |
|
245 |
|
246 void setJSHTMLScriptElementEvent(ExecState* exec, JSObject* thisObject, JSValue value) |
|
247 { |
|
248 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject); |
|
249 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
250 imp->setAttribute(WebCore::HTMLNames::eventAttr, valueToStringWithNullCheck(exec, value)); |
|
251 } |
|
252 |
|
253 void setJSHTMLScriptElementCharset(ExecState* exec, JSObject* thisObject, JSValue value) |
|
254 { |
|
255 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject); |
|
256 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
257 imp->setAttribute(WebCore::HTMLNames::charsetAttr, valueToStringWithNullCheck(exec, value)); |
|
258 } |
|
259 |
|
260 void setJSHTMLScriptElementAsync(ExecState* exec, JSObject* thisObject, JSValue value) |
|
261 { |
|
262 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject); |
|
263 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
264 imp->setBooleanAttribute(WebCore::HTMLNames::asyncAttr, value.toBoolean(exec)); |
|
265 } |
|
266 |
|
267 void setJSHTMLScriptElementDefer(ExecState* exec, JSObject* thisObject, JSValue value) |
|
268 { |
|
269 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject); |
|
270 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
271 imp->setBooleanAttribute(WebCore::HTMLNames::deferAttr, value.toBoolean(exec)); |
|
272 } |
|
273 |
|
274 void setJSHTMLScriptElementSrc(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::srcAttr, valueToStringWithNullCheck(exec, value)); |
|
279 } |
|
280 |
|
281 void setJSHTMLScriptElementType(ExecState* exec, JSObject* thisObject, JSValue value) |
|
282 { |
|
283 JSHTMLScriptElement* castedThis = static_cast<JSHTMLScriptElement*>(thisObject); |
|
284 HTMLScriptElement* imp = static_cast<HTMLScriptElement*>(castedThis->impl()); |
|
285 imp->setAttribute(WebCore::HTMLNames::typeAttr, valueToStringWithNullCheck(exec, value)); |
|
286 } |
|
287 |
|
288 JSValue JSHTMLScriptElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
289 { |
|
290 return getDOMConstructor<JSHTMLScriptElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
291 } |
|
292 |
|
293 |
|
294 } |