|
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 "JSSVGElement.h" |
|
26 |
|
27 #include "HTMLNames.h" |
|
28 #include "JSSVGElement.h" |
|
29 #include "JSSVGSVGElement.h" |
|
30 #include "KURL.h" |
|
31 #include "SVGElement.h" |
|
32 #include "SVGSVGElement.h" |
|
33 #include <runtime/JSString.h> |
|
34 #include <wtf/GetPtr.h> |
|
35 |
|
36 using namespace JSC; |
|
37 |
|
38 namespace WebCore { |
|
39 |
|
40 ASSERT_CLASS_FITS_IN_CELL(JSSVGElement); |
|
41 |
|
42 /* Hash table */ |
|
43 #if ENABLE(JIT) |
|
44 #define THUNK_GENERATOR(generator) , generator |
|
45 #else |
|
46 #define THUNK_GENERATOR(generator) |
|
47 #endif |
|
48 |
|
49 static const HashTableValue JSSVGElementTableValues[6] = |
|
50 { |
|
51 { "id", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGElementId), (intptr_t)setJSSVGElementId THUNK_GENERATOR(0) }, |
|
52 { "xmlbase", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGElementXmlbase), (intptr_t)setJSSVGElementXmlbase THUNK_GENERATOR(0) }, |
|
53 { "ownerSVGElement", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGElementOwnerSVGElement), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
54 { "viewportElement", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGElementViewportElement), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
55 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
56 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
57 }; |
|
58 |
|
59 #undef THUNK_GENERATOR |
|
60 static JSC_CONST_HASHTABLE HashTable JSSVGElementTable = { 16, 15, JSSVGElementTableValues, 0 }; |
|
61 /* Hash table for constructor */ |
|
62 #if ENABLE(JIT) |
|
63 #define THUNK_GENERATOR(generator) , generator |
|
64 #else |
|
65 #define THUNK_GENERATOR(generator) |
|
66 #endif |
|
67 |
|
68 static const HashTableValue JSSVGElementConstructorTableValues[1] = |
|
69 { |
|
70 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
71 }; |
|
72 |
|
73 #undef THUNK_GENERATOR |
|
74 static JSC_CONST_HASHTABLE HashTable JSSVGElementConstructorTable = { 1, 0, JSSVGElementConstructorTableValues, 0 }; |
|
75 class JSSVGElementConstructor : public DOMConstructorObject { |
|
76 public: |
|
77 JSSVGElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
78 |
|
79 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
80 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
81 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
82 static const JSC::ClassInfo s_info; |
|
83 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
84 { |
|
85 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
86 } |
|
87 protected: |
|
88 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
89 }; |
|
90 |
|
91 const ClassInfo JSSVGElementConstructor::s_info = { "SVGElementConstructor", 0, &JSSVGElementConstructorTable, 0 }; |
|
92 |
|
93 JSSVGElementConstructor::JSSVGElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
94 : DOMConstructorObject(JSSVGElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
95 { |
|
96 putDirect(exec->propertyNames().prototype, JSSVGElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
97 } |
|
98 |
|
99 bool JSSVGElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
100 { |
|
101 return getStaticValueSlot<JSSVGElementConstructor, DOMObject>(exec, &JSSVGElementConstructorTable, this, propertyName, slot); |
|
102 } |
|
103 |
|
104 bool JSSVGElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
105 { |
|
106 return getStaticValueDescriptor<JSSVGElementConstructor, DOMObject>(exec, &JSSVGElementConstructorTable, this, propertyName, descriptor); |
|
107 } |
|
108 |
|
109 /* Hash table for prototype */ |
|
110 #if ENABLE(JIT) |
|
111 #define THUNK_GENERATOR(generator) , generator |
|
112 #else |
|
113 #define THUNK_GENERATOR(generator) |
|
114 #endif |
|
115 |
|
116 static const HashTableValue JSSVGElementPrototypeTableValues[1] = |
|
117 { |
|
118 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
119 }; |
|
120 |
|
121 #undef THUNK_GENERATOR |
|
122 static JSC_CONST_HASHTABLE HashTable JSSVGElementPrototypeTable = { 1, 0, JSSVGElementPrototypeTableValues, 0 }; |
|
123 const ClassInfo JSSVGElementPrototype::s_info = { "SVGElementPrototype", 0, &JSSVGElementPrototypeTable, 0 }; |
|
124 |
|
125 JSObject* JSSVGElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
126 { |
|
127 return getDOMPrototype<JSSVGElement>(exec, globalObject); |
|
128 } |
|
129 |
|
130 const ClassInfo JSSVGElement::s_info = { "SVGElement", &JSElement::s_info, &JSSVGElementTable, 0 }; |
|
131 |
|
132 JSSVGElement::JSSVGElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGElement> impl) |
|
133 : JSElement(structure, globalObject, impl) |
|
134 { |
|
135 } |
|
136 |
|
137 JSObject* JSSVGElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
138 { |
|
139 return new (exec) JSSVGElementPrototype(globalObject, JSSVGElementPrototype::createStructure(JSElementPrototype::self(exec, globalObject))); |
|
140 } |
|
141 |
|
142 bool JSSVGElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
143 { |
|
144 return getStaticValueSlot<JSSVGElement, Base>(exec, &JSSVGElementTable, this, propertyName, slot); |
|
145 } |
|
146 |
|
147 bool JSSVGElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
148 { |
|
149 return getStaticValueDescriptor<JSSVGElement, Base>(exec, &JSSVGElementTable, this, propertyName, descriptor); |
|
150 } |
|
151 |
|
152 JSValue jsSVGElementId(ExecState* exec, JSValue slotBase, const Identifier&) |
|
153 { |
|
154 JSSVGElement* castedThis = static_cast<JSSVGElement*>(asObject(slotBase)); |
|
155 UNUSED_PARAM(exec); |
|
156 SVGElement* imp = static_cast<SVGElement*>(castedThis->impl()); |
|
157 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::idAttr)); |
|
158 return result; |
|
159 } |
|
160 |
|
161 JSValue jsSVGElementXmlbase(ExecState* exec, JSValue slotBase, const Identifier&) |
|
162 { |
|
163 JSSVGElement* castedThis = static_cast<JSSVGElement*>(asObject(slotBase)); |
|
164 UNUSED_PARAM(exec); |
|
165 SVGElement* imp = static_cast<SVGElement*>(castedThis->impl()); |
|
166 JSValue result = jsString(exec, imp->xmlbase()); |
|
167 return result; |
|
168 } |
|
169 |
|
170 JSValue jsSVGElementOwnerSVGElement(ExecState* exec, JSValue slotBase, const Identifier&) |
|
171 { |
|
172 JSSVGElement* castedThis = static_cast<JSSVGElement*>(asObject(slotBase)); |
|
173 UNUSED_PARAM(exec); |
|
174 SVGElement* imp = static_cast<SVGElement*>(castedThis->impl()); |
|
175 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->ownerSVGElement())); |
|
176 return result; |
|
177 } |
|
178 |
|
179 JSValue jsSVGElementViewportElement(ExecState* exec, JSValue slotBase, const Identifier&) |
|
180 { |
|
181 JSSVGElement* castedThis = static_cast<JSSVGElement*>(asObject(slotBase)); |
|
182 UNUSED_PARAM(exec); |
|
183 SVGElement* imp = static_cast<SVGElement*>(castedThis->impl()); |
|
184 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->viewportElement())); |
|
185 return result; |
|
186 } |
|
187 |
|
188 JSValue jsSVGElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
189 { |
|
190 JSSVGElement* domObject = static_cast<JSSVGElement*>(asObject(slotBase)); |
|
191 return JSSVGElement::getConstructor(exec, domObject->globalObject()); |
|
192 } |
|
193 void JSSVGElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
194 { |
|
195 lookupPut<JSSVGElement, Base>(exec, propertyName, value, &JSSVGElementTable, this, slot); |
|
196 } |
|
197 |
|
198 void setJSSVGElementId(ExecState* exec, JSObject* thisObject, JSValue value) |
|
199 { |
|
200 JSSVGElement* castedThis = static_cast<JSSVGElement*>(thisObject); |
|
201 SVGElement* imp = static_cast<SVGElement*>(castedThis->impl()); |
|
202 ExceptionCode ec = 0; |
|
203 imp->setAttribute(WebCore::HTMLNames::idAttr, valueToStringWithNullCheck(exec, value), ec); |
|
204 setDOMException(exec, ec); |
|
205 } |
|
206 |
|
207 void setJSSVGElementXmlbase(ExecState* exec, JSObject* thisObject, JSValue value) |
|
208 { |
|
209 JSSVGElement* castedThis = static_cast<JSSVGElement*>(thisObject); |
|
210 SVGElement* imp = static_cast<SVGElement*>(castedThis->impl()); |
|
211 ExceptionCode ec = 0; |
|
212 imp->setXmlbase(valueToStringWithNullCheck(exec, value), ec); |
|
213 setDOMException(exec, ec); |
|
214 } |
|
215 |
|
216 JSValue JSSVGElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
217 { |
|
218 return getDOMConstructor<JSSVGElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
219 } |
|
220 |
|
221 SVGElement* toSVGElement(JSC::JSValue value) |
|
222 { |
|
223 return value.inherits(&JSSVGElement::s_info) ? static_cast<JSSVGElement*>(asObject(value))->impl() : 0; |
|
224 } |
|
225 |
|
226 } |
|
227 |
|
228 #endif // ENABLE(SVG) |