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 "JSSVGTextContentElement.h"
23
24#include "JSDOMAttribute.h"
25#include "JSDOMBinding.h"
26#include "JSDOMConstructorNotConstructable.h"
27#include "JSDOMConvertDictionary.h"
28#include "JSDOMConvertInterface.h"
29#include "JSDOMConvertNumbers.h"
30#include "JSDOMExceptionHandling.h"
31#include "JSDOMGlobalObject.h"
32#include "JSDOMOperation.h"
33#include "JSDOMPointInit.h"
34#include "JSDOMWrapperCache.h"
35#include "JSSVGAnimatedBoolean.h"
36#include "JSSVGAnimatedEnumeration.h"
37#include "JSSVGAnimatedLength.h"
38#include "JSSVGPoint.h"
39#include "JSSVGRect.h"
40#include "ScriptExecutionContext.h"
41#include <JavaScriptCore/HeapSnapshotBuilder.h>
42#include <JavaScriptCore/JSCInlines.h>
43#include <wtf/GetPtr.h>
44#include <wtf/PointerPreparations.h>
45#include <wtf/URL.h>
46
47
48namespace WebCore {
49using namespace JSC;
50
51// Functions
52
53JSC::EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetNumberOfChars(JSC::ExecState*);
54JSC::EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetComputedTextLength(JSC::ExecState*);
55JSC::EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetSubStringLength(JSC::ExecState*);
56JSC::EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetStartPositionOfChar(JSC::ExecState*);
57JSC::EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetEndPositionOfChar(JSC::ExecState*);
58JSC::EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetExtentOfChar(JSC::ExecState*);
59JSC::EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetRotationOfChar(JSC::ExecState*);
60JSC::EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetCharNumAtPosition(JSC::ExecState*);
61JSC::EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionSelectSubString(JSC::ExecState*);
62
63// Attributes
64
65JSC::EncodedJSValue jsSVGTextContentElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
66bool setJSSVGTextContentElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
67JSC::EncodedJSValue jsSVGTextContentElementTextLength(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
68JSC::EncodedJSValue jsSVGTextContentElementLengthAdjust(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
69JSC::EncodedJSValue jsSVGTextContentElementExternalResourcesRequired(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
70
71class JSSVGTextContentElementPrototype : public JSC::JSNonFinalObject {
72public:
73 using Base = JSC::JSNonFinalObject;
74 static JSSVGTextContentElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
75 {
76 JSSVGTextContentElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGTextContentElementPrototype>(vm.heap)) JSSVGTextContentElementPrototype(vm, globalObject, structure);
77 ptr->finishCreation(vm);
78 return ptr;
79 }
80
81 DECLARE_INFO;
82 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
83 {
84 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
85 }
86
87private:
88 JSSVGTextContentElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
89 : JSC::JSNonFinalObject(vm, structure)
90 {
91 }
92
93 void finishCreation(JSC::VM&);
94};
95
96using JSSVGTextContentElementConstructor = JSDOMConstructorNotConstructable<JSSVGTextContentElement>;
97
98/* Hash table for constructor */
99
100static const HashTableValue JSSVGTextContentElementConstructorTableValues[] =
101{
102 { "LENGTHADJUST_UNKNOWN", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0) } },
103 { "LENGTHADJUST_SPACING", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } },
104 { "LENGTHADJUST_SPACINGANDGLYPHS", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(2) } },
105};
106
107static_assert(SVGTextContentElement::LENGTHADJUST_UNKNOWN == 0, "LENGTHADJUST_UNKNOWN in SVGTextContentElement does not match value from IDL");
108static_assert(SVGTextContentElement::LENGTHADJUST_SPACING == 1, "LENGTHADJUST_SPACING in SVGTextContentElement does not match value from IDL");
109static_assert(SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS == 2, "LENGTHADJUST_SPACINGANDGLYPHS in SVGTextContentElement does not match value from IDL");
110
111template<> JSValue JSSVGTextContentElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
112{
113 return JSSVGGraphicsElement::getConstructor(vm, &globalObject);
114}
115
116template<> void JSSVGTextContentElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
117{
118 putDirect(vm, vm.propertyNames->prototype, JSSVGTextContentElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
119 putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGTextContentElement"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
120 putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
121 reifyStaticProperties(vm, JSSVGTextContentElement::info(), JSSVGTextContentElementConstructorTableValues, *this);
122}
123
124template<> const ClassInfo JSSVGTextContentElementConstructor::s_info = { "SVGTextContentElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGTextContentElementConstructor) };
125
126/* Hash table for prototype */
127
128static const HashTableValue JSSVGTextContentElementPrototypeTableValues[] =
129{
130 { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGTextContentElementConstructor) } },
131 { "textLength", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementTextLength), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
132 { "lengthAdjust", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementLengthAdjust), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
133 { "externalResourcesRequired", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementExternalResourcesRequired), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
134 { "getNumberOfChars", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGTextContentElementPrototypeFunctionGetNumberOfChars), (intptr_t) (0) } },
135 { "getComputedTextLength", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGTextContentElementPrototypeFunctionGetComputedTextLength), (intptr_t) (0) } },
136 { "getSubStringLength", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGTextContentElementPrototypeFunctionGetSubStringLength), (intptr_t) (0) } },
137 { "getStartPositionOfChar", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGTextContentElementPrototypeFunctionGetStartPositionOfChar), (intptr_t) (0) } },
138 { "getEndPositionOfChar", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGTextContentElementPrototypeFunctionGetEndPositionOfChar), (intptr_t) (0) } },
139 { "getExtentOfChar", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGTextContentElementPrototypeFunctionGetExtentOfChar), (intptr_t) (0) } },
140 { "getRotationOfChar", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGTextContentElementPrototypeFunctionGetRotationOfChar), (intptr_t) (0) } },
141 { "getCharNumAtPosition", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGTextContentElementPrototypeFunctionGetCharNumAtPosition), (intptr_t) (1) } },
142 { "selectSubString", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGTextContentElementPrototypeFunctionSelectSubString), (intptr_t) (0) } },
143 { "LENGTHADJUST_UNKNOWN", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0) } },
144 { "LENGTHADJUST_SPACING", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } },
145 { "LENGTHADJUST_SPACINGANDGLYPHS", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(2) } },
146};
147
148const ClassInfo JSSVGTextContentElementPrototype::s_info = { "SVGTextContentElementPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGTextContentElementPrototype) };
149
150void JSSVGTextContentElementPrototype::finishCreation(VM& vm)
151{
152 Base::finishCreation(vm);
153 reifyStaticProperties(vm, JSSVGTextContentElement::info(), JSSVGTextContentElementPrototypeTableValues, *this);
154}
155
156const ClassInfo JSSVGTextContentElement::s_info = { "SVGTextContentElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGTextContentElement) };
157
158JSSVGTextContentElement::JSSVGTextContentElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGTextContentElement>&& impl)
159 : JSSVGGraphicsElement(structure, globalObject, WTFMove(impl))
160{
161}
162
163void JSSVGTextContentElement::finishCreation(VM& vm)
164{
165 Base::finishCreation(vm);
166 ASSERT(inherits(vm, info()));
167
168}
169
170JSObject* JSSVGTextContentElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
171{
172 return JSSVGTextContentElementPrototype::create(vm, &globalObject, JSSVGTextContentElementPrototype::createStructure(vm, &globalObject, JSSVGGraphicsElement::prototype(vm, globalObject)));
173}
174
175JSObject* JSSVGTextContentElement::prototype(VM& vm, JSDOMGlobalObject& globalObject)
176{
177 return getDOMPrototype<JSSVGTextContentElement>(vm, globalObject);
178}
179
180JSValue JSSVGTextContentElement::getConstructor(VM& vm, const JSGlobalObject* globalObject)
181{
182 return getDOMConstructor<JSSVGTextContentElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
183}
184
185template<> inline JSSVGTextContentElement* IDLAttribute<JSSVGTextContentElement>::cast(ExecState& state, EncodedJSValue thisValue)
186{
187 return jsDynamicCast<JSSVGTextContentElement*>(state.vm(), JSValue::decode(thisValue));
188}
189
190template<> inline JSSVGTextContentElement* IDLOperation<JSSVGTextContentElement>::cast(ExecState& state)
191{
192 return jsDynamicCast<JSSVGTextContentElement*>(state.vm(), state.thisValue());
193}
194
195EncodedJSValue jsSVGTextContentElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
196{
197 VM& vm = state->vm();
198 auto throwScope = DECLARE_THROW_SCOPE(vm);
199 auto* prototype = jsDynamicCast<JSSVGTextContentElementPrototype*>(vm, JSValue::decode(thisValue));
200 if (UNLIKELY(!prototype))
201 return throwVMTypeError(state, throwScope);
202 return JSValue::encode(JSSVGTextContentElement::getConstructor(state->vm(), prototype->globalObject()));
203}
204
205bool setJSSVGTextContentElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
206{
207 VM& vm = state->vm();
208 auto throwScope = DECLARE_THROW_SCOPE(vm);
209 auto* prototype = jsDynamicCast<JSSVGTextContentElementPrototype*>(vm, JSValue::decode(thisValue));
210 if (UNLIKELY(!prototype)) {
211 throwVMTypeError(state, throwScope);
212 return false;
213 }
214 // Shadowing a built-in constructor
215 return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
216}
217
218static inline JSValue jsSVGTextContentElementTextLengthGetter(ExecState& state, JSSVGTextContentElement& thisObject, ThrowScope& throwScope)
219{
220 UNUSED_PARAM(throwScope);
221 UNUSED_PARAM(state);
222 auto& impl = thisObject.wrapped();
223 JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.textLengthAnimated());
224 return result;
225}
226
227EncodedJSValue jsSVGTextContentElementTextLength(ExecState* state, EncodedJSValue thisValue, PropertyName)
228{
229 return IDLAttribute<JSSVGTextContentElement>::get<jsSVGTextContentElementTextLengthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "textLength");
230}
231
232static inline JSValue jsSVGTextContentElementLengthAdjustGetter(ExecState& state, JSSVGTextContentElement& thisObject, ThrowScope& throwScope)
233{
234 UNUSED_PARAM(throwScope);
235 UNUSED_PARAM(state);
236 auto& impl = thisObject.wrapped();
237 JSValue result = toJS<IDLInterface<SVGAnimatedEnumeration>>(state, *thisObject.globalObject(), throwScope, impl.lengthAdjustAnimated());
238 return result;
239}
240
241EncodedJSValue jsSVGTextContentElementLengthAdjust(ExecState* state, EncodedJSValue thisValue, PropertyName)
242{
243 return IDLAttribute<JSSVGTextContentElement>::get<jsSVGTextContentElementLengthAdjustGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "lengthAdjust");
244}
245
246static inline JSValue jsSVGTextContentElementExternalResourcesRequiredGetter(ExecState& state, JSSVGTextContentElement& thisObject, ThrowScope& throwScope)
247{
248 UNUSED_PARAM(throwScope);
249 UNUSED_PARAM(state);
250 auto& impl = thisObject.wrapped();
251 JSValue result = toJS<IDLInterface<SVGAnimatedBoolean>>(state, *thisObject.globalObject(), throwScope, impl.externalResourcesRequiredAnimated());
252 return result;
253}
254
255EncodedJSValue jsSVGTextContentElementExternalResourcesRequired(ExecState* state, EncodedJSValue thisValue, PropertyName)
256{
257 return IDLAttribute<JSSVGTextContentElement>::get<jsSVGTextContentElementExternalResourcesRequiredGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "externalResourcesRequired");
258}
259
260static inline JSC::EncodedJSValue jsSVGTextContentElementPrototypeFunctionGetNumberOfCharsBody(JSC::ExecState* state, typename IDLOperation<JSSVGTextContentElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
261{
262 UNUSED_PARAM(state);
263 UNUSED_PARAM(throwScope);
264 auto& impl = castedThis->wrapped();
265 return JSValue::encode(toJS<IDLLong>(impl.getNumberOfChars()));
266}
267
268EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetNumberOfChars(ExecState* state)
269{
270 return IDLOperation<JSSVGTextContentElement>::call<jsSVGTextContentElementPrototypeFunctionGetNumberOfCharsBody>(*state, "getNumberOfChars");
271}
272
273static inline JSC::EncodedJSValue jsSVGTextContentElementPrototypeFunctionGetComputedTextLengthBody(JSC::ExecState* state, typename IDLOperation<JSSVGTextContentElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
274{
275 UNUSED_PARAM(state);
276 UNUSED_PARAM(throwScope);
277 auto& impl = castedThis->wrapped();
278 return JSValue::encode(toJS<IDLUnrestrictedFloat>(impl.getComputedTextLength()));
279}
280
281EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetComputedTextLength(ExecState* state)
282{
283 return IDLOperation<JSSVGTextContentElement>::call<jsSVGTextContentElementPrototypeFunctionGetComputedTextLengthBody>(*state, "getComputedTextLength");
284}
285
286static inline JSC::EncodedJSValue jsSVGTextContentElementPrototypeFunctionGetSubStringLengthBody(JSC::ExecState* state, typename IDLOperation<JSSVGTextContentElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
287{
288 UNUSED_PARAM(state);
289 UNUSED_PARAM(throwScope);
290 auto& impl = castedThis->wrapped();
291 auto offset = convert<IDLUnsignedLong>(*state, state->argument(0));
292 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
293 auto length = convert<IDLUnsignedLong>(*state, state->argument(1));
294 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
295 return JSValue::encode(toJS<IDLUnrestrictedFloat>(*state, throwScope, impl.getSubStringLength(WTFMove(offset), WTFMove(length))));
296}
297
298EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetSubStringLength(ExecState* state)
299{
300 return IDLOperation<JSSVGTextContentElement>::call<jsSVGTextContentElementPrototypeFunctionGetSubStringLengthBody>(*state, "getSubStringLength");
301}
302
303static inline JSC::EncodedJSValue jsSVGTextContentElementPrototypeFunctionGetStartPositionOfCharBody(JSC::ExecState* state, typename IDLOperation<JSSVGTextContentElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
304{
305 UNUSED_PARAM(state);
306 UNUSED_PARAM(throwScope);
307 auto& impl = castedThis->wrapped();
308 auto offset = convert<IDLUnsignedLong>(*state, state->argument(0));
309 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
310 return JSValue::encode(toJSNewlyCreated<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), throwScope, impl.getStartPositionOfChar(WTFMove(offset))));
311}
312
313EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetStartPositionOfChar(ExecState* state)
314{
315 return IDLOperation<JSSVGTextContentElement>::call<jsSVGTextContentElementPrototypeFunctionGetStartPositionOfCharBody>(*state, "getStartPositionOfChar");
316}
317
318static inline JSC::EncodedJSValue jsSVGTextContentElementPrototypeFunctionGetEndPositionOfCharBody(JSC::ExecState* state, typename IDLOperation<JSSVGTextContentElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
319{
320 UNUSED_PARAM(state);
321 UNUSED_PARAM(throwScope);
322 auto& impl = castedThis->wrapped();
323 auto offset = convert<IDLUnsignedLong>(*state, state->argument(0));
324 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
325 return JSValue::encode(toJSNewlyCreated<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), throwScope, impl.getEndPositionOfChar(WTFMove(offset))));
326}
327
328EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetEndPositionOfChar(ExecState* state)
329{
330 return IDLOperation<JSSVGTextContentElement>::call<jsSVGTextContentElementPrototypeFunctionGetEndPositionOfCharBody>(*state, "getEndPositionOfChar");
331}
332
333static inline JSC::EncodedJSValue jsSVGTextContentElementPrototypeFunctionGetExtentOfCharBody(JSC::ExecState* state, typename IDLOperation<JSSVGTextContentElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
334{
335 UNUSED_PARAM(state);
336 UNUSED_PARAM(throwScope);
337 auto& impl = castedThis->wrapped();
338 auto offset = convert<IDLUnsignedLong>(*state, state->argument(0));
339 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
340 return JSValue::encode(toJSNewlyCreated<IDLInterface<SVGRect>>(*state, *castedThis->globalObject(), throwScope, impl.getExtentOfChar(WTFMove(offset))));
341}
342
343EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetExtentOfChar(ExecState* state)
344{
345 return IDLOperation<JSSVGTextContentElement>::call<jsSVGTextContentElementPrototypeFunctionGetExtentOfCharBody>(*state, "getExtentOfChar");
346}
347
348static inline JSC::EncodedJSValue jsSVGTextContentElementPrototypeFunctionGetRotationOfCharBody(JSC::ExecState* state, typename IDLOperation<JSSVGTextContentElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
349{
350 UNUSED_PARAM(state);
351 UNUSED_PARAM(throwScope);
352 auto& impl = castedThis->wrapped();
353 auto offset = convert<IDLUnsignedLong>(*state, state->argument(0));
354 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
355 return JSValue::encode(toJS<IDLUnrestrictedFloat>(*state, throwScope, impl.getRotationOfChar(WTFMove(offset))));
356}
357
358EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetRotationOfChar(ExecState* state)
359{
360 return IDLOperation<JSSVGTextContentElement>::call<jsSVGTextContentElementPrototypeFunctionGetRotationOfCharBody>(*state, "getRotationOfChar");
361}
362
363static inline JSC::EncodedJSValue jsSVGTextContentElementPrototypeFunctionGetCharNumAtPositionBody(JSC::ExecState* state, typename IDLOperation<JSSVGTextContentElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
364{
365 UNUSED_PARAM(state);
366 UNUSED_PARAM(throwScope);
367 auto& impl = castedThis->wrapped();
368 if (UNLIKELY(state->argumentCount() < 1))
369 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
370 auto point = convert<IDLDictionary<DOMPointInit>>(*state, state->uncheckedArgument(0));
371 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
372 return JSValue::encode(toJS<IDLLong>(impl.getCharNumAtPosition(WTFMove(point))));
373}
374
375EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetCharNumAtPosition(ExecState* state)
376{
377 return IDLOperation<JSSVGTextContentElement>::call<jsSVGTextContentElementPrototypeFunctionGetCharNumAtPositionBody>(*state, "getCharNumAtPosition");
378}
379
380static inline JSC::EncodedJSValue jsSVGTextContentElementPrototypeFunctionSelectSubStringBody(JSC::ExecState* state, typename IDLOperation<JSSVGTextContentElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
381{
382 UNUSED_PARAM(state);
383 UNUSED_PARAM(throwScope);
384 auto& impl = castedThis->wrapped();
385 auto offset = convert<IDLUnsignedLong>(*state, state->argument(0));
386 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
387 auto length = convert<IDLUnsignedLong>(*state, state->argument(1));
388 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
389 propagateException(*state, throwScope, impl.selectSubString(WTFMove(offset), WTFMove(length)));
390 return JSValue::encode(jsUndefined());
391}
392
393EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionSelectSubString(ExecState* state)
394{
395 return IDLOperation<JSSVGTextContentElement>::call<jsSVGTextContentElementPrototypeFunctionSelectSubStringBody>(*state, "selectSubString");
396}
397
398void JSSVGTextContentElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
399{
400 auto* thisObject = jsCast<JSSVGTextContentElement*>(cell);
401 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
402 if (thisObject->scriptExecutionContext())
403 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
404 Base::heapSnapshot(cell, builder);
405}
406
407
408}
409