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 "JSSVGForeignObjectElement.h" |
23 | |
24 | #include "JSDOMAttribute.h" |
25 | #include "JSDOMBinding.h" |
26 | #include "JSDOMConstructorNotConstructable.h" |
27 | #include "JSDOMConvertInterface.h" |
28 | #include "JSDOMExceptionHandling.h" |
29 | #include "JSDOMGlobalObject.h" |
30 | #include "JSDOMWrapperCache.h" |
31 | #include "JSSVGAnimatedBoolean.h" |
32 | #include "JSSVGAnimatedLength.h" |
33 | #include "ScriptExecutionContext.h" |
34 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
35 | #include <JavaScriptCore/JSCInlines.h> |
36 | #include <wtf/GetPtr.h> |
37 | #include <wtf/PointerPreparations.h> |
38 | #include <wtf/URL.h> |
39 | |
40 | |
41 | namespace WebCore { |
42 | using namespace JSC; |
43 | |
44 | // Attributes |
45 | |
46 | JSC::EncodedJSValue jsSVGForeignObjectElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
47 | bool setJSSVGForeignObjectElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
48 | JSC::EncodedJSValue jsSVGForeignObjectElementX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
49 | JSC::EncodedJSValue jsSVGForeignObjectElementY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
50 | JSC::EncodedJSValue jsSVGForeignObjectElementWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
51 | JSC::EncodedJSValue jsSVGForeignObjectElementHeight(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
52 | JSC::EncodedJSValue jsSVGForeignObjectElementExternalResourcesRequired(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
53 | |
54 | class JSSVGForeignObjectElementPrototype : public JSC::JSNonFinalObject { |
55 | public: |
56 | using Base = JSC::JSNonFinalObject; |
57 | static JSSVGForeignObjectElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
58 | { |
59 | JSSVGForeignObjectElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGForeignObjectElementPrototype>(vm.heap)) JSSVGForeignObjectElementPrototype(vm, globalObject, structure); |
60 | ptr->finishCreation(vm); |
61 | return ptr; |
62 | } |
63 | |
64 | DECLARE_INFO; |
65 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
66 | { |
67 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
68 | } |
69 | |
70 | private: |
71 | JSSVGForeignObjectElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
72 | : JSC::JSNonFinalObject(vm, structure) |
73 | { |
74 | } |
75 | |
76 | void finishCreation(JSC::VM&); |
77 | }; |
78 | |
79 | using JSSVGForeignObjectElementConstructor = JSDOMConstructorNotConstructable<JSSVGForeignObjectElement>; |
80 | |
81 | template<> JSValue JSSVGForeignObjectElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
82 | { |
83 | return JSSVGGraphicsElement::getConstructor(vm, &globalObject); |
84 | } |
85 | |
86 | template<> void JSSVGForeignObjectElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
87 | { |
88 | putDirect(vm, vm.propertyNames->prototype, JSSVGForeignObjectElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
89 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGForeignObjectElement"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
90 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
91 | } |
92 | |
93 | template<> const ClassInfo JSSVGForeignObjectElementConstructor::s_info = { "SVGForeignObjectElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGForeignObjectElementConstructor) }; |
94 | |
95 | /* Hash table for prototype */ |
96 | |
97 | static const HashTableValue JSSVGForeignObjectElementPrototypeTableValues[] = |
98 | { |
99 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGForeignObjectElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGForeignObjectElementConstructor) } }, |
100 | { "x" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGForeignObjectElementX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
101 | { "y" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGForeignObjectElementY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
102 | { "width" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGForeignObjectElementWidth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
103 | { "height" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGForeignObjectElementHeight), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
104 | { "externalResourcesRequired" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGForeignObjectElementExternalResourcesRequired), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
105 | }; |
106 | |
107 | const ClassInfo JSSVGForeignObjectElementPrototype::s_info = { "SVGForeignObjectElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGForeignObjectElementPrototype) }; |
108 | |
109 | void JSSVGForeignObjectElementPrototype::finishCreation(VM& vm) |
110 | { |
111 | Base::finishCreation(vm); |
112 | reifyStaticProperties(vm, JSSVGForeignObjectElement::info(), JSSVGForeignObjectElementPrototypeTableValues, *this); |
113 | } |
114 | |
115 | const ClassInfo JSSVGForeignObjectElement::s_info = { "SVGForeignObjectElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGForeignObjectElement) }; |
116 | |
117 | JSSVGForeignObjectElement::JSSVGForeignObjectElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGForeignObjectElement>&& impl) |
118 | : JSSVGGraphicsElement(structure, globalObject, WTFMove(impl)) |
119 | { |
120 | } |
121 | |
122 | void JSSVGForeignObjectElement::finishCreation(VM& vm) |
123 | { |
124 | Base::finishCreation(vm); |
125 | ASSERT(inherits(vm, info())); |
126 | |
127 | } |
128 | |
129 | JSObject* JSSVGForeignObjectElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
130 | { |
131 | return JSSVGForeignObjectElementPrototype::create(vm, &globalObject, JSSVGForeignObjectElementPrototype::createStructure(vm, &globalObject, JSSVGGraphicsElement::prototype(vm, globalObject))); |
132 | } |
133 | |
134 | JSObject* JSSVGForeignObjectElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
135 | { |
136 | return getDOMPrototype<JSSVGForeignObjectElement>(vm, globalObject); |
137 | } |
138 | |
139 | JSValue JSSVGForeignObjectElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
140 | { |
141 | return getDOMConstructor<JSSVGForeignObjectElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
142 | } |
143 | |
144 | template<> inline JSSVGForeignObjectElement* IDLAttribute<JSSVGForeignObjectElement>::cast(ExecState& state, EncodedJSValue thisValue) |
145 | { |
146 | return jsDynamicCast<JSSVGForeignObjectElement*>(state.vm(), JSValue::decode(thisValue)); |
147 | } |
148 | |
149 | EncodedJSValue jsSVGForeignObjectElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
150 | { |
151 | VM& vm = state->vm(); |
152 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
153 | auto* prototype = jsDynamicCast<JSSVGForeignObjectElementPrototype*>(vm, JSValue::decode(thisValue)); |
154 | if (UNLIKELY(!prototype)) |
155 | return throwVMTypeError(state, throwScope); |
156 | return JSValue::encode(JSSVGForeignObjectElement::getConstructor(state->vm(), prototype->globalObject())); |
157 | } |
158 | |
159 | bool setJSSVGForeignObjectElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
160 | { |
161 | VM& vm = state->vm(); |
162 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
163 | auto* prototype = jsDynamicCast<JSSVGForeignObjectElementPrototype*>(vm, JSValue::decode(thisValue)); |
164 | if (UNLIKELY(!prototype)) { |
165 | throwVMTypeError(state, throwScope); |
166 | return false; |
167 | } |
168 | // Shadowing a built-in constructor |
169 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
170 | } |
171 | |
172 | static inline JSValue jsSVGForeignObjectElementXGetter(ExecState& state, JSSVGForeignObjectElement& thisObject, ThrowScope& throwScope) |
173 | { |
174 | UNUSED_PARAM(throwScope); |
175 | UNUSED_PARAM(state); |
176 | auto& impl = thisObject.wrapped(); |
177 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.xAnimated()); |
178 | return result; |
179 | } |
180 | |
181 | EncodedJSValue jsSVGForeignObjectElementX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
182 | { |
183 | return IDLAttribute<JSSVGForeignObjectElement>::get<jsSVGForeignObjectElementXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "x" ); |
184 | } |
185 | |
186 | static inline JSValue jsSVGForeignObjectElementYGetter(ExecState& state, JSSVGForeignObjectElement& thisObject, ThrowScope& throwScope) |
187 | { |
188 | UNUSED_PARAM(throwScope); |
189 | UNUSED_PARAM(state); |
190 | auto& impl = thisObject.wrapped(); |
191 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.yAnimated()); |
192 | return result; |
193 | } |
194 | |
195 | EncodedJSValue jsSVGForeignObjectElementY(ExecState* state, EncodedJSValue thisValue, PropertyName) |
196 | { |
197 | return IDLAttribute<JSSVGForeignObjectElement>::get<jsSVGForeignObjectElementYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "y" ); |
198 | } |
199 | |
200 | static inline JSValue jsSVGForeignObjectElementWidthGetter(ExecState& state, JSSVGForeignObjectElement& thisObject, ThrowScope& throwScope) |
201 | { |
202 | UNUSED_PARAM(throwScope); |
203 | UNUSED_PARAM(state); |
204 | auto& impl = thisObject.wrapped(); |
205 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.widthAnimated()); |
206 | return result; |
207 | } |
208 | |
209 | EncodedJSValue jsSVGForeignObjectElementWidth(ExecState* state, EncodedJSValue thisValue, PropertyName) |
210 | { |
211 | return IDLAttribute<JSSVGForeignObjectElement>::get<jsSVGForeignObjectElementWidthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "width" ); |
212 | } |
213 | |
214 | static inline JSValue jsSVGForeignObjectElementHeightGetter(ExecState& state, JSSVGForeignObjectElement& thisObject, ThrowScope& throwScope) |
215 | { |
216 | UNUSED_PARAM(throwScope); |
217 | UNUSED_PARAM(state); |
218 | auto& impl = thisObject.wrapped(); |
219 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.heightAnimated()); |
220 | return result; |
221 | } |
222 | |
223 | EncodedJSValue jsSVGForeignObjectElementHeight(ExecState* state, EncodedJSValue thisValue, PropertyName) |
224 | { |
225 | return IDLAttribute<JSSVGForeignObjectElement>::get<jsSVGForeignObjectElementHeightGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "height" ); |
226 | } |
227 | |
228 | static inline JSValue jsSVGForeignObjectElementExternalResourcesRequiredGetter(ExecState& state, JSSVGForeignObjectElement& thisObject, ThrowScope& throwScope) |
229 | { |
230 | UNUSED_PARAM(throwScope); |
231 | UNUSED_PARAM(state); |
232 | auto& impl = thisObject.wrapped(); |
233 | JSValue result = toJS<IDLInterface<SVGAnimatedBoolean>>(state, *thisObject.globalObject(), throwScope, impl.externalResourcesRequiredAnimated()); |
234 | return result; |
235 | } |
236 | |
237 | EncodedJSValue jsSVGForeignObjectElementExternalResourcesRequired(ExecState* state, EncodedJSValue thisValue, PropertyName) |
238 | { |
239 | return IDLAttribute<JSSVGForeignObjectElement>::get<jsSVGForeignObjectElementExternalResourcesRequiredGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "externalResourcesRequired" ); |
240 | } |
241 | |
242 | void JSSVGForeignObjectElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
243 | { |
244 | auto* thisObject = jsCast<JSSVGForeignObjectElement*>(cell); |
245 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
246 | if (thisObject->scriptExecutionContext()) |
247 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
248 | Base::heapSnapshot(cell, builder); |
249 | } |
250 | |
251 | |
252 | } |
253 | |