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 "JSSVGSymbolElement.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 "JSSVGAnimatedPreserveAspectRatio.h"
33#include "JSSVGAnimatedRect.h"
34#include "ScriptExecutionContext.h"
35#include <JavaScriptCore/HeapSnapshotBuilder.h>
36#include <JavaScriptCore/JSCInlines.h>
37#include <wtf/GetPtr.h>
38#include <wtf/PointerPreparations.h>
39#include <wtf/URL.h>
40
41
42namespace WebCore {
43using namespace JSC;
44
45// Attributes
46
47JSC::EncodedJSValue jsSVGSymbolElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
48bool setJSSVGSymbolElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
49JSC::EncodedJSValue jsSVGSymbolElementExternalResourcesRequired(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
50JSC::EncodedJSValue jsSVGSymbolElementViewBox(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
51JSC::EncodedJSValue jsSVGSymbolElementPreserveAspectRatio(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
52
53class JSSVGSymbolElementPrototype : public JSC::JSNonFinalObject {
54public:
55 using Base = JSC::JSNonFinalObject;
56 static JSSVGSymbolElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
57 {
58 JSSVGSymbolElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGSymbolElementPrototype>(vm.heap)) JSSVGSymbolElementPrototype(vm, globalObject, structure);
59 ptr->finishCreation(vm);
60 return ptr;
61 }
62
63 DECLARE_INFO;
64 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
65 {
66 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
67 }
68
69private:
70 JSSVGSymbolElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
71 : JSC::JSNonFinalObject(vm, structure)
72 {
73 }
74
75 void finishCreation(JSC::VM&);
76};
77
78using JSSVGSymbolElementConstructor = JSDOMConstructorNotConstructable<JSSVGSymbolElement>;
79
80template<> JSValue JSSVGSymbolElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
81{
82 return JSSVGElement::getConstructor(vm, &globalObject);
83}
84
85template<> void JSSVGSymbolElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
86{
87 putDirect(vm, vm.propertyNames->prototype, JSSVGSymbolElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
88 putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGSymbolElement"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
89 putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
90}
91
92template<> const ClassInfo JSSVGSymbolElementConstructor::s_info = { "SVGSymbolElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGSymbolElementConstructor) };
93
94/* Hash table for prototype */
95
96static const HashTableValue JSSVGSymbolElementPrototypeTableValues[] =
97{
98 { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGSymbolElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGSymbolElementConstructor) } },
99 { "externalResourcesRequired", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGSymbolElementExternalResourcesRequired), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
100 { "viewBox", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGSymbolElementViewBox), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
101 { "preserveAspectRatio", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGSymbolElementPreserveAspectRatio), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
102};
103
104const ClassInfo JSSVGSymbolElementPrototype::s_info = { "SVGSymbolElementPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGSymbolElementPrototype) };
105
106void JSSVGSymbolElementPrototype::finishCreation(VM& vm)
107{
108 Base::finishCreation(vm);
109 reifyStaticProperties(vm, JSSVGSymbolElement::info(), JSSVGSymbolElementPrototypeTableValues, *this);
110}
111
112const ClassInfo JSSVGSymbolElement::s_info = { "SVGSymbolElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGSymbolElement) };
113
114JSSVGSymbolElement::JSSVGSymbolElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGSymbolElement>&& impl)
115 : JSSVGElement(structure, globalObject, WTFMove(impl))
116{
117}
118
119void JSSVGSymbolElement::finishCreation(VM& vm)
120{
121 Base::finishCreation(vm);
122 ASSERT(inherits(vm, info()));
123
124}
125
126JSObject* JSSVGSymbolElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
127{
128 return JSSVGSymbolElementPrototype::create(vm, &globalObject, JSSVGSymbolElementPrototype::createStructure(vm, &globalObject, JSSVGElement::prototype(vm, globalObject)));
129}
130
131JSObject* JSSVGSymbolElement::prototype(VM& vm, JSDOMGlobalObject& globalObject)
132{
133 return getDOMPrototype<JSSVGSymbolElement>(vm, globalObject);
134}
135
136JSValue JSSVGSymbolElement::getConstructor(VM& vm, const JSGlobalObject* globalObject)
137{
138 return getDOMConstructor<JSSVGSymbolElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
139}
140
141template<> inline JSSVGSymbolElement* IDLAttribute<JSSVGSymbolElement>::cast(ExecState& state, EncodedJSValue thisValue)
142{
143 return jsDynamicCast<JSSVGSymbolElement*>(state.vm(), JSValue::decode(thisValue));
144}
145
146EncodedJSValue jsSVGSymbolElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
147{
148 VM& vm = state->vm();
149 auto throwScope = DECLARE_THROW_SCOPE(vm);
150 auto* prototype = jsDynamicCast<JSSVGSymbolElementPrototype*>(vm, JSValue::decode(thisValue));
151 if (UNLIKELY(!prototype))
152 return throwVMTypeError(state, throwScope);
153 return JSValue::encode(JSSVGSymbolElement::getConstructor(state->vm(), prototype->globalObject()));
154}
155
156bool setJSSVGSymbolElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
157{
158 VM& vm = state->vm();
159 auto throwScope = DECLARE_THROW_SCOPE(vm);
160 auto* prototype = jsDynamicCast<JSSVGSymbolElementPrototype*>(vm, JSValue::decode(thisValue));
161 if (UNLIKELY(!prototype)) {
162 throwVMTypeError(state, throwScope);
163 return false;
164 }
165 // Shadowing a built-in constructor
166 return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
167}
168
169static inline JSValue jsSVGSymbolElementExternalResourcesRequiredGetter(ExecState& state, JSSVGSymbolElement& thisObject, ThrowScope& throwScope)
170{
171 UNUSED_PARAM(throwScope);
172 UNUSED_PARAM(state);
173 auto& impl = thisObject.wrapped();
174 JSValue result = toJS<IDLInterface<SVGAnimatedBoolean>>(state, *thisObject.globalObject(), throwScope, impl.externalResourcesRequiredAnimated());
175 return result;
176}
177
178EncodedJSValue jsSVGSymbolElementExternalResourcesRequired(ExecState* state, EncodedJSValue thisValue, PropertyName)
179{
180 return IDLAttribute<JSSVGSymbolElement>::get<jsSVGSymbolElementExternalResourcesRequiredGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "externalResourcesRequired");
181}
182
183static inline JSValue jsSVGSymbolElementViewBoxGetter(ExecState& state, JSSVGSymbolElement& thisObject, ThrowScope& throwScope)
184{
185 UNUSED_PARAM(throwScope);
186 UNUSED_PARAM(state);
187 auto& impl = thisObject.wrapped();
188 JSValue result = toJS<IDLInterface<SVGAnimatedRect>>(state, *thisObject.globalObject(), throwScope, impl.viewBoxAnimated());
189 return result;
190}
191
192EncodedJSValue jsSVGSymbolElementViewBox(ExecState* state, EncodedJSValue thisValue, PropertyName)
193{
194 return IDLAttribute<JSSVGSymbolElement>::get<jsSVGSymbolElementViewBoxGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "viewBox");
195}
196
197static inline JSValue jsSVGSymbolElementPreserveAspectRatioGetter(ExecState& state, JSSVGSymbolElement& thisObject, ThrowScope& throwScope)
198{
199 UNUSED_PARAM(throwScope);
200 UNUSED_PARAM(state);
201 auto& impl = thisObject.wrapped();
202 JSValue result = toJS<IDLInterface<SVGAnimatedPreserveAspectRatio>>(state, *thisObject.globalObject(), throwScope, impl.preserveAspectRatioAnimated());
203 return result;
204}
205
206EncodedJSValue jsSVGSymbolElementPreserveAspectRatio(ExecState* state, EncodedJSValue thisValue, PropertyName)
207{
208 return IDLAttribute<JSSVGSymbolElement>::get<jsSVGSymbolElementPreserveAspectRatioGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "preserveAspectRatio");
209}
210
211void JSSVGSymbolElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
212{
213 auto* thisObject = jsCast<JSSVGSymbolElement*>(cell);
214 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
215 if (thisObject->scriptExecutionContext())
216 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
217 Base::heapSnapshot(cell, builder);
218}
219
220
221}
222