2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
25 #include "JSSVGLength.h"
27 #include "ExceptionCode.h"
28 #include "JSDOMBinding.h"
30 #include "SVGLength.h"
31 #include <runtime/Error.h>
32 #include <runtime/JSString.h>
33 #include <wtf/GetPtr.h>
39 ASSERT_CLASS_FITS_IN_CELL(JSSVGLength);
43 #define THUNK_GENERATOR(generator) , generator
45 #define THUNK_GENERATOR(generator)
48 #define INTRINSIC(intrinsic) , intrinsic
50 #define INTRINSIC(intrinsic)
53 static const HashTableValue JSSVGLengthTableValues[] =
55 { "unitType", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthUnitType), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56 { "value", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthValue), (intptr_t)setJSSVGLengthValue THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57 { "valueInSpecifiedUnits", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthValueInSpecifiedUnits), (intptr_t)setJSSVGLengthValueInSpecifiedUnits THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58 { "valueAsString", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthValueAsString), (intptr_t)setJSSVGLengthValueAsString THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
63 #undef THUNK_GENERATOR
64 static const HashTable JSSVGLengthTable = { 17, 15, JSSVGLengthTableValues, 0 };
65 /* Hash table for constructor */
67 #define THUNK_GENERATOR(generator) , generator
69 #define THUNK_GENERATOR(generator)
72 #define INTRINSIC(intrinsic) , intrinsic
74 #define INTRINSIC(intrinsic)
77 static const HashTableValue JSSVGLengthConstructorTableValues[] =
79 { "SVG_LENGTHTYPE_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
80 { "SVG_LENGTHTYPE_NUMBER", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_NUMBER), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
81 { "SVG_LENGTHTYPE_PERCENTAGE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PERCENTAGE), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
82 { "SVG_LENGTHTYPE_EMS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_EMS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
83 { "SVG_LENGTHTYPE_EXS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_EXS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
84 { "SVG_LENGTHTYPE_PX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PX), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
85 { "SVG_LENGTHTYPE_CM", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_CM), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
86 { "SVG_LENGTHTYPE_MM", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_MM), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
87 { "SVG_LENGTHTYPE_IN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_IN), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
88 { "SVG_LENGTHTYPE_PT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PT), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
89 { "SVG_LENGTHTYPE_PC", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PC), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
90 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
93 #undef THUNK_GENERATOR
94 static const HashTable JSSVGLengthConstructorTable = { 33, 31, JSSVGLengthConstructorTableValues, 0 };
96 COMPILE_ASSERT(0 == SVGLength::SVG_LENGTHTYPE_UNKNOWN, SVGLengthEnumSVG_LENGTHTYPE_UNKNOWNIsWrongUseDontCheckEnums);
97 COMPILE_ASSERT(1 == SVGLength::SVG_LENGTHTYPE_NUMBER, SVGLengthEnumSVG_LENGTHTYPE_NUMBERIsWrongUseDontCheckEnums);
98 COMPILE_ASSERT(2 == SVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGLengthEnumSVG_LENGTHTYPE_PERCENTAGEIsWrongUseDontCheckEnums);
99 COMPILE_ASSERT(3 == SVGLength::SVG_LENGTHTYPE_EMS, SVGLengthEnumSVG_LENGTHTYPE_EMSIsWrongUseDontCheckEnums);
100 COMPILE_ASSERT(4 == SVGLength::SVG_LENGTHTYPE_EXS, SVGLengthEnumSVG_LENGTHTYPE_EXSIsWrongUseDontCheckEnums);
101 COMPILE_ASSERT(5 == SVGLength::SVG_LENGTHTYPE_PX, SVGLengthEnumSVG_LENGTHTYPE_PXIsWrongUseDontCheckEnums);
102 COMPILE_ASSERT(6 == SVGLength::SVG_LENGTHTYPE_CM, SVGLengthEnumSVG_LENGTHTYPE_CMIsWrongUseDontCheckEnums);
103 COMPILE_ASSERT(7 == SVGLength::SVG_LENGTHTYPE_MM, SVGLengthEnumSVG_LENGTHTYPE_MMIsWrongUseDontCheckEnums);
104 COMPILE_ASSERT(8 == SVGLength::SVG_LENGTHTYPE_IN, SVGLengthEnumSVG_LENGTHTYPE_INIsWrongUseDontCheckEnums);
105 COMPILE_ASSERT(9 == SVGLength::SVG_LENGTHTYPE_PT, SVGLengthEnumSVG_LENGTHTYPE_PTIsWrongUseDontCheckEnums);
106 COMPILE_ASSERT(10 == SVGLength::SVG_LENGTHTYPE_PC, SVGLengthEnumSVG_LENGTHTYPE_PCIsWrongUseDontCheckEnums);
108 const ClassInfo JSSVGLengthConstructor::s_info = { "SVGLengthConstructor", &DOMConstructorObject::s_info, &JSSVGLengthConstructorTable, 0, CREATE_METHOD_TABLE(JSSVGLengthConstructor) };
110 JSSVGLengthConstructor::JSSVGLengthConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
111 : DOMConstructorObject(structure, globalObject)
115 void JSSVGLengthConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
117 Base::finishCreation(exec->globalData());
118 ASSERT(inherits(&s_info));
119 putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGLengthPrototype::self(exec, globalObject), DontDelete | ReadOnly);
122 bool JSSVGLengthConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
124 return getStaticValueSlot<JSSVGLengthConstructor, JSDOMWrapper>(exec, &JSSVGLengthConstructorTable, static_cast<JSSVGLengthConstructor*>(cell), propertyName, slot);
127 bool JSSVGLengthConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
129 return getStaticValueDescriptor<JSSVGLengthConstructor, JSDOMWrapper>(exec, &JSSVGLengthConstructorTable, static_cast<JSSVGLengthConstructor*>(object), propertyName, descriptor);
132 /* Hash table for prototype */
134 #define THUNK_GENERATOR(generator) , generator
136 #define THUNK_GENERATOR(generator)
139 #define INTRINSIC(intrinsic) , intrinsic
141 #define INTRINSIC(intrinsic)
144 static const HashTableValue JSSVGLengthPrototypeTableValues[] =
146 { "SVG_LENGTHTYPE_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
147 { "SVG_LENGTHTYPE_NUMBER", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_NUMBER), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
148 { "SVG_LENGTHTYPE_PERCENTAGE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PERCENTAGE), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
149 { "SVG_LENGTHTYPE_EMS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_EMS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
150 { "SVG_LENGTHTYPE_EXS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_EXS), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
151 { "SVG_LENGTHTYPE_PX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PX), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
152 { "SVG_LENGTHTYPE_CM", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_CM), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
153 { "SVG_LENGTHTYPE_MM", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_MM), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
154 { "SVG_LENGTHTYPE_IN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_IN), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
155 { "SVG_LENGTHTYPE_PT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PT), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
156 { "SVG_LENGTHTYPE_PC", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PC), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
157 { "newValueSpecifiedUnits", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGLengthPrototypeFunctionNewValueSpecifiedUnits), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
158 { "convertToSpecifiedUnits", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGLengthPrototypeFunctionConvertToSpecifiedUnits), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
159 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
162 #undef THUNK_GENERATOR
163 static const HashTable JSSVGLengthPrototypeTable = { 33, 31, JSSVGLengthPrototypeTableValues, 0 };
164 const ClassInfo JSSVGLengthPrototype::s_info = { "SVGLengthPrototype", &JSC::JSNonFinalObject::s_info, &JSSVGLengthPrototypeTable, 0, CREATE_METHOD_TABLE(JSSVGLengthPrototype) };
166 JSObject* JSSVGLengthPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
168 return getDOMPrototype<JSSVGLength>(exec, globalObject);
171 bool JSSVGLengthPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
173 JSSVGLengthPrototype* thisObject = jsCast<JSSVGLengthPrototype*>(cell);
174 return getStaticPropertySlot<JSSVGLengthPrototype, JSObject>(exec, &JSSVGLengthPrototypeTable, thisObject, propertyName, slot);
177 bool JSSVGLengthPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
179 JSSVGLengthPrototype* thisObject = jsCast<JSSVGLengthPrototype*>(object);
180 return getStaticPropertyDescriptor<JSSVGLengthPrototype, JSObject>(exec, &JSSVGLengthPrototypeTable, thisObject, propertyName, descriptor);
183 const ClassInfo JSSVGLength::s_info = { "SVGLength", &JSDOMWrapper::s_info, &JSSVGLengthTable, 0 , CREATE_METHOD_TABLE(JSSVGLength) };
185 JSSVGLength::JSSVGLength(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGPropertyTearOff<SVGLength> > impl)
186 : JSDOMWrapper(structure, globalObject)
187 , m_impl(impl.leakRef())
191 void JSSVGLength::finishCreation(JSGlobalData& globalData)
193 Base::finishCreation(globalData);
194 ASSERT(inherits(&s_info));
197 JSObject* JSSVGLength::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
199 return JSSVGLengthPrototype::create(exec->globalData(), globalObject, JSSVGLengthPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
202 bool JSSVGLength::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
204 JSSVGLength* thisObject = jsCast<JSSVGLength*>(cell);
205 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
206 return getStaticValueSlot<JSSVGLength, Base>(exec, &JSSVGLengthTable, thisObject, propertyName, slot);
209 bool JSSVGLength::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
211 JSSVGLength* thisObject = jsCast<JSSVGLength*>(object);
212 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
213 return getStaticValueDescriptor<JSSVGLength, Base>(exec, &JSSVGLengthTable, thisObject, propertyName, descriptor);
216 JSValue jsSVGLengthUnitType(ExecState* exec, JSValue slotBase, const Identifier&)
218 JSSVGLength* castedThis = static_cast<JSSVGLength*>(asObject(slotBase));
220 SVGLength& imp = castedThis->impl()->propertyReference();
221 JSValue result = jsNumber(imp.unitType());
226 JSValue jsSVGLengthValue(ExecState* exec, JSValue slotBase, const Identifier&)
228 JSSVGLength* castedThis = static_cast<JSSVGLength*>(asObject(slotBase));
229 return castedThis->value(exec);
233 JSValue jsSVGLengthValueInSpecifiedUnits(ExecState* exec, JSValue slotBase, const Identifier&)
235 JSSVGLength* castedThis = static_cast<JSSVGLength*>(asObject(slotBase));
237 SVGLength& imp = castedThis->impl()->propertyReference();
238 JSValue result = jsNumber(imp.valueInSpecifiedUnits());
243 JSValue jsSVGLengthValueAsString(ExecState* exec, JSValue slotBase, const Identifier&)
245 JSSVGLength* castedThis = static_cast<JSSVGLength*>(asObject(slotBase));
247 SVGLength& imp = castedThis->impl()->propertyReference();
248 JSValue result = jsString(exec, imp.valueAsString());
253 JSValue jsSVGLengthConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
255 JSSVGLength* domObject = static_cast<JSSVGLength*>(asObject(slotBase));
256 return JSSVGLength::getConstructor(exec, domObject->globalObject());
259 void JSSVGLength::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
261 JSSVGLength* thisObject = jsCast<JSSVGLength*>(cell);
262 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
263 lookupPut<JSSVGLength, Base>(exec, propertyName, value, &JSSVGLengthTable, thisObject, slot);
266 void setJSSVGLengthValue(ExecState* exec, JSObject* thisObject, JSValue value)
268 static_cast<JSSVGLength*>(thisObject)->setValue(exec, value);
272 void setJSSVGLengthValueInSpecifiedUnits(ExecState* exec, JSObject* thisObject, JSValue value)
274 JSSVGLength* castedThis = static_cast<JSSVGLength*>(thisObject);
275 SVGPropertyTearOff<SVGLength> * imp = static_cast<SVGPropertyTearOff<SVGLength> *>(castedThis->impl());
276 if (imp->role() == AnimValRole) {
277 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
280 SVGLength& podImp = imp->propertyReference();
281 podImp.setValueInSpecifiedUnits(value.toFloat(exec));
286 void setJSSVGLengthValueAsString(ExecState* exec, JSObject* thisObject, JSValue value)
288 JSSVGLength* castedThis = static_cast<JSSVGLength*>(thisObject);
289 SVGPropertyTearOff<SVGLength> * imp = static_cast<SVGPropertyTearOff<SVGLength> *>(castedThis->impl());
290 ExceptionCode ec = 0;
291 if (imp->role() == AnimValRole) {
292 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
295 SVGLength& podImp = imp->propertyReference();
296 podImp.setValueAsString(valueToStringWithNullCheck(exec, value), ec);
297 setDOMException(exec, ec);
303 JSValue JSSVGLength::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
305 return getDOMConstructor<JSSVGLengthConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
308 EncodedJSValue JSC_HOST_CALL jsSVGLengthPrototypeFunctionNewValueSpecifiedUnits(ExecState* exec)
310 JSValue thisValue = exec->hostThisValue();
311 if (!thisValue.inherits(&JSSVGLength::s_info))
312 return throwVMTypeError(exec);
313 JSSVGLength* castedThis = static_cast<JSSVGLength*>(asObject(thisValue));
314 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGLength::s_info);
315 SVGPropertyTearOff<SVGLength> * imp = static_cast<SVGPropertyTearOff<SVGLength> *>(castedThis->impl());
316 if (imp->role() == AnimValRole) {
317 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
318 return JSValue::encode(jsUndefined());
320 SVGLength& podImp = imp->propertyReference();
321 if (exec->argumentCount() < 2)
322 return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
323 ExceptionCode ec = 0;
324 unsigned short unitType(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toUInt32(exec));
325 if (exec->hadException())
326 return JSValue::encode(jsUndefined());
327 float valueInSpecifiedUnits(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toFloat(exec));
328 if (exec->hadException())
329 return JSValue::encode(jsUndefined());
330 podImp.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits, ec);
331 setDOMException(exec, ec);
334 return JSValue::encode(jsUndefined());
337 EncodedJSValue JSC_HOST_CALL jsSVGLengthPrototypeFunctionConvertToSpecifiedUnits(ExecState* exec)
339 JSValue thisValue = exec->hostThisValue();
340 if (!thisValue.inherits(&JSSVGLength::s_info))
341 return throwVMTypeError(exec);
342 JSSVGLength* castedThis = static_cast<JSSVGLength*>(asObject(thisValue));
343 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGLength::s_info);
344 return JSValue::encode(castedThis->convertToSpecifiedUnits(exec));
349 JSValue jsSVGLengthSVG_LENGTHTYPE_UNKNOWN(ExecState* exec, JSValue, const Identifier&)
352 return jsNumber(static_cast<int>(0));
355 JSValue jsSVGLengthSVG_LENGTHTYPE_NUMBER(ExecState* exec, JSValue, const Identifier&)
358 return jsNumber(static_cast<int>(1));
361 JSValue jsSVGLengthSVG_LENGTHTYPE_PERCENTAGE(ExecState* exec, JSValue, const Identifier&)
364 return jsNumber(static_cast<int>(2));
367 JSValue jsSVGLengthSVG_LENGTHTYPE_EMS(ExecState* exec, JSValue, const Identifier&)
370 return jsNumber(static_cast<int>(3));
373 JSValue jsSVGLengthSVG_LENGTHTYPE_EXS(ExecState* exec, JSValue, const Identifier&)
376 return jsNumber(static_cast<int>(4));
379 JSValue jsSVGLengthSVG_LENGTHTYPE_PX(ExecState* exec, JSValue, const Identifier&)
382 return jsNumber(static_cast<int>(5));
385 JSValue jsSVGLengthSVG_LENGTHTYPE_CM(ExecState* exec, JSValue, const Identifier&)
388 return jsNumber(static_cast<int>(6));
391 JSValue jsSVGLengthSVG_LENGTHTYPE_MM(ExecState* exec, JSValue, const Identifier&)
394 return jsNumber(static_cast<int>(7));
397 JSValue jsSVGLengthSVG_LENGTHTYPE_IN(ExecState* exec, JSValue, const Identifier&)
400 return jsNumber(static_cast<int>(8));
403 JSValue jsSVGLengthSVG_LENGTHTYPE_PT(ExecState* exec, JSValue, const Identifier&)
406 return jsNumber(static_cast<int>(9));
409 JSValue jsSVGLengthSVG_LENGTHTYPE_PC(ExecState* exec, JSValue, const Identifier&)
412 return jsNumber(static_cast<int>(10));
415 static inline bool isObservable(JSSVGLength* jsSVGLength)
417 if (jsSVGLength->hasCustomProperties())
422 bool JSSVGLengthOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
424 JSSVGLength* jsSVGLength = static_cast<JSSVGLength*>(handle.get().asCell());
425 if (!isObservable(jsSVGLength))
427 UNUSED_PARAM(visitor);
431 void JSSVGLengthOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
433 JSSVGLength* jsSVGLength = static_cast<JSSVGLength*>(handle.get().asCell());
434 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
435 uncacheWrapper(world, jsSVGLength->impl(), jsSVGLength);
436 jsSVGLength->releaseImpl();
439 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGPropertyTearOff<SVGLength> * impl)
441 return wrap<JSSVGLength, SVGPropertyTearOff<SVGLength> >(exec, globalObject, impl);
444 SVGPropertyTearOff<SVGLength> * toSVGLength(JSC::JSValue value)
446 return value.inherits(&JSSVGLength::s_info) ? static_cast<JSSVGLength*>(asObject(value))->impl() : 0;
451 #endif // ENABLE(SVG)