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 "JSSVGMissingGlyphElement.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 jsSVGMissingGlyphElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
45 | bool setJSSVGMissingGlyphElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
46 | |
47 | class JSSVGMissingGlyphElementPrototype : public JSC::JSNonFinalObject { |
48 | public: |
49 | using Base = JSC::JSNonFinalObject; |
50 | static JSSVGMissingGlyphElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
51 | { |
52 | JSSVGMissingGlyphElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGMissingGlyphElementPrototype>(vm.heap)) JSSVGMissingGlyphElementPrototype(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 | JSSVGMissingGlyphElementPrototype(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 JSSVGMissingGlyphElementConstructor = JSDOMConstructorNotConstructable<JSSVGMissingGlyphElement>; |
73 | |
74 | template<> JSValue JSSVGMissingGlyphElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
75 | { |
76 | return JSSVGElement::getConstructor(vm, &globalObject); |
77 | } |
78 | |
79 | template<> void JSSVGMissingGlyphElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
80 | { |
81 | putDirect(vm, vm.propertyNames->prototype, JSSVGMissingGlyphElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
82 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGMissingGlyphElement"_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 JSSVGMissingGlyphElementConstructor::s_info = { "SVGMissingGlyphElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGMissingGlyphElementConstructor) }; |
87 | |
88 | /* Hash table for prototype */ |
89 | |
90 | static const HashTableValue JSSVGMissingGlyphElementPrototypeTableValues[] = |
91 | { |
92 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGMissingGlyphElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGMissingGlyphElementConstructor) } }, |
93 | }; |
94 | |
95 | const ClassInfo JSSVGMissingGlyphElementPrototype::s_info = { "SVGMissingGlyphElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGMissingGlyphElementPrototype) }; |
96 | |
97 | void JSSVGMissingGlyphElementPrototype::finishCreation(VM& vm) |
98 | { |
99 | Base::finishCreation(vm); |
100 | reifyStaticProperties(vm, JSSVGMissingGlyphElement::info(), JSSVGMissingGlyphElementPrototypeTableValues, *this); |
101 | } |
102 | |
103 | const ClassInfo JSSVGMissingGlyphElement::s_info = { "SVGMissingGlyphElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGMissingGlyphElement) }; |
104 | |
105 | JSSVGMissingGlyphElement::JSSVGMissingGlyphElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGMissingGlyphElement>&& impl) |
106 | : JSSVGElement(structure, globalObject, WTFMove(impl)) |
107 | { |
108 | } |
109 | |
110 | void JSSVGMissingGlyphElement::finishCreation(VM& vm) |
111 | { |
112 | Base::finishCreation(vm); |
113 | ASSERT(inherits(vm, info())); |
114 | |
115 | } |
116 | |
117 | JSObject* JSSVGMissingGlyphElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
118 | { |
119 | return JSSVGMissingGlyphElementPrototype::create(vm, &globalObject, JSSVGMissingGlyphElementPrototype::createStructure(vm, &globalObject, JSSVGElement::prototype(vm, globalObject))); |
120 | } |
121 | |
122 | JSObject* JSSVGMissingGlyphElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
123 | { |
124 | return getDOMPrototype<JSSVGMissingGlyphElement>(vm, globalObject); |
125 | } |
126 | |
127 | JSValue JSSVGMissingGlyphElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
128 | { |
129 | return getDOMConstructor<JSSVGMissingGlyphElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
130 | } |
131 | |
132 | EncodedJSValue jsSVGMissingGlyphElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
133 | { |
134 | VM& vm = state->vm(); |
135 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
136 | auto* prototype = jsDynamicCast<JSSVGMissingGlyphElementPrototype*>(vm, JSValue::decode(thisValue)); |
137 | if (UNLIKELY(!prototype)) |
138 | return throwVMTypeError(state, throwScope); |
139 | return JSValue::encode(JSSVGMissingGlyphElement::getConstructor(state->vm(), prototype->globalObject())); |
140 | } |
141 | |
142 | bool setJSSVGMissingGlyphElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
143 | { |
144 | VM& vm = state->vm(); |
145 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
146 | auto* prototype = jsDynamicCast<JSSVGMissingGlyphElementPrototype*>(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 JSSVGMissingGlyphElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
156 | { |
157 | auto* thisObject = jsCast<JSSVGMissingGlyphElement*>(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 | |