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 "JSSVGFEPointLightElement.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
40namespace WebCore {
41using namespace JSC;
42
43// Attributes
44
45JSC::EncodedJSValue jsSVGFEPointLightElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
46bool setJSSVGFEPointLightElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
47JSC::EncodedJSValue jsSVGFEPointLightElementX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
48JSC::EncodedJSValue jsSVGFEPointLightElementY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
49JSC::EncodedJSValue jsSVGFEPointLightElementZ(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
50
51class JSSVGFEPointLightElementPrototype : public JSC::JSNonFinalObject {
52public:
53 using Base = JSC::JSNonFinalObject;
54 static JSSVGFEPointLightElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
55 {
56 JSSVGFEPointLightElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGFEPointLightElementPrototype>(vm.heap)) JSSVGFEPointLightElementPrototype(vm, globalObject, structure);
57 ptr->finishCreation(vm);
58 return ptr;
59 }
60
61 DECLARE_INFO;
62 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
63 {
64 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
65 }
66
67private:
68 JSSVGFEPointLightElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
69 : JSC::JSNonFinalObject(vm, structure)
70 {
71 }
72
73 void finishCreation(JSC::VM&);
74};
75
76using JSSVGFEPointLightElementConstructor = JSDOMConstructorNotConstructable<JSSVGFEPointLightElement>;
77
78template<> JSValue JSSVGFEPointLightElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
79{
80 return JSSVGElement::getConstructor(vm, &globalObject);
81}
82
83template<> void JSSVGFEPointLightElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
84{
85 putDirect(vm, vm.propertyNames->prototype, JSSVGFEPointLightElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
86 putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGFEPointLightElement"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
87 putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
88}
89
90template<> const ClassInfo JSSVGFEPointLightElementConstructor::s_info = { "SVGFEPointLightElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFEPointLightElementConstructor) };
91
92/* Hash table for prototype */
93
94static const HashTableValue JSSVGFEPointLightElementPrototypeTableValues[] =
95{
96 { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEPointLightElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGFEPointLightElementConstructor) } },
97 { "x", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEPointLightElementX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
98 { "y", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEPointLightElementY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
99 { "z", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEPointLightElementZ), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
100};
101
102const ClassInfo JSSVGFEPointLightElementPrototype::s_info = { "SVGFEPointLightElementPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFEPointLightElementPrototype) };
103
104void JSSVGFEPointLightElementPrototype::finishCreation(VM& vm)
105{
106 Base::finishCreation(vm);
107 reifyStaticProperties(vm, JSSVGFEPointLightElement::info(), JSSVGFEPointLightElementPrototypeTableValues, *this);
108}
109
110const ClassInfo JSSVGFEPointLightElement::s_info = { "SVGFEPointLightElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFEPointLightElement) };
111
112JSSVGFEPointLightElement::JSSVGFEPointLightElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGFEPointLightElement>&& impl)
113 : JSSVGElement(structure, globalObject, WTFMove(impl))
114{
115}
116
117void JSSVGFEPointLightElement::finishCreation(VM& vm)
118{
119 Base::finishCreation(vm);
120 ASSERT(inherits(vm, info()));
121
122}
123
124JSObject* JSSVGFEPointLightElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
125{
126 return JSSVGFEPointLightElementPrototype::create(vm, &globalObject, JSSVGFEPointLightElementPrototype::createStructure(vm, &globalObject, JSSVGElement::prototype(vm, globalObject)));
127}
128
129JSObject* JSSVGFEPointLightElement::prototype(VM& vm, JSDOMGlobalObject& globalObject)
130{
131 return getDOMPrototype<JSSVGFEPointLightElement>(vm, globalObject);
132}
133
134JSValue JSSVGFEPointLightElement::getConstructor(VM& vm, const JSGlobalObject* globalObject)
135{
136 return getDOMConstructor<JSSVGFEPointLightElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
137}
138
139template<> inline JSSVGFEPointLightElement* IDLAttribute<JSSVGFEPointLightElement>::cast(ExecState& state, EncodedJSValue thisValue)
140{
141 return jsDynamicCast<JSSVGFEPointLightElement*>(state.vm(), JSValue::decode(thisValue));
142}
143
144EncodedJSValue jsSVGFEPointLightElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
145{
146 VM& vm = state->vm();
147 auto throwScope = DECLARE_THROW_SCOPE(vm);
148 auto* prototype = jsDynamicCast<JSSVGFEPointLightElementPrototype*>(vm, JSValue::decode(thisValue));
149 if (UNLIKELY(!prototype))
150 return throwVMTypeError(state, throwScope);
151 return JSValue::encode(JSSVGFEPointLightElement::getConstructor(state->vm(), prototype->globalObject()));
152}
153
154bool setJSSVGFEPointLightElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
155{
156 VM& vm = state->vm();
157 auto throwScope = DECLARE_THROW_SCOPE(vm);
158 auto* prototype = jsDynamicCast<JSSVGFEPointLightElementPrototype*>(vm, JSValue::decode(thisValue));
159 if (UNLIKELY(!prototype)) {
160 throwVMTypeError(state, throwScope);
161 return false;
162 }
163 // Shadowing a built-in constructor
164 return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
165}
166
167static inline JSValue jsSVGFEPointLightElementXGetter(ExecState& state, JSSVGFEPointLightElement& thisObject, ThrowScope& throwScope)
168{
169 UNUSED_PARAM(throwScope);
170 UNUSED_PARAM(state);
171 auto& impl = thisObject.wrapped();
172 JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.xAnimated());
173 return result;
174}
175
176EncodedJSValue jsSVGFEPointLightElementX(ExecState* state, EncodedJSValue thisValue, PropertyName)
177{
178 return IDLAttribute<JSSVGFEPointLightElement>::get<jsSVGFEPointLightElementXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "x");
179}
180
181static inline JSValue jsSVGFEPointLightElementYGetter(ExecState& state, JSSVGFEPointLightElement& thisObject, ThrowScope& throwScope)
182{
183 UNUSED_PARAM(throwScope);
184 UNUSED_PARAM(state);
185 auto& impl = thisObject.wrapped();
186 JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.yAnimated());
187 return result;
188}
189
190EncodedJSValue jsSVGFEPointLightElementY(ExecState* state, EncodedJSValue thisValue, PropertyName)
191{
192 return IDLAttribute<JSSVGFEPointLightElement>::get<jsSVGFEPointLightElementYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "y");
193}
194
195static inline JSValue jsSVGFEPointLightElementZGetter(ExecState& state, JSSVGFEPointLightElement& thisObject, ThrowScope& throwScope)
196{
197 UNUSED_PARAM(throwScope);
198 UNUSED_PARAM(state);
199 auto& impl = thisObject.wrapped();
200 JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.zAnimated());
201 return result;
202}
203
204EncodedJSValue jsSVGFEPointLightElementZ(ExecState* state, EncodedJSValue thisValue, PropertyName)
205{
206 return IDLAttribute<JSSVGFEPointLightElement>::get<jsSVGFEPointLightElementZGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "z");
207}
208
209void JSSVGFEPointLightElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
210{
211 auto* thisObject = jsCast<JSSVGFEPointLightElement*>(cell);
212 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
213 if (thisObject->scriptExecutionContext())
214 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
215 Base::heapSnapshot(cell, builder);
216}
217
218
219}
220