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