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 "JSSVGAnimatedNumberList.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 "JSSVGNumberList.h"
32#include "ScriptExecutionContext.h"
33#include <JavaScriptCore/FunctionPrototype.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
41namespace WebCore {
42using namespace JSC;
43
44// Attributes
45
46JSC::EncodedJSValue jsSVGAnimatedNumberListConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
47bool setJSSVGAnimatedNumberListConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
48JSC::EncodedJSValue jsSVGAnimatedNumberListBaseVal(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
49JSC::EncodedJSValue jsSVGAnimatedNumberListAnimVal(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
50
51class JSSVGAnimatedNumberListPrototype : public JSC::JSNonFinalObject {
52public:
53 using Base = JSC::JSNonFinalObject;
54 static JSSVGAnimatedNumberListPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
55 {
56 JSSVGAnimatedNumberListPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGAnimatedNumberListPrototype>(vm.heap)) JSSVGAnimatedNumberListPrototype(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 JSSVGAnimatedNumberListPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
69 : JSC::JSNonFinalObject(vm, structure)
70 {
71 }
72
73 void finishCreation(JSC::VM&);
74};
75
76using JSSVGAnimatedNumberListConstructor = JSDOMConstructorNotConstructable<JSSVGAnimatedNumberList>;
77
78template<> JSValue JSSVGAnimatedNumberListConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
79{
80 UNUSED_PARAM(vm);
81 return globalObject.functionPrototype();
82}
83
84template<> void JSSVGAnimatedNumberListConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
85{
86 putDirect(vm, vm.propertyNames->prototype, JSSVGAnimatedNumberList::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
87 putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGAnimatedNumberList"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
88 putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
89}
90
91template<> const ClassInfo JSSVGAnimatedNumberListConstructor::s_info = { "SVGAnimatedNumberList", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGAnimatedNumberListConstructor) };
92
93/* Hash table for prototype */
94
95static const HashTableValue JSSVGAnimatedNumberListPrototypeTableValues[] =
96{
97 { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedNumberListConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGAnimatedNumberListConstructor) } },
98 { "baseVal", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedNumberListBaseVal), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
99 { "animVal", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedNumberListAnimVal), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
100};
101
102const ClassInfo JSSVGAnimatedNumberListPrototype::s_info = { "SVGAnimatedNumberListPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGAnimatedNumberListPrototype) };
103
104void JSSVGAnimatedNumberListPrototype::finishCreation(VM& vm)
105{
106 Base::finishCreation(vm);
107 reifyStaticProperties(vm, JSSVGAnimatedNumberList::info(), JSSVGAnimatedNumberListPrototypeTableValues, *this);
108}
109
110const ClassInfo JSSVGAnimatedNumberList::s_info = { "SVGAnimatedNumberList", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGAnimatedNumberList) };
111
112JSSVGAnimatedNumberList::JSSVGAnimatedNumberList(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGAnimatedNumberList>&& impl)
113 : JSDOMWrapper<SVGAnimatedNumberList>(structure, globalObject, WTFMove(impl))
114{
115}
116
117void JSSVGAnimatedNumberList::finishCreation(VM& vm)
118{
119 Base::finishCreation(vm);
120 ASSERT(inherits(vm, info()));
121
122}
123
124JSObject* JSSVGAnimatedNumberList::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
125{
126 return JSSVGAnimatedNumberListPrototype::create(vm, &globalObject, JSSVGAnimatedNumberListPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
127}
128
129JSObject* JSSVGAnimatedNumberList::prototype(VM& vm, JSDOMGlobalObject& globalObject)
130{
131 return getDOMPrototype<JSSVGAnimatedNumberList>(vm, globalObject);
132}
133
134JSValue JSSVGAnimatedNumberList::getConstructor(VM& vm, const JSGlobalObject* globalObject)
135{
136 return getDOMConstructor<JSSVGAnimatedNumberListConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
137}
138
139void JSSVGAnimatedNumberList::destroy(JSC::JSCell* cell)
140{
141 JSSVGAnimatedNumberList* thisObject = static_cast<JSSVGAnimatedNumberList*>(cell);
142 thisObject->JSSVGAnimatedNumberList::~JSSVGAnimatedNumberList();
143}
144
145template<> inline JSSVGAnimatedNumberList* IDLAttribute<JSSVGAnimatedNumberList>::cast(ExecState& state, EncodedJSValue thisValue)
146{
147 return jsDynamicCast<JSSVGAnimatedNumberList*>(state.vm(), JSValue::decode(thisValue));
148}
149
150EncodedJSValue jsSVGAnimatedNumberListConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
151{
152 VM& vm = state->vm();
153 auto throwScope = DECLARE_THROW_SCOPE(vm);
154 auto* prototype = jsDynamicCast<JSSVGAnimatedNumberListPrototype*>(vm, JSValue::decode(thisValue));
155 if (UNLIKELY(!prototype))
156 return throwVMTypeError(state, throwScope);
157 return JSValue::encode(JSSVGAnimatedNumberList::getConstructor(state->vm(), prototype->globalObject()));
158}
159
160bool setJSSVGAnimatedNumberListConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
161{
162 VM& vm = state->vm();
163 auto throwScope = DECLARE_THROW_SCOPE(vm);
164 auto* prototype = jsDynamicCast<JSSVGAnimatedNumberListPrototype*>(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
173static inline JSValue jsSVGAnimatedNumberListBaseValGetter(ExecState& state, JSSVGAnimatedNumberList& thisObject, ThrowScope& throwScope)
174{
175 UNUSED_PARAM(throwScope);
176 UNUSED_PARAM(state);
177 auto& impl = thisObject.wrapped();
178 JSValue result = toJS<IDLInterface<SVGNumberList>>(state, *thisObject.globalObject(), throwScope, impl.baseVal());
179 return result;
180}
181
182EncodedJSValue jsSVGAnimatedNumberListBaseVal(ExecState* state, EncodedJSValue thisValue, PropertyName)
183{
184 return IDLAttribute<JSSVGAnimatedNumberList>::get<jsSVGAnimatedNumberListBaseValGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "baseVal");
185}
186
187static inline JSValue jsSVGAnimatedNumberListAnimValGetter(ExecState& state, JSSVGAnimatedNumberList& thisObject, ThrowScope& throwScope)
188{
189 UNUSED_PARAM(throwScope);
190 UNUSED_PARAM(state);
191 auto& impl = thisObject.wrapped();
192 JSValue result = toJS<IDLInterface<SVGNumberList>>(state, *thisObject.globalObject(), throwScope, impl.animVal());
193 return result;
194}
195
196EncodedJSValue jsSVGAnimatedNumberListAnimVal(ExecState* state, EncodedJSValue thisValue, PropertyName)
197{
198 return IDLAttribute<JSSVGAnimatedNumberList>::get<jsSVGAnimatedNumberListAnimValGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "animVal");
199}
200
201void JSSVGAnimatedNumberList::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
202{
203 auto* thisObject = jsCast<JSSVGAnimatedNumberList*>(cell);
204 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
205 if (thisObject->scriptExecutionContext())
206 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
207 Base::heapSnapshot(cell, builder);
208}
209
210bool JSSVGAnimatedNumberListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason)
211{
212 UNUSED_PARAM(handle);
213 UNUSED_PARAM(visitor);
214 UNUSED_PARAM(reason);
215 return false;
216}
217
218void JSSVGAnimatedNumberListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
219{
220 auto* jsSVGAnimatedNumberList = static_cast<JSSVGAnimatedNumberList*>(handle.slot()->asCell());
221 auto& world = *static_cast<DOMWrapperWorld*>(context);
222 uncacheWrapper(world, &jsSVGAnimatedNumberList->wrapped(), jsSVGAnimatedNumberList);
223}
224
225JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<SVGAnimatedNumberList>&& impl)
226{
227 return createWrapper<SVGAnimatedNumberList>(globalObject, WTFMove(impl));
228}
229
230JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, SVGAnimatedNumberList& impl)
231{
232 return wrap(state, globalObject, impl);
233}
234
235SVGAnimatedNumberList* JSSVGAnimatedNumberList::toWrapped(JSC::VM& vm, JSC::JSValue value)
236{
237 if (auto* wrapper = jsDynamicCast<JSSVGAnimatedNumberList*>(vm, value))
238 return &wrapper->wrapped();
239 return nullptr;
240}
241
242}
243