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 "CustomElementReactionQueue.h" |
25 | #include "HTMLNames.h" |
26 | #include "JSDOMAttribute.h" |
27 | #include "JSDOMBinding.h" |
28 | #include "JSDOMBindingSecurity.h" |
29 | #include "JSDOMConstructorNotConstructable.h" |
30 | #include "JSDOMConvertInterface.h" |
31 | #include "JSDOMConvertStrings.h" |
32 | #include "JSDOMExceptionHandling.h" |
33 | #include "JSDOMGlobalObject.h" |
34 | #include "JSDOMOperation.h" |
35 | #include "JSDOMWrapperCache.h" |
36 | #include "JSDocument.h" |
37 | #include "JSPluginElementFunctions.h" |
38 | #include "ScriptExecutionContext.h" |
39 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
40 | #include <JavaScriptCore/JSCInlines.h> |
41 | #include <wtf/GetPtr.h> |
42 | #include <wtf/PointerPreparations.h> |
43 | #include <wtf/URL.h> |
44 | |
45 | |
46 | namespace WebCore { |
47 | using namespace JSC; |
48 | |
49 | // Functions |
50 | |
51 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLEmbedElementPrototypeFunctionGetSVGDocument(JSC::ExecState*); |
52 | |
53 | // Attributes |
54 | |
55 | JSC::EncodedJSValue jsHTMLEmbedElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
56 | bool setJSHTMLEmbedElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
57 | JSC::EncodedJSValue jsHTMLEmbedElementAlign(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
58 | bool setJSHTMLEmbedElementAlign(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
59 | JSC::EncodedJSValue jsHTMLEmbedElementHeight(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
60 | bool setJSHTMLEmbedElementHeight(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
61 | JSC::EncodedJSValue jsHTMLEmbedElementName(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
62 | bool setJSHTMLEmbedElementName(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
63 | JSC::EncodedJSValue jsHTMLEmbedElementSrc(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
64 | bool setJSHTMLEmbedElementSrc(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
65 | JSC::EncodedJSValue jsHTMLEmbedElementType(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
66 | bool setJSHTMLEmbedElementType(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
67 | JSC::EncodedJSValue jsHTMLEmbedElementWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
68 | bool setJSHTMLEmbedElementWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
69 | |
70 | class JSHTMLEmbedElementPrototype : public JSC::JSNonFinalObject { |
71 | public: |
72 | using Base = JSC::JSNonFinalObject; |
73 | static JSHTMLEmbedElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
74 | { |
75 | JSHTMLEmbedElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSHTMLEmbedElementPrototype>(vm.heap)) JSHTMLEmbedElementPrototype(vm, globalObject, structure); |
76 | ptr->finishCreation(vm); |
77 | return ptr; |
78 | } |
79 | |
80 | DECLARE_INFO; |
81 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
82 | { |
83 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
84 | } |
85 | |
86 | private: |
87 | JSHTMLEmbedElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
88 | : JSC::JSNonFinalObject(vm, structure) |
89 | { |
90 | } |
91 | |
92 | void finishCreation(JSC::VM&); |
93 | }; |
94 | |
95 | using JSHTMLEmbedElementConstructor = JSDOMConstructorNotConstructable<JSHTMLEmbedElement>; |
96 | |
97 | template<> JSValue JSHTMLEmbedElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
98 | { |
99 | return JSHTMLElement::getConstructor(vm, &globalObject); |
100 | } |
101 | |
102 | template<> void JSHTMLEmbedElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
103 | { |
104 | putDirect(vm, vm.propertyNames->prototype, JSHTMLEmbedElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
105 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("HTMLEmbedElement"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
106 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
107 | } |
108 | |
109 | template<> const ClassInfo JSHTMLEmbedElementConstructor::s_info = { "HTMLEmbedElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLEmbedElementConstructor) }; |
110 | |
111 | /* Hash table for prototype */ |
112 | |
113 | static const HashTableValue JSHTMLEmbedElementPrototypeTableValues[] = |
114 | { |
115 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLEmbedElementConstructor) } }, |
116 | { "align" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementAlign), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLEmbedElementAlign) } }, |
117 | { "height" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementHeight), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLEmbedElementHeight) } }, |
118 | { "name" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementName), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLEmbedElementName) } }, |
119 | { "src" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementSrc), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLEmbedElementSrc) } }, |
120 | { "type" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLEmbedElementType) } }, |
121 | { "width" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLEmbedElementWidth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLEmbedElementWidth) } }, |
122 | { "getSVGDocument" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLEmbedElementPrototypeFunctionGetSVGDocument), (intptr_t) (0) } }, |
123 | }; |
124 | |
125 | const ClassInfo JSHTMLEmbedElementPrototype::s_info = { "HTMLEmbedElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLEmbedElementPrototype) }; |
126 | |
127 | void JSHTMLEmbedElementPrototype::finishCreation(VM& vm) |
128 | { |
129 | Base::finishCreation(vm); |
130 | reifyStaticProperties(vm, JSHTMLEmbedElement::info(), JSHTMLEmbedElementPrototypeTableValues, *this); |
131 | } |
132 | |
133 | const ClassInfo JSHTMLEmbedElement::s_info = { "HTMLEmbedElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLEmbedElement) }; |
134 | |
135 | JSHTMLEmbedElement::JSHTMLEmbedElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<HTMLEmbedElement>&& impl) |
136 | : JSHTMLElement(structure, globalObject, WTFMove(impl)) |
137 | { |
138 | } |
139 | |
140 | void JSHTMLEmbedElement::finishCreation(VM& vm) |
141 | { |
142 | Base::finishCreation(vm); |
143 | ASSERT(inherits(vm, info())); |
144 | |
145 | } |
146 | |
147 | JSObject* JSHTMLEmbedElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
148 | { |
149 | return JSHTMLEmbedElementPrototype::create(vm, &globalObject, JSHTMLEmbedElementPrototype::createStructure(vm, &globalObject, JSHTMLElement::prototype(vm, globalObject))); |
150 | } |
151 | |
152 | JSObject* JSHTMLEmbedElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
153 | { |
154 | return getDOMPrototype<JSHTMLEmbedElement>(vm, globalObject); |
155 | } |
156 | |
157 | JSValue JSHTMLEmbedElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
158 | { |
159 | return getDOMConstructor<JSHTMLEmbedElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
160 | } |
161 | |
162 | bool JSHTMLEmbedElement::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot) |
163 | { |
164 | auto* thisObject = jsCast<JSHTMLEmbedElement*>(object); |
165 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
166 | if (pluginElementCustomGetOwnPropertySlot(thisObject, state, propertyName, slot)) |
167 | return true; |
168 | return JSObject::getOwnPropertySlot(object, state, propertyName, slot); |
169 | } |
170 | |
171 | bool JSHTMLEmbedElement::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot) |
172 | { |
173 | auto* thisObject = jsCast<JSHTMLEmbedElement*>(object); |
174 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
175 | auto propertyName = Identifier::from(state, index); |
176 | if (pluginElementCustomGetOwnPropertySlot(thisObject, state, propertyName, slot)) |
177 | return true; |
178 | return JSObject::getOwnPropertySlotByIndex(object, state, index, slot); |
179 | } |
180 | |
181 | bool JSHTMLEmbedElement::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot) |
182 | { |
183 | auto* thisObject = jsCast<JSHTMLEmbedElement*>(cell); |
184 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
185 | |
186 | bool putResult = false; |
187 | if (pluginElementCustomPut(thisObject, state, propertyName, value, putPropertySlot, putResult)) |
188 | return putResult; |
189 | |
190 | return JSObject::put(thisObject, state, propertyName, value, putPropertySlot); |
191 | } |
192 | |
193 | bool JSHTMLEmbedElement::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow) |
194 | { |
195 | auto* thisObject = jsCast<JSHTMLEmbedElement*>(cell); |
196 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
197 | |
198 | auto propertyName = Identifier::from(state, index); |
199 | PutPropertySlot putPropertySlot(thisObject, shouldThrow); |
200 | bool putResult = false; |
201 | if (pluginElementCustomPut(thisObject, state, propertyName, value, putPropertySlot, putResult)) |
202 | return putResult; |
203 | |
204 | return JSObject::putByIndex(cell, state, index, value, shouldThrow); |
205 | } |
206 | |
207 | CallType JSHTMLEmbedElement::getCallData(JSCell* cell, CallData& callData) |
208 | { |
209 | auto* thisObject = jsCast<JSHTMLEmbedElement*>(cell); |
210 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
211 | |
212 | return pluginElementCustomGetCallData(thisObject, callData); |
213 | } |
214 | |
215 | template<> inline JSHTMLEmbedElement* IDLAttribute<JSHTMLEmbedElement>::cast(ExecState& state, EncodedJSValue thisValue) |
216 | { |
217 | return jsDynamicCast<JSHTMLEmbedElement*>(state.vm(), JSValue::decode(thisValue)); |
218 | } |
219 | |
220 | template<> inline JSHTMLEmbedElement* IDLOperation<JSHTMLEmbedElement>::cast(ExecState& state) |
221 | { |
222 | return jsDynamicCast<JSHTMLEmbedElement*>(state.vm(), state.thisValue()); |
223 | } |
224 | |
225 | EncodedJSValue jsHTMLEmbedElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
226 | { |
227 | VM& vm = state->vm(); |
228 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
229 | auto* prototype = jsDynamicCast<JSHTMLEmbedElementPrototype*>(vm, JSValue::decode(thisValue)); |
230 | if (UNLIKELY(!prototype)) |
231 | return throwVMTypeError(state, throwScope); |
232 | return JSValue::encode(JSHTMLEmbedElement::getConstructor(state->vm(), prototype->globalObject())); |
233 | } |
234 | |
235 | bool setJSHTMLEmbedElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
236 | { |
237 | VM& vm = state->vm(); |
238 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
239 | auto* prototype = jsDynamicCast<JSHTMLEmbedElementPrototype*>(vm, JSValue::decode(thisValue)); |
240 | if (UNLIKELY(!prototype)) { |
241 | throwVMTypeError(state, throwScope); |
242 | return false; |
243 | } |
244 | // Shadowing a built-in constructor |
245 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
246 | } |
247 | |
248 | static inline JSValue jsHTMLEmbedElementAlignGetter(ExecState& state, JSHTMLEmbedElement& thisObject, ThrowScope& throwScope) |
249 | { |
250 | UNUSED_PARAM(throwScope); |
251 | UNUSED_PARAM(state); |
252 | auto& impl = thisObject.wrapped(); |
253 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::alignAttr)); |
254 | return result; |
255 | } |
256 | |
257 | EncodedJSValue jsHTMLEmbedElementAlign(ExecState* state, EncodedJSValue thisValue, PropertyName) |
258 | { |
259 | return IDLAttribute<JSHTMLEmbedElement>::get<jsHTMLEmbedElementAlignGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "align" ); |
260 | } |
261 | |
262 | static inline bool setJSHTMLEmbedElementAlignSetter(ExecState& state, JSHTMLEmbedElement& thisObject, JSValue value, ThrowScope& throwScope) |
263 | { |
264 | UNUSED_PARAM(throwScope); |
265 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
266 | auto& impl = thisObject.wrapped(); |
267 | auto nativeValue = convert<IDLDOMString>(state, value); |
268 | RETURN_IF_EXCEPTION(throwScope, false); |
269 | AttributeSetter::call(state, throwScope, [&] { |
270 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::alignAttr, WTFMove(nativeValue)); |
271 | }); |
272 | return true; |
273 | } |
274 | |
275 | bool setJSHTMLEmbedElementAlign(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
276 | { |
277 | return IDLAttribute<JSHTMLEmbedElement>::set<setJSHTMLEmbedElementAlignSetter>(*state, thisValue, encodedValue, "align" ); |
278 | } |
279 | |
280 | static inline JSValue jsHTMLEmbedElementHeightGetter(ExecState& state, JSHTMLEmbedElement& thisObject, ThrowScope& throwScope) |
281 | { |
282 | UNUSED_PARAM(throwScope); |
283 | UNUSED_PARAM(state); |
284 | auto& impl = thisObject.wrapped(); |
285 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::heightAttr)); |
286 | return result; |
287 | } |
288 | |
289 | EncodedJSValue jsHTMLEmbedElementHeight(ExecState* state, EncodedJSValue thisValue, PropertyName) |
290 | { |
291 | return IDLAttribute<JSHTMLEmbedElement>::get<jsHTMLEmbedElementHeightGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "height" ); |
292 | } |
293 | |
294 | static inline bool setJSHTMLEmbedElementHeightSetter(ExecState& state, JSHTMLEmbedElement& thisObject, JSValue value, ThrowScope& throwScope) |
295 | { |
296 | UNUSED_PARAM(throwScope); |
297 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
298 | auto& impl = thisObject.wrapped(); |
299 | auto nativeValue = convert<IDLDOMString>(state, value); |
300 | RETURN_IF_EXCEPTION(throwScope, false); |
301 | AttributeSetter::call(state, throwScope, [&] { |
302 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::heightAttr, WTFMove(nativeValue)); |
303 | }); |
304 | return true; |
305 | } |
306 | |
307 | bool setJSHTMLEmbedElementHeight(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
308 | { |
309 | return IDLAttribute<JSHTMLEmbedElement>::set<setJSHTMLEmbedElementHeightSetter>(*state, thisValue, encodedValue, "height" ); |
310 | } |
311 | |
312 | static inline JSValue jsHTMLEmbedElementNameGetter(ExecState& state, JSHTMLEmbedElement& thisObject, ThrowScope& throwScope) |
313 | { |
314 | UNUSED_PARAM(throwScope); |
315 | UNUSED_PARAM(state); |
316 | auto& impl = thisObject.wrapped(); |
317 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.getNameAttribute()); |
318 | return result; |
319 | } |
320 | |
321 | EncodedJSValue jsHTMLEmbedElementName(ExecState* state, EncodedJSValue thisValue, PropertyName) |
322 | { |
323 | return IDLAttribute<JSHTMLEmbedElement>::get<jsHTMLEmbedElementNameGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "name" ); |
324 | } |
325 | |
326 | static inline bool setJSHTMLEmbedElementNameSetter(ExecState& state, JSHTMLEmbedElement& thisObject, JSValue value, ThrowScope& throwScope) |
327 | { |
328 | UNUSED_PARAM(throwScope); |
329 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
330 | auto& impl = thisObject.wrapped(); |
331 | auto nativeValue = convert<IDLDOMString>(state, value); |
332 | RETURN_IF_EXCEPTION(throwScope, false); |
333 | AttributeSetter::call(state, throwScope, [&] { |
334 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::nameAttr, WTFMove(nativeValue)); |
335 | }); |
336 | return true; |
337 | } |
338 | |
339 | bool setJSHTMLEmbedElementName(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
340 | { |
341 | return IDLAttribute<JSHTMLEmbedElement>::set<setJSHTMLEmbedElementNameSetter>(*state, thisValue, encodedValue, "name" ); |
342 | } |
343 | |
344 | static inline JSValue jsHTMLEmbedElementSrcGetter(ExecState& state, JSHTMLEmbedElement& thisObject, ThrowScope& throwScope) |
345 | { |
346 | UNUSED_PARAM(throwScope); |
347 | UNUSED_PARAM(state); |
348 | auto& impl = thisObject.wrapped(); |
349 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.getURLAttribute(WebCore::HTMLNames::srcAttr)); |
350 | return result; |
351 | } |
352 | |
353 | EncodedJSValue jsHTMLEmbedElementSrc(ExecState* state, EncodedJSValue thisValue, PropertyName) |
354 | { |
355 | return IDLAttribute<JSHTMLEmbedElement>::get<jsHTMLEmbedElementSrcGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "src" ); |
356 | } |
357 | |
358 | static inline bool setJSHTMLEmbedElementSrcSetter(ExecState& state, JSHTMLEmbedElement& thisObject, JSValue value, ThrowScope& throwScope) |
359 | { |
360 | UNUSED_PARAM(throwScope); |
361 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
362 | auto& impl = thisObject.wrapped(); |
363 | auto nativeValue = convert<IDLUSVString>(state, value); |
364 | RETURN_IF_EXCEPTION(throwScope, false); |
365 | AttributeSetter::call(state, throwScope, [&] { |
366 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::srcAttr, WTFMove(nativeValue)); |
367 | }); |
368 | return true; |
369 | } |
370 | |
371 | bool setJSHTMLEmbedElementSrc(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
372 | { |
373 | return IDLAttribute<JSHTMLEmbedElement>::set<setJSHTMLEmbedElementSrcSetter>(*state, thisValue, encodedValue, "src" ); |
374 | } |
375 | |
376 | static inline JSValue jsHTMLEmbedElementTypeGetter(ExecState& state, JSHTMLEmbedElement& thisObject, ThrowScope& throwScope) |
377 | { |
378 | UNUSED_PARAM(throwScope); |
379 | UNUSED_PARAM(state); |
380 | auto& impl = thisObject.wrapped(); |
381 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::typeAttr)); |
382 | return result; |
383 | } |
384 | |
385 | EncodedJSValue jsHTMLEmbedElementType(ExecState* state, EncodedJSValue thisValue, PropertyName) |
386 | { |
387 | return IDLAttribute<JSHTMLEmbedElement>::get<jsHTMLEmbedElementTypeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "type" ); |
388 | } |
389 | |
390 | static inline bool setJSHTMLEmbedElementTypeSetter(ExecState& state, JSHTMLEmbedElement& thisObject, JSValue value, ThrowScope& throwScope) |
391 | { |
392 | UNUSED_PARAM(throwScope); |
393 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
394 | auto& impl = thisObject.wrapped(); |
395 | auto nativeValue = convert<IDLDOMString>(state, value); |
396 | RETURN_IF_EXCEPTION(throwScope, false); |
397 | AttributeSetter::call(state, throwScope, [&] { |
398 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::typeAttr, WTFMove(nativeValue)); |
399 | }); |
400 | return true; |
401 | } |
402 | |
403 | bool setJSHTMLEmbedElementType(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
404 | { |
405 | return IDLAttribute<JSHTMLEmbedElement>::set<setJSHTMLEmbedElementTypeSetter>(*state, thisValue, encodedValue, "type" ); |
406 | } |
407 | |
408 | static inline JSValue jsHTMLEmbedElementWidthGetter(ExecState& state, JSHTMLEmbedElement& thisObject, ThrowScope& throwScope) |
409 | { |
410 | UNUSED_PARAM(throwScope); |
411 | UNUSED_PARAM(state); |
412 | auto& impl = thisObject.wrapped(); |
413 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::widthAttr)); |
414 | return result; |
415 | } |
416 | |
417 | EncodedJSValue jsHTMLEmbedElementWidth(ExecState* state, EncodedJSValue thisValue, PropertyName) |
418 | { |
419 | return IDLAttribute<JSHTMLEmbedElement>::get<jsHTMLEmbedElementWidthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "width" ); |
420 | } |
421 | |
422 | static inline bool setJSHTMLEmbedElementWidthSetter(ExecState& state, JSHTMLEmbedElement& thisObject, JSValue value, ThrowScope& throwScope) |
423 | { |
424 | UNUSED_PARAM(throwScope); |
425 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
426 | auto& impl = thisObject.wrapped(); |
427 | auto nativeValue = convert<IDLDOMString>(state, value); |
428 | RETURN_IF_EXCEPTION(throwScope, false); |
429 | AttributeSetter::call(state, throwScope, [&] { |
430 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::widthAttr, WTFMove(nativeValue)); |
431 | }); |
432 | return true; |
433 | } |
434 | |
435 | bool setJSHTMLEmbedElementWidth(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
436 | { |
437 | return IDLAttribute<JSHTMLEmbedElement>::set<setJSHTMLEmbedElementWidthSetter>(*state, thisValue, encodedValue, "width" ); |
438 | } |
439 | |
440 | static inline JSC::EncodedJSValue jsHTMLEmbedElementPrototypeFunctionGetSVGDocumentBody(JSC::ExecState* state, typename IDLOperation<JSHTMLEmbedElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
441 | { |
442 | UNUSED_PARAM(state); |
443 | UNUSED_PARAM(throwScope); |
444 | auto& impl = castedThis->wrapped(); |
445 | return JSValue::encode(toJS<IDLInterface<Document>>(*state, *castedThis->globalObject(), throwScope, BindingSecurity::checkSecurityForNode(*state, impl.getSVGDocument()))); |
446 | } |
447 | |
448 | EncodedJSValue JSC_HOST_CALL jsHTMLEmbedElementPrototypeFunctionGetSVGDocument(ExecState* state) |
449 | { |
450 | return IDLOperation<JSHTMLEmbedElement>::call<jsHTMLEmbedElementPrototypeFunctionGetSVGDocumentBody>(*state, "getSVGDocument" ); |
451 | } |
452 | |
453 | void JSHTMLEmbedElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
454 | { |
455 | auto* thisObject = jsCast<JSHTMLEmbedElement*>(cell); |
456 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
457 | if (thisObject->scriptExecutionContext()) |
458 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
459 | Base::heapSnapshot(cell, builder); |
460 | } |
461 | |
462 | |
463 | } |
464 | |