tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSHTMLLinkElement.cpp
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 "JSHTMLLinkElement.h"
23
24 #include "HTMLLinkElement.h"
25 #include "HTMLNames.h"
26 #include "JSStyleSheet.h"
27 #include "KURL.h"
28 #include "StyleSheet.h"
29 #include <runtime/JSString.h>
30 #include <wtf/GetPtr.h>
31
32 using namespace JSC;
33
34 namespace WebCore {
35
36 ASSERT_CLASS_FITS_IN_CELL(JSHTMLLinkElement);
37
38 /* Hash table */
39 #if ENABLE(JIT)
40 #define THUNK_GENERATOR(generator) , generator
41 #else
42 #define THUNK_GENERATOR(generator)
43 #endif
44 #if ENABLE(DFG_JIT)
45 #define INTRINSIC(intrinsic) , intrinsic
46 #else
47 #define INTRINSIC(intrinsic)
48 #endif
49
50 static const HashTableValue JSHTMLLinkElementTableValues[] =
51 {
52     { "disabled", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementDisabled), (intptr_t)setJSHTMLLinkElementDisabled THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53     { "charset", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementCharset), (intptr_t)setJSHTMLLinkElementCharset THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54     { "href", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementHref), (intptr_t)setJSHTMLLinkElementHref THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55     { "hreflang", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementHreflang), (intptr_t)setJSHTMLLinkElementHreflang THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56     { "media", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementMedia), (intptr_t)setJSHTMLLinkElementMedia THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57     { "rel", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementRel), (intptr_t)setJSHTMLLinkElementRel THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58     { "rev", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementRev), (intptr_t)setJSHTMLLinkElementRev THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59     { "sizes", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementSizes), (intptr_t)setJSHTMLLinkElementSizes THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60     { "target", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementTarget), (intptr_t)setJSHTMLLinkElementTarget THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
61     { "type", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementType), (intptr_t)setJSHTMLLinkElementType THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
62     { "sheet", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementSheet), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
63     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
64     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
65 };
66
67 #undef THUNK_GENERATOR
68 static const HashTable JSHTMLLinkElementTable = { 33, 31, JSHTMLLinkElementTableValues, 0 };
69 /* Hash table for constructor */
70 #if ENABLE(JIT)
71 #define THUNK_GENERATOR(generator) , generator
72 #else
73 #define THUNK_GENERATOR(generator)
74 #endif
75 #if ENABLE(DFG_JIT)
76 #define INTRINSIC(intrinsic) , intrinsic
77 #else
78 #define INTRINSIC(intrinsic)
79 #endif
80
81 static const HashTableValue JSHTMLLinkElementConstructorTableValues[] =
82 {
83     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
84 };
85
86 #undef THUNK_GENERATOR
87 static const HashTable JSHTMLLinkElementConstructorTable = { 1, 0, JSHTMLLinkElementConstructorTableValues, 0 };
88 const ClassInfo JSHTMLLinkElementConstructor::s_info = { "HTMLLinkElementConstructor", &DOMConstructorObject::s_info, &JSHTMLLinkElementConstructorTable, 0, CREATE_METHOD_TABLE(JSHTMLLinkElementConstructor) };
89
90 JSHTMLLinkElementConstructor::JSHTMLLinkElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
91     : DOMConstructorObject(structure, globalObject)
92 {
93 }
94
95 void JSHTMLLinkElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
96 {
97     Base::finishCreation(exec->globalData());
98     ASSERT(inherits(&s_info));
99     putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLLinkElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
100 }
101
102 bool JSHTMLLinkElementConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
103 {
104     return getStaticValueSlot<JSHTMLLinkElementConstructor, JSDOMWrapper>(exec, &JSHTMLLinkElementConstructorTable, static_cast<JSHTMLLinkElementConstructor*>(cell), propertyName, slot);
105 }
106
107 bool JSHTMLLinkElementConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
108 {
109     return getStaticValueDescriptor<JSHTMLLinkElementConstructor, JSDOMWrapper>(exec, &JSHTMLLinkElementConstructorTable, static_cast<JSHTMLLinkElementConstructor*>(object), propertyName, descriptor);
110 }
111
112 /* Hash table for prototype */
113 #if ENABLE(JIT)
114 #define THUNK_GENERATOR(generator) , generator
115 #else
116 #define THUNK_GENERATOR(generator)
117 #endif
118 #if ENABLE(DFG_JIT)
119 #define INTRINSIC(intrinsic) , intrinsic
120 #else
121 #define INTRINSIC(intrinsic)
122 #endif
123
124 static const HashTableValue JSHTMLLinkElementPrototypeTableValues[] =
125 {
126     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
127 };
128
129 #undef THUNK_GENERATOR
130 static const HashTable JSHTMLLinkElementPrototypeTable = { 1, 0, JSHTMLLinkElementPrototypeTableValues, 0 };
131 const ClassInfo JSHTMLLinkElementPrototype::s_info = { "HTMLLinkElementPrototype", &JSC::JSNonFinalObject::s_info, &JSHTMLLinkElementPrototypeTable, 0, CREATE_METHOD_TABLE(JSHTMLLinkElementPrototype) };
132
133 JSObject* JSHTMLLinkElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
134 {
135     return getDOMPrototype<JSHTMLLinkElement>(exec, globalObject);
136 }
137
138 const ClassInfo JSHTMLLinkElement::s_info = { "HTMLLinkElement", &JSHTMLElement::s_info, &JSHTMLLinkElementTable, 0 , CREATE_METHOD_TABLE(JSHTMLLinkElement) };
139
140 JSHTMLLinkElement::JSHTMLLinkElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLLinkElement> impl)
141     : JSHTMLElement(structure, globalObject, impl)
142 {
143 }
144
145 void JSHTMLLinkElement::finishCreation(JSGlobalData& globalData)
146 {
147     Base::finishCreation(globalData);
148     ASSERT(inherits(&s_info));
149 }
150
151 JSObject* JSHTMLLinkElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
152 {
153     return JSHTMLLinkElementPrototype::create(exec->globalData(), globalObject, JSHTMLLinkElementPrototype::createStructure(exec->globalData(), globalObject, JSHTMLElementPrototype::self(exec, globalObject)));
154 }
155
156 bool JSHTMLLinkElement::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
157 {
158     JSHTMLLinkElement* thisObject = jsCast<JSHTMLLinkElement*>(cell);
159     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
160     return getStaticValueSlot<JSHTMLLinkElement, Base>(exec, &JSHTMLLinkElementTable, thisObject, propertyName, slot);
161 }
162
163 bool JSHTMLLinkElement::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
164 {
165     JSHTMLLinkElement* thisObject = jsCast<JSHTMLLinkElement*>(object);
166     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
167     return getStaticValueDescriptor<JSHTMLLinkElement, Base>(exec, &JSHTMLLinkElementTable, thisObject, propertyName, descriptor);
168 }
169
170 JSValue jsHTMLLinkElementDisabled(ExecState* exec, JSValue slotBase, const Identifier&)
171 {
172     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase));
173     UNUSED_PARAM(exec);
174     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
175     JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::disabledAttr));
176     return result;
177 }
178
179
180 JSValue jsHTMLLinkElementCharset(ExecState* exec, JSValue slotBase, const Identifier&)
181 {
182     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase));
183     UNUSED_PARAM(exec);
184     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
185     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::charsetAttr));
186     return result;
187 }
188
189
190 JSValue jsHTMLLinkElementHref(ExecState* exec, JSValue slotBase, const Identifier&)
191 {
192     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase));
193     UNUSED_PARAM(exec);
194     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
195     JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::hrefAttr));
196     return result;
197 }
198
199
200 JSValue jsHTMLLinkElementHreflang(ExecState* exec, JSValue slotBase, const Identifier&)
201 {
202     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase));
203     UNUSED_PARAM(exec);
204     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
205     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::hreflangAttr));
206     return result;
207 }
208
209
210 JSValue jsHTMLLinkElementMedia(ExecState* exec, JSValue slotBase, const Identifier&)
211 {
212     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase));
213     UNUSED_PARAM(exec);
214     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
215     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::mediaAttr));
216     return result;
217 }
218
219
220 JSValue jsHTMLLinkElementRel(ExecState* exec, JSValue slotBase, const Identifier&)
221 {
222     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase));
223     UNUSED_PARAM(exec);
224     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
225     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::relAttr));
226     return result;
227 }
228
229
230 JSValue jsHTMLLinkElementRev(ExecState* exec, JSValue slotBase, const Identifier&)
231 {
232     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase));
233     UNUSED_PARAM(exec);
234     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
235     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::revAttr));
236     return result;
237 }
238
239
240 JSValue jsHTMLLinkElementSizes(ExecState* exec, JSValue slotBase, const Identifier&)
241 {
242     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase));
243     return castedThis->sizes(exec);
244 }
245
246
247 JSValue jsHTMLLinkElementTarget(ExecState* exec, JSValue slotBase, const Identifier&)
248 {
249     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase));
250     UNUSED_PARAM(exec);
251     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
252     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::targetAttr));
253     return result;
254 }
255
256
257 JSValue jsHTMLLinkElementType(ExecState* exec, JSValue slotBase, const Identifier&)
258 {
259     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase));
260     UNUSED_PARAM(exec);
261     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
262     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::typeAttr));
263     return result;
264 }
265
266
267 JSValue jsHTMLLinkElementSheet(ExecState* exec, JSValue slotBase, const Identifier&)
268 {
269     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase));
270     UNUSED_PARAM(exec);
271     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
272     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->sheet()));
273     return result;
274 }
275
276
277 JSValue jsHTMLLinkElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
278 {
279     JSHTMLLinkElement* domObject = static_cast<JSHTMLLinkElement*>(asObject(slotBase));
280     return JSHTMLLinkElement::getConstructor(exec, domObject->globalObject());
281 }
282
283 void JSHTMLLinkElement::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
284 {
285     JSHTMLLinkElement* thisObject = jsCast<JSHTMLLinkElement*>(cell);
286     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
287     lookupPut<JSHTMLLinkElement, Base>(exec, propertyName, value, &JSHTMLLinkElementTable, thisObject, slot);
288 }
289
290 void setJSHTMLLinkElementDisabled(ExecState* exec, JSObject* thisObject, JSValue value)
291 {
292     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject);
293     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
294     imp->setBooleanAttribute(WebCore::HTMLNames::disabledAttr, value.toBoolean(exec));
295 }
296
297
298 void setJSHTMLLinkElementCharset(ExecState* exec, JSObject* thisObject, JSValue value)
299 {
300     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject);
301     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
302     imp->setAttribute(WebCore::HTMLNames::charsetAttr, valueToStringWithNullCheck(exec, value));
303 }
304
305
306 void setJSHTMLLinkElementHref(ExecState* exec, JSObject* thisObject, JSValue value)
307 {
308     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject);
309     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
310     imp->setAttribute(WebCore::HTMLNames::hrefAttr, valueToStringWithNullCheck(exec, value));
311 }
312
313
314 void setJSHTMLLinkElementHreflang(ExecState* exec, JSObject* thisObject, JSValue value)
315 {
316     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject);
317     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
318     imp->setAttribute(WebCore::HTMLNames::hreflangAttr, valueToStringWithNullCheck(exec, value));
319 }
320
321
322 void setJSHTMLLinkElementMedia(ExecState* exec, JSObject* thisObject, JSValue value)
323 {
324     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject);
325     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
326     imp->setAttribute(WebCore::HTMLNames::mediaAttr, valueToStringWithNullCheck(exec, value));
327 }
328
329
330 void setJSHTMLLinkElementRel(ExecState* exec, JSObject* thisObject, JSValue value)
331 {
332     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject);
333     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
334     imp->setAttribute(WebCore::HTMLNames::relAttr, valueToStringWithNullCheck(exec, value));
335 }
336
337
338 void setJSHTMLLinkElementRev(ExecState* exec, JSObject* thisObject, JSValue value)
339 {
340     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject);
341     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
342     imp->setAttribute(WebCore::HTMLNames::revAttr, valueToStringWithNullCheck(exec, value));
343 }
344
345
346 void setJSHTMLLinkElementSizes(ExecState* exec, JSObject* thisObject, JSValue value)
347 {
348     static_cast<JSHTMLLinkElement*>(thisObject)->setSizes(exec, value);
349 }
350
351
352 void setJSHTMLLinkElementTarget(ExecState* exec, JSObject* thisObject, JSValue value)
353 {
354     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject);
355     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
356     imp->setAttribute(WebCore::HTMLNames::targetAttr, valueToStringWithNullCheck(exec, value));
357 }
358
359
360 void setJSHTMLLinkElementType(ExecState* exec, JSObject* thisObject, JSValue value)
361 {
362     JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject);
363     HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl());
364     imp->setAttribute(WebCore::HTMLNames::typeAttr, valueToStringWithNullCheck(exec, value));
365 }
366
367
368 JSValue JSHTMLLinkElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
369 {
370     return getDOMConstructor<JSHTMLLinkElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
371 }
372
373
374 }