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 "JSSVGFESpotLightElement.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 "JSSVGAnimatedNumber.h" |
32 | #include "ScriptExecutionContext.h" |
33 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
34 | #include <JavaScriptCore/JSCInlines.h> |
35 | #include <wtf/GetPtr.h> |
36 | #include <wtf/PointerPreparations.h> |
37 | #include <wtf/URL.h> |
38 | |
39 | |
40 | namespace WebCore { |
41 | using namespace JSC; |
42 | |
43 | // Attributes |
44 | |
45 | JSC::EncodedJSValue jsSVGFESpotLightElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
46 | bool setJSSVGFESpotLightElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
47 | JSC::EncodedJSValue jsSVGFESpotLightElementX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
48 | JSC::EncodedJSValue jsSVGFESpotLightElementY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
49 | JSC::EncodedJSValue jsSVGFESpotLightElementZ(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
50 | JSC::EncodedJSValue jsSVGFESpotLightElementPointsAtX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
51 | JSC::EncodedJSValue jsSVGFESpotLightElementPointsAtY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
52 | JSC::EncodedJSValue jsSVGFESpotLightElementPointsAtZ(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
53 | JSC::EncodedJSValue jsSVGFESpotLightElementSpecularExponent(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
54 | JSC::EncodedJSValue jsSVGFESpotLightElementLimitingConeAngle(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
55 | |
56 | class JSSVGFESpotLightElementPrototype : public JSC::JSNonFinalObject { |
57 | public: |
58 | using Base = JSC::JSNonFinalObject; |
59 | static JSSVGFESpotLightElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
60 | { |
61 | JSSVGFESpotLightElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGFESpotLightElementPrototype>(vm.heap)) JSSVGFESpotLightElementPrototype(vm, globalObject, structure); |
62 | ptr->finishCreation(vm); |
63 | return ptr; |
64 | } |
65 | |
66 | DECLARE_INFO; |
67 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
68 | { |
69 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
70 | } |
71 | |
72 | private: |
73 | JSSVGFESpotLightElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
74 | : JSC::JSNonFinalObject(vm, structure) |
75 | { |
76 | } |
77 | |
78 | void finishCreation(JSC::VM&); |
79 | }; |
80 | |
81 | using JSSVGFESpotLightElementConstructor = JSDOMConstructorNotConstructable<JSSVGFESpotLightElement>; |
82 | |
83 | template<> JSValue JSSVGFESpotLightElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
84 | { |
85 | return JSSVGElement::getConstructor(vm, &globalObject); |
86 | } |
87 | |
88 | template<> void JSSVGFESpotLightElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
89 | { |
90 | putDirect(vm, vm.propertyNames->prototype, JSSVGFESpotLightElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
91 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGFESpotLightElement"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
92 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
93 | } |
94 | |
95 | template<> const ClassInfo JSSVGFESpotLightElementConstructor::s_info = { "SVGFESpotLightElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFESpotLightElementConstructor) }; |
96 | |
97 | /* Hash table for prototype */ |
98 | |
99 | static const HashTableValue JSSVGFESpotLightElementPrototypeTableValues[] = |
100 | { |
101 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFESpotLightElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGFESpotLightElementConstructor) } }, |
102 | { "x" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFESpotLightElementX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
103 | { "y" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFESpotLightElementY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
104 | { "z" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFESpotLightElementZ), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
105 | { "pointsAtX" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFESpotLightElementPointsAtX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
106 | { "pointsAtY" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFESpotLightElementPointsAtY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
107 | { "pointsAtZ" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFESpotLightElementPointsAtZ), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
108 | { "specularExponent" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFESpotLightElementSpecularExponent), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
109 | { "limitingConeAngle" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFESpotLightElementLimitingConeAngle), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
110 | }; |
111 | |
112 | const ClassInfo JSSVGFESpotLightElementPrototype::s_info = { "SVGFESpotLightElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFESpotLightElementPrototype) }; |
113 | |
114 | void JSSVGFESpotLightElementPrototype::finishCreation(VM& vm) |
115 | { |
116 | Base::finishCreation(vm); |
117 | reifyStaticProperties(vm, JSSVGFESpotLightElement::info(), JSSVGFESpotLightElementPrototypeTableValues, *this); |
118 | } |
119 | |
120 | const ClassInfo JSSVGFESpotLightElement::s_info = { "SVGFESpotLightElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFESpotLightElement) }; |
121 | |
122 | JSSVGFESpotLightElement::JSSVGFESpotLightElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGFESpotLightElement>&& impl) |
123 | : JSSVGElement(structure, globalObject, WTFMove(impl)) |
124 | { |
125 | } |
126 | |
127 | void JSSVGFESpotLightElement::finishCreation(VM& vm) |
128 | { |
129 | Base::finishCreation(vm); |
130 | ASSERT(inherits(vm, info())); |
131 | |
132 | } |
133 | |
134 | JSObject* JSSVGFESpotLightElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
135 | { |
136 | return JSSVGFESpotLightElementPrototype::create(vm, &globalObject, JSSVGFESpotLightElementPrototype::createStructure(vm, &globalObject, JSSVGElement::prototype(vm, globalObject))); |
137 | } |
138 | |
139 | JSObject* JSSVGFESpotLightElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
140 | { |
141 | return getDOMPrototype<JSSVGFESpotLightElement>(vm, globalObject); |
142 | } |
143 | |
144 | JSValue JSSVGFESpotLightElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
145 | { |
146 | return getDOMConstructor<JSSVGFESpotLightElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
147 | } |
148 | |
149 | template<> inline JSSVGFESpotLightElement* IDLAttribute<JSSVGFESpotLightElement>::cast(ExecState& state, EncodedJSValue thisValue) |
150 | { |
151 | return jsDynamicCast<JSSVGFESpotLightElement*>(state.vm(), JSValue::decode(thisValue)); |
152 | } |
153 | |
154 | EncodedJSValue jsSVGFESpotLightElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
155 | { |
156 | VM& vm = state->vm(); |
157 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
158 | auto* prototype = jsDynamicCast<JSSVGFESpotLightElementPrototype*>(vm, JSValue::decode(thisValue)); |
159 | if (UNLIKELY(!prototype)) |
160 | return throwVMTypeError(state, throwScope); |
161 | return JSValue::encode(JSSVGFESpotLightElement::getConstructor(state->vm(), prototype->globalObject())); |
162 | } |
163 | |
164 | bool setJSSVGFESpotLightElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
165 | { |
166 | VM& vm = state->vm(); |
167 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
168 | auto* prototype = jsDynamicCast<JSSVGFESpotLightElementPrototype*>(vm, JSValue::decode(thisValue)); |
169 | if (UNLIKELY(!prototype)) { |
170 | throwVMTypeError(state, throwScope); |
171 | return false; |
172 | } |
173 | // Shadowing a built-in constructor |
174 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
175 | } |
176 | |
177 | static inline JSValue jsSVGFESpotLightElementXGetter(ExecState& state, JSSVGFESpotLightElement& thisObject, ThrowScope& throwScope) |
178 | { |
179 | UNUSED_PARAM(throwScope); |
180 | UNUSED_PARAM(state); |
181 | auto& impl = thisObject.wrapped(); |
182 | JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.xAnimated()); |
183 | return result; |
184 | } |
185 | |
186 | EncodedJSValue jsSVGFESpotLightElementX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
187 | { |
188 | return IDLAttribute<JSSVGFESpotLightElement>::get<jsSVGFESpotLightElementXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "x" ); |
189 | } |
190 | |
191 | static inline JSValue jsSVGFESpotLightElementYGetter(ExecState& state, JSSVGFESpotLightElement& thisObject, ThrowScope& throwScope) |
192 | { |
193 | UNUSED_PARAM(throwScope); |
194 | UNUSED_PARAM(state); |
195 | auto& impl = thisObject.wrapped(); |
196 | JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.yAnimated()); |
197 | return result; |
198 | } |
199 | |
200 | EncodedJSValue jsSVGFESpotLightElementY(ExecState* state, EncodedJSValue thisValue, PropertyName) |
201 | { |
202 | return IDLAttribute<JSSVGFESpotLightElement>::get<jsSVGFESpotLightElementYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "y" ); |
203 | } |
204 | |
205 | static inline JSValue jsSVGFESpotLightElementZGetter(ExecState& state, JSSVGFESpotLightElement& thisObject, ThrowScope& throwScope) |
206 | { |
207 | UNUSED_PARAM(throwScope); |
208 | UNUSED_PARAM(state); |
209 | auto& impl = thisObject.wrapped(); |
210 | JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.zAnimated()); |
211 | return result; |
212 | } |
213 | |
214 | EncodedJSValue jsSVGFESpotLightElementZ(ExecState* state, EncodedJSValue thisValue, PropertyName) |
215 | { |
216 | return IDLAttribute<JSSVGFESpotLightElement>::get<jsSVGFESpotLightElementZGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "z" ); |
217 | } |
218 | |
219 | static inline JSValue jsSVGFESpotLightElementPointsAtXGetter(ExecState& state, JSSVGFESpotLightElement& thisObject, ThrowScope& throwScope) |
220 | { |
221 | UNUSED_PARAM(throwScope); |
222 | UNUSED_PARAM(state); |
223 | auto& impl = thisObject.wrapped(); |
224 | JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.pointsAtXAnimated()); |
225 | return result; |
226 | } |
227 | |
228 | EncodedJSValue jsSVGFESpotLightElementPointsAtX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
229 | { |
230 | return IDLAttribute<JSSVGFESpotLightElement>::get<jsSVGFESpotLightElementPointsAtXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "pointsAtX" ); |
231 | } |
232 | |
233 | static inline JSValue jsSVGFESpotLightElementPointsAtYGetter(ExecState& state, JSSVGFESpotLightElement& thisObject, ThrowScope& throwScope) |
234 | { |
235 | UNUSED_PARAM(throwScope); |
236 | UNUSED_PARAM(state); |
237 | auto& impl = thisObject.wrapped(); |
238 | JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.pointsAtYAnimated()); |
239 | return result; |
240 | } |
241 | |
242 | EncodedJSValue jsSVGFESpotLightElementPointsAtY(ExecState* state, EncodedJSValue thisValue, PropertyName) |
243 | { |
244 | return IDLAttribute<JSSVGFESpotLightElement>::get<jsSVGFESpotLightElementPointsAtYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "pointsAtY" ); |
245 | } |
246 | |
247 | static inline JSValue jsSVGFESpotLightElementPointsAtZGetter(ExecState& state, JSSVGFESpotLightElement& thisObject, ThrowScope& throwScope) |
248 | { |
249 | UNUSED_PARAM(throwScope); |
250 | UNUSED_PARAM(state); |
251 | auto& impl = thisObject.wrapped(); |
252 | JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.pointsAtZAnimated()); |
253 | return result; |
254 | } |
255 | |
256 | EncodedJSValue jsSVGFESpotLightElementPointsAtZ(ExecState* state, EncodedJSValue thisValue, PropertyName) |
257 | { |
258 | return IDLAttribute<JSSVGFESpotLightElement>::get<jsSVGFESpotLightElementPointsAtZGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "pointsAtZ" ); |
259 | } |
260 | |
261 | static inline JSValue jsSVGFESpotLightElementSpecularExponentGetter(ExecState& state, JSSVGFESpotLightElement& thisObject, ThrowScope& throwScope) |
262 | { |
263 | UNUSED_PARAM(throwScope); |
264 | UNUSED_PARAM(state); |
265 | auto& impl = thisObject.wrapped(); |
266 | JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.specularExponentAnimated()); |
267 | return result; |
268 | } |
269 | |
270 | EncodedJSValue jsSVGFESpotLightElementSpecularExponent(ExecState* state, EncodedJSValue thisValue, PropertyName) |
271 | { |
272 | return IDLAttribute<JSSVGFESpotLightElement>::get<jsSVGFESpotLightElementSpecularExponentGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "specularExponent" ); |
273 | } |
274 | |
275 | static inline JSValue jsSVGFESpotLightElementLimitingConeAngleGetter(ExecState& state, JSSVGFESpotLightElement& thisObject, ThrowScope& throwScope) |
276 | { |
277 | UNUSED_PARAM(throwScope); |
278 | UNUSED_PARAM(state); |
279 | auto& impl = thisObject.wrapped(); |
280 | JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.limitingConeAngleAnimated()); |
281 | return result; |
282 | } |
283 | |
284 | EncodedJSValue jsSVGFESpotLightElementLimitingConeAngle(ExecState* state, EncodedJSValue thisValue, PropertyName) |
285 | { |
286 | return IDLAttribute<JSSVGFESpotLightElement>::get<jsSVGFESpotLightElementLimitingConeAngleGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "limitingConeAngle" ); |
287 | } |
288 | |
289 | void JSSVGFESpotLightElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
290 | { |
291 | auto* thisObject = jsCast<JSSVGFESpotLightElement*>(cell); |
292 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
293 | if (thisObject->scriptExecutionContext()) |
294 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
295 | Base::heapSnapshot(cell, builder); |
296 | } |
297 | |
298 | |
299 | } |
300 | |