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