|
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 "HTMLEmbedElement.h" |
|
25 #include "HTMLNames.h" |
|
26 #include "JSDOMBinding.h" |
|
27 #include "JSHTMLEmbedElementCustom.h" |
|
28 #include "JSSVGDocument.h" |
|
29 #include "KURL.h" |
|
30 #include "SVGDocument.h" |
|
31 #include <runtime/Error.h> |
|
32 #include <runtime/JSString.h> |
|
33 #include <wtf/GetPtr.h> |
|
34 |
|
35 using namespace JSC; |
|
36 |
|
37 namespace WebCore { |
|
38 |
|
39 ASSERT_CLASS_FITS_IN_CELL(JSHTMLEmbedElement); |
|
40 |
|
41 /* Hash table */ |
|
42 #if ENABLE(JIT) |
|
43 #define THUNK_GENERATOR(generator) , generator |
|
44 #else |
|
45 #define THUNK_GENERATOR(generator) |
|
46 #endif |
|
47 |
|
48 static const HashTableValue JSHTMLEmbedElementTableValues[8] = |
|
49 { |
|
50 { "align", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementAlign), (intptr_t)setJSHTMLEmbedElementAlign THUNK_GENERATOR(0) }, |
|
51 { "height", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementHeight), (intptr_t)setJSHTMLEmbedElementHeight THUNK_GENERATOR(0) }, |
|
52 { "name", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementName), (intptr_t)setJSHTMLEmbedElementName THUNK_GENERATOR(0) }, |
|
53 { "src", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementSrc), (intptr_t)setJSHTMLEmbedElementSrc THUNK_GENERATOR(0) }, |
|
54 { "type", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementType), (intptr_t)setJSHTMLEmbedElementType THUNK_GENERATOR(0) }, |
|
55 { "width", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementWidth), (intptr_t)setJSHTMLEmbedElementWidth THUNK_GENERATOR(0) }, |
|
56 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementConstructor), (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 JSHTMLEmbedElementTable = { 19, 15, JSHTMLEmbedElementTableValues, 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 JSHTMLEmbedElementConstructorTableValues[1] = |
|
70 { |
|
71 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
72 }; |
|
73 |
|
74 #undef THUNK_GENERATOR |
|
75 static JSC_CONST_HASHTABLE HashTable JSHTMLEmbedElementConstructorTable = { 1, 0, JSHTMLEmbedElementConstructorTableValues, 0 }; |
|
76 class JSHTMLEmbedElementConstructor : public DOMConstructorObject { |
|
77 public: |
|
78 JSHTMLEmbedElementConstructor(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 JSHTMLEmbedElementConstructor::s_info = { "HTMLEmbedElementConstructor", 0, &JSHTMLEmbedElementConstructorTable, 0 }; |
|
93 |
|
94 JSHTMLEmbedElementConstructor::JSHTMLEmbedElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
95 : DOMConstructorObject(JSHTMLEmbedElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
96 { |
|
97 putDirect(exec->propertyNames().prototype, JSHTMLEmbedElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
98 } |
|
99 |
|
100 bool JSHTMLEmbedElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
101 { |
|
102 return getStaticValueSlot<JSHTMLEmbedElementConstructor, DOMObject>(exec, &JSHTMLEmbedElementConstructorTable, this, propertyName, slot); |
|
103 } |
|
104 |
|
105 bool JSHTMLEmbedElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
106 { |
|
107 return getStaticValueDescriptor<JSHTMLEmbedElementConstructor, DOMObject>(exec, &JSHTMLEmbedElementConstructorTable, 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 JSHTMLEmbedElementPrototypeTableValues[2] = |
|
118 { |
|
119 { "getSVGDocument", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLEmbedElementPrototypeFunctionGetSVGDocument), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
120 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
121 }; |
|
122 |
|
123 #undef THUNK_GENERATOR |
|
124 static JSC_CONST_HASHTABLE HashTable JSHTMLEmbedElementPrototypeTable = { 2, 1, JSHTMLEmbedElementPrototypeTableValues, 0 }; |
|
125 const ClassInfo JSHTMLEmbedElementPrototype::s_info = { "HTMLEmbedElementPrototype", 0, &JSHTMLEmbedElementPrototypeTable, 0 }; |
|
126 |
|
127 JSObject* JSHTMLEmbedElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
128 { |
|
129 return getDOMPrototype<JSHTMLEmbedElement>(exec, globalObject); |
|
130 } |
|
131 |
|
132 bool JSHTMLEmbedElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
133 { |
|
134 return getStaticFunctionSlot<JSObject>(exec, &JSHTMLEmbedElementPrototypeTable, this, propertyName, slot); |
|
135 } |
|
136 |
|
137 bool JSHTMLEmbedElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
138 { |
|
139 return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLEmbedElementPrototypeTable, this, propertyName, descriptor); |
|
140 } |
|
141 |
|
142 const ClassInfo JSHTMLEmbedElement::s_info = { "HTMLEmbedElement", &JSHTMLElement::s_info, &JSHTMLEmbedElementTable, 0 }; |
|
143 |
|
144 JSHTMLEmbedElement::JSHTMLEmbedElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLEmbedElement> impl) |
|
145 : JSHTMLElement(structure, globalObject, impl) |
|
146 { |
|
147 } |
|
148 |
|
149 JSObject* JSHTMLEmbedElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
150 { |
|
151 return new (exec) JSHTMLEmbedElementPrototype(globalObject, JSHTMLEmbedElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
152 } |
|
153 |
|
154 bool JSHTMLEmbedElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
155 { |
|
156 if (getOwnPropertySlotDelegate(exec, propertyName, slot)) |
|
157 return true; |
|
158 return getStaticValueSlot<JSHTMLEmbedElement, Base>(exec, &JSHTMLEmbedElementTable, this, propertyName, slot); |
|
159 } |
|
160 |
|
161 bool JSHTMLEmbedElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
162 { |
|
163 if (getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor)) |
|
164 return true; |
|
165 return getStaticValueDescriptor<JSHTMLEmbedElement, Base>(exec, &JSHTMLEmbedElementTable, this, propertyName, descriptor); |
|
166 } |
|
167 |
|
168 JSValue jsHTMLEmbedElementAlign(ExecState* exec, JSValue slotBase, const Identifier&) |
|
169 { |
|
170 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase)); |
|
171 UNUSED_PARAM(exec); |
|
172 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl()); |
|
173 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::alignAttr)); |
|
174 return result; |
|
175 } |
|
176 |
|
177 JSValue jsHTMLEmbedElementHeight(ExecState* exec, JSValue slotBase, const Identifier&) |
|
178 { |
|
179 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase)); |
|
180 UNUSED_PARAM(exec); |
|
181 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl()); |
|
182 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::heightAttr)); |
|
183 return result; |
|
184 } |
|
185 |
|
186 JSValue jsHTMLEmbedElementName(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::nameAttr)); |
|
192 return result; |
|
193 } |
|
194 |
|
195 JSValue jsHTMLEmbedElementSrc(ExecState* exec, JSValue slotBase, const Identifier&) |
|
196 { |
|
197 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase)); |
|
198 UNUSED_PARAM(exec); |
|
199 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl()); |
|
200 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::srcAttr)); |
|
201 return result; |
|
202 } |
|
203 |
|
204 JSValue jsHTMLEmbedElementType(ExecState* exec, JSValue slotBase, const Identifier&) |
|
205 { |
|
206 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase)); |
|
207 UNUSED_PARAM(exec); |
|
208 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl()); |
|
209 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::typeAttr)); |
|
210 return result; |
|
211 } |
|
212 |
|
213 JSValue jsHTMLEmbedElementWidth(ExecState* exec, JSValue slotBase, const Identifier&) |
|
214 { |
|
215 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(slotBase)); |
|
216 UNUSED_PARAM(exec); |
|
217 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl()); |
|
218 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::widthAttr)); |
|
219 return result; |
|
220 } |
|
221 |
|
222 JSValue jsHTMLEmbedElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
223 { |
|
224 JSHTMLEmbedElement* domObject = static_cast<JSHTMLEmbedElement*>(asObject(slotBase)); |
|
225 return JSHTMLEmbedElement::getConstructor(exec, domObject->globalObject()); |
|
226 } |
|
227 void JSHTMLEmbedElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
228 { |
|
229 if (putDelegate(exec, propertyName, value, slot)) |
|
230 return; |
|
231 lookupPut<JSHTMLEmbedElement, Base>(exec, propertyName, value, &JSHTMLEmbedElementTable, this, slot); |
|
232 } |
|
233 |
|
234 void setJSHTMLEmbedElementAlign(ExecState* exec, JSObject* thisObject, JSValue value) |
|
235 { |
|
236 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject); |
|
237 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl()); |
|
238 imp->setAttribute(WebCore::HTMLNames::alignAttr, valueToStringWithNullCheck(exec, value)); |
|
239 } |
|
240 |
|
241 void setJSHTMLEmbedElementHeight(ExecState* exec, JSObject* thisObject, JSValue value) |
|
242 { |
|
243 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject); |
|
244 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl()); |
|
245 imp->setAttribute(WebCore::HTMLNames::heightAttr, valueToStringWithNullCheck(exec, value)); |
|
246 } |
|
247 |
|
248 void setJSHTMLEmbedElementName(ExecState* exec, JSObject* thisObject, JSValue value) |
|
249 { |
|
250 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject); |
|
251 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl()); |
|
252 imp->setAttribute(WebCore::HTMLNames::nameAttr, valueToStringWithNullCheck(exec, value)); |
|
253 } |
|
254 |
|
255 void setJSHTMLEmbedElementSrc(ExecState* exec, JSObject* thisObject, JSValue value) |
|
256 { |
|
257 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject); |
|
258 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl()); |
|
259 imp->setAttribute(WebCore::HTMLNames::srcAttr, valueToStringWithNullCheck(exec, value)); |
|
260 } |
|
261 |
|
262 void setJSHTMLEmbedElementType(ExecState* exec, JSObject* thisObject, JSValue value) |
|
263 { |
|
264 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(thisObject); |
|
265 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl()); |
|
266 imp->setAttribute(WebCore::HTMLNames::typeAttr, valueToStringWithNullCheck(exec, value)); |
|
267 } |
|
268 |
|
269 void setJSHTMLEmbedElementWidth(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::widthAttr, valueToStringWithNullCheck(exec, value)); |
|
274 } |
|
275 |
|
276 JSValue JSHTMLEmbedElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
277 { |
|
278 return getDOMConstructor<JSHTMLEmbedElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
279 } |
|
280 |
|
281 EncodedJSValue JSC_HOST_CALL jsHTMLEmbedElementPrototypeFunctionGetSVGDocument(ExecState* exec) |
|
282 { |
|
283 JSValue thisValue = exec->hostThisValue(); |
|
284 if (!thisValue.inherits(&JSHTMLEmbedElement::s_info)) |
|
285 return throwVMTypeError(exec); |
|
286 JSHTMLEmbedElement* castedThis = static_cast<JSHTMLEmbedElement*>(asObject(thisValue)); |
|
287 HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(castedThis->impl()); |
|
288 ExceptionCode ec = 0; |
|
289 if (!checkNodeSecurity(exec, imp->getSVGDocument(ec))) |
|
290 return JSValue::encode(jsUndefined()); |
|
291 |
|
292 |
|
293 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getSVGDocument(ec))); |
|
294 setDOMException(exec, ec); |
|
295 return JSValue::encode(result); |
|
296 } |
|
297 |
|
298 |
|
299 } |