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