tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSHTMLEmbedElement.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 "JSHTMLEmbedElement.h"
23
24 #include "ExceptionCode.h"
25 #include "HTMLEmbedElement.h"
26 #include "HTMLNames.h"
27 #include "JSDOMBinding.h"
28 #include "JSHTMLEmbedElementCustom.h"
29 #include "JSSVGDocument.h"
30 #include "KURL.h"
31 #include "SVGDocument.h"
32 #include <runtime/Error.h>
33 #include <runtime/JSString.h>
34 #include <wtf/GetPtr.h>
35
36 using namespace JSC;
37
38 namespace WebCore {
39
40 ASSERT_CLASS_FITS_IN_CELL(JSHTMLEmbedElement);
41
42 /* Hash table */
43 #if ENABLE(JIT)
44 #define THUNK_GENERATOR(generator) , generator
45 #else
46 #define THUNK_GENERATOR(generator)
47 #endif
48 #if ENABLE(DFG_JIT)
49 #define INTRINSIC(intrinsic) , intrinsic
50 #else
51 #define INTRINSIC(intrinsic)
52 #endif
53
54 static const HashTableValue JSHTMLEmbedElementTableValues[] =
55 {
56     { "align", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementAlign), (intptr_t)setJSHTMLEmbedElementAlign THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57     { "height", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementHeight), (intptr_t)setJSHTMLEmbedElementHeight THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58     { "name", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementName), (intptr_t)setJSHTMLEmbedElementName THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59     { "src", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementSrc), (intptr_t)setJSHTMLEmbedElementSrc THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60     { "type", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementType), (intptr_t)setJSHTMLEmbedElementType THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
61     { "width", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementWidth), (intptr_t)setJSHTMLEmbedElementWidth THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
62     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
63     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
64 };
65
66 #undef THUNK_GENERATOR
67 static const HashTable JSHTMLEmbedElementTable = { 19, 15, JSHTMLEmbedElementTableValues, 0 };
68 /* Hash table for constructor */
69 #if ENABLE(JIT)
70 #define THUNK_GENERATOR(generator) , generator
71 #else
72 #define THUNK_GENERATOR(generator)
73 #endif
74 #if ENABLE(DFG_JIT)
75 #define INTRINSIC(intrinsic) , intrinsic
76 #else
77 #define INTRINSIC(intrinsic)
78 #endif
79
80 static const HashTableValue JSHTMLEmbedElementConstructorTableValues[] =
81 {
82     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
83 };
84
85 #undef THUNK_GENERATOR
86 static const HashTable JSHTMLEmbedElementConstructorTable = { 1, 0, JSHTMLEmbedElementConstructorTableValues, 0 };
87 const ClassInfo JSHTMLEmbedElementConstructor::s_info = { "HTMLEmbedElementConstructor", &DOMConstructorObject::s_info, &JSHTMLEmbedElementConstructorTable, 0, CREATE_METHOD_TABLE(JSHTMLEmbedElementConstructor) };
88
89 JSHTMLEmbedElementConstructor::JSHTMLEmbedElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
90     : DOMConstructorObject(structure, globalObject)
91 {
92 }
93
94 void JSHTMLEmbedElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
95 {
96     Base::finishCreation(exec->globalData());
97     ASSERT(inherits(&s_info));
98     putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLEmbedElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
99 }
100
101 bool JSHTMLEmbedElementConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
102 {
103     return getStaticValueSlot<JSHTMLEmbedElementConstructor, JSDOMWrapper>(exec, &JSHTMLEmbedElementConstructorTable, static_cast<JSHTMLEmbedElementConstructor*>(cell), propertyName, slot);
104 }
105
106 bool JSHTMLEmbedElementConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
107 {
108     return getStaticValueDescriptor<JSHTMLEmbedElementConstructor, JSDOMWrapper>(exec, &JSHTMLEmbedElementConstructorTable, static_cast<JSHTMLEmbedElementConstructor*>(object), propertyName, descriptor);
109 }
110
111 /* Hash table for prototype */
112 #if ENABLE(JIT)
113 #define THUNK_GENERATOR(generator) , generator
114 #else
115 #define THUNK_GENERATOR(generator)
116 #endif
117 #if ENABLE(DFG_JIT)
118 #define INTRINSIC(intrinsic) , intrinsic
119 #else
120 #define INTRINSIC(intrinsic)
121 #endif
122
123 static const HashTableValue JSHTMLEmbedElementPrototypeTableValues[] =
124 {
125     { "getSVGDocument", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLEmbedElementPrototypeFunctionGetSVGDocument), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
126     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
127 };
128
129 #undef THUNK_GENERATOR
130 static const HashTable JSHTMLEmbedElementPrototypeTable = { 2, 1, JSHTMLEmbedElementPrototypeTableValues, 0 };
131 const ClassInfo JSHTMLEmbedElementPrototype::s_info = { "HTMLEmbedElementPrototype", &JSC::JSNonFinalObject::s_info, &JSHTMLEmbedElementPrototypeTable, 0, CREATE_METHOD_TABLE(JSHTMLEmbedElementPrototype) };
132
133 JSObject* JSHTMLEmbedElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
134 {
135     return getDOMPrototype<JSHTMLEmbedElement>(exec, globalObject);
136 }
137
138 bool JSHTMLEmbedElementPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
139 {
140     JSHTMLEmbedElementPrototype* thisObject = jsCast<JSHTMLEmbedElementPrototype*>(cell);
141     return getStaticFunctionSlot<JSObject>(exec, &JSHTMLEmbedElementPrototypeTable, thisObject, propertyName, slot);
142 }
143
144 bool JSHTMLEmbedElementPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
145 {
146     JSHTMLEmbedElementPrototype* thisObject = jsCast<JSHTMLEmbedElementPrototype*>(object);
147     return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLEmbedElementPrototypeTable, thisObject, propertyName, descriptor);
148 }
149
150 const ClassInfo JSHTMLEmbedElement::s_info = { "HTMLEmbedElement", &JSHTMLElement::s_info, &JSHTMLEmbedElementTable, 0 , CREATE_METHOD_TABLE(JSHTMLEmbedElement) };
151
152 JSHTMLEmbedElement::JSHTMLEmbedElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLEmbedElement> impl)
153     : JSHTMLElement(structure, globalObject, impl)
154 {
155 }
156
157 void JSHTMLEmbedElement::finishCreation(JSGlobalData& globalData)
158 {
159     Base::finishCreation(globalData);
160     ASSERT(inherits(&s_info));
161 }
162
163 JSObject* JSHTMLEmbedElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
164 {
165     return JSHTMLEmbedElementPrototype::create(exec->globalData(), globalObject, JSHTMLEmbedElementPrototype::createStructure(exec->globalData(), globalObject, JSHTMLElementPrototype::self(exec, globalObject)));
166 }
167
168 bool JSHTMLEmbedElement::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
169 {
170     JSHTMLEmbedElement* thisObject = jsCast<JSHTMLEmbedElement*>(cell);
171     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
172     if (thisObject->getOwnPropertySlotDelegate(exec, propertyName, slot))
173         return true;
174     return getStaticValueSlot<JSHTMLEmbedElement, Base>(exec, &JSHTMLEmbedElementTable, thisObject, propertyName, slot);
175 }
176
177 bool JSHTMLEmbedElement::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
178 {
179     JSHTMLEmbedElement* thisObject = jsCast<JSHTMLEmbedElement*>(object);
180     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
181     if (thisObject->getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))
182         return true;
183     return getStaticValueDescriptor<JSHTMLEmbedElement, Base>(exec, &JSHTMLEmbedElementTable, thisObject, propertyName, descriptor);
184 }
185
186 JSValue jsHTMLEmbedElementAlign(ExecState* exec, JSValue slotBase, const Identifier&)
187 {
188     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
189     UNUSED_PARAM(exec);
190     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
191     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::alignAttr));
192     return result;
193 }
194
195
196 JSValue jsHTMLEmbedElementHeight(ExecState* exec, JSValue slotBase, const Identifier&)
197 {
198     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
199     UNUSED_PARAM(exec);
200     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
201     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::heightAttr));
202     return result;
203 }
204
205
206 JSValue jsHTMLEmbedElementName(ExecState* exec, JSValue slotBase, const Identifier&)
207 {
208     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
209     UNUSED_PARAM(exec);
210     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
211     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::nameAttr));
212     return result;
213 }
214
215
216 JSValue jsHTMLEmbedElementSrc(ExecState* exec, JSValue slotBase, const Identifier&)
217 {
218     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
219     UNUSED_PARAM(exec);
220     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
221     JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::srcAttr));
222     return result;
223 }
224
225
226 JSValue jsHTMLEmbedElementType(ExecState* exec, JSValue slotBase, const Identifier&)
227 {
228     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
229     UNUSED_PARAM(exec);
230     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
231     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::typeAttr));
232     return result;
233 }
234
235
236 JSValue jsHTMLEmbedElementWidth(ExecState* exec, JSValue slotBase, const Identifier&)
237 {
238     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
239     UNUSED_PARAM(exec);
240     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
241     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::widthAttr));
242     return result;
243 }
244
245
246 JSValue jsHTMLEmbedElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
247 {
248     JSHTMLEmbedElement* domObject = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
249     return JSHTMLEmbedElement::getConstructor(exec, domObject->globalObject());
250 }
251
252 void JSHTMLEmbedElement::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
253 {
254     JSHTMLEmbedElement* thisObject = jsCast<JSHTMLEmbedElement*>(cell);
255     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
256     if (thisObject->putDelegate(exec, propertyName, value, slot))
257         return;
258     lookupPut<JSHTMLEmbedElement, Base>(exec, propertyName, value, &JSHTMLEmbedElementTable, thisObject, slot);
259 }
260
261 void setJSHTMLEmbedElementAlign(ExecState* exec, JSObject* thisObject, JSValue value)
262 {
263     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject);
264     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
265     imp->setAttribute(WebCore::HTMLNames::alignAttr, valueToStringWithNullCheck(exec, value));
266 }
267
268
269 void setJSHTMLEmbedElementHeight(ExecState* exec, JSObject* thisObject, JSValue value)
270 {
271     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject);
272     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
273     imp->setAttribute(WebCore::HTMLNames::heightAttr, valueToStringWithNullCheck(exec, value));
274 }
275
276
277 void setJSHTMLEmbedElementName(ExecState* exec, JSObject* thisObject, JSValue value)
278 {
279     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject);
280     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
281     imp->setAttribute(WebCore::HTMLNames::nameAttr, valueToStringWithNullCheck(exec, value));
282 }
283
284
285 void setJSHTMLEmbedElementSrc(ExecState* exec, JSObject* thisObject, JSValue value)
286 {
287     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject);
288     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
289     imp->setAttribute(WebCore::HTMLNames::srcAttr, valueToStringWithNullCheck(exec, value));
290 }
291
292
293 void setJSHTMLEmbedElementType(ExecState* exec, JSObject* thisObject, JSValue value)
294 {
295     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject);
296     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
297     imp->setAttribute(WebCore::HTMLNames::typeAttr, valueToStringWithNullCheck(exec, value));
298 }
299
300
301 void setJSHTMLEmbedElementWidth(ExecState* exec, JSObject* thisObject, JSValue value)
302 {
303     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject);
304     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
305     imp->setAttribute(WebCore::HTMLNames::widthAttr, valueToStringWithNullCheck(exec, value));
306 }
307
308
309 JSValue JSHTMLEmbedElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
310 {
311     return getDOMConstructor<JSHTMLEmbedElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
312 }
313
314 EncodedJSValue JSC_HOST_CALL jsHTMLEmbedElementPrototypeFunctionGetSVGDocument(ExecState* exec)
315 {
316     JSValue thisValue = exec->hostThisValue();
317     if (!thisValue.inherits(&JSHTMLEmbedElement::s_info))
318         return throwVMTypeError(exec);
319     JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(thisValue));
320     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLEmbedElement::s_info);
321     HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
322     ExceptionCode ec = 0;
323     if (!checkNodeSecurity(exec, imp->getSVGDocument(ec)))
324         return JSValue::encode(jsUndefined());
325
326     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getSVGDocument(ec)));
327     setDOMException(exec, ec);
328     return JSValue::encode(result);
329 }
330
331
332 }