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 "JSSVGFEDistantLightElement.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 "JSSVGAnimatedNumber.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 jsSVGFEDistantLightElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
46 | bool setJSSVGFEDistantLightElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
47 | JSC::EncodedJSValue jsSVGFEDistantLightElementAzimuth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
48 | JSC::EncodedJSValue jsSVGFEDistantLightElementElevation(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
49 | |
50 | class JSSVGFEDistantLightElementPrototype : public JSC::JSNonFinalObject { |
51 | public: |
52 | using Base = JSC::JSNonFinalObject; |
53 | static JSSVGFEDistantLightElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
54 | { |
55 | JSSVGFEDistantLightElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGFEDistantLightElementPrototype>(vm.heap)) JSSVGFEDistantLightElementPrototype(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 | JSSVGFEDistantLightElementPrototype(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 JSSVGFEDistantLightElementConstructor = JSDOMConstructorNotConstructable<JSSVGFEDistantLightElement>; |
76 | |
77 | template<> JSValue JSSVGFEDistantLightElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
78 | { |
79 | return JSSVGElement::getConstructor(vm, &globalObject); |
80 | } |
81 | |
82 | template<> void JSSVGFEDistantLightElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
83 | { |
84 | putDirect(vm, vm.propertyNames->prototype, JSSVGFEDistantLightElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
85 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGFEDistantLightElement"_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 JSSVGFEDistantLightElementConstructor::s_info = { "SVGFEDistantLightElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFEDistantLightElementConstructor) }; |
90 | |
91 | /* Hash table for prototype */ |
92 | |
93 | static const HashTableValue JSSVGFEDistantLightElementPrototypeTableValues[] = |
94 | { |
95 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEDistantLightElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGFEDistantLightElementConstructor) } }, |
96 | { "azimuth" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEDistantLightElementAzimuth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
97 | { "elevation" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEDistantLightElementElevation), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
98 | }; |
99 | |
100 | const ClassInfo JSSVGFEDistantLightElementPrototype::s_info = { "SVGFEDistantLightElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFEDistantLightElementPrototype) }; |
101 | |
102 | void JSSVGFEDistantLightElementPrototype::finishCreation(VM& vm) |
103 | { |
104 | Base::finishCreation(vm); |
105 | reifyStaticProperties(vm, JSSVGFEDistantLightElement::info(), JSSVGFEDistantLightElementPrototypeTableValues, *this); |
106 | } |
107 | |
108 | const ClassInfo JSSVGFEDistantLightElement::s_info = { "SVGFEDistantLightElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFEDistantLightElement) }; |
109 | |
110 | JSSVGFEDistantLightElement::JSSVGFEDistantLightElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGFEDistantLightElement>&& impl) |
111 | : JSSVGElement(structure, globalObject, WTFMove(impl)) |
112 | { |
113 | } |
114 | |
115 | void JSSVGFEDistantLightElement::finishCreation(VM& vm) |
116 | { |
117 | Base::finishCreation(vm); |
118 | ASSERT(inherits(vm, info())); |
119 | |
120 | } |
121 | |
122 | JSObject* JSSVGFEDistantLightElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
123 | { |
124 | return JSSVGFEDistantLightElementPrototype::create(vm, &globalObject, JSSVGFEDistantLightElementPrototype::createStructure(vm, &globalObject, JSSVGElement::prototype(vm, globalObject))); |
125 | } |
126 | |
127 | JSObject* JSSVGFEDistantLightElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
128 | { |
129 | return getDOMPrototype<JSSVGFEDistantLightElement>(vm, globalObject); |
130 | } |
131 | |
132 | JSValue JSSVGFEDistantLightElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
133 | { |
134 | return getDOMConstructor<JSSVGFEDistantLightElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
135 | } |
136 | |
137 | template<> inline JSSVGFEDistantLightElement* IDLAttribute<JSSVGFEDistantLightElement>::cast(ExecState& state, EncodedJSValue thisValue) |
138 | { |
139 | return jsDynamicCast<JSSVGFEDistantLightElement*>(state.vm(), JSValue::decode(thisValue)); |
140 | } |
141 | |
142 | EncodedJSValue jsSVGFEDistantLightElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
143 | { |
144 | VM& vm = state->vm(); |
145 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
146 | auto* prototype = jsDynamicCast<JSSVGFEDistantLightElementPrototype*>(vm, JSValue::decode(thisValue)); |
147 | if (UNLIKELY(!prototype)) |
148 | return throwVMTypeError(state, throwScope); |
149 | return JSValue::encode(JSSVGFEDistantLightElement::getConstructor(state->vm(), prototype->globalObject())); |
150 | } |
151 | |
152 | bool setJSSVGFEDistantLightElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
153 | { |
154 | VM& vm = state->vm(); |
155 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
156 | auto* prototype = jsDynamicCast<JSSVGFEDistantLightElementPrototype*>(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 jsSVGFEDistantLightElementAzimuthGetter(ExecState& state, JSSVGFEDistantLightElement& thisObject, ThrowScope& throwScope) |
166 | { |
167 | UNUSED_PARAM(throwScope); |
168 | UNUSED_PARAM(state); |
169 | auto& impl = thisObject.wrapped(); |
170 | JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.azimuthAnimated()); |
171 | return result; |
172 | } |
173 | |
174 | EncodedJSValue jsSVGFEDistantLightElementAzimuth(ExecState* state, EncodedJSValue thisValue, PropertyName) |
175 | { |
176 | return IDLAttribute<JSSVGFEDistantLightElement>::get<jsSVGFEDistantLightElementAzimuthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "azimuth" ); |
177 | } |
178 | |
179 | static inline JSValue jsSVGFEDistantLightElementElevationGetter(ExecState& state, JSSVGFEDistantLightElement& thisObject, ThrowScope& throwScope) |
180 | { |
181 | UNUSED_PARAM(throwScope); |
182 | UNUSED_PARAM(state); |
183 | auto& impl = thisObject.wrapped(); |
184 | JSValue result = toJS<IDLInterface<SVGAnimatedNumber>>(state, *thisObject.globalObject(), throwScope, impl.elevationAnimated()); |
185 | return result; |
186 | } |
187 | |
188 | EncodedJSValue jsSVGFEDistantLightElementElevation(ExecState* state, EncodedJSValue thisValue, PropertyName) |
189 | { |
190 | return IDLAttribute<JSSVGFEDistantLightElement>::get<jsSVGFEDistantLightElementElevationGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "elevation" ); |
191 | } |
192 | |
193 | void JSSVGFEDistantLightElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
194 | { |
195 | auto* thisObject = jsCast<JSSVGFEDistantLightElement*>(cell); |
196 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
197 | if (thisObject->scriptExecutionContext()) |
198 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
199 | Base::heapSnapshot(cell, builder); |
200 | } |
201 | |
202 | |
203 | } |
204 | |