|
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 "JSSVGClipPathElement.h" |
|
26 |
|
27 #include "CSSMutableStyleDeclaration.h" |
|
28 #include "CSSStyleDeclaration.h" |
|
29 #include "CSSValue.h" |
|
30 #include "JSCSSStyleDeclaration.h" |
|
31 #include "JSCSSValue.h" |
|
32 #include "JSSVGAnimatedBoolean.h" |
|
33 #include "JSSVGAnimatedEnumeration.h" |
|
34 #include "JSSVGAnimatedString.h" |
|
35 #include "JSSVGAnimatedTransformList.h" |
|
36 #include "JSSVGElement.h" |
|
37 #include "JSSVGMatrix.h" |
|
38 #include "JSSVGRect.h" |
|
39 #include "JSSVGStringList.h" |
|
40 #include "KURL.h" |
|
41 #include "SVGClipPathElement.h" |
|
42 #include "SVGElement.h" |
|
43 #include "SVGStringList.h" |
|
44 #include <runtime/Error.h> |
|
45 #include <runtime/JSString.h> |
|
46 #include <wtf/GetPtr.h> |
|
47 |
|
48 using namespace JSC; |
|
49 |
|
50 namespace WebCore { |
|
51 |
|
52 ASSERT_CLASS_FITS_IN_CELL(JSSVGClipPathElement); |
|
53 |
|
54 /* Hash table */ |
|
55 #if ENABLE(JIT) |
|
56 #define THUNK_GENERATOR(generator) , generator |
|
57 #else |
|
58 #define THUNK_GENERATOR(generator) |
|
59 #endif |
|
60 |
|
61 static const HashTableValue JSSVGClipPathElementTableValues[14] = |
|
62 { |
|
63 { "clipPathUnits", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementClipPathUnits), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
64 { "requiredFeatures", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementRequiredFeatures), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
65 { "requiredExtensions", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementRequiredExtensions), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
66 { "systemLanguage", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementSystemLanguage), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
67 { "xmllang", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementXmllang), (intptr_t)setJSSVGClipPathElementXmllang THUNK_GENERATOR(0) }, |
|
68 { "xmlspace", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementXmlspace), (intptr_t)setJSSVGClipPathElementXmlspace THUNK_GENERATOR(0) }, |
|
69 { "externalResourcesRequired", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementExternalResourcesRequired), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
70 { "className", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementClassName), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
71 { "style", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementStyle), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
72 { "transform", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementTransform), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
73 { "nearestViewportElement", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementNearestViewportElement), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
74 { "farthestViewportElement", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementFarthestViewportElement), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
75 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGClipPathElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
76 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
77 }; |
|
78 |
|
79 #undef THUNK_GENERATOR |
|
80 static JSC_CONST_HASHTABLE HashTable JSSVGClipPathElementTable = { 35, 31, JSSVGClipPathElementTableValues, 0 }; |
|
81 /* Hash table for constructor */ |
|
82 #if ENABLE(JIT) |
|
83 #define THUNK_GENERATOR(generator) , generator |
|
84 #else |
|
85 #define THUNK_GENERATOR(generator) |
|
86 #endif |
|
87 |
|
88 static const HashTableValue JSSVGClipPathElementConstructorTableValues[1] = |
|
89 { |
|
90 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
91 }; |
|
92 |
|
93 #undef THUNK_GENERATOR |
|
94 static JSC_CONST_HASHTABLE HashTable JSSVGClipPathElementConstructorTable = { 1, 0, JSSVGClipPathElementConstructorTableValues, 0 }; |
|
95 class JSSVGClipPathElementConstructor : public DOMConstructorObject { |
|
96 public: |
|
97 JSSVGClipPathElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
98 |
|
99 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
100 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
101 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
102 static const JSC::ClassInfo s_info; |
|
103 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
104 { |
|
105 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
106 } |
|
107 protected: |
|
108 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
109 }; |
|
110 |
|
111 const ClassInfo JSSVGClipPathElementConstructor::s_info = { "SVGClipPathElementConstructor", 0, &JSSVGClipPathElementConstructorTable, 0 }; |
|
112 |
|
113 JSSVGClipPathElementConstructor::JSSVGClipPathElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
114 : DOMConstructorObject(JSSVGClipPathElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
115 { |
|
116 putDirect(exec->propertyNames().prototype, JSSVGClipPathElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
117 } |
|
118 |
|
119 bool JSSVGClipPathElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
120 { |
|
121 return getStaticValueSlot<JSSVGClipPathElementConstructor, DOMObject>(exec, &JSSVGClipPathElementConstructorTable, this, propertyName, slot); |
|
122 } |
|
123 |
|
124 bool JSSVGClipPathElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
125 { |
|
126 return getStaticValueDescriptor<JSSVGClipPathElementConstructor, DOMObject>(exec, &JSSVGClipPathElementConstructorTable, this, propertyName, descriptor); |
|
127 } |
|
128 |
|
129 /* Hash table for prototype */ |
|
130 #if ENABLE(JIT) |
|
131 #define THUNK_GENERATOR(generator) , generator |
|
132 #else |
|
133 #define THUNK_GENERATOR(generator) |
|
134 #endif |
|
135 |
|
136 static const HashTableValue JSSVGClipPathElementPrototypeTableValues[7] = |
|
137 { |
|
138 { "hasExtension", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGClipPathElementPrototypeFunctionHasExtension), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
139 { "getPresentationAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGClipPathElementPrototypeFunctionGetPresentationAttribute), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
140 { "getBBox", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGClipPathElementPrototypeFunctionGetBBox), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
141 { "getCTM", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGClipPathElementPrototypeFunctionGetCTM), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
142 { "getScreenCTM", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGClipPathElementPrototypeFunctionGetScreenCTM), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
143 { "getTransformToElement", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGClipPathElementPrototypeFunctionGetTransformToElement), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
144 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
145 }; |
|
146 |
|
147 #undef THUNK_GENERATOR |
|
148 static JSC_CONST_HASHTABLE HashTable JSSVGClipPathElementPrototypeTable = { 17, 15, JSSVGClipPathElementPrototypeTableValues, 0 }; |
|
149 const ClassInfo JSSVGClipPathElementPrototype::s_info = { "SVGClipPathElementPrototype", 0, &JSSVGClipPathElementPrototypeTable, 0 }; |
|
150 |
|
151 JSObject* JSSVGClipPathElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
152 { |
|
153 return getDOMPrototype<JSSVGClipPathElement>(exec, globalObject); |
|
154 } |
|
155 |
|
156 bool JSSVGClipPathElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
157 { |
|
158 return getStaticFunctionSlot<JSObject>(exec, &JSSVGClipPathElementPrototypeTable, this, propertyName, slot); |
|
159 } |
|
160 |
|
161 bool JSSVGClipPathElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
162 { |
|
163 return getStaticFunctionDescriptor<JSObject>(exec, &JSSVGClipPathElementPrototypeTable, this, propertyName, descriptor); |
|
164 } |
|
165 |
|
166 const ClassInfo JSSVGClipPathElement::s_info = { "SVGClipPathElement", &JSSVGElement::s_info, &JSSVGClipPathElementTable, 0 }; |
|
167 |
|
168 JSSVGClipPathElement::JSSVGClipPathElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGClipPathElement> impl) |
|
169 : JSSVGElement(structure, globalObject, impl) |
|
170 { |
|
171 } |
|
172 |
|
173 JSObject* JSSVGClipPathElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
174 { |
|
175 return new (exec) JSSVGClipPathElementPrototype(globalObject, JSSVGClipPathElementPrototype::createStructure(JSSVGElementPrototype::self(exec, globalObject))); |
|
176 } |
|
177 |
|
178 bool JSSVGClipPathElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
179 { |
|
180 return getStaticValueSlot<JSSVGClipPathElement, Base>(exec, &JSSVGClipPathElementTable, this, propertyName, slot); |
|
181 } |
|
182 |
|
183 bool JSSVGClipPathElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
184 { |
|
185 return getStaticValueDescriptor<JSSVGClipPathElement, Base>(exec, &JSSVGClipPathElementTable, this, propertyName, descriptor); |
|
186 } |
|
187 |
|
188 JSValue jsSVGClipPathElementClipPathUnits(ExecState* exec, JSValue slotBase, const Identifier&) |
|
189 { |
|
190 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
191 UNUSED_PARAM(exec); |
|
192 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
193 RefPtr<SVGAnimatedEnumeration> obj = imp->clipPathUnitsAnimated(); |
|
194 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
195 return result; |
|
196 } |
|
197 |
|
198 JSValue jsSVGClipPathElementRequiredFeatures(ExecState* exec, JSValue slotBase, const Identifier&) |
|
199 { |
|
200 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
201 UNUSED_PARAM(exec); |
|
202 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
203 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->requiredFeatures()), imp); |
|
204 return result; |
|
205 } |
|
206 |
|
207 JSValue jsSVGClipPathElementRequiredExtensions(ExecState* exec, JSValue slotBase, const Identifier&) |
|
208 { |
|
209 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
210 UNUSED_PARAM(exec); |
|
211 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
212 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->requiredExtensions()), imp); |
|
213 return result; |
|
214 } |
|
215 |
|
216 JSValue jsSVGClipPathElementSystemLanguage(ExecState* exec, JSValue slotBase, const Identifier&) |
|
217 { |
|
218 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
219 UNUSED_PARAM(exec); |
|
220 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
221 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->systemLanguage()), imp); |
|
222 return result; |
|
223 } |
|
224 |
|
225 JSValue jsSVGClipPathElementXmllang(ExecState* exec, JSValue slotBase, const Identifier&) |
|
226 { |
|
227 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
228 UNUSED_PARAM(exec); |
|
229 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
230 JSValue result = jsString(exec, imp->xmllang()); |
|
231 return result; |
|
232 } |
|
233 |
|
234 JSValue jsSVGClipPathElementXmlspace(ExecState* exec, JSValue slotBase, const Identifier&) |
|
235 { |
|
236 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
237 UNUSED_PARAM(exec); |
|
238 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
239 JSValue result = jsString(exec, imp->xmlspace()); |
|
240 return result; |
|
241 } |
|
242 |
|
243 JSValue jsSVGClipPathElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&) |
|
244 { |
|
245 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
246 UNUSED_PARAM(exec); |
|
247 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
248 RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated(); |
|
249 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
250 return result; |
|
251 } |
|
252 |
|
253 JSValue jsSVGClipPathElementClassName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
254 { |
|
255 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
256 UNUSED_PARAM(exec); |
|
257 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
258 RefPtr<SVGAnimatedString> obj = imp->classNameAnimated(); |
|
259 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
260 return result; |
|
261 } |
|
262 |
|
263 JSValue jsSVGClipPathElementStyle(ExecState* exec, JSValue slotBase, const Identifier&) |
|
264 { |
|
265 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
266 UNUSED_PARAM(exec); |
|
267 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
268 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style())); |
|
269 return result; |
|
270 } |
|
271 |
|
272 JSValue jsSVGClipPathElementTransform(ExecState* exec, JSValue slotBase, const Identifier&) |
|
273 { |
|
274 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
275 UNUSED_PARAM(exec); |
|
276 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
277 RefPtr<SVGAnimatedTransformList> obj = imp->transformAnimated(); |
|
278 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
279 return result; |
|
280 } |
|
281 |
|
282 JSValue jsSVGClipPathElementNearestViewportElement(ExecState* exec, JSValue slotBase, const Identifier&) |
|
283 { |
|
284 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
285 UNUSED_PARAM(exec); |
|
286 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
287 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->nearestViewportElement())); |
|
288 return result; |
|
289 } |
|
290 |
|
291 JSValue jsSVGClipPathElementFarthestViewportElement(ExecState* exec, JSValue slotBase, const Identifier&) |
|
292 { |
|
293 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
294 UNUSED_PARAM(exec); |
|
295 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
296 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->farthestViewportElement())); |
|
297 return result; |
|
298 } |
|
299 |
|
300 JSValue jsSVGClipPathElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
301 { |
|
302 JSSVGClipPathElement* domObject = static_cast<JSSVGClipPathElement*>(asObject(slotBase)); |
|
303 return JSSVGClipPathElement::getConstructor(exec, domObject->globalObject()); |
|
304 } |
|
305 void JSSVGClipPathElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
306 { |
|
307 lookupPut<JSSVGClipPathElement, Base>(exec, propertyName, value, &JSSVGClipPathElementTable, this, slot); |
|
308 } |
|
309 |
|
310 void setJSSVGClipPathElementXmllang(ExecState* exec, JSObject* thisObject, JSValue value) |
|
311 { |
|
312 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(thisObject); |
|
313 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
314 imp->setXmllang(ustringToString(value.toString(exec))); |
|
315 } |
|
316 |
|
317 void setJSSVGClipPathElementXmlspace(ExecState* exec, JSObject* thisObject, JSValue value) |
|
318 { |
|
319 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(thisObject); |
|
320 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
321 imp->setXmlspace(ustringToString(value.toString(exec))); |
|
322 } |
|
323 |
|
324 JSValue JSSVGClipPathElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
325 { |
|
326 return getDOMConstructor<JSSVGClipPathElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
327 } |
|
328 |
|
329 EncodedJSValue JSC_HOST_CALL jsSVGClipPathElementPrototypeFunctionHasExtension(ExecState* exec) |
|
330 { |
|
331 JSValue thisValue = exec->hostThisValue(); |
|
332 if (!thisValue.inherits(&JSSVGClipPathElement::s_info)) |
|
333 return throwVMTypeError(exec); |
|
334 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(thisValue)); |
|
335 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
336 const String& extension = ustringToString(exec->argument(0).toString(exec)); |
|
337 |
|
338 |
|
339 JSC::JSValue result = jsBoolean(imp->hasExtension(extension)); |
|
340 return JSValue::encode(result); |
|
341 } |
|
342 |
|
343 EncodedJSValue JSC_HOST_CALL jsSVGClipPathElementPrototypeFunctionGetPresentationAttribute(ExecState* exec) |
|
344 { |
|
345 JSValue thisValue = exec->hostThisValue(); |
|
346 if (!thisValue.inherits(&JSSVGClipPathElement::s_info)) |
|
347 return throwVMTypeError(exec); |
|
348 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(thisValue)); |
|
349 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
350 const String& name = ustringToString(exec->argument(0).toString(exec)); |
|
351 |
|
352 |
|
353 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getPresentationAttribute(name))); |
|
354 return JSValue::encode(result); |
|
355 } |
|
356 |
|
357 EncodedJSValue JSC_HOST_CALL jsSVGClipPathElementPrototypeFunctionGetBBox(ExecState* exec) |
|
358 { |
|
359 JSValue thisValue = exec->hostThisValue(); |
|
360 if (!thisValue.inherits(&JSSVGClipPathElement::s_info)) |
|
361 return throwVMTypeError(exec); |
|
362 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(thisValue)); |
|
363 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
364 |
|
365 |
|
366 JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper<FloatRect>::create(imp->getBBox()).get(), 0 /* no context on purpose */); |
|
367 return JSValue::encode(result); |
|
368 } |
|
369 |
|
370 EncodedJSValue JSC_HOST_CALL jsSVGClipPathElementPrototypeFunctionGetCTM(ExecState* exec) |
|
371 { |
|
372 JSValue thisValue = exec->hostThisValue(); |
|
373 if (!thisValue.inherits(&JSSVGClipPathElement::s_info)) |
|
374 return throwVMTypeError(exec); |
|
375 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(thisValue)); |
|
376 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
377 |
|
378 |
|
379 JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp->getCTM()).get(), 0 /* no context on purpose */); |
|
380 return JSValue::encode(result); |
|
381 } |
|
382 |
|
383 EncodedJSValue JSC_HOST_CALL jsSVGClipPathElementPrototypeFunctionGetScreenCTM(ExecState* exec) |
|
384 { |
|
385 JSValue thisValue = exec->hostThisValue(); |
|
386 if (!thisValue.inherits(&JSSVGClipPathElement::s_info)) |
|
387 return throwVMTypeError(exec); |
|
388 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(thisValue)); |
|
389 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
390 |
|
391 |
|
392 JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp->getScreenCTM()).get(), 0 /* no context on purpose */); |
|
393 return JSValue::encode(result); |
|
394 } |
|
395 |
|
396 EncodedJSValue JSC_HOST_CALL jsSVGClipPathElementPrototypeFunctionGetTransformToElement(ExecState* exec) |
|
397 { |
|
398 JSValue thisValue = exec->hostThisValue(); |
|
399 if (!thisValue.inherits(&JSSVGClipPathElement::s_info)) |
|
400 return throwVMTypeError(exec); |
|
401 JSSVGClipPathElement* castedThis = static_cast<JSSVGClipPathElement*>(asObject(thisValue)); |
|
402 SVGClipPathElement* imp = static_cast<SVGClipPathElement*>(castedThis->impl()); |
|
403 ExceptionCode ec = 0; |
|
404 SVGElement* element = toSVGElement(exec->argument(0)); |
|
405 |
|
406 |
|
407 JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp->getTransformToElement(element, ec)).get(), 0 /* no context on purpose */); |
|
408 setDOMException(exec, ec); |
|
409 return JSValue::encode(result); |
|
410 } |
|
411 |
|
412 |
|
413 } |
|
414 |
|
415 #endif // ENABLE(SVG) |