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