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 "JSSVGFEColorMatrixElement.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 "JSSVGAnimatedEnumeration.h"
32#include "JSSVGAnimatedLength.h"
33#include "JSSVGAnimatedNumberList.h"
34#include "JSSVGAnimatedString.h"
35#include "ScriptExecutionContext.h"
36#include <JavaScriptCore/HeapSnapshotBuilder.h>
37#include <JavaScriptCore/JSCInlines.h>
38#include <wtf/GetPtr.h>
39#include <wtf/PointerPreparations.h>
40#include <wtf/URL.h>
41
42
43namespace WebCore {
44using namespace JSC;
45
46// Attributes
47
48JSC::EncodedJSValue jsSVGFEColorMatrixElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
49bool setJSSVGFEColorMatrixElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
50JSC::EncodedJSValue jsSVGFEColorMatrixElementIn1(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
51JSC::EncodedJSValue jsSVGFEColorMatrixElementType(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
52JSC::EncodedJSValue jsSVGFEColorMatrixElementValues(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
53JSC::EncodedJSValue jsSVGFEColorMatrixElementX(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
54JSC::EncodedJSValue jsSVGFEColorMatrixElementY(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
55JSC::EncodedJSValue jsSVGFEColorMatrixElementWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
56JSC::EncodedJSValue jsSVGFEColorMatrixElementHeight(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
57JSC::EncodedJSValue jsSVGFEColorMatrixElementResult(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
58
59class JSSVGFEColorMatrixElementPrototype : public JSC::JSNonFinalObject {
60public:
61 using Base = JSC::JSNonFinalObject;
62 static JSSVGFEColorMatrixElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
63 {
64 JSSVGFEColorMatrixElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGFEColorMatrixElementPrototype>(vm.heap)) JSSVGFEColorMatrixElementPrototype(vm, globalObject, structure);
65 ptr->finishCreation(vm);
66 return ptr;
67 }
68
69 DECLARE_INFO;
70 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
71 {
72 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
73 }
74
75private:
76 JSSVGFEColorMatrixElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
77 : JSC::JSNonFinalObject(vm, structure)
78 {
79 }
80
81 void finishCreation(JSC::VM&);
82};
83
84using JSSVGFEColorMatrixElementConstructor = JSDOMConstructorNotConstructable<JSSVGFEColorMatrixElement>;
85
86/* Hash table for constructor */
87
88static const HashTableValue JSSVGFEColorMatrixElementConstructorTableValues[] =
89{
90 { "SVG_FECOLORMATRIX_TYPE_UNKNOWN", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0) } },
91 { "SVG_FECOLORMATRIX_TYPE_MATRIX", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } },
92 { "SVG_FECOLORMATRIX_TYPE_SATURATE", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(2) } },
93 { "SVG_FECOLORMATRIX_TYPE_HUEROTATE", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(3) } },
94 { "SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(4) } },
95};
96
97template<> JSValue JSSVGFEColorMatrixElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
98{
99 return JSSVGElement::getConstructor(vm, &globalObject);
100}
101
102template<> void JSSVGFEColorMatrixElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
103{
104 putDirect(vm, vm.propertyNames->prototype, JSSVGFEColorMatrixElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
105 putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGFEColorMatrixElement"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
106 putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
107 reifyStaticProperties(vm, JSSVGFEColorMatrixElement::info(), JSSVGFEColorMatrixElementConstructorTableValues, *this);
108}
109
110template<> const ClassInfo JSSVGFEColorMatrixElementConstructor::s_info = { "SVGFEColorMatrixElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFEColorMatrixElementConstructor) };
111
112/* Hash table for prototype */
113
114static const HashTableValue JSSVGFEColorMatrixElementPrototypeTableValues[] =
115{
116 { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEColorMatrixElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGFEColorMatrixElementConstructor) } },
117 { "in1", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEColorMatrixElementIn1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
118 { "type", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEColorMatrixElementType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
119 { "values", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEColorMatrixElementValues), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
120 { "x", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEColorMatrixElementX), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
121 { "y", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEColorMatrixElementY), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
122 { "width", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEColorMatrixElementWidth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
123 { "height", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEColorMatrixElementHeight), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
124 { "result", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEColorMatrixElementResult), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
125 { "SVG_FECOLORMATRIX_TYPE_UNKNOWN", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0) } },
126 { "SVG_FECOLORMATRIX_TYPE_MATRIX", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } },
127 { "SVG_FECOLORMATRIX_TYPE_SATURATE", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(2) } },
128 { "SVG_FECOLORMATRIX_TYPE_HUEROTATE", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(3) } },
129 { "SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(4) } },
130};
131
132const ClassInfo JSSVGFEColorMatrixElementPrototype::s_info = { "SVGFEColorMatrixElementPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFEColorMatrixElementPrototype) };
133
134void JSSVGFEColorMatrixElementPrototype::finishCreation(VM& vm)
135{
136 Base::finishCreation(vm);
137 reifyStaticProperties(vm, JSSVGFEColorMatrixElement::info(), JSSVGFEColorMatrixElementPrototypeTableValues, *this);
138}
139
140const ClassInfo JSSVGFEColorMatrixElement::s_info = { "SVGFEColorMatrixElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGFEColorMatrixElement) };
141
142JSSVGFEColorMatrixElement::JSSVGFEColorMatrixElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGFEColorMatrixElement>&& impl)
143 : JSSVGElement(structure, globalObject, WTFMove(impl))
144{
145}
146
147void JSSVGFEColorMatrixElement::finishCreation(VM& vm)
148{
149 Base::finishCreation(vm);
150 ASSERT(inherits(vm, info()));
151
152}
153
154JSObject* JSSVGFEColorMatrixElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
155{
156 return JSSVGFEColorMatrixElementPrototype::create(vm, &globalObject, JSSVGFEColorMatrixElementPrototype::createStructure(vm, &globalObject, JSSVGElement::prototype(vm, globalObject)));
157}
158
159JSObject* JSSVGFEColorMatrixElement::prototype(VM& vm, JSDOMGlobalObject& globalObject)
160{
161 return getDOMPrototype<JSSVGFEColorMatrixElement>(vm, globalObject);
162}
163
164JSValue JSSVGFEColorMatrixElement::getConstructor(VM& vm, const JSGlobalObject* globalObject)
165{
166 return getDOMConstructor<JSSVGFEColorMatrixElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
167}
168
169template<> inline JSSVGFEColorMatrixElement* IDLAttribute<JSSVGFEColorMatrixElement>::cast(ExecState& state, EncodedJSValue thisValue)
170{
171 return jsDynamicCast<JSSVGFEColorMatrixElement*>(state.vm(), JSValue::decode(thisValue));
172}
173
174EncodedJSValue jsSVGFEColorMatrixElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
175{
176 VM& vm = state->vm();
177 auto throwScope = DECLARE_THROW_SCOPE(vm);
178 auto* prototype = jsDynamicCast<JSSVGFEColorMatrixElementPrototype*>(vm, JSValue::decode(thisValue));
179 if (UNLIKELY(!prototype))
180 return throwVMTypeError(state, throwScope);
181 return JSValue::encode(JSSVGFEColorMatrixElement::getConstructor(state->vm(), prototype->globalObject()));
182}
183
184bool setJSSVGFEColorMatrixElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
185{
186 VM& vm = state->vm();
187 auto throwScope = DECLARE_THROW_SCOPE(vm);
188 auto* prototype = jsDynamicCast<JSSVGFEColorMatrixElementPrototype*>(vm, JSValue::decode(thisValue));
189 if (UNLIKELY(!prototype)) {
190 throwVMTypeError(state, throwScope);
191 return false;
192 }
193 // Shadowing a built-in constructor
194 return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
195}
196
197static inline JSValue jsSVGFEColorMatrixElementIn1Getter(ExecState& state, JSSVGFEColorMatrixElement& thisObject, ThrowScope& throwScope)
198{
199 UNUSED_PARAM(throwScope);
200 UNUSED_PARAM(state);
201 auto& impl = thisObject.wrapped();
202 JSValue result = toJS<IDLInterface<SVGAnimatedString>>(state, *thisObject.globalObject(), throwScope, impl.in1Animated());
203 return result;
204}
205
206EncodedJSValue jsSVGFEColorMatrixElementIn1(ExecState* state, EncodedJSValue thisValue, PropertyName)
207{
208 return IDLAttribute<JSSVGFEColorMatrixElement>::get<jsSVGFEColorMatrixElementIn1Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "in1");
209}
210
211static inline JSValue jsSVGFEColorMatrixElementTypeGetter(ExecState& state, JSSVGFEColorMatrixElement& thisObject, ThrowScope& throwScope)
212{
213 UNUSED_PARAM(throwScope);
214 UNUSED_PARAM(state);
215 auto& impl = thisObject.wrapped();
216 JSValue result = toJS<IDLInterface<SVGAnimatedEnumeration>>(state, *thisObject.globalObject(), throwScope, impl.typeAnimated());
217 return result;
218}
219
220EncodedJSValue jsSVGFEColorMatrixElementType(ExecState* state, EncodedJSValue thisValue, PropertyName)
221{
222 return IDLAttribute<JSSVGFEColorMatrixElement>::get<jsSVGFEColorMatrixElementTypeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "type");
223}
224
225static inline JSValue jsSVGFEColorMatrixElementValuesGetter(ExecState& state, JSSVGFEColorMatrixElement& thisObject, ThrowScope& throwScope)
226{
227 UNUSED_PARAM(throwScope);
228 UNUSED_PARAM(state);
229 auto& impl = thisObject.wrapped();
230 JSValue result = toJS<IDLInterface<SVGAnimatedNumberList>>(state, *thisObject.globalObject(), throwScope, impl.valuesAnimated());
231 return result;
232}
233
234EncodedJSValue jsSVGFEColorMatrixElementValues(ExecState* state, EncodedJSValue thisValue, PropertyName)
235{
236 return IDLAttribute<JSSVGFEColorMatrixElement>::get<jsSVGFEColorMatrixElementValuesGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "values");
237}
238
239static inline JSValue jsSVGFEColorMatrixElementXGetter(ExecState& state, JSSVGFEColorMatrixElement& thisObject, ThrowScope& throwScope)
240{
241 UNUSED_PARAM(throwScope);
242 UNUSED_PARAM(state);
243 auto& impl = thisObject.wrapped();
244 JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.xAnimated());
245 return result;
246}
247
248EncodedJSValue jsSVGFEColorMatrixElementX(ExecState* state, EncodedJSValue thisValue, PropertyName)
249{
250 return IDLAttribute<JSSVGFEColorMatrixElement>::get<jsSVGFEColorMatrixElementXGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "x");
251}
252
253static inline JSValue jsSVGFEColorMatrixElementYGetter(ExecState& state, JSSVGFEColorMatrixElement& thisObject, ThrowScope& throwScope)
254{
255 UNUSED_PARAM(throwScope);
256 UNUSED_PARAM(state);
257 auto& impl = thisObject.wrapped();
258 JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.yAnimated());
259 return result;
260}
261
262EncodedJSValue jsSVGFEColorMatrixElementY(ExecState* state, EncodedJSValue thisValue, PropertyName)
263{
264 return IDLAttribute<JSSVGFEColorMatrixElement>::get<jsSVGFEColorMatrixElementYGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "y");
265}
266
267static inline JSValue jsSVGFEColorMatrixElementWidthGetter(ExecState& state, JSSVGFEColorMatrixElement& thisObject, ThrowScope& throwScope)
268{
269 UNUSED_PARAM(throwScope);
270 UNUSED_PARAM(state);
271 auto& impl = thisObject.wrapped();
272 JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.widthAnimated());
273 return result;
274}
275
276EncodedJSValue jsSVGFEColorMatrixElementWidth(ExecState* state, EncodedJSValue thisValue, PropertyName)
277{
278 return IDLAttribute<JSSVGFEColorMatrixElement>::get<jsSVGFEColorMatrixElementWidthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "width");
279}
280
281static inline JSValue jsSVGFEColorMatrixElementHeightGetter(ExecState& state, JSSVGFEColorMatrixElement& thisObject, ThrowScope& throwScope)
282{
283 UNUSED_PARAM(throwScope);
284 UNUSED_PARAM(state);
285 auto& impl = thisObject.wrapped();
286 JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.heightAnimated());
287 return result;
288}
289
290EncodedJSValue jsSVGFEColorMatrixElementHeight(ExecState* state, EncodedJSValue thisValue, PropertyName)
291{
292 return IDLAttribute<JSSVGFEColorMatrixElement>::get<jsSVGFEColorMatrixElementHeightGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "height");
293}
294
295static inline JSValue jsSVGFEColorMatrixElementResultGetter(ExecState& state, JSSVGFEColorMatrixElement& thisObject, ThrowScope& throwScope)
296{
297 UNUSED_PARAM(throwScope);
298 UNUSED_PARAM(state);
299 auto& impl = thisObject.wrapped();
300 JSValue result = toJS<IDLInterface<SVGAnimatedString>>(state, *thisObject.globalObject(), throwScope, impl.resultAnimated());
301 return result;
302}
303
304EncodedJSValue jsSVGFEColorMatrixElementResult(ExecState* state, EncodedJSValue thisValue, PropertyName)
305{
306 return IDLAttribute<JSSVGFEColorMatrixElement>::get<jsSVGFEColorMatrixElementResultGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "result");
307}
308
309void JSSVGFEColorMatrixElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
310{
311 auto* thisObject = jsCast<JSSVGFEColorMatrixElement*>(cell);
312 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
313 if (thisObject->scriptExecutionContext())
314 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
315 Base::heapSnapshot(cell, builder);
316}
317
318
319}
320