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 | |
40 | namespace WebCore { |
41 | using namespace JSC; |
42 | |
43 | // Attributes |
44 | |
45 | JSC::EncodedJSValue jsSVGFEPointLightElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
46 | bool setJSSVGFEPointLightElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
47 | JSC::EncodedJSValue jsSVGFEPointLightElementX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
48 | JSC::EncodedJSValue jsSVGFEPointLightElementY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
49 | JSC::EncodedJSValue jsSVGFEPointLightElementZ(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
50 | |
51 | class JSSVGFEPointLightElementPrototype : public JSC::JSNonFinalObject { |
52 | public: |
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 | |
67 | private: |
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 | |
76 | using JSSVGFEPointLightElementConstructor = JSDOMConstructorNotConstructable<JSSVGFEPointLightElement>; |
77 | |
78 | template<> JSValue JSSVGFEPointLightElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
79 | { |
80 | return JSSVGElement::getConstructor(vm, &globalObject); |
81 | } |
82 | |
83 | template<> 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 | |
90 | template<> const ClassInfo JSSVGFEPointLightElementConstructor::s_info = { "SVGFEPointLightElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFEPointLightElementConstructor) }; |
91 | |
92 | /* Hash table for prototype */ |
93 | |
94 | static 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 | |
102 | const ClassInfo JSSVGFEPointLightElementPrototype::s_info = { "SVGFEPointLightElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFEPointLightElementPrototype) }; |
103 | |
104 | void JSSVGFEPointLightElementPrototype::finishCreation(VM& vm) |
105 | { |
106 | Base::finishCreation(vm); |
107 | reifyStaticProperties(vm, JSSVGFEPointLightElement::info(), JSSVGFEPointLightElementPrototypeTableValues, *this); |
108 | } |
109 | |
110 | const ClassInfo JSSVGFEPointLightElement::s_info = { "SVGFEPointLightElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFEPointLightElement) }; |
111 | |
112 | JSSVGFEPointLightElement::JSSVGFEPointLightElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGFEPointLightElement>&& impl) |
113 | : JSSVGElement(structure, globalObject, WTFMove(impl)) |
114 | { |
115 | } |
116 | |
117 | void JSSVGFEPointLightElement::finishCreation(VM& vm) |
118 | { |
119 | Base::finishCreation(vm); |
120 | ASSERT(inherits(vm, info())); |
121 | |
122 | } |
123 | |
124 | JSObject* JSSVGFEPointLightElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
125 | { |
126 | return JSSVGFEPointLightElementPrototype::create(vm, &globalObject, JSSVGFEPointLightElementPrototype::createStructure(vm, &globalObject, JSSVGElement::prototype(vm, globalObject))); |
127 | } |
128 | |
129 | JSObject* JSSVGFEPointLightElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
130 | { |
131 | return getDOMPrototype<JSSVGFEPointLightElement>(vm, globalObject); |
132 | } |
133 | |
134 | JSValue JSSVGFEPointLightElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
135 | { |
136 | return getDOMConstructor<JSSVGFEPointLightElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
137 | } |
138 | |
139 | template<> inline JSSVGFEPointLightElement* IDLAttribute<JSSVGFEPointLightElement>::cast(ExecState& state, EncodedJSValue thisValue) |
140 | { |
141 | return jsDynamicCast<JSSVGFEPointLightElement*>(state.vm(), JSValue::decode(thisValue)); |
142 | } |
143 | |
144 | EncodedJSValue 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 | |
154 | bool 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 | |
167 | static 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 | |
176 | EncodedJSValue jsSVGFEPointLightElementX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
177 | { |
178 | return IDLAttribute<JSSVGFEPointLightElement>::get<jsSVGFEPointLightElementXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "x" ); |
179 | } |
180 | |
181 | static 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 | |
190 | EncodedJSValue jsSVGFEPointLightElementY(ExecState* state, EncodedJSValue thisValue, PropertyName) |
191 | { |
192 | return IDLAttribute<JSSVGFEPointLightElement>::get<jsSVGFEPointLightElementYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "y" ); |
193 | } |
194 | |
195 | static 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 | |
204 | EncodedJSValue jsSVGFEPointLightElementZ(ExecState* state, EncodedJSValue thisValue, PropertyName) |
205 | { |
206 | return IDLAttribute<JSSVGFEPointLightElement>::get<jsSVGFEPointLightElementZGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "z" ); |
207 | } |
208 | |
209 | void 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 | |