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 "JSSVGMaskElement.h"
23
24#include "JSDOMAttribute.h"
25#include "JSDOMBinding.h"
26#include "JSDOMConstructorNotConstructable.h"
27#include "JSDOMConvertBoolean.h"
28#include "JSDOMConvertInterface.h"
29#include "JSDOMConvertStrings.h"
30#include "JSDOMExceptionHandling.h"
31#include "JSDOMGlobalObject.h"
32#include "JSDOMOperation.h"
33#include "JSDOMWrapperCache.h"
34#include "JSSVGAnimatedBoolean.h"
35#include "JSSVGAnimatedEnumeration.h"
36#include "JSSVGAnimatedLength.h"
37#include "JSSVGStringList.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
46namespace WebCore {
47using namespace JSC;
48
49// Functions
50
51JSC::EncodedJSValue JSC_HOST_CALL jsSVGMaskElementPrototypeFunctionHasExtension(JSC::ExecState*);
52
53// Attributes
54
55JSC::EncodedJSValue jsSVGMaskElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
56bool setJSSVGMaskElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
57JSC::EncodedJSValue jsSVGMaskElementMaskUnits(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
58JSC::EncodedJSValue jsSVGMaskElementMaskContentUnits(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
59JSC::EncodedJSValue jsSVGMaskElementX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
60JSC::EncodedJSValue jsSVGMaskElementY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
61JSC::EncodedJSValue jsSVGMaskElementWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
62JSC::EncodedJSValue jsSVGMaskElementHeight(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
63JSC::EncodedJSValue jsSVGMaskElementExternalResourcesRequired(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
64JSC::EncodedJSValue jsSVGMaskElementRequiredFeatures(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
65JSC::EncodedJSValue jsSVGMaskElementRequiredExtensions(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
66JSC::EncodedJSValue jsSVGMaskElementSystemLanguage(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
67
68class JSSVGMaskElementPrototype : public JSC::JSNonFinalObject {
69public:
70 using Base = JSC::JSNonFinalObject;
71 static JSSVGMaskElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
72 {
73 JSSVGMaskElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGMaskElementPrototype>(vm.heap)) JSSVGMaskElementPrototype(vm, globalObject, structure);
74 ptr->finishCreation(vm);
75 return ptr;
76 }
77
78 DECLARE_INFO;
79 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
80 {
81 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
82 }
83
84private:
85 JSSVGMaskElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
86 : JSC::JSNonFinalObject(vm, structure)
87 {
88 }
89
90 void finishCreation(JSC::VM&);
91};
92
93using JSSVGMaskElementConstructor = JSDOMConstructorNotConstructable<JSSVGMaskElement>;
94
95template<> JSValue JSSVGMaskElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
96{
97 return JSSVGElement::getConstructor(vm, &globalObject);
98}
99
100template<> void JSSVGMaskElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
101{
102 putDirect(vm, vm.propertyNames->prototype, JSSVGMaskElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
103 putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGMaskElement"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
104 putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
105}
106
107template<> const ClassInfo JSSVGMaskElementConstructor::s_info = { "SVGMaskElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGMaskElementConstructor) };
108
109/* Hash table for prototype */
110
111static const HashTableValue JSSVGMaskElementPrototypeTableValues[] =
112{
113 { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGMaskElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGMaskElementConstructor) } },
114 { "maskUnits", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGMaskElementMaskUnits), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
115 { "maskContentUnits", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGMaskElementMaskContentUnits), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
116 { "x", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGMaskElementX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
117 { "y", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGMaskElementY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
118 { "width", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGMaskElementWidth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
119 { "height", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGMaskElementHeight), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
120 { "externalResourcesRequired", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGMaskElementExternalResourcesRequired), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
121 { "requiredFeatures", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGMaskElementRequiredFeatures), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
122 { "requiredExtensions", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGMaskElementRequiredExtensions), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
123 { "systemLanguage", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGMaskElementSystemLanguage), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
124 { "hasExtension", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGMaskElementPrototypeFunctionHasExtension), (intptr_t) (0) } },
125};
126
127const ClassInfo JSSVGMaskElementPrototype::s_info = { "SVGMaskElementPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGMaskElementPrototype) };
128
129void JSSVGMaskElementPrototype::finishCreation(VM& vm)
130{
131 Base::finishCreation(vm);
132 reifyStaticProperties(vm, JSSVGMaskElement::info(), JSSVGMaskElementPrototypeTableValues, *this);
133}
134
135const ClassInfo JSSVGMaskElement::s_info = { "SVGMaskElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGMaskElement) };
136
137JSSVGMaskElement::JSSVGMaskElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGMaskElement>&& impl)
138 : JSSVGElement(structure, globalObject, WTFMove(impl))
139{
140}
141
142void JSSVGMaskElement::finishCreation(VM& vm)
143{
144 Base::finishCreation(vm);
145 ASSERT(inherits(vm, info()));
146
147}
148
149JSObject* JSSVGMaskElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
150{
151 return JSSVGMaskElementPrototype::create(vm, &globalObject, JSSVGMaskElementPrototype::createStructure(vm, &globalObject, JSSVGElement::prototype(vm, globalObject)));
152}
153
154JSObject* JSSVGMaskElement::prototype(VM& vm, JSDOMGlobalObject& globalObject)
155{
156 return getDOMPrototype<JSSVGMaskElement>(vm, globalObject);
157}
158
159JSValue JSSVGMaskElement::getConstructor(VM& vm, const JSGlobalObject* globalObject)
160{
161 return getDOMConstructor<JSSVGMaskElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
162}
163
164template<> inline JSSVGMaskElement* IDLAttribute<JSSVGMaskElement>::cast(ExecState& state, EncodedJSValue thisValue)
165{
166 return jsDynamicCast<JSSVGMaskElement*>(state.vm(), JSValue::decode(thisValue));
167}
168
169template<> inline JSSVGMaskElement* IDLOperation<JSSVGMaskElement>::cast(ExecState& state)
170{
171 return jsDynamicCast<JSSVGMaskElement*>(state.vm(), state.thisValue());
172}
173
174EncodedJSValue jsSVGMaskElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
175{
176 VM& vm = state->vm();
177 auto throwScope = DECLARE_THROW_SCOPE(vm);
178 auto* prototype = jsDynamicCast<JSSVGMaskElementPrototype*>(vm, JSValue::decode(thisValue));
179 if (UNLIKELY(!prototype))
180 return throwVMTypeError(state, throwScope);
181 return JSValue::encode(JSSVGMaskElement::getConstructor(state->vm(), prototype->globalObject()));
182}
183
184bool setJSSVGMaskElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
185{
186 VM& vm = state->vm();
187 auto throwScope = DECLARE_THROW_SCOPE(vm);
188 auto* prototype = jsDynamicCast<JSSVGMaskElementPrototype*>(vm, JSValue::decode(thisValue));
189 if (UNLIKELY(!prototype)) {
190 throwVMTypeError(state, throwScope);
191 return false;
192 }
193 // Shadowing a built-in constructor
194 return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
195}
196
197static inline JSValue jsSVGMaskElementMaskUnitsGetter(ExecState& state, JSSVGMaskElement& thisObject, ThrowScope& throwScope)
198{
199 UNUSED_PARAM(throwScope);
200 UNUSED_PARAM(state);
201 auto& impl = thisObject.wrapped();
202 JSValue result = toJS<IDLInterface<SVGAnimatedEnumeration>>(state, *thisObject.globalObject(), throwScope, impl.maskUnitsAnimated());
203 return result;
204}
205
206EncodedJSValue jsSVGMaskElementMaskUnits(ExecState* state, EncodedJSValue thisValue, PropertyName)
207{
208 return IDLAttribute<JSSVGMaskElement>::get<jsSVGMaskElementMaskUnitsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "maskUnits");
209}
210
211static inline JSValue jsSVGMaskElementMaskContentUnitsGetter(ExecState& state, JSSVGMaskElement& thisObject, ThrowScope& throwScope)
212{
213 UNUSED_PARAM(throwScope);
214 UNUSED_PARAM(state);
215 auto& impl = thisObject.wrapped();
216 JSValue result = toJS<IDLInterface<SVGAnimatedEnumeration>>(state, *thisObject.globalObject(), throwScope, impl.maskContentUnitsAnimated());
217 return result;
218}
219
220EncodedJSValue jsSVGMaskElementMaskContentUnits(ExecState* state, EncodedJSValue thisValue, PropertyName)
221{
222 return IDLAttribute<JSSVGMaskElement>::get<jsSVGMaskElementMaskContentUnitsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "maskContentUnits");
223}
224
225static inline JSValue jsSVGMaskElementXGetter(ExecState& state, JSSVGMaskElement& thisObject, ThrowScope& throwScope)
226{
227 UNUSED_PARAM(throwScope);
228 UNUSED_PARAM(state);
229 auto& impl = thisObject.wrapped();
230 JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.xAnimated());
231 return result;
232}
233
234EncodedJSValue jsSVGMaskElementX(ExecState* state, EncodedJSValue thisValue, PropertyName)
235{
236 return IDLAttribute<JSSVGMaskElement>::get<jsSVGMaskElementXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "x");
237}
238
239static inline JSValue jsSVGMaskElementYGetter(ExecState& state, JSSVGMaskElement& thisObject, ThrowScope& throwScope)
240{
241 UNUSED_PARAM(throwScope);
242 UNUSED_PARAM(state);
243 auto& impl = thisObject.wrapped();
244 JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.yAnimated());
245 return result;
246}
247
248EncodedJSValue jsSVGMaskElementY(ExecState* state, EncodedJSValue thisValue, PropertyName)
249{
250 return IDLAttribute<JSSVGMaskElement>::get<jsSVGMaskElementYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "y");
251}
252
253static inline JSValue jsSVGMaskElementWidthGetter(ExecState& state, JSSVGMaskElement& thisObject, ThrowScope& throwScope)
254{
255 UNUSED_PARAM(throwScope);
256 UNUSED_PARAM(state);
257 auto& impl = thisObject.wrapped();
258 JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.widthAnimated());
259 return result;
260}
261
262EncodedJSValue jsSVGMaskElementWidth(ExecState* state, EncodedJSValue thisValue, PropertyName)
263{
264 return IDLAttribute<JSSVGMaskElement>::get<jsSVGMaskElementWidthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "width");
265}
266
267static inline JSValue jsSVGMaskElementHeightGetter(ExecState& state, JSSVGMaskElement& thisObject, ThrowScope& throwScope)
268{
269 UNUSED_PARAM(throwScope);
270 UNUSED_PARAM(state);
271 auto& impl = thisObject.wrapped();
272 JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.heightAnimated());
273 return result;
274}
275
276EncodedJSValue jsSVGMaskElementHeight(ExecState* state, EncodedJSValue thisValue, PropertyName)
277{
278 return IDLAttribute<JSSVGMaskElement>::get<jsSVGMaskElementHeightGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "height");
279}
280
281static inline JSValue jsSVGMaskElementExternalResourcesRequiredGetter(ExecState& state, JSSVGMaskElement& thisObject, ThrowScope& throwScope)
282{
283 UNUSED_PARAM(throwScope);
284 UNUSED_PARAM(state);
285 auto& impl = thisObject.wrapped();
286 JSValue result = toJS<IDLInterface<SVGAnimatedBoolean>>(state, *thisObject.globalObject(), throwScope, impl.externalResourcesRequiredAnimated());
287 return result;
288}
289
290EncodedJSValue jsSVGMaskElementExternalResourcesRequired(ExecState* state, EncodedJSValue thisValue, PropertyName)
291{
292 return IDLAttribute<JSSVGMaskElement>::get<jsSVGMaskElementExternalResourcesRequiredGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "externalResourcesRequired");
293}
294
295static inline JSValue jsSVGMaskElementRequiredFeaturesGetter(ExecState& state, JSSVGMaskElement& thisObject, ThrowScope& throwScope)
296{
297 UNUSED_PARAM(throwScope);
298 UNUSED_PARAM(state);
299 auto& impl = thisObject.wrapped();
300 JSValue result = toJS<IDLInterface<SVGStringList>>(state, *thisObject.globalObject(), throwScope, impl.requiredFeatures());
301 return result;
302}
303
304EncodedJSValue jsSVGMaskElementRequiredFeatures(ExecState* state, EncodedJSValue thisValue, PropertyName)
305{
306 return IDLAttribute<JSSVGMaskElement>::get<jsSVGMaskElementRequiredFeaturesGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "requiredFeatures");
307}
308
309static inline JSValue jsSVGMaskElementRequiredExtensionsGetter(ExecState& state, JSSVGMaskElement& thisObject, ThrowScope& throwScope)
310{
311 UNUSED_PARAM(throwScope);
312 UNUSED_PARAM(state);
313 auto& impl = thisObject.wrapped();
314 JSValue result = toJS<IDLInterface<SVGStringList>>(state, *thisObject.globalObject(), throwScope, impl.requiredExtensions());
315 return result;
316}
317
318EncodedJSValue jsSVGMaskElementRequiredExtensions(ExecState* state, EncodedJSValue thisValue, PropertyName)
319{
320 return IDLAttribute<JSSVGMaskElement>::get<jsSVGMaskElementRequiredExtensionsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "requiredExtensions");
321}
322
323static inline JSValue jsSVGMaskElementSystemLanguageGetter(ExecState& state, JSSVGMaskElement& thisObject, ThrowScope& throwScope)
324{
325 UNUSED_PARAM(throwScope);
326 UNUSED_PARAM(state);
327 auto& impl = thisObject.wrapped();
328 JSValue result = toJS<IDLInterface<SVGStringList>>(state, *thisObject.globalObject(), throwScope, impl.systemLanguage());
329 return result;
330}
331
332EncodedJSValue jsSVGMaskElementSystemLanguage(ExecState* state, EncodedJSValue thisValue, PropertyName)
333{
334 return IDLAttribute<JSSVGMaskElement>::get<jsSVGMaskElementSystemLanguageGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "systemLanguage");
335}
336
337static inline JSC::EncodedJSValue jsSVGMaskElementPrototypeFunctionHasExtensionBody(JSC::ExecState* state, typename IDLOperation<JSSVGMaskElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
338{
339 UNUSED_PARAM(state);
340 UNUSED_PARAM(throwScope);
341 auto& impl = castedThis->wrapped();
342 auto extension = convert<IDLDOMString>(*state, state->argument(0));
343 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
344 return JSValue::encode(toJS<IDLBoolean>(impl.hasExtension(WTFMove(extension))));
345}
346
347EncodedJSValue JSC_HOST_CALL jsSVGMaskElementPrototypeFunctionHasExtension(ExecState* state)
348{
349 return IDLOperation<JSSVGMaskElement>::call<jsSVGMaskElementPrototypeFunctionHasExtensionBody>(*state, "hasExtension");
350}
351
352void JSSVGMaskElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
353{
354 auto* thisObject = jsCast<JSSVGMaskElement*>(cell);
355 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
356 if (thisObject->scriptExecutionContext())
357 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
358 Base::heapSnapshot(cell, builder);
359}
360
361
362}
363