2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
22 #include "JSHTMLEmbedElement.h"
24 #include "ExceptionCode.h"
25 #include "HTMLEmbedElement.h"
26 #include "HTMLNames.h"
27 #include "JSDOMBinding.h"
28 #include "JSHTMLEmbedElementCustom.h"
29 #include "JSSVGDocument.h"
31 #include "SVGDocument.h"
32 #include <runtime/Error.h>
33 #include <runtime/JSString.h>
34 #include <wtf/GetPtr.h>
40 ASSERT_CLASS_FITS_IN_CELL(JSHTMLEmbedElement);
44 #define THUNK_GENERATOR(generator) , generator
46 #define THUNK_GENERATOR(generator)
49 #define INTRINSIC(intrinsic) , intrinsic
51 #define INTRINSIC(intrinsic)
54 static const HashTableValue JSHTMLEmbedElementTableValues[] =
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) }
66 #undef THUNK_GENERATOR
67 static const HashTable JSHTMLEmbedElementTable = { 19, 15, JSHTMLEmbedElementTableValues, 0 };
68 /* Hash table for constructor */
70 #define THUNK_GENERATOR(generator) , generator
72 #define THUNK_GENERATOR(generator)
75 #define INTRINSIC(intrinsic) , intrinsic
77 #define INTRINSIC(intrinsic)
80 static const HashTableValue JSHTMLEmbedElementConstructorTableValues[] =
82 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
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) };
89 JSHTMLEmbedElementConstructor::JSHTMLEmbedElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
90 : DOMConstructorObject(structure, globalObject)
94 void JSHTMLEmbedElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
96 Base::finishCreation(exec->globalData());
97 ASSERT(inherits(&s_info));
98 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLEmbedElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
101 bool JSHTMLEmbedElementConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
103 return getStaticValueSlot<JSHTMLEmbedElementConstructor, JSDOMWrapper>(exec, &JSHTMLEmbedElementConstructorTable, static_cast<JSHTMLEmbedElementConstructor*>(cell), propertyName, slot);
106 bool JSHTMLEmbedElementConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
108 return getStaticValueDescriptor<JSHTMLEmbedElementConstructor, JSDOMWrapper>(exec, &JSHTMLEmbedElementConstructorTable, static_cast<JSHTMLEmbedElementConstructor*>(object), propertyName, descriptor);
111 /* Hash table for prototype */
113 #define THUNK_GENERATOR(generator) , generator
115 #define THUNK_GENERATOR(generator)
118 #define INTRINSIC(intrinsic) , intrinsic
120 #define INTRINSIC(intrinsic)
123 static const HashTableValue JSHTMLEmbedElementPrototypeTableValues[] =
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) }
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) };
133 JSObject* JSHTMLEmbedElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
135 return getDOMPrototype<JSHTMLEmbedElement>(exec, globalObject);
138 bool JSHTMLEmbedElementPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
140 JSHTMLEmbedElementPrototype* thisObject = jsCast<JSHTMLEmbedElementPrototype*>(cell);
141 return getStaticFunctionSlot<JSObject>(exec, &JSHTMLEmbedElementPrototypeTable, thisObject, propertyName, slot);
144 bool JSHTMLEmbedElementPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
146 JSHTMLEmbedElementPrototype* thisObject = jsCast<JSHTMLEmbedElementPrototype*>(object);
147 return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLEmbedElementPrototypeTable, thisObject, propertyName, descriptor);
150 const ClassInfo JSHTMLEmbedElement::s_info = { "HTMLEmbedElement", &JSHTMLElement::s_info, &JSHTMLEmbedElementTable, 0 , CREATE_METHOD_TABLE(JSHTMLEmbedElement) };
152 JSHTMLEmbedElement::JSHTMLEmbedElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLEmbedElement> impl)
153 : JSHTMLElement(structure, globalObject, impl)
157 void JSHTMLEmbedElement::finishCreation(JSGlobalData& globalData)
159 Base::finishCreation(globalData);
160 ASSERT(inherits(&s_info));
163 JSObject* JSHTMLEmbedElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
165 return JSHTMLEmbedElementPrototype::create(exec->globalData(), globalObject, JSHTMLEmbedElementPrototype::createStructure(exec->globalData(), globalObject, JSHTMLElementPrototype::self(exec, globalObject)));
168 bool JSHTMLEmbedElement::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
170 JSHTMLEmbedElement* thisObject = jsCast<JSHTMLEmbedElement*>(cell);
171 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
172 if (thisObject->getOwnPropertySlotDelegate(exec, propertyName, slot))
174 return getStaticValueSlot<JSHTMLEmbedElement, Base>(exec, &JSHTMLEmbedElementTable, thisObject, propertyName, slot);
177 bool JSHTMLEmbedElement::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
179 JSHTMLEmbedElement* thisObject = jsCast<JSHTMLEmbedElement*>(object);
180 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
181 if (thisObject->getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))
183 return getStaticValueDescriptor<JSHTMLEmbedElement, Base>(exec, &JSHTMLEmbedElementTable, thisObject, propertyName, descriptor);
186 JSValue jsHTMLEmbedElementAlign(ExecState* exec, JSValue slotBase, const Identifier&)
188 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
190 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
191 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::alignAttr));
196 JSValue jsHTMLEmbedElementHeight(ExecState* exec, JSValue slotBase, const Identifier&)
198 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
200 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
201 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::heightAttr));
206 JSValue jsHTMLEmbedElementName(ExecState* exec, JSValue slotBase, const Identifier&)
208 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
210 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
211 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::nameAttr));
216 JSValue jsHTMLEmbedElementSrc(ExecState* exec, JSValue slotBase, const Identifier&)
218 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
220 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
221 JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::srcAttr));
226 JSValue jsHTMLEmbedElementType(ExecState* exec, JSValue slotBase, const Identifier&)
228 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
230 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
231 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::typeAttr));
236 JSValue jsHTMLEmbedElementWidth(ExecState* exec, JSValue slotBase, const Identifier&)
238 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
240 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
241 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::widthAttr));
246 JSValue jsHTMLEmbedElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
248 JSHTMLEmbedElement* domObject = static_cast<JSHTMLEmbedElement*>(asObject(slotBase));
249 return JSHTMLEmbedElement::getConstructor(exec, domObject->globalObject());
252 void JSHTMLEmbedElement::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
254 JSHTMLEmbedElement* thisObject = jsCast<JSHTMLEmbedElement*>(cell);
255 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
256 if (thisObject->putDelegate(exec, propertyName, value, slot))
258 lookupPut<JSHTMLEmbedElement, Base>(exec, propertyName, value, &JSHTMLEmbedElementTable, thisObject, slot);
261 void setJSHTMLEmbedElementAlign(ExecState* exec, JSObject* thisObject, JSValue value)
263 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject);
264 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
265 imp->setAttribute(WebCore::HTMLNames::alignAttr, valueToStringWithNullCheck(exec, value));
269 void setJSHTMLEmbedElementHeight(ExecState* exec, JSObject* thisObject, JSValue value)
271 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject);
272 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
273 imp->setAttribute(WebCore::HTMLNames::heightAttr, valueToStringWithNullCheck(exec, value));
277 void setJSHTMLEmbedElementName(ExecState* exec, JSObject* thisObject, JSValue value)
279 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject);
280 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
281 imp->setAttribute(WebCore::HTMLNames::nameAttr, valueToStringWithNullCheck(exec, value));
285 void setJSHTMLEmbedElementSrc(ExecState* exec, JSObject* thisObject, JSValue value)
287 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject);
288 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
289 imp->setAttribute(WebCore::HTMLNames::srcAttr, valueToStringWithNullCheck(exec, value));
293 void setJSHTMLEmbedElementType(ExecState* exec, JSObject* thisObject, JSValue value)
295 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject);
296 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
297 imp->setAttribute(WebCore::HTMLNames::typeAttr, valueToStringWithNullCheck(exec, value));
301 void setJSHTMLEmbedElementWidth(ExecState* exec, JSObject* thisObject, JSValue value)
303 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject);
304 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl());
305 imp->setAttribute(WebCore::HTMLNames::widthAttr, valueToStringWithNullCheck(exec, value));
309 JSValue JSHTMLEmbedElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
311 return getDOMConstructor<JSHTMLEmbedElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
314 EncodedJSValue JSC_HOST_CALL jsHTMLEmbedElementPrototypeFunctionGetSVGDocument(ExecState* exec)
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());
326 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getSVGDocument(ec)));
327 setDOMException(exec, ec);
328 return JSValue::encode(result);