|
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 "JSHTMLAreaElement.h" |
|
23 |
|
24 #include "HTMLAreaElement.h" |
|
25 #include "HTMLNames.h" |
|
26 #include "KURL.h" |
|
27 #include <runtime/JSString.h> |
|
28 #include <wtf/GetPtr.h> |
|
29 |
|
30 using namespace JSC; |
|
31 |
|
32 namespace WebCore { |
|
33 |
|
34 ASSERT_CLASS_FITS_IN_CELL(JSHTMLAreaElement); |
|
35 |
|
36 /* Hash table */ |
|
37 #if ENABLE(JIT) |
|
38 #define THUNK_GENERATOR(generator) , generator |
|
39 #else |
|
40 #define THUNK_GENERATOR(generator) |
|
41 #endif |
|
42 |
|
43 static const HashTableValue JSHTMLAreaElementTableValues[16] = |
|
44 { |
|
45 { "accessKey", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementAccessKey), (intptr_t)setJSHTMLAreaElementAccessKey THUNK_GENERATOR(0) }, |
|
46 { "alt", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementAlt), (intptr_t)setJSHTMLAreaElementAlt THUNK_GENERATOR(0) }, |
|
47 { "coords", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementCoords), (intptr_t)setJSHTMLAreaElementCoords THUNK_GENERATOR(0) }, |
|
48 { "href", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementHref), (intptr_t)setJSHTMLAreaElementHref THUNK_GENERATOR(0) }, |
|
49 { "noHref", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementNoHref), (intptr_t)setJSHTMLAreaElementNoHref THUNK_GENERATOR(0) }, |
|
50 { "shape", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementShape), (intptr_t)setJSHTMLAreaElementShape THUNK_GENERATOR(0) }, |
|
51 { "target", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementTarget), (intptr_t)setJSHTMLAreaElementTarget THUNK_GENERATOR(0) }, |
|
52 { "hash", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementHash), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
53 { "host", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementHost), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
54 { "hostname", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementHostname), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
55 { "pathname", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementPathname), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
56 { "port", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementPort), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
57 { "protocol", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementProtocol), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
58 { "search", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementSearch), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
59 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAreaElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
60 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
61 }; |
|
62 |
|
63 #undef THUNK_GENERATOR |
|
64 static JSC_CONST_HASHTABLE HashTable JSHTMLAreaElementTable = { 36, 31, JSHTMLAreaElementTableValues, 0 }; |
|
65 /* Hash table for constructor */ |
|
66 #if ENABLE(JIT) |
|
67 #define THUNK_GENERATOR(generator) , generator |
|
68 #else |
|
69 #define THUNK_GENERATOR(generator) |
|
70 #endif |
|
71 |
|
72 static const HashTableValue JSHTMLAreaElementConstructorTableValues[1] = |
|
73 { |
|
74 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
75 }; |
|
76 |
|
77 #undef THUNK_GENERATOR |
|
78 static JSC_CONST_HASHTABLE HashTable JSHTMLAreaElementConstructorTable = { 1, 0, JSHTMLAreaElementConstructorTableValues, 0 }; |
|
79 class JSHTMLAreaElementConstructor : public DOMConstructorObject { |
|
80 public: |
|
81 JSHTMLAreaElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
82 |
|
83 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
84 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
85 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
86 static const JSC::ClassInfo s_info; |
|
87 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
88 { |
|
89 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
90 } |
|
91 protected: |
|
92 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
93 }; |
|
94 |
|
95 const ClassInfo JSHTMLAreaElementConstructor::s_info = { "HTMLAreaElementConstructor", 0, &JSHTMLAreaElementConstructorTable, 0 }; |
|
96 |
|
97 JSHTMLAreaElementConstructor::JSHTMLAreaElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
98 : DOMConstructorObject(JSHTMLAreaElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
99 { |
|
100 putDirect(exec->propertyNames().prototype, JSHTMLAreaElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
101 } |
|
102 |
|
103 bool JSHTMLAreaElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
104 { |
|
105 return getStaticValueSlot<JSHTMLAreaElementConstructor, DOMObject>(exec, &JSHTMLAreaElementConstructorTable, this, propertyName, slot); |
|
106 } |
|
107 |
|
108 bool JSHTMLAreaElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
109 { |
|
110 return getStaticValueDescriptor<JSHTMLAreaElementConstructor, DOMObject>(exec, &JSHTMLAreaElementConstructorTable, this, propertyName, descriptor); |
|
111 } |
|
112 |
|
113 /* Hash table for prototype */ |
|
114 #if ENABLE(JIT) |
|
115 #define THUNK_GENERATOR(generator) , generator |
|
116 #else |
|
117 #define THUNK_GENERATOR(generator) |
|
118 #endif |
|
119 |
|
120 static const HashTableValue JSHTMLAreaElementPrototypeTableValues[1] = |
|
121 { |
|
122 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
123 }; |
|
124 |
|
125 #undef THUNK_GENERATOR |
|
126 static JSC_CONST_HASHTABLE HashTable JSHTMLAreaElementPrototypeTable = { 1, 0, JSHTMLAreaElementPrototypeTableValues, 0 }; |
|
127 const ClassInfo JSHTMLAreaElementPrototype::s_info = { "HTMLAreaElementPrototype", 0, &JSHTMLAreaElementPrototypeTable, 0 }; |
|
128 |
|
129 JSObject* JSHTMLAreaElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
130 { |
|
131 return getDOMPrototype<JSHTMLAreaElement>(exec, globalObject); |
|
132 } |
|
133 |
|
134 const ClassInfo JSHTMLAreaElement::s_info = { "HTMLAreaElement", &JSHTMLElement::s_info, &JSHTMLAreaElementTable, 0 }; |
|
135 |
|
136 JSHTMLAreaElement::JSHTMLAreaElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLAreaElement> impl) |
|
137 : JSHTMLElement(structure, globalObject, impl) |
|
138 { |
|
139 } |
|
140 |
|
141 JSObject* JSHTMLAreaElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
142 { |
|
143 return new (exec) JSHTMLAreaElementPrototype(globalObject, JSHTMLAreaElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
144 } |
|
145 |
|
146 bool JSHTMLAreaElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
147 { |
|
148 return getStaticValueSlot<JSHTMLAreaElement, Base>(exec, &JSHTMLAreaElementTable, this, propertyName, slot); |
|
149 } |
|
150 |
|
151 bool JSHTMLAreaElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
152 { |
|
153 return getStaticValueDescriptor<JSHTMLAreaElement, Base>(exec, &JSHTMLAreaElementTable, this, propertyName, descriptor); |
|
154 } |
|
155 |
|
156 JSValue jsHTMLAreaElementAccessKey(ExecState* exec, JSValue slotBase, const Identifier&) |
|
157 { |
|
158 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
159 UNUSED_PARAM(exec); |
|
160 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
161 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::accesskeyAttr)); |
|
162 return result; |
|
163 } |
|
164 |
|
165 JSValue jsHTMLAreaElementAlt(ExecState* exec, JSValue slotBase, const Identifier&) |
|
166 { |
|
167 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
168 UNUSED_PARAM(exec); |
|
169 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
170 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::altAttr)); |
|
171 return result; |
|
172 } |
|
173 |
|
174 JSValue jsHTMLAreaElementCoords(ExecState* exec, JSValue slotBase, const Identifier&) |
|
175 { |
|
176 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
177 UNUSED_PARAM(exec); |
|
178 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
179 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::coordsAttr)); |
|
180 return result; |
|
181 } |
|
182 |
|
183 JSValue jsHTMLAreaElementHref(ExecState* exec, JSValue slotBase, const Identifier&) |
|
184 { |
|
185 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
186 UNUSED_PARAM(exec); |
|
187 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
188 JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::hrefAttr)); |
|
189 return result; |
|
190 } |
|
191 |
|
192 JSValue jsHTMLAreaElementNoHref(ExecState* exec, JSValue slotBase, const Identifier&) |
|
193 { |
|
194 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
195 UNUSED_PARAM(exec); |
|
196 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
197 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::nohrefAttr)); |
|
198 return result; |
|
199 } |
|
200 |
|
201 JSValue jsHTMLAreaElementShape(ExecState* exec, JSValue slotBase, const Identifier&) |
|
202 { |
|
203 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
204 UNUSED_PARAM(exec); |
|
205 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
206 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::shapeAttr)); |
|
207 return result; |
|
208 } |
|
209 |
|
210 JSValue jsHTMLAreaElementTarget(ExecState* exec, JSValue slotBase, const Identifier&) |
|
211 { |
|
212 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
213 UNUSED_PARAM(exec); |
|
214 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
215 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::targetAttr)); |
|
216 return result; |
|
217 } |
|
218 |
|
219 JSValue jsHTMLAreaElementHash(ExecState* exec, JSValue slotBase, const Identifier&) |
|
220 { |
|
221 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
222 UNUSED_PARAM(exec); |
|
223 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
224 JSValue result = jsString(exec, imp->hash()); |
|
225 return result; |
|
226 } |
|
227 |
|
228 JSValue jsHTMLAreaElementHost(ExecState* exec, JSValue slotBase, const Identifier&) |
|
229 { |
|
230 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
231 UNUSED_PARAM(exec); |
|
232 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
233 JSValue result = jsString(exec, imp->host()); |
|
234 return result; |
|
235 } |
|
236 |
|
237 JSValue jsHTMLAreaElementHostname(ExecState* exec, JSValue slotBase, const Identifier&) |
|
238 { |
|
239 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
240 UNUSED_PARAM(exec); |
|
241 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
242 JSValue result = jsString(exec, imp->hostname()); |
|
243 return result; |
|
244 } |
|
245 |
|
246 JSValue jsHTMLAreaElementPathname(ExecState* exec, JSValue slotBase, const Identifier&) |
|
247 { |
|
248 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
249 UNUSED_PARAM(exec); |
|
250 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
251 JSValue result = jsString(exec, imp->pathname()); |
|
252 return result; |
|
253 } |
|
254 |
|
255 JSValue jsHTMLAreaElementPort(ExecState* exec, JSValue slotBase, const Identifier&) |
|
256 { |
|
257 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
258 UNUSED_PARAM(exec); |
|
259 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
260 JSValue result = jsString(exec, imp->port()); |
|
261 return result; |
|
262 } |
|
263 |
|
264 JSValue jsHTMLAreaElementProtocol(ExecState* exec, JSValue slotBase, const Identifier&) |
|
265 { |
|
266 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
267 UNUSED_PARAM(exec); |
|
268 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
269 JSValue result = jsString(exec, imp->protocol()); |
|
270 return result; |
|
271 } |
|
272 |
|
273 JSValue jsHTMLAreaElementSearch(ExecState* exec, JSValue slotBase, const Identifier&) |
|
274 { |
|
275 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
276 UNUSED_PARAM(exec); |
|
277 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
278 JSValue result = jsString(exec, imp->search()); |
|
279 return result; |
|
280 } |
|
281 |
|
282 JSValue jsHTMLAreaElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
283 { |
|
284 JSHTMLAreaElement* domObject = static_cast<JSHTMLAreaElement*>(asObject(slotBase)); |
|
285 return JSHTMLAreaElement::getConstructor(exec, domObject->globalObject()); |
|
286 } |
|
287 void JSHTMLAreaElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
288 { |
|
289 lookupPut<JSHTMLAreaElement, Base>(exec, propertyName, value, &JSHTMLAreaElementTable, this, slot); |
|
290 } |
|
291 |
|
292 void setJSHTMLAreaElementAccessKey(ExecState* exec, JSObject* thisObject, JSValue value) |
|
293 { |
|
294 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(thisObject); |
|
295 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
296 imp->setAttribute(WebCore::HTMLNames::accesskeyAttr, valueToStringWithNullCheck(exec, value)); |
|
297 } |
|
298 |
|
299 void setJSHTMLAreaElementAlt(ExecState* exec, JSObject* thisObject, JSValue value) |
|
300 { |
|
301 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(thisObject); |
|
302 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
303 imp->setAttribute(WebCore::HTMLNames::altAttr, valueToStringWithNullCheck(exec, value)); |
|
304 } |
|
305 |
|
306 void setJSHTMLAreaElementCoords(ExecState* exec, JSObject* thisObject, JSValue value) |
|
307 { |
|
308 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(thisObject); |
|
309 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
310 imp->setAttribute(WebCore::HTMLNames::coordsAttr, valueToStringWithNullCheck(exec, value)); |
|
311 } |
|
312 |
|
313 void setJSHTMLAreaElementHref(ExecState* exec, JSObject* thisObject, JSValue value) |
|
314 { |
|
315 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(thisObject); |
|
316 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
317 imp->setAttribute(WebCore::HTMLNames::hrefAttr, valueToStringWithNullCheck(exec, value)); |
|
318 } |
|
319 |
|
320 void setJSHTMLAreaElementNoHref(ExecState* exec, JSObject* thisObject, JSValue value) |
|
321 { |
|
322 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(thisObject); |
|
323 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
324 imp->setBooleanAttribute(WebCore::HTMLNames::nohrefAttr, value.toBoolean(exec)); |
|
325 } |
|
326 |
|
327 void setJSHTMLAreaElementShape(ExecState* exec, JSObject* thisObject, JSValue value) |
|
328 { |
|
329 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(thisObject); |
|
330 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
331 imp->setAttribute(WebCore::HTMLNames::shapeAttr, valueToStringWithNullCheck(exec, value)); |
|
332 } |
|
333 |
|
334 void setJSHTMLAreaElementTarget(ExecState* exec, JSObject* thisObject, JSValue value) |
|
335 { |
|
336 JSHTMLAreaElement* castedThis = static_cast<JSHTMLAreaElement*>(thisObject); |
|
337 HTMLAreaElement* imp = static_cast<HTMLAreaElement*>(castedThis->impl()); |
|
338 imp->setAttribute(WebCore::HTMLNames::targetAttr, valueToStringWithNullCheck(exec, value)); |
|
339 } |
|
340 |
|
341 JSValue JSHTMLAreaElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
342 { |
|
343 return getDOMConstructor<JSHTMLAreaElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
344 } |
|
345 |
|
346 |
|
347 } |