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 "JSSVGPathSegLinetoRel.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 jsSVGPathSegLinetoRelConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
44bool setJSSVGPathSegLinetoRelConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
45JSC::EncodedJSValue jsSVGPathSegLinetoRelX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
46bool setJSSVGPathSegLinetoRelX(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
47JSC::EncodedJSValue jsSVGPathSegLinetoRelY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
48bool setJSSVGPathSegLinetoRelY(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
49
50class JSSVGPathSegLinetoRelPrototype : public JSC::JSNonFinalObject {
51public:
52 using Base = JSC::JSNonFinalObject;
53 static JSSVGPathSegLinetoRelPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
54 {
55 JSSVGPathSegLinetoRelPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGPathSegLinetoRelPrototype>(vm.heap)) JSSVGPathSegLinetoRelPrototype(vm, globalObject, structure);
56 ptr->finishCreation(vm);
57 return ptr;
58 }
59
60 DECLARE_INFO;
61 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
62 {
63 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
64 }
65
66private:
67 JSSVGPathSegLinetoRelPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
68 : JSC::JSNonFinalObject(vm, structure)
69 {
70 }
71
72 void finishCreation(JSC::VM&);
73};
74
75using JSSVGPathSegLinetoRelConstructor = JSDOMConstructorNotConstructable<JSSVGPathSegLinetoRel>;
76
77template<> JSValue JSSVGPathSegLinetoRelConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
78{
79 return JSSVGPathSeg::getConstructor(vm, &globalObject);
80}
81
82template<> void JSSVGPathSegLinetoRelConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
83{
84 putDirect(vm, vm.propertyNames->prototype, JSSVGPathSegLinetoRel::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
85 putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGPathSegLinetoRel"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
86 putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
87}
88
89template<> const ClassInfo JSSVGPathSegLinetoRelConstructor::s_info = { "SVGPathSegLinetoRel", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPathSegLinetoRelConstructor) };
90
91/* Hash table for prototype */
92
93static const HashTableValue JSSVGPathSegLinetoRelPrototypeTableValues[] =
94{
95 { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegLinetoRelConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGPathSegLinetoRelConstructor) } },
96 { "x", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegLinetoRelX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGPathSegLinetoRelX) } },
97 { "y", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegLinetoRelY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGPathSegLinetoRelY) } },
98};
99
100const ClassInfo JSSVGPathSegLinetoRelPrototype::s_info = { "SVGPathSegLinetoRelPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPathSegLinetoRelPrototype) };
101
102void JSSVGPathSegLinetoRelPrototype::finishCreation(VM& vm)
103{
104 Base::finishCreation(vm);
105 reifyStaticProperties(vm, JSSVGPathSegLinetoRel::info(), JSSVGPathSegLinetoRelPrototypeTableValues, *this);
106}
107
108const ClassInfo JSSVGPathSegLinetoRel::s_info = { "SVGPathSegLinetoRel", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPathSegLinetoRel) };
109
110JSSVGPathSegLinetoRel::JSSVGPathSegLinetoRel(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGPathSegLinetoRel>&& impl)
111 : JSSVGPathSeg(structure, globalObject, WTFMove(impl))
112{
113}
114
115void JSSVGPathSegLinetoRel::finishCreation(VM& vm)
116{
117 Base::finishCreation(vm);
118 ASSERT(inherits(vm, info()));
119
120}
121
122JSObject* JSSVGPathSegLinetoRel::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
123{
124 return JSSVGPathSegLinetoRelPrototype::create(vm, &globalObject, JSSVGPathSegLinetoRelPrototype::createStructure(vm, &globalObject, JSSVGPathSeg::prototype(vm, globalObject)));
125}
126
127JSObject* JSSVGPathSegLinetoRel::prototype(VM& vm, JSDOMGlobalObject& globalObject)
128{
129 return getDOMPrototype<JSSVGPathSegLinetoRel>(vm, globalObject);
130}
131
132JSValue JSSVGPathSegLinetoRel::getConstructor(VM& vm, const JSGlobalObject* globalObject)
133{
134 return getDOMConstructor<JSSVGPathSegLinetoRelConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
135}
136
137template<> inline JSSVGPathSegLinetoRel* IDLAttribute<JSSVGPathSegLinetoRel>::cast(ExecState& state, EncodedJSValue thisValue)
138{
139 return jsDynamicCast<JSSVGPathSegLinetoRel*>(state.vm(), JSValue::decode(thisValue));
140}
141
142EncodedJSValue jsSVGPathSegLinetoRelConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
143{
144 VM& vm = state->vm();
145 auto throwScope = DECLARE_THROW_SCOPE(vm);
146 auto* prototype = jsDynamicCast<JSSVGPathSegLinetoRelPrototype*>(vm, JSValue::decode(thisValue));
147 if (UNLIKELY(!prototype))
148 return throwVMTypeError(state, throwScope);
149 return JSValue::encode(JSSVGPathSegLinetoRel::getConstructor(state->vm(), prototype->globalObject()));
150}
151
152bool setJSSVGPathSegLinetoRelConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
153{
154 VM& vm = state->vm();
155 auto throwScope = DECLARE_THROW_SCOPE(vm);
156 auto* prototype = jsDynamicCast<JSSVGPathSegLinetoRelPrototype*>(vm, JSValue::decode(thisValue));
157 if (UNLIKELY(!prototype)) {
158 throwVMTypeError(state, throwScope);
159 return false;
160 }
161 // Shadowing a built-in constructor
162 return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
163}
164
165static inline JSValue jsSVGPathSegLinetoRelXGetter(ExecState& state, JSSVGPathSegLinetoRel& thisObject, ThrowScope& throwScope)
166{
167 UNUSED_PARAM(throwScope);
168 UNUSED_PARAM(state);
169 auto& impl = thisObject.wrapped();
170 JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.x());
171 return result;
172}
173
174EncodedJSValue jsSVGPathSegLinetoRelX(ExecState* state, EncodedJSValue thisValue, PropertyName)
175{
176 return IDLAttribute<JSSVGPathSegLinetoRel>::get<jsSVGPathSegLinetoRelXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "x");
177}
178
179static inline bool setJSSVGPathSegLinetoRelXSetter(ExecState& state, JSSVGPathSegLinetoRel& thisObject, JSValue value, ThrowScope& throwScope)
180{
181 UNUSED_PARAM(throwScope);
182 auto& impl = thisObject.wrapped();
183 auto nativeValue = convert<IDLUnrestrictedFloat>(state, value);
184 RETURN_IF_EXCEPTION(throwScope, false);
185 AttributeSetter::call(state, throwScope, [&] {
186 return impl.setX(WTFMove(nativeValue));
187 });
188 return true;
189}
190
191bool setJSSVGPathSegLinetoRelX(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
192{
193 return IDLAttribute<JSSVGPathSegLinetoRel>::set<setJSSVGPathSegLinetoRelXSetter>(*state, thisValue, encodedValue, "x");
194}
195
196static inline JSValue jsSVGPathSegLinetoRelYGetter(ExecState& state, JSSVGPathSegLinetoRel& thisObject, ThrowScope& throwScope)
197{
198 UNUSED_PARAM(throwScope);
199 UNUSED_PARAM(state);
200 auto& impl = thisObject.wrapped();
201 JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.y());
202 return result;
203}
204
205EncodedJSValue jsSVGPathSegLinetoRelY(ExecState* state, EncodedJSValue thisValue, PropertyName)
206{
207 return IDLAttribute<JSSVGPathSegLinetoRel>::get<jsSVGPathSegLinetoRelYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "y");
208}
209
210static inline bool setJSSVGPathSegLinetoRelYSetter(ExecState& state, JSSVGPathSegLinetoRel& thisObject, JSValue value, ThrowScope& throwScope)
211{
212 UNUSED_PARAM(throwScope);
213 auto& impl = thisObject.wrapped();
214 auto nativeValue = convert<IDLUnrestrictedFloat>(state, value);
215 RETURN_IF_EXCEPTION(throwScope, false);
216 AttributeSetter::call(state, throwScope, [&] {
217 return impl.setY(WTFMove(nativeValue));
218 });
219 return true;
220}
221
222bool setJSSVGPathSegLinetoRelY(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
223{
224 return IDLAttribute<JSSVGPathSegLinetoRel>::set<setJSSVGPathSegLinetoRelYSetter>(*state, thisValue, encodedValue, "y");
225}
226
227void JSSVGPathSegLinetoRel::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
228{
229 auto* thisObject = jsCast<JSSVGPathSegLinetoRel*>(cell);
230 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
231 if (thisObject->scriptExecutionContext())
232 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
233 Base::heapSnapshot(cell, builder);
234}
235
236
237}
238