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