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 "JSSVGEllipseElement.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 "JSSVGAnimatedBoolean.h" |
32 | #include "JSSVGAnimatedLength.h" |
33 | #include "ScriptExecutionContext.h" |
34 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
35 | #include <JavaScriptCore/JSCInlines.h> |
36 | #include <wtf/GetPtr.h> |
37 | #include <wtf/PointerPreparations.h> |
38 | #include <wtf/URL.h> |
39 | |
40 | |
41 | namespace WebCore { |
42 | using namespace JSC; |
43 | |
44 | // Attributes |
45 | |
46 | JSC::EncodedJSValue jsSVGEllipseElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
47 | bool setJSSVGEllipseElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
48 | JSC::EncodedJSValue jsSVGEllipseElementCx(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
49 | JSC::EncodedJSValue jsSVGEllipseElementCy(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
50 | JSC::EncodedJSValue jsSVGEllipseElementRx(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
51 | JSC::EncodedJSValue jsSVGEllipseElementRy(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
52 | JSC::EncodedJSValue jsSVGEllipseElementExternalResourcesRequired(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
53 | |
54 | class JSSVGEllipseElementPrototype : public JSC::JSNonFinalObject { |
55 | public: |
56 | using Base = JSC::JSNonFinalObject; |
57 | static JSSVGEllipseElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
58 | { |
59 | JSSVGEllipseElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGEllipseElementPrototype>(vm.heap)) JSSVGEllipseElementPrototype(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 | JSSVGEllipseElementPrototype(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 JSSVGEllipseElementConstructor = JSDOMConstructorNotConstructable<JSSVGEllipseElement>; |
80 | |
81 | template<> JSValue JSSVGEllipseElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
82 | { |
83 | return JSSVGGeometryElement::getConstructor(vm, &globalObject); |
84 | } |
85 | |
86 | template<> void JSSVGEllipseElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
87 | { |
88 | putDirect(vm, vm.propertyNames->prototype, JSSVGEllipseElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
89 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGEllipseElement"_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 JSSVGEllipseElementConstructor::s_info = { "SVGEllipseElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGEllipseElementConstructor) }; |
94 | |
95 | /* Hash table for prototype */ |
96 | |
97 | static const HashTableValue JSSVGEllipseElementPrototypeTableValues[] = |
98 | { |
99 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGEllipseElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGEllipseElementConstructor) } }, |
100 | { "cx" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGEllipseElementCx), (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>(jsSVGEllipseElementCy), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
102 | { "rx" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGEllipseElementRx), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
103 | { "ry" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGEllipseElementRy), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
104 | { "externalResourcesRequired" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGEllipseElementExternalResourcesRequired), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
105 | }; |
106 | |
107 | const ClassInfo JSSVGEllipseElementPrototype::s_info = { "SVGEllipseElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGEllipseElementPrototype) }; |
108 | |
109 | void JSSVGEllipseElementPrototype::finishCreation(VM& vm) |
110 | { |
111 | Base::finishCreation(vm); |
112 | reifyStaticProperties(vm, JSSVGEllipseElement::info(), JSSVGEllipseElementPrototypeTableValues, *this); |
113 | } |
114 | |
115 | const ClassInfo JSSVGEllipseElement::s_info = { "SVGEllipseElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGEllipseElement) }; |
116 | |
117 | JSSVGEllipseElement::JSSVGEllipseElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGEllipseElement>&& impl) |
118 | : JSSVGGeometryElement(structure, globalObject, WTFMove(impl)) |
119 | { |
120 | } |
121 | |
122 | void JSSVGEllipseElement::finishCreation(VM& vm) |
123 | { |
124 | Base::finishCreation(vm); |
125 | ASSERT(inherits(vm, info())); |
126 | |
127 | } |
128 | |
129 | JSObject* JSSVGEllipseElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
130 | { |
131 | return JSSVGEllipseElementPrototype::create(vm, &globalObject, JSSVGEllipseElementPrototype::createStructure(vm, &globalObject, JSSVGGeometryElement::prototype(vm, globalObject))); |
132 | } |
133 | |
134 | JSObject* JSSVGEllipseElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
135 | { |
136 | return getDOMPrototype<JSSVGEllipseElement>(vm, globalObject); |
137 | } |
138 | |
139 | JSValue JSSVGEllipseElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
140 | { |
141 | return getDOMConstructor<JSSVGEllipseElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
142 | } |
143 | |
144 | template<> inline JSSVGEllipseElement* IDLAttribute<JSSVGEllipseElement>::cast(ExecState& state, EncodedJSValue thisValue) |
145 | { |
146 | return jsDynamicCast<JSSVGEllipseElement*>(state.vm(), JSValue::decode(thisValue)); |
147 | } |
148 | |
149 | EncodedJSValue jsSVGEllipseElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
150 | { |
151 | VM& vm = state->vm(); |
152 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
153 | auto* prototype = jsDynamicCast<JSSVGEllipseElementPrototype*>(vm, JSValue::decode(thisValue)); |
154 | if (UNLIKELY(!prototype)) |
155 | return throwVMTypeError(state, throwScope); |
156 | return JSValue::encode(JSSVGEllipseElement::getConstructor(state->vm(), prototype->globalObject())); |
157 | } |
158 | |
159 | bool setJSSVGEllipseElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
160 | { |
161 | VM& vm = state->vm(); |
162 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
163 | auto* prototype = jsDynamicCast<JSSVGEllipseElementPrototype*>(vm, JSValue::decode(thisValue)); |
164 | if (UNLIKELY(!prototype)) { |
165 | throwVMTypeError(state, throwScope); |
166 | return false; |
167 | } |
168 | // Shadowing a built-in constructor |
169 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
170 | } |
171 | |
172 | static inline JSValue jsSVGEllipseElementCxGetter(ExecState& state, JSSVGEllipseElement& thisObject, ThrowScope& throwScope) |
173 | { |
174 | UNUSED_PARAM(throwScope); |
175 | UNUSED_PARAM(state); |
176 | auto& impl = thisObject.wrapped(); |
177 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.cxAnimated()); |
178 | return result; |
179 | } |
180 | |
181 | EncodedJSValue jsSVGEllipseElementCx(ExecState* state, EncodedJSValue thisValue, PropertyName) |
182 | { |
183 | return IDLAttribute<JSSVGEllipseElement>::get<jsSVGEllipseElementCxGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "cx" ); |
184 | } |
185 | |
186 | static inline JSValue jsSVGEllipseElementCyGetter(ExecState& state, JSSVGEllipseElement& thisObject, ThrowScope& throwScope) |
187 | { |
188 | UNUSED_PARAM(throwScope); |
189 | UNUSED_PARAM(state); |
190 | auto& impl = thisObject.wrapped(); |
191 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.cyAnimated()); |
192 | return result; |
193 | } |
194 | |
195 | EncodedJSValue jsSVGEllipseElementCy(ExecState* state, EncodedJSValue thisValue, PropertyName) |
196 | { |
197 | return IDLAttribute<JSSVGEllipseElement>::get<jsSVGEllipseElementCyGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "cy" ); |
198 | } |
199 | |
200 | static inline JSValue jsSVGEllipseElementRxGetter(ExecState& state, JSSVGEllipseElement& thisObject, ThrowScope& throwScope) |
201 | { |
202 | UNUSED_PARAM(throwScope); |
203 | UNUSED_PARAM(state); |
204 | auto& impl = thisObject.wrapped(); |
205 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.rxAnimated()); |
206 | return result; |
207 | } |
208 | |
209 | EncodedJSValue jsSVGEllipseElementRx(ExecState* state, EncodedJSValue thisValue, PropertyName) |
210 | { |
211 | return IDLAttribute<JSSVGEllipseElement>::get<jsSVGEllipseElementRxGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "rx" ); |
212 | } |
213 | |
214 | static inline JSValue jsSVGEllipseElementRyGetter(ExecState& state, JSSVGEllipseElement& thisObject, ThrowScope& throwScope) |
215 | { |
216 | UNUSED_PARAM(throwScope); |
217 | UNUSED_PARAM(state); |
218 | auto& impl = thisObject.wrapped(); |
219 | JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.ryAnimated()); |
220 | return result; |
221 | } |
222 | |
223 | EncodedJSValue jsSVGEllipseElementRy(ExecState* state, EncodedJSValue thisValue, PropertyName) |
224 | { |
225 | return IDLAttribute<JSSVGEllipseElement>::get<jsSVGEllipseElementRyGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "ry" ); |
226 | } |
227 | |
228 | static inline JSValue jsSVGEllipseElementExternalResourcesRequiredGetter(ExecState& state, JSSVGEllipseElement& thisObject, ThrowScope& throwScope) |
229 | { |
230 | UNUSED_PARAM(throwScope); |
231 | UNUSED_PARAM(state); |
232 | auto& impl = thisObject.wrapped(); |
233 | JSValue result = toJS<IDLInterface<SVGAnimatedBoolean>>(state, *thisObject.globalObject(), throwScope, impl.externalResourcesRequiredAnimated()); |
234 | return result; |
235 | } |
236 | |
237 | EncodedJSValue jsSVGEllipseElementExternalResourcesRequired(ExecState* state, EncodedJSValue thisValue, PropertyName) |
238 | { |
239 | return IDLAttribute<JSSVGEllipseElement>::get<jsSVGEllipseElementExternalResourcesRequiredGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "externalResourcesRequired" ); |
240 | } |
241 | |
242 | void JSSVGEllipseElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
243 | { |
244 | auto* thisObject = jsCast<JSSVGEllipseElement*>(cell); |
245 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
246 | if (thisObject->scriptExecutionContext()) |
247 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
248 | Base::heapSnapshot(cell, builder); |
249 | } |
250 | |
251 | |
252 | } |
253 | |