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 "JSSVGRadialGradientElement.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 "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 jsSVGRadialGradientElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
46 | bool setJSSVGRadialGradientElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
47 | JSC::EncodedJSValue jsSVGRadialGradientElementCx(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
48 | JSC::EncodedJSValue jsSVGRadialGradientElementCy(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
49 | JSC::EncodedJSValue jsSVGRadialGradientElementR(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
50 | JSC::EncodedJSValue jsSVGRadialGradientElementFx(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
51 | JSC::EncodedJSValue jsSVGRadialGradientElementFy(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
52 | JSC::EncodedJSValue jsSVGRadialGradientElementFr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
53 | |
54 | class JSSVGRadialGradientElementPrototype : public JSC::JSNonFinalObject { |
55 | public: |
56 | using Base = JSC::JSNonFinalObject; |
57 | static JSSVGRadialGradientElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
58 | { |
59 | JSSVGRadialGradientElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGRadialGradientElementPrototype>(vm.heap)) JSSVGRadialGradientElementPrototype(vm, globalObject, structure); |
60 | ptr->finishCreation(vm); |
61 | return ptr; |
62 | } |
63 | |
64 | DECLARE_INFO; |
65 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
66 | { |
67 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
68 | } |
69 | |
70 | private: |
71 | JSSVGRadialGradientElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
72 | : JSC::JSNonFinalObject(vm, structure) |
73 | { |
74 | } |
75 | |
76 | void finishCreation(JSC::VM&); |
77 | }; |
78 | |
79 | using JSSVGRadialGradientElementConstructor = JSDOMConstructorNotConstructable<JSSVGRadialGradientElement>; |
80 | |
81 | template<> JSValue JSSVGRadialGradientElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
82 | { |
83 | return JSSVGGradientElement::getConstructor(vm, &globalObject); |
84 | } |
85 | |
86 | template<> void JSSVGRadialGradientElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
87 | { |
88 | putDirect(vm, vm.propertyNames->prototype, JSSVGRadialGradientElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
89 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGRadialGradientElement"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
90 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
91 | } |
92 | |
93 | template<> const ClassInfo JSSVGRadialGradientElementConstructor::s_info = { "SVGRadialGradientElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGRadialGradientElementConstructor) }; |
94 | |
95 | /* Hash table for prototype */ |
96 | |
97 | static const HashTableValue JSSVGRadialGradientElementPrototypeTableValues[] = |
98 | { |
99 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRadialGradientElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGRadialGradientElementConstructor) } }, |
100 | { "cx" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRadialGradientElementCx), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
101 | { "cy" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRadialGradientElementCy), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
102 | { "r" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRadialGradientElementR), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
103 | { "fx" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRadialGradientElementFx), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
104 | { "fy" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRadialGradientElementFy), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
105 | { "fr" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRadialGradientElementFr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
106 | }; |
107 | |
108 | const ClassInfo JSSVGRadialGradientElementPrototype::s_info = { "SVGRadialGradientElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGRadialGradientElementPrototype) }; |
109 | |
110 | void JSSVGRadialGradientElementPrototype::finishCreation(VM& vm) |
111 | { |
112 | Base::finishCreation(vm); |
113 | reifyStaticProperties(vm, JSSVGRadialGradientElement::info(), JSSVGRadialGradientElementPrototypeTableValues, *this); |
114 | } |
115 | |
116 | const ClassInfo JSSVGRadialGradientElement::s_info = { "SVGRadialGradientElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGRadialGradientElement) }; |
117 | |
118 | JSSVGRadialGradientElement::JSSVGRadialGradientElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGRadialGradientElement>&& impl) |
119 | : JSSVGGradientElement(structure, globalObject, WTFMove(impl)) |
120 | { |
121 | } |
122 | |
123 | void JSSVGRadialGradientElement::finishCreation(VM& vm) |
124 | { |
125 | Base::finishCreation(vm); |
126 | ASSERT(inherits(vm, info())); |
127 | |
128 | } |
129 | |
130 | JSObject* JSSVGRadialGradientElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
131 | { |
132 | return JSSVGRadialGradientElementPrototype::create(vm, &globalObject, JSSVGRadialGradientElementPrototype::createStructure(vm, &globalObject, JSSVGGradientElement::prototype(vm, globalObject))); |
133 | } |
134 | |
135 | JSObject* JSSVGRadialGradientElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
136 | { |
137 | return getDOMPrototype<JSSVGRadialGradientElement>(vm, globalObject); |
138 | } |
139 | |
140 | JSValue JSSVGRadialGradientElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
141 | { |
142 | return getDOMConstructor<JSSVGRadialGradientElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
143 | } |
144 | |
145 | template<> inline JSSVGRadialGradientElement* IDLAttribute<JSSVGRadialGradientElement>::cast(ExecState& state, EncodedJSValue thisValue) |
146 | { |
147 | return jsDynamicCast<JSSVGRadialGradientElement*>(state.vm(), JSValue::decode(thisValue)); |
148 | } |
149 | |
150 | EncodedJSValue jsSVGRadialGradientElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
151 | { |
152 | VM& vm = state->vm(); |
153 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
154 | auto* prototype = jsDynamicCast<JSSVGRadialGradientElementPrototype*>(vm, JSValue::decode(thisValue)); |
155 | if (UNLIKELY(!prototype)) |
156 | return throwVMTypeError(state, throwScope); |
157 | return JSValue::encode(JSSVGRadialGradientElement::getConstructor(state->vm(), prototype->globalObject())); |
158 | } |
159 | |
160 | bool setJSSVGRadialGradientElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
161 | { |
162 | VM& vm = state->vm(); |
163 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
164 | auto* prototype = jsDynamicCast<JSSVGRadialGradientElementPrototype*>(vm, JSValue::decode(thisValue)); |
165 | if (UNLIKELY(!prototype)) { |
166 | throwVMTypeError(state, throwScope); |
167 | return false; |
168 | } |
169 | // Shadowing a built-in constructor |
170 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
171 | } |
172 | |
173 | static inline JSValue jsSVGRadialGradientElementCxGetter(ExecState& state, JSSVGRadialGradientElement& thisObject, ThrowScope& throwScope) |
174 | { |
175 | UNUSED_PARAM(throwScope); |
176 | UNUSED_PARAM(state); |
177 | auto& impl = thisObject.wrapped(); |
178 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.cxAnimated()); |
179 | return result; |
180 | } |
181 | |
182 | EncodedJSValue jsSVGRadialGradientElementCx(ExecState* state, EncodedJSValue thisValue, PropertyName) |
183 | { |
184 | return IDLAttribute<JSSVGRadialGradientElement>::get<jsSVGRadialGradientElementCxGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "cx" ); |
185 | } |
186 | |
187 | static inline JSValue jsSVGRadialGradientElementCyGetter(ExecState& state, JSSVGRadialGradientElement& thisObject, ThrowScope& throwScope) |
188 | { |
189 | UNUSED_PARAM(throwScope); |
190 | UNUSED_PARAM(state); |
191 | auto& impl = thisObject.wrapped(); |
192 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.cyAnimated()); |
193 | return result; |
194 | } |
195 | |
196 | EncodedJSValue jsSVGRadialGradientElementCy(ExecState* state, EncodedJSValue thisValue, PropertyName) |
197 | { |
198 | return IDLAttribute<JSSVGRadialGradientElement>::get<jsSVGRadialGradientElementCyGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "cy" ); |
199 | } |
200 | |
201 | static inline JSValue jsSVGRadialGradientElementRGetter(ExecState& state, JSSVGRadialGradientElement& thisObject, ThrowScope& throwScope) |
202 | { |
203 | UNUSED_PARAM(throwScope); |
204 | UNUSED_PARAM(state); |
205 | auto& impl = thisObject.wrapped(); |
206 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.rAnimated()); |
207 | return result; |
208 | } |
209 | |
210 | EncodedJSValue jsSVGRadialGradientElementR(ExecState* state, EncodedJSValue thisValue, PropertyName) |
211 | { |
212 | return IDLAttribute<JSSVGRadialGradientElement>::get<jsSVGRadialGradientElementRGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "r" ); |
213 | } |
214 | |
215 | static inline JSValue jsSVGRadialGradientElementFxGetter(ExecState& state, JSSVGRadialGradientElement& thisObject, ThrowScope& throwScope) |
216 | { |
217 | UNUSED_PARAM(throwScope); |
218 | UNUSED_PARAM(state); |
219 | auto& impl = thisObject.wrapped(); |
220 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.fxAnimated()); |
221 | return result; |
222 | } |
223 | |
224 | EncodedJSValue jsSVGRadialGradientElementFx(ExecState* state, EncodedJSValue thisValue, PropertyName) |
225 | { |
226 | return IDLAttribute<JSSVGRadialGradientElement>::get<jsSVGRadialGradientElementFxGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "fx" ); |
227 | } |
228 | |
229 | static inline JSValue jsSVGRadialGradientElementFyGetter(ExecState& state, JSSVGRadialGradientElement& thisObject, ThrowScope& throwScope) |
230 | { |
231 | UNUSED_PARAM(throwScope); |
232 | UNUSED_PARAM(state); |
233 | auto& impl = thisObject.wrapped(); |
234 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.fyAnimated()); |
235 | return result; |
236 | } |
237 | |
238 | EncodedJSValue jsSVGRadialGradientElementFy(ExecState* state, EncodedJSValue thisValue, PropertyName) |
239 | { |
240 | return IDLAttribute<JSSVGRadialGradientElement>::get<jsSVGRadialGradientElementFyGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "fy" ); |
241 | } |
242 | |
243 | static inline JSValue jsSVGRadialGradientElementFrGetter(ExecState& state, JSSVGRadialGradientElement& thisObject, ThrowScope& throwScope) |
244 | { |
245 | UNUSED_PARAM(throwScope); |
246 | UNUSED_PARAM(state); |
247 | auto& impl = thisObject.wrapped(); |
248 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.frAnimated()); |
249 | return result; |
250 | } |
251 | |
252 | EncodedJSValue jsSVGRadialGradientElementFr(ExecState* state, EncodedJSValue thisValue, PropertyName) |
253 | { |
254 | return IDLAttribute<JSSVGRadialGradientElement>::get<jsSVGRadialGradientElementFrGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "fr" ); |
255 | } |
256 | |
257 | void JSSVGRadialGradientElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
258 | { |
259 | auto* thisObject = jsCast<JSSVGRadialGradientElement*>(cell); |
260 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
261 | if (thisObject->scriptExecutionContext()) |
262 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
263 | Base::heapSnapshot(cell, builder); |
264 | } |
265 | |
266 | |
267 | } |
268 | |