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 "JSSVGPathSegLinetoHorizontalAbs.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 | |
38 | namespace WebCore { |
39 | using namespace JSC; |
40 | |
41 | // Attributes |
42 | |
43 | JSC::EncodedJSValue jsSVGPathSegLinetoHorizontalAbsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
44 | bool setJSSVGPathSegLinetoHorizontalAbsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
45 | JSC::EncodedJSValue jsSVGPathSegLinetoHorizontalAbsX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
46 | bool setJSSVGPathSegLinetoHorizontalAbsX(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
47 | |
48 | class JSSVGPathSegLinetoHorizontalAbsPrototype : public JSC::JSNonFinalObject { |
49 | public: |
50 | using Base = JSC::JSNonFinalObject; |
51 | static JSSVGPathSegLinetoHorizontalAbsPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
52 | { |
53 | JSSVGPathSegLinetoHorizontalAbsPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGPathSegLinetoHorizontalAbsPrototype>(vm.heap)) JSSVGPathSegLinetoHorizontalAbsPrototype(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 | |
64 | private: |
65 | JSSVGPathSegLinetoHorizontalAbsPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
66 | : JSC::JSNonFinalObject(vm, structure) |
67 | { |
68 | } |
69 | |
70 | void finishCreation(JSC::VM&); |
71 | }; |
72 | |
73 | using JSSVGPathSegLinetoHorizontalAbsConstructor = JSDOMConstructorNotConstructable<JSSVGPathSegLinetoHorizontalAbs>; |
74 | |
75 | template<> JSValue JSSVGPathSegLinetoHorizontalAbsConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
76 | { |
77 | return JSSVGPathSeg::getConstructor(vm, &globalObject); |
78 | } |
79 | |
80 | template<> void JSSVGPathSegLinetoHorizontalAbsConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
81 | { |
82 | putDirect(vm, vm.propertyNames->prototype, JSSVGPathSegLinetoHorizontalAbs::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
83 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGPathSegLinetoHorizontalAbs"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
84 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
85 | } |
86 | |
87 | template<> const ClassInfo JSSVGPathSegLinetoHorizontalAbsConstructor::s_info = { "SVGPathSegLinetoHorizontalAbs" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPathSegLinetoHorizontalAbsConstructor) }; |
88 | |
89 | /* Hash table for prototype */ |
90 | |
91 | static const HashTableValue JSSVGPathSegLinetoHorizontalAbsPrototypeTableValues[] = |
92 | { |
93 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegLinetoHorizontalAbsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGPathSegLinetoHorizontalAbsConstructor) } }, |
94 | { "x" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegLinetoHorizontalAbsX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGPathSegLinetoHorizontalAbsX) } }, |
95 | }; |
96 | |
97 | const ClassInfo JSSVGPathSegLinetoHorizontalAbsPrototype::s_info = { "SVGPathSegLinetoHorizontalAbsPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPathSegLinetoHorizontalAbsPrototype) }; |
98 | |
99 | void JSSVGPathSegLinetoHorizontalAbsPrototype::finishCreation(VM& vm) |
100 | { |
101 | Base::finishCreation(vm); |
102 | reifyStaticProperties(vm, JSSVGPathSegLinetoHorizontalAbs::info(), JSSVGPathSegLinetoHorizontalAbsPrototypeTableValues, *this); |
103 | } |
104 | |
105 | const ClassInfo JSSVGPathSegLinetoHorizontalAbs::s_info = { "SVGPathSegLinetoHorizontalAbs" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPathSegLinetoHorizontalAbs) }; |
106 | |
107 | JSSVGPathSegLinetoHorizontalAbs::JSSVGPathSegLinetoHorizontalAbs(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGPathSegLinetoHorizontalAbs>&& impl) |
108 | : JSSVGPathSeg(structure, globalObject, WTFMove(impl)) |
109 | { |
110 | } |
111 | |
112 | void JSSVGPathSegLinetoHorizontalAbs::finishCreation(VM& vm) |
113 | { |
114 | Base::finishCreation(vm); |
115 | ASSERT(inherits(vm, info())); |
116 | |
117 | } |
118 | |
119 | JSObject* JSSVGPathSegLinetoHorizontalAbs::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
120 | { |
121 | return JSSVGPathSegLinetoHorizontalAbsPrototype::create(vm, &globalObject, JSSVGPathSegLinetoHorizontalAbsPrototype::createStructure(vm, &globalObject, JSSVGPathSeg::prototype(vm, globalObject))); |
122 | } |
123 | |
124 | JSObject* JSSVGPathSegLinetoHorizontalAbs::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
125 | { |
126 | return getDOMPrototype<JSSVGPathSegLinetoHorizontalAbs>(vm, globalObject); |
127 | } |
128 | |
129 | JSValue JSSVGPathSegLinetoHorizontalAbs::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
130 | { |
131 | return getDOMConstructor<JSSVGPathSegLinetoHorizontalAbsConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
132 | } |
133 | |
134 | template<> inline JSSVGPathSegLinetoHorizontalAbs* IDLAttribute<JSSVGPathSegLinetoHorizontalAbs>::cast(ExecState& state, EncodedJSValue thisValue) |
135 | { |
136 | return jsDynamicCast<JSSVGPathSegLinetoHorizontalAbs*>(state.vm(), JSValue::decode(thisValue)); |
137 | } |
138 | |
139 | EncodedJSValue jsSVGPathSegLinetoHorizontalAbsConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
140 | { |
141 | VM& vm = state->vm(); |
142 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
143 | auto* prototype = jsDynamicCast<JSSVGPathSegLinetoHorizontalAbsPrototype*>(vm, JSValue::decode(thisValue)); |
144 | if (UNLIKELY(!prototype)) |
145 | return throwVMTypeError(state, throwScope); |
146 | return JSValue::encode(JSSVGPathSegLinetoHorizontalAbs::getConstructor(state->vm(), prototype->globalObject())); |
147 | } |
148 | |
149 | bool setJSSVGPathSegLinetoHorizontalAbsConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
150 | { |
151 | VM& vm = state->vm(); |
152 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
153 | auto* prototype = jsDynamicCast<JSSVGPathSegLinetoHorizontalAbsPrototype*>(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 | |
162 | static inline JSValue jsSVGPathSegLinetoHorizontalAbsXGetter(ExecState& state, JSSVGPathSegLinetoHorizontalAbs& 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.x()); |
168 | return result; |
169 | } |
170 | |
171 | EncodedJSValue jsSVGPathSegLinetoHorizontalAbsX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
172 | { |
173 | return IDLAttribute<JSSVGPathSegLinetoHorizontalAbs>::get<jsSVGPathSegLinetoHorizontalAbsXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "x" ); |
174 | } |
175 | |
176 | static inline bool setJSSVGPathSegLinetoHorizontalAbsXSetter(ExecState& state, JSSVGPathSegLinetoHorizontalAbs& 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.setX(WTFMove(nativeValue)); |
184 | }); |
185 | return true; |
186 | } |
187 | |
188 | bool setJSSVGPathSegLinetoHorizontalAbsX(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
189 | { |
190 | return IDLAttribute<JSSVGPathSegLinetoHorizontalAbs>::set<setJSSVGPathSegLinetoHorizontalAbsXSetter>(*state, thisValue, encodedValue, "x" ); |
191 | } |
192 | |
193 | void JSSVGPathSegLinetoHorizontalAbs::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
194 | { |
195 | auto* thisObject = jsCast<JSSVGPathSegLinetoHorizontalAbs*>(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 | |