|
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 |
|
23 #if ENABLE(SVG) |
|
24 |
|
25 #include "JSSVGLength.h" |
|
26 |
|
27 #include "KURL.h" |
|
28 #include "SVGLength.h" |
|
29 #include <runtime/Error.h> |
|
30 #include <runtime/JSNumberCell.h> |
|
31 #include <runtime/JSString.h> |
|
32 #include <wtf/GetPtr.h> |
|
33 |
|
34 using namespace JSC; |
|
35 |
|
36 namespace WebCore { |
|
37 |
|
38 ASSERT_CLASS_FITS_IN_CELL(JSSVGLength); |
|
39 |
|
40 /* Hash table */ |
|
41 #if ENABLE(JIT) |
|
42 #define THUNK_GENERATOR(generator) , generator |
|
43 #else |
|
44 #define THUNK_GENERATOR(generator) |
|
45 #endif |
|
46 |
|
47 static const HashTableValue JSSVGLengthTableValues[6] = |
|
48 { |
|
49 { "unitType", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthUnitType), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
50 { "value", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthValue), (intptr_t)setJSSVGLengthValue THUNK_GENERATOR(0) }, |
|
51 { "valueInSpecifiedUnits", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthValueInSpecifiedUnits), (intptr_t)setJSSVGLengthValueInSpecifiedUnits THUNK_GENERATOR(0) }, |
|
52 { "valueAsString", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthValueAsString), (intptr_t)setJSSVGLengthValueAsString THUNK_GENERATOR(0) }, |
|
53 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
54 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
55 }; |
|
56 |
|
57 #undef THUNK_GENERATOR |
|
58 static JSC_CONST_HASHTABLE HashTable JSSVGLengthTable = { 17, 15, JSSVGLengthTableValues, 0 }; |
|
59 /* Hash table for constructor */ |
|
60 #if ENABLE(JIT) |
|
61 #define THUNK_GENERATOR(generator) , generator |
|
62 #else |
|
63 #define THUNK_GENERATOR(generator) |
|
64 #endif |
|
65 |
|
66 static const HashTableValue JSSVGLengthConstructorTableValues[12] = |
|
67 { |
|
68 { "SVG_LENGTHTYPE_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
69 { "SVG_LENGTHTYPE_NUMBER", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_NUMBER), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
70 { "SVG_LENGTHTYPE_PERCENTAGE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PERCENTAGE), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
71 { "SVG_LENGTHTYPE_EMS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_EMS), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
72 { "SVG_LENGTHTYPE_EXS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_EXS), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
73 { "SVG_LENGTHTYPE_PX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PX), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
74 { "SVG_LENGTHTYPE_CM", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_CM), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
75 { "SVG_LENGTHTYPE_MM", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_MM), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
76 { "SVG_LENGTHTYPE_IN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_IN), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
77 { "SVG_LENGTHTYPE_PT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PT), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
78 { "SVG_LENGTHTYPE_PC", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PC), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
79 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
80 }; |
|
81 |
|
82 #undef THUNK_GENERATOR |
|
83 static JSC_CONST_HASHTABLE HashTable JSSVGLengthConstructorTable = { 33, 31, JSSVGLengthConstructorTableValues, 0 }; |
|
84 |
|
85 COMPILE_ASSERT(0 == SVGLength::SVG_LENGTHTYPE_UNKNOWN, SVGLengthEnumSVG_LENGTHTYPE_UNKNOWNIsWrongUseDontCheckEnums); |
|
86 COMPILE_ASSERT(1 == SVGLength::SVG_LENGTHTYPE_NUMBER, SVGLengthEnumSVG_LENGTHTYPE_NUMBERIsWrongUseDontCheckEnums); |
|
87 COMPILE_ASSERT(2 == SVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGLengthEnumSVG_LENGTHTYPE_PERCENTAGEIsWrongUseDontCheckEnums); |
|
88 COMPILE_ASSERT(3 == SVGLength::SVG_LENGTHTYPE_EMS, SVGLengthEnumSVG_LENGTHTYPE_EMSIsWrongUseDontCheckEnums); |
|
89 COMPILE_ASSERT(4 == SVGLength::SVG_LENGTHTYPE_EXS, SVGLengthEnumSVG_LENGTHTYPE_EXSIsWrongUseDontCheckEnums); |
|
90 COMPILE_ASSERT(5 == SVGLength::SVG_LENGTHTYPE_PX, SVGLengthEnumSVG_LENGTHTYPE_PXIsWrongUseDontCheckEnums); |
|
91 COMPILE_ASSERT(6 == SVGLength::SVG_LENGTHTYPE_CM, SVGLengthEnumSVG_LENGTHTYPE_CMIsWrongUseDontCheckEnums); |
|
92 COMPILE_ASSERT(7 == SVGLength::SVG_LENGTHTYPE_MM, SVGLengthEnumSVG_LENGTHTYPE_MMIsWrongUseDontCheckEnums); |
|
93 COMPILE_ASSERT(8 == SVGLength::SVG_LENGTHTYPE_IN, SVGLengthEnumSVG_LENGTHTYPE_INIsWrongUseDontCheckEnums); |
|
94 COMPILE_ASSERT(9 == SVGLength::SVG_LENGTHTYPE_PT, SVGLengthEnumSVG_LENGTHTYPE_PTIsWrongUseDontCheckEnums); |
|
95 COMPILE_ASSERT(10 == SVGLength::SVG_LENGTHTYPE_PC, SVGLengthEnumSVG_LENGTHTYPE_PCIsWrongUseDontCheckEnums); |
|
96 |
|
97 class JSSVGLengthConstructor : public DOMConstructorObject { |
|
98 public: |
|
99 JSSVGLengthConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
100 |
|
101 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
102 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
103 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
104 static const JSC::ClassInfo s_info; |
|
105 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
106 { |
|
107 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
108 } |
|
109 protected: |
|
110 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
111 }; |
|
112 |
|
113 const ClassInfo JSSVGLengthConstructor::s_info = { "SVGLengthConstructor", 0, &JSSVGLengthConstructorTable, 0 }; |
|
114 |
|
115 JSSVGLengthConstructor::JSSVGLengthConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
116 : DOMConstructorObject(JSSVGLengthConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
117 { |
|
118 putDirect(exec->propertyNames().prototype, JSSVGLengthPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
119 } |
|
120 |
|
121 bool JSSVGLengthConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
122 { |
|
123 return getStaticValueSlot<JSSVGLengthConstructor, DOMObject>(exec, &JSSVGLengthConstructorTable, this, propertyName, slot); |
|
124 } |
|
125 |
|
126 bool JSSVGLengthConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
127 { |
|
128 return getStaticValueDescriptor<JSSVGLengthConstructor, DOMObject>(exec, &JSSVGLengthConstructorTable, this, propertyName, descriptor); |
|
129 } |
|
130 |
|
131 /* Hash table for prototype */ |
|
132 #if ENABLE(JIT) |
|
133 #define THUNK_GENERATOR(generator) , generator |
|
134 #else |
|
135 #define THUNK_GENERATOR(generator) |
|
136 #endif |
|
137 |
|
138 static const HashTableValue JSSVGLengthPrototypeTableValues[14] = |
|
139 { |
|
140 { "SVG_LENGTHTYPE_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
141 { "SVG_LENGTHTYPE_NUMBER", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_NUMBER), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
142 { "SVG_LENGTHTYPE_PERCENTAGE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PERCENTAGE), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
143 { "SVG_LENGTHTYPE_EMS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_EMS), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
144 { "SVG_LENGTHTYPE_EXS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_EXS), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
145 { "SVG_LENGTHTYPE_PX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PX), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
146 { "SVG_LENGTHTYPE_CM", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_CM), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
147 { "SVG_LENGTHTYPE_MM", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_MM), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
148 { "SVG_LENGTHTYPE_IN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_IN), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
149 { "SVG_LENGTHTYPE_PT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PT), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
150 { "SVG_LENGTHTYPE_PC", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGLengthSVG_LENGTHTYPE_PC), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
151 { "newValueSpecifiedUnits", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGLengthPrototypeFunctionNewValueSpecifiedUnits), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
152 { "convertToSpecifiedUnits", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGLengthPrototypeFunctionConvertToSpecifiedUnits), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
153 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
154 }; |
|
155 |
|
156 #undef THUNK_GENERATOR |
|
157 static JSC_CONST_HASHTABLE HashTable JSSVGLengthPrototypeTable = { 33, 31, JSSVGLengthPrototypeTableValues, 0 }; |
|
158 const ClassInfo JSSVGLengthPrototype::s_info = { "SVGLengthPrototype", 0, &JSSVGLengthPrototypeTable, 0 }; |
|
159 |
|
160 JSObject* JSSVGLengthPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
161 { |
|
162 return getDOMPrototype<JSSVGLength>(exec, globalObject); |
|
163 } |
|
164 |
|
165 bool JSSVGLengthPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
166 { |
|
167 return getStaticPropertySlot<JSSVGLengthPrototype, JSObject>(exec, &JSSVGLengthPrototypeTable, this, propertyName, slot); |
|
168 } |
|
169 |
|
170 bool JSSVGLengthPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
171 { |
|
172 return getStaticPropertyDescriptor<JSSVGLengthPrototype, JSObject>(exec, &JSSVGLengthPrototypeTable, this, propertyName, descriptor); |
|
173 } |
|
174 |
|
175 const ClassInfo JSSVGLength::s_info = { "SVGLength", 0, &JSSVGLengthTable, 0 }; |
|
176 |
|
177 JSSVGLength::JSSVGLength(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<JSSVGPODTypeWrapper<SVGLength> > impl) |
|
178 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
179 , m_impl(impl) |
|
180 { |
|
181 } |
|
182 |
|
183 JSSVGLength::~JSSVGLength() |
|
184 { |
|
185 forgetDOMObject(this, impl()); |
|
186 JSSVGContextCache::forgetWrapper(this); |
|
187 } |
|
188 |
|
189 JSObject* JSSVGLength::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
190 { |
|
191 return new (exec) JSSVGLengthPrototype(globalObject, JSSVGLengthPrototype::createStructure(globalObject->objectPrototype())); |
|
192 } |
|
193 |
|
194 bool JSSVGLength::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
195 { |
|
196 return getStaticValueSlot<JSSVGLength, Base>(exec, &JSSVGLengthTable, this, propertyName, slot); |
|
197 } |
|
198 |
|
199 bool JSSVGLength::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
200 { |
|
201 return getStaticValueDescriptor<JSSVGLength, Base>(exec, &JSSVGLengthTable, this, propertyName, descriptor); |
|
202 } |
|
203 |
|
204 JSValue jsSVGLengthUnitType(ExecState* exec, JSValue slotBase, const Identifier&) |
|
205 { |
|
206 JSSVGLength* castedThis = static_cast<JSSVGLength*>(asObject(slotBase)); |
|
207 UNUSED_PARAM(exec); |
|
208 SVGLength imp(*castedThis->impl()); |
|
209 JSValue result = jsNumber(exec, imp.unitType()); |
|
210 return result; |
|
211 } |
|
212 |
|
213 JSValue jsSVGLengthValue(ExecState* exec, JSValue slotBase, const Identifier&) |
|
214 { |
|
215 JSSVGLength* castedThis = static_cast<JSSVGLength*>(asObject(slotBase)); |
|
216 return castedThis->value(exec); |
|
217 } |
|
218 |
|
219 JSValue jsSVGLengthValueInSpecifiedUnits(ExecState* exec, JSValue slotBase, const Identifier&) |
|
220 { |
|
221 JSSVGLength* castedThis = static_cast<JSSVGLength*>(asObject(slotBase)); |
|
222 UNUSED_PARAM(exec); |
|
223 SVGLength imp(*castedThis->impl()); |
|
224 JSValue result = jsNumber(exec, imp.valueInSpecifiedUnits()); |
|
225 return result; |
|
226 } |
|
227 |
|
228 JSValue jsSVGLengthValueAsString(ExecState* exec, JSValue slotBase, const Identifier&) |
|
229 { |
|
230 JSSVGLength* castedThis = static_cast<JSSVGLength*>(asObject(slotBase)); |
|
231 UNUSED_PARAM(exec); |
|
232 SVGLength imp(*castedThis->impl()); |
|
233 JSValue result = jsString(exec, imp.valueAsString()); |
|
234 return result; |
|
235 } |
|
236 |
|
237 JSValue jsSVGLengthConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
238 { |
|
239 JSSVGLength* domObject = static_cast<JSSVGLength*>(asObject(slotBase)); |
|
240 return JSSVGLength::getConstructor(exec, domObject->globalObject()); |
|
241 } |
|
242 void JSSVGLength::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
243 { |
|
244 lookupPut<JSSVGLength, Base>(exec, propertyName, value, &JSSVGLengthTable, this, slot); |
|
245 } |
|
246 |
|
247 void setJSSVGLengthValue(ExecState* exec, JSObject* thisObject, JSValue value) |
|
248 { |
|
249 JSSVGLength* castedThis = static_cast<JSSVGLength*>(thisObject); |
|
250 JSSVGPODTypeWrapper<SVGLength> * imp = static_cast<JSSVGPODTypeWrapper<SVGLength> *>(castedThis->impl()); |
|
251 SVGLength podImp(*imp); |
|
252 podImp.setValue(value.toFloat(exec)); |
|
253 imp->commitChange(podImp, castedThis); |
|
254 } |
|
255 |
|
256 void setJSSVGLengthValueInSpecifiedUnits(ExecState* exec, JSObject* thisObject, JSValue value) |
|
257 { |
|
258 JSSVGLength* castedThis = static_cast<JSSVGLength*>(thisObject); |
|
259 JSSVGPODTypeWrapper<SVGLength> * imp = static_cast<JSSVGPODTypeWrapper<SVGLength> *>(castedThis->impl()); |
|
260 SVGLength podImp(*imp); |
|
261 podImp.setValueInSpecifiedUnits(value.toFloat(exec)); |
|
262 imp->commitChange(podImp, castedThis); |
|
263 } |
|
264 |
|
265 void setJSSVGLengthValueAsString(ExecState* exec, JSObject* thisObject, JSValue value) |
|
266 { |
|
267 JSSVGLength* castedThis = static_cast<JSSVGLength*>(thisObject); |
|
268 JSSVGPODTypeWrapper<SVGLength> * imp = static_cast<JSSVGPODTypeWrapper<SVGLength> *>(castedThis->impl()); |
|
269 SVGLength podImp(*imp); |
|
270 podImp.setValueAsString(valueToStringWithNullCheck(exec, value)); |
|
271 imp->commitChange(podImp, castedThis); |
|
272 } |
|
273 |
|
274 JSValue JSSVGLength::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
275 { |
|
276 return getDOMConstructor<JSSVGLengthConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
277 } |
|
278 |
|
279 EncodedJSValue JSC_HOST_CALL jsSVGLengthPrototypeFunctionNewValueSpecifiedUnits(ExecState* exec) |
|
280 { |
|
281 JSValue thisValue = exec->hostThisValue(); |
|
282 if (!thisValue.inherits(&JSSVGLength::s_info)) |
|
283 return throwVMTypeError(exec); |
|
284 JSSVGLength* castedThis = static_cast<JSSVGLength*>(asObject(thisValue)); |
|
285 JSSVGPODTypeWrapper<SVGLength> * imp = static_cast<JSSVGPODTypeWrapper<SVGLength> *>(castedThis->impl()); |
|
286 SVGLength podImp(*imp); |
|
287 unsigned short unitType = exec->argument(0).toInt32(exec); |
|
288 float valueInSpecifiedUnits = exec->argument(1).toFloat(exec); |
|
289 |
|
290 podImp.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits); |
|
291 imp->commitChange(podImp, castedThis); |
|
292 return JSValue::encode(jsUndefined()); |
|
293 } |
|
294 |
|
295 EncodedJSValue JSC_HOST_CALL jsSVGLengthPrototypeFunctionConvertToSpecifiedUnits(ExecState* exec) |
|
296 { |
|
297 JSValue thisValue = exec->hostThisValue(); |
|
298 if (!thisValue.inherits(&JSSVGLength::s_info)) |
|
299 return throwVMTypeError(exec); |
|
300 JSSVGLength* castedThis = static_cast<JSSVGLength*>(asObject(thisValue)); |
|
301 return JSValue::encode(castedThis->convertToSpecifiedUnits(exec)); |
|
302 } |
|
303 |
|
304 // Constant getters |
|
305 |
|
306 JSValue jsSVGLengthSVG_LENGTHTYPE_UNKNOWN(ExecState* exec, JSValue, const Identifier&) |
|
307 { |
|
308 return jsNumber(exec, static_cast<int>(0)); |
|
309 } |
|
310 |
|
311 JSValue jsSVGLengthSVG_LENGTHTYPE_NUMBER(ExecState* exec, JSValue, const Identifier&) |
|
312 { |
|
313 return jsNumber(exec, static_cast<int>(1)); |
|
314 } |
|
315 |
|
316 JSValue jsSVGLengthSVG_LENGTHTYPE_PERCENTAGE(ExecState* exec, JSValue, const Identifier&) |
|
317 { |
|
318 return jsNumber(exec, static_cast<int>(2)); |
|
319 } |
|
320 |
|
321 JSValue jsSVGLengthSVG_LENGTHTYPE_EMS(ExecState* exec, JSValue, const Identifier&) |
|
322 { |
|
323 return jsNumber(exec, static_cast<int>(3)); |
|
324 } |
|
325 |
|
326 JSValue jsSVGLengthSVG_LENGTHTYPE_EXS(ExecState* exec, JSValue, const Identifier&) |
|
327 { |
|
328 return jsNumber(exec, static_cast<int>(4)); |
|
329 } |
|
330 |
|
331 JSValue jsSVGLengthSVG_LENGTHTYPE_PX(ExecState* exec, JSValue, const Identifier&) |
|
332 { |
|
333 return jsNumber(exec, static_cast<int>(5)); |
|
334 } |
|
335 |
|
336 JSValue jsSVGLengthSVG_LENGTHTYPE_CM(ExecState* exec, JSValue, const Identifier&) |
|
337 { |
|
338 return jsNumber(exec, static_cast<int>(6)); |
|
339 } |
|
340 |
|
341 JSValue jsSVGLengthSVG_LENGTHTYPE_MM(ExecState* exec, JSValue, const Identifier&) |
|
342 { |
|
343 return jsNumber(exec, static_cast<int>(7)); |
|
344 } |
|
345 |
|
346 JSValue jsSVGLengthSVG_LENGTHTYPE_IN(ExecState* exec, JSValue, const Identifier&) |
|
347 { |
|
348 return jsNumber(exec, static_cast<int>(8)); |
|
349 } |
|
350 |
|
351 JSValue jsSVGLengthSVG_LENGTHTYPE_PT(ExecState* exec, JSValue, const Identifier&) |
|
352 { |
|
353 return jsNumber(exec, static_cast<int>(9)); |
|
354 } |
|
355 |
|
356 JSValue jsSVGLengthSVG_LENGTHTYPE_PC(ExecState* exec, JSValue, const Identifier&) |
|
357 { |
|
358 return jsNumber(exec, static_cast<int>(10)); |
|
359 } |
|
360 |
|
361 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, JSSVGPODTypeWrapper<SVGLength>* object, SVGElement* context) |
|
362 { |
|
363 return getDOMObjectWrapper<JSSVGLength, JSSVGPODTypeWrapper<SVGLength> >(exec, globalObject, object, context); |
|
364 } |
|
365 SVGLength toSVGLength(JSC::JSValue value) |
|
366 { |
|
367 return value.inherits(&JSSVGLength::s_info) ? (SVGLength) *static_cast<JSSVGLength*>(asObject(value))->impl() : SVGLength(); |
|
368 } |
|
369 |
|
370 } |
|
371 |
|
372 #endif // ENABLE(SVG) |