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 "JSSVGPathSegLinetoVerticalRel.h"
23
24#include "JSDOMAttribute.h"
25#include "JSDOMBinding.h"
26#include "JSDOMConstructorNotConstructable.h"
27#include "JSDOMConvertNumbers.h"
28#include "JSDOMExceptionHandling.h"
29#include "JSDOMWrapperCache.h"
30#include "ScriptExecutionContext.h"
31#include <JavaScriptCore/HeapSnapshotBuilder.h>
32#include <JavaScriptCore/JSCInlines.h>
33#include <wtf/GetPtr.h>
34#include <wtf/PointerPreparations.h>
35#include <wtf/URL.h>
36
37
38namespace WebCore {
39using namespace JSC;
40
41// Attributes
42
43JSC::EncodedJSValue jsSVGPathSegLinetoVerticalRelConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
44bool setJSSVGPathSegLinetoVerticalRelConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
45JSC::EncodedJSValue jsSVGPathSegLinetoVerticalRelY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
46bool setJSSVGPathSegLinetoVerticalRelY(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
47
48class JSSVGPathSegLinetoVerticalRelPrototype : public JSC::JSNonFinalObject {
49public:
50 using Base = JSC::JSNonFinalObject;
51 static JSSVGPathSegLinetoVerticalRelPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
52 {
53 JSSVGPathSegLinetoVerticalRelPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGPathSegLinetoVerticalRelPrototype>(vm.heap)) JSSVGPathSegLinetoVerticalRelPrototype(vm, globalObject, structure);
54 ptr->finishCreation(vm);
55 return ptr;
56 }
57
58 DECLARE_INFO;
59 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
60 {
61 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
62 }
63
64private:
65 JSSVGPathSegLinetoVerticalRelPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
66 : JSC::JSNonFinalObject(vm, structure)
67 {
68 }
69
70 void finishCreation(JSC::VM&);
71};
72
73using JSSVGPathSegLinetoVerticalRelConstructor = JSDOMConstructorNotConstructable<JSSVGPathSegLinetoVerticalRel>;
74
75template<> JSValue JSSVGPathSegLinetoVerticalRelConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
76{
77 return JSSVGPathSeg::getConstructor(vm, &globalObject);
78}
79
80template<> void JSSVGPathSegLinetoVerticalRelConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
81{
82 putDirect(vm, vm.propertyNames->prototype, JSSVGPathSegLinetoVerticalRel::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
83 putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGPathSegLinetoVerticalRel"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
84 putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
85}
86
87template<> const ClassInfo JSSVGPathSegLinetoVerticalRelConstructor::s_info = { "SVGPathSegLinetoVerticalRel", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPathSegLinetoVerticalRelConstructor) };
88
89/* Hash table for prototype */
90
91static const HashTableValue JSSVGPathSegLinetoVerticalRelPrototypeTableValues[] =
92{
93 { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegLinetoVerticalRelConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGPathSegLinetoVerticalRelConstructor) } },
94 { "y", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegLinetoVerticalRelY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGPathSegLinetoVerticalRelY) } },
95};
96
97const ClassInfo JSSVGPathSegLinetoVerticalRelPrototype::s_info = { "SVGPathSegLinetoVerticalRelPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPathSegLinetoVerticalRelPrototype) };
98
99void JSSVGPathSegLinetoVerticalRelPrototype::finishCreation(VM& vm)
100{
101 Base::finishCreation(vm);
102 reifyStaticProperties(vm, JSSVGPathSegLinetoVerticalRel::info(), JSSVGPathSegLinetoVerticalRelPrototypeTableValues, *this);
103}
104
105const ClassInfo JSSVGPathSegLinetoVerticalRel::s_info = { "SVGPathSegLinetoVerticalRel", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPathSegLinetoVerticalRel) };
106
107JSSVGPathSegLinetoVerticalRel::JSSVGPathSegLinetoVerticalRel(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGPathSegLinetoVerticalRel>&& impl)
108 : JSSVGPathSeg(structure, globalObject, WTFMove(impl))
109{
110}
111
112void JSSVGPathSegLinetoVerticalRel::finishCreation(VM& vm)
113{
114 Base::finishCreation(vm);
115 ASSERT(inherits(vm, info()));
116
117}
118
119JSObject* JSSVGPathSegLinetoVerticalRel::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
120{
121 return JSSVGPathSegLinetoVerticalRelPrototype::create(vm, &globalObject, JSSVGPathSegLinetoVerticalRelPrototype::createStructure(vm, &globalObject, JSSVGPathSeg::prototype(vm, globalObject)));
122}
123
124JSObject* JSSVGPathSegLinetoVerticalRel::prototype(VM& vm, JSDOMGlobalObject& globalObject)
125{
126 return getDOMPrototype<JSSVGPathSegLinetoVerticalRel>(vm, globalObject);
127}
128
129JSValue JSSVGPathSegLinetoVerticalRel::getConstructor(VM& vm, const JSGlobalObject* globalObject)
130{
131 return getDOMConstructor<JSSVGPathSegLinetoVerticalRelConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
132}
133
134template<> inline JSSVGPathSegLinetoVerticalRel* IDLAttribute<JSSVGPathSegLinetoVerticalRel>::cast(ExecState& state, EncodedJSValue thisValue)
135{
136 return jsDynamicCast<JSSVGPathSegLinetoVerticalRel*>(state.vm(), JSValue::decode(thisValue));
137}
138
139EncodedJSValue jsSVGPathSegLinetoVerticalRelConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
140{
141 VM& vm = state->vm();
142 auto throwScope = DECLARE_THROW_SCOPE(vm);
143 auto* prototype = jsDynamicCast<JSSVGPathSegLinetoVerticalRelPrototype*>(vm, JSValue::decode(thisValue));
144 if (UNLIKELY(!prototype))
145 return throwVMTypeError(state, throwScope);
146 return JSValue::encode(JSSVGPathSegLinetoVerticalRel::getConstructor(state->vm(), prototype->globalObject()));
147}
148
149bool setJSSVGPathSegLinetoVerticalRelConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
150{
151 VM& vm = state->vm();
152 auto throwScope = DECLARE_THROW_SCOPE(vm);
153 auto* prototype = jsDynamicCast<JSSVGPathSegLinetoVerticalRelPrototype*>(vm, JSValue::decode(thisValue));
154 if (UNLIKELY(!prototype)) {
155 throwVMTypeError(state, throwScope);
156 return false;
157 }
158 // Shadowing a built-in constructor
159 return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
160}
161
162static inline JSValue jsSVGPathSegLinetoVerticalRelYGetter(ExecState& state, JSSVGPathSegLinetoVerticalRel& thisObject, ThrowScope& throwScope)
163{
164 UNUSED_PARAM(throwScope);
165 UNUSED_PARAM(state);
166 auto& impl = thisObject.wrapped();
167 JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.y());
168 return result;
169}
170
171EncodedJSValue jsSVGPathSegLinetoVerticalRelY(ExecState* state, EncodedJSValue thisValue, PropertyName)
172{
173 return IDLAttribute<JSSVGPathSegLinetoVerticalRel>::get<jsSVGPathSegLinetoVerticalRelYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "y");
174}
175
176static inline bool setJSSVGPathSegLinetoVerticalRelYSetter(ExecState& state, JSSVGPathSegLinetoVerticalRel& thisObject, JSValue value, ThrowScope& throwScope)
177{
178 UNUSED_PARAM(throwScope);
179 auto& impl = thisObject.wrapped();
180 auto nativeValue = convert<IDLUnrestrictedFloat>(state, value);
181 RETURN_IF_EXCEPTION(throwScope, false);
182 AttributeSetter::call(state, throwScope, [&] {
183 return impl.setY(WTFMove(nativeValue));
184 });
185 return true;
186}
187
188bool setJSSVGPathSegLinetoVerticalRelY(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
189{
190 return IDLAttribute<JSSVGPathSegLinetoVerticalRel>::set<setJSSVGPathSegLinetoVerticalRelYSetter>(*state, thisValue, encodedValue, "y");
191}
192
193void JSSVGPathSegLinetoVerticalRel::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
194{
195 auto* thisObject = jsCast<JSSVGPathSegLinetoVerticalRel*>(cell);
196 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
197 if (thisObject->scriptExecutionContext())
198 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
199 Base::heapSnapshot(cell, builder);
200}
201
202
203}
204