| 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 "JSSVGPathSegCurvetoQuadraticSmoothRel.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 jsSVGPathSegCurvetoQuadraticSmoothRelConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 44 | bool setJSSVGPathSegCurvetoQuadraticSmoothRelConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 45 | JSC::EncodedJSValue jsSVGPathSegCurvetoQuadraticSmoothRelX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 46 | bool setJSSVGPathSegCurvetoQuadraticSmoothRelX(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 47 | JSC::EncodedJSValue jsSVGPathSegCurvetoQuadraticSmoothRelY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 48 | bool setJSSVGPathSegCurvetoQuadraticSmoothRelY(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 49 | |
| 50 | class JSSVGPathSegCurvetoQuadraticSmoothRelPrototype : public JSC::JSNonFinalObject { |
| 51 | public: |
| 52 | using Base = JSC::JSNonFinalObject; |
| 53 | static JSSVGPathSegCurvetoQuadraticSmoothRelPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
| 54 | { |
| 55 | JSSVGPathSegCurvetoQuadraticSmoothRelPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGPathSegCurvetoQuadraticSmoothRelPrototype>(vm.heap)) JSSVGPathSegCurvetoQuadraticSmoothRelPrototype(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 | |
| 66 | private: |
| 67 | JSSVGPathSegCurvetoQuadraticSmoothRelPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| 68 | : JSC::JSNonFinalObject(vm, structure) |
| 69 | { |
| 70 | } |
| 71 | |
| 72 | void finishCreation(JSC::VM&); |
| 73 | }; |
| 74 | |
| 75 | using JSSVGPathSegCurvetoQuadraticSmoothRelConstructor = JSDOMConstructorNotConstructable<JSSVGPathSegCurvetoQuadraticSmoothRel>; |
| 76 | |
| 77 | template<> JSValue JSSVGPathSegCurvetoQuadraticSmoothRelConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| 78 | { |
| 79 | return JSSVGPathSeg::getConstructor(vm, &globalObject); |
| 80 | } |
| 81 | |
| 82 | template<> void JSSVGPathSegCurvetoQuadraticSmoothRelConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| 83 | { |
| 84 | putDirect(vm, vm.propertyNames->prototype, JSSVGPathSegCurvetoQuadraticSmoothRel::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 85 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGPathSegCurvetoQuadraticSmoothRel"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 86 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 87 | } |
| 88 | |
| 89 | template<> const ClassInfo JSSVGPathSegCurvetoQuadraticSmoothRelConstructor::s_info = { "SVGPathSegCurvetoQuadraticSmoothRel" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPathSegCurvetoQuadraticSmoothRelConstructor) }; |
| 90 | |
| 91 | /* Hash table for prototype */ |
| 92 | |
| 93 | static const HashTableValue JSSVGPathSegCurvetoQuadraticSmoothRelPrototypeTableValues[] = |
| 94 | { |
| 95 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegCurvetoQuadraticSmoothRelConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGPathSegCurvetoQuadraticSmoothRelConstructor) } }, |
| 96 | { "x" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegCurvetoQuadraticSmoothRelX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGPathSegCurvetoQuadraticSmoothRelX) } }, |
| 97 | { "y" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegCurvetoQuadraticSmoothRelY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGPathSegCurvetoQuadraticSmoothRelY) } }, |
| 98 | }; |
| 99 | |
| 100 | const ClassInfo JSSVGPathSegCurvetoQuadraticSmoothRelPrototype::s_info = { "SVGPathSegCurvetoQuadraticSmoothRelPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPathSegCurvetoQuadraticSmoothRelPrototype) }; |
| 101 | |
| 102 | void JSSVGPathSegCurvetoQuadraticSmoothRelPrototype::finishCreation(VM& vm) |
| 103 | { |
| 104 | Base::finishCreation(vm); |
| 105 | reifyStaticProperties(vm, JSSVGPathSegCurvetoQuadraticSmoothRel::info(), JSSVGPathSegCurvetoQuadraticSmoothRelPrototypeTableValues, *this); |
| 106 | } |
| 107 | |
| 108 | const ClassInfo JSSVGPathSegCurvetoQuadraticSmoothRel::s_info = { "SVGPathSegCurvetoQuadraticSmoothRel" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGPathSegCurvetoQuadraticSmoothRel) }; |
| 109 | |
| 110 | JSSVGPathSegCurvetoQuadraticSmoothRel::JSSVGPathSegCurvetoQuadraticSmoothRel(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGPathSegCurvetoQuadraticSmoothRel>&& impl) |
| 111 | : JSSVGPathSeg(structure, globalObject, WTFMove(impl)) |
| 112 | { |
| 113 | } |
| 114 | |
| 115 | void JSSVGPathSegCurvetoQuadraticSmoothRel::finishCreation(VM& vm) |
| 116 | { |
| 117 | Base::finishCreation(vm); |
| 118 | ASSERT(inherits(vm, info())); |
| 119 | |
| 120 | } |
| 121 | |
| 122 | JSObject* JSSVGPathSegCurvetoQuadraticSmoothRel::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 123 | { |
| 124 | return JSSVGPathSegCurvetoQuadraticSmoothRelPrototype::create(vm, &globalObject, JSSVGPathSegCurvetoQuadraticSmoothRelPrototype::createStructure(vm, &globalObject, JSSVGPathSeg::prototype(vm, globalObject))); |
| 125 | } |
| 126 | |
| 127 | JSObject* JSSVGPathSegCurvetoQuadraticSmoothRel::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 128 | { |
| 129 | return getDOMPrototype<JSSVGPathSegCurvetoQuadraticSmoothRel>(vm, globalObject); |
| 130 | } |
| 131 | |
| 132 | JSValue JSSVGPathSegCurvetoQuadraticSmoothRel::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| 133 | { |
| 134 | return getDOMConstructor<JSSVGPathSegCurvetoQuadraticSmoothRelConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| 135 | } |
| 136 | |
| 137 | template<> inline JSSVGPathSegCurvetoQuadraticSmoothRel* IDLAttribute<JSSVGPathSegCurvetoQuadraticSmoothRel>::cast(ExecState& state, EncodedJSValue thisValue) |
| 138 | { |
| 139 | return jsDynamicCast<JSSVGPathSegCurvetoQuadraticSmoothRel*>(state.vm(), JSValue::decode(thisValue)); |
| 140 | } |
| 141 | |
| 142 | EncodedJSValue jsSVGPathSegCurvetoQuadraticSmoothRelConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 143 | { |
| 144 | VM& vm = state->vm(); |
| 145 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 146 | auto* prototype = jsDynamicCast<JSSVGPathSegCurvetoQuadraticSmoothRelPrototype*>(vm, JSValue::decode(thisValue)); |
| 147 | if (UNLIKELY(!prototype)) |
| 148 | return throwVMTypeError(state, throwScope); |
| 149 | return JSValue::encode(JSSVGPathSegCurvetoQuadraticSmoothRel::getConstructor(state->vm(), prototype->globalObject())); |
| 150 | } |
| 151 | |
| 152 | bool setJSSVGPathSegCurvetoQuadraticSmoothRelConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 153 | { |
| 154 | VM& vm = state->vm(); |
| 155 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 156 | auto* prototype = jsDynamicCast<JSSVGPathSegCurvetoQuadraticSmoothRelPrototype*>(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 | |
| 165 | static inline JSValue jsSVGPathSegCurvetoQuadraticSmoothRelXGetter(ExecState& state, JSSVGPathSegCurvetoQuadraticSmoothRel& 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 | |
| 174 | EncodedJSValue jsSVGPathSegCurvetoQuadraticSmoothRelX(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 175 | { |
| 176 | return IDLAttribute<JSSVGPathSegCurvetoQuadraticSmoothRel>::get<jsSVGPathSegCurvetoQuadraticSmoothRelXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "x" ); |
| 177 | } |
| 178 | |
| 179 | static inline bool setJSSVGPathSegCurvetoQuadraticSmoothRelXSetter(ExecState& state, JSSVGPathSegCurvetoQuadraticSmoothRel& 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 | |
| 191 | bool setJSSVGPathSegCurvetoQuadraticSmoothRelX(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 192 | { |
| 193 | return IDLAttribute<JSSVGPathSegCurvetoQuadraticSmoothRel>::set<setJSSVGPathSegCurvetoQuadraticSmoothRelXSetter>(*state, thisValue, encodedValue, "x" ); |
| 194 | } |
| 195 | |
| 196 | static inline JSValue jsSVGPathSegCurvetoQuadraticSmoothRelYGetter(ExecState& state, JSSVGPathSegCurvetoQuadraticSmoothRel& 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 | |
| 205 | EncodedJSValue jsSVGPathSegCurvetoQuadraticSmoothRelY(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 206 | { |
| 207 | return IDLAttribute<JSSVGPathSegCurvetoQuadraticSmoothRel>::get<jsSVGPathSegCurvetoQuadraticSmoothRelYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "y" ); |
| 208 | } |
| 209 | |
| 210 | static inline bool setJSSVGPathSegCurvetoQuadraticSmoothRelYSetter(ExecState& state, JSSVGPathSegCurvetoQuadraticSmoothRel& 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 | |
| 222 | bool setJSSVGPathSegCurvetoQuadraticSmoothRelY(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 223 | { |
| 224 | return IDLAttribute<JSSVGPathSegCurvetoQuadraticSmoothRel>::set<setJSSVGPathSegCurvetoQuadraticSmoothRelYSetter>(*state, thisValue, encodedValue, "y" ); |
| 225 | } |
| 226 | |
| 227 | void JSSVGPathSegCurvetoQuadraticSmoothRel::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
| 228 | { |
| 229 | auto* thisObject = jsCast<JSSVGPathSegCurvetoQuadraticSmoothRel*>(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 | |