|
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 |
|
45 static const HashTableValue JSHTMLLinkElementTableValues[12] = |
|
46 { |
|
47 { "disabled", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementDisabled), (intptr_t)setJSHTMLLinkElementDisabled THUNK_GENERATOR(0) }, |
|
48 { "charset", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementCharset), (intptr_t)setJSHTMLLinkElementCharset THUNK_GENERATOR(0) }, |
|
49 { "href", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementHref), (intptr_t)setJSHTMLLinkElementHref THUNK_GENERATOR(0) }, |
|
50 { "hreflang", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementHreflang), (intptr_t)setJSHTMLLinkElementHreflang THUNK_GENERATOR(0) }, |
|
51 { "media", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementMedia), (intptr_t)setJSHTMLLinkElementMedia THUNK_GENERATOR(0) }, |
|
52 { "rel", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementRel), (intptr_t)setJSHTMLLinkElementRel THUNK_GENERATOR(0) }, |
|
53 { "rev", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementRev), (intptr_t)setJSHTMLLinkElementRev THUNK_GENERATOR(0) }, |
|
54 { "target", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementTarget), (intptr_t)setJSHTMLLinkElementTarget THUNK_GENERATOR(0) }, |
|
55 { "type", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementType), (intptr_t)setJSHTMLLinkElementType THUNK_GENERATOR(0) }, |
|
56 { "sheet", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementSheet), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
57 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
58 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
59 }; |
|
60 |
|
61 #undef THUNK_GENERATOR |
|
62 static JSC_CONST_HASHTABLE HashTable JSHTMLLinkElementTable = { 33, 31, JSHTMLLinkElementTableValues, 0 }; |
|
63 /* Hash table for constructor */ |
|
64 #if ENABLE(JIT) |
|
65 #define THUNK_GENERATOR(generator) , generator |
|
66 #else |
|
67 #define THUNK_GENERATOR(generator) |
|
68 #endif |
|
69 |
|
70 static const HashTableValue JSHTMLLinkElementConstructorTableValues[1] = |
|
71 { |
|
72 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
73 }; |
|
74 |
|
75 #undef THUNK_GENERATOR |
|
76 static JSC_CONST_HASHTABLE HashTable JSHTMLLinkElementConstructorTable = { 1, 0, JSHTMLLinkElementConstructorTableValues, 0 }; |
|
77 class JSHTMLLinkElementConstructor : public DOMConstructorObject { |
|
78 public: |
|
79 JSHTMLLinkElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
80 |
|
81 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
82 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
83 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
84 static const JSC::ClassInfo s_info; |
|
85 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
86 { |
|
87 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
88 } |
|
89 protected: |
|
90 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
91 }; |
|
92 |
|
93 const ClassInfo JSHTMLLinkElementConstructor::s_info = { "HTMLLinkElementConstructor", 0, &JSHTMLLinkElementConstructorTable, 0 }; |
|
94 |
|
95 JSHTMLLinkElementConstructor::JSHTMLLinkElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
96 : DOMConstructorObject(JSHTMLLinkElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
97 { |
|
98 putDirect(exec->propertyNames().prototype, JSHTMLLinkElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
99 } |
|
100 |
|
101 bool JSHTMLLinkElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
102 { |
|
103 return getStaticValueSlot<JSHTMLLinkElementConstructor, DOMObject>(exec, &JSHTMLLinkElementConstructorTable, this, propertyName, slot); |
|
104 } |
|
105 |
|
106 bool JSHTMLLinkElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
107 { |
|
108 return getStaticValueDescriptor<JSHTMLLinkElementConstructor, DOMObject>(exec, &JSHTMLLinkElementConstructorTable, this, propertyName, descriptor); |
|
109 } |
|
110 |
|
111 /* Hash table for prototype */ |
|
112 #if ENABLE(JIT) |
|
113 #define THUNK_GENERATOR(generator) , generator |
|
114 #else |
|
115 #define THUNK_GENERATOR(generator) |
|
116 #endif |
|
117 |
|
118 static const HashTableValue JSHTMLLinkElementPrototypeTableValues[1] = |
|
119 { |
|
120 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
121 }; |
|
122 |
|
123 #undef THUNK_GENERATOR |
|
124 static JSC_CONST_HASHTABLE HashTable JSHTMLLinkElementPrototypeTable = { 1, 0, JSHTMLLinkElementPrototypeTableValues, 0 }; |
|
125 const ClassInfo JSHTMLLinkElementPrototype::s_info = { "HTMLLinkElementPrototype", 0, &JSHTMLLinkElementPrototypeTable, 0 }; |
|
126 |
|
127 JSObject* JSHTMLLinkElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
128 { |
|
129 return getDOMPrototype<JSHTMLLinkElement>(exec, globalObject); |
|
130 } |
|
131 |
|
132 const ClassInfo JSHTMLLinkElement::s_info = { "HTMLLinkElement", &JSHTMLElement::s_info, &JSHTMLLinkElementTable, 0 }; |
|
133 |
|
134 JSHTMLLinkElement::JSHTMLLinkElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLLinkElement> impl) |
|
135 : JSHTMLElement(structure, globalObject, impl) |
|
136 { |
|
137 } |
|
138 |
|
139 JSObject* JSHTMLLinkElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
140 { |
|
141 return new (exec) JSHTMLLinkElementPrototype(globalObject, JSHTMLLinkElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
142 } |
|
143 |
|
144 bool JSHTMLLinkElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
145 { |
|
146 return getStaticValueSlot<JSHTMLLinkElement, Base>(exec, &JSHTMLLinkElementTable, this, propertyName, slot); |
|
147 } |
|
148 |
|
149 bool JSHTMLLinkElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
150 { |
|
151 return getStaticValueDescriptor<JSHTMLLinkElement, Base>(exec, &JSHTMLLinkElementTable, this, propertyName, descriptor); |
|
152 } |
|
153 |
|
154 JSValue jsHTMLLinkElementDisabled(ExecState* exec, JSValue slotBase, const Identifier&) |
|
155 { |
|
156 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase)); |
|
157 UNUSED_PARAM(exec); |
|
158 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
159 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::disabledAttr)); |
|
160 return result; |
|
161 } |
|
162 |
|
163 JSValue jsHTMLLinkElementCharset(ExecState* exec, JSValue slotBase, const Identifier&) |
|
164 { |
|
165 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase)); |
|
166 UNUSED_PARAM(exec); |
|
167 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
168 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::charsetAttr)); |
|
169 return result; |
|
170 } |
|
171 |
|
172 JSValue jsHTMLLinkElementHref(ExecState* exec, JSValue slotBase, const Identifier&) |
|
173 { |
|
174 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase)); |
|
175 UNUSED_PARAM(exec); |
|
176 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
177 JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::hrefAttr)); |
|
178 return result; |
|
179 } |
|
180 |
|
181 JSValue jsHTMLLinkElementHreflang(ExecState* exec, JSValue slotBase, const Identifier&) |
|
182 { |
|
183 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase)); |
|
184 UNUSED_PARAM(exec); |
|
185 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
186 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::hreflangAttr)); |
|
187 return result; |
|
188 } |
|
189 |
|
190 JSValue jsHTMLLinkElementMedia(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->getAttribute(WebCore::HTMLNames::mediaAttr)); |
|
196 return result; |
|
197 } |
|
198 |
|
199 JSValue jsHTMLLinkElementRel(ExecState* exec, JSValue slotBase, const Identifier&) |
|
200 { |
|
201 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase)); |
|
202 UNUSED_PARAM(exec); |
|
203 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
204 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::relAttr)); |
|
205 return result; |
|
206 } |
|
207 |
|
208 JSValue jsHTMLLinkElementRev(ExecState* exec, JSValue slotBase, const Identifier&) |
|
209 { |
|
210 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase)); |
|
211 UNUSED_PARAM(exec); |
|
212 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
213 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::revAttr)); |
|
214 return result; |
|
215 } |
|
216 |
|
217 JSValue jsHTMLLinkElementTarget(ExecState* exec, JSValue slotBase, const Identifier&) |
|
218 { |
|
219 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase)); |
|
220 UNUSED_PARAM(exec); |
|
221 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
222 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::targetAttr)); |
|
223 return result; |
|
224 } |
|
225 |
|
226 JSValue jsHTMLLinkElementType(ExecState* exec, JSValue slotBase, const Identifier&) |
|
227 { |
|
228 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase)); |
|
229 UNUSED_PARAM(exec); |
|
230 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
231 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::typeAttr)); |
|
232 return result; |
|
233 } |
|
234 |
|
235 JSValue jsHTMLLinkElementSheet(ExecState* exec, JSValue slotBase, const Identifier&) |
|
236 { |
|
237 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(asObject(slotBase)); |
|
238 UNUSED_PARAM(exec); |
|
239 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
240 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->sheet())); |
|
241 return result; |
|
242 } |
|
243 |
|
244 JSValue jsHTMLLinkElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
245 { |
|
246 JSHTMLLinkElement* domObject = static_cast<JSHTMLLinkElement*>(asObject(slotBase)); |
|
247 return JSHTMLLinkElement::getConstructor(exec, domObject->globalObject()); |
|
248 } |
|
249 void JSHTMLLinkElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
250 { |
|
251 lookupPut<JSHTMLLinkElement, Base>(exec, propertyName, value, &JSHTMLLinkElementTable, this, slot); |
|
252 } |
|
253 |
|
254 void setJSHTMLLinkElementDisabled(ExecState* exec, JSObject* thisObject, JSValue value) |
|
255 { |
|
256 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject); |
|
257 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
258 imp->setBooleanAttribute(WebCore::HTMLNames::disabledAttr, value.toBoolean(exec)); |
|
259 } |
|
260 |
|
261 void setJSHTMLLinkElementCharset(ExecState* exec, JSObject* thisObject, JSValue value) |
|
262 { |
|
263 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject); |
|
264 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
265 imp->setAttribute(WebCore::HTMLNames::charsetAttr, valueToStringWithNullCheck(exec, value)); |
|
266 } |
|
267 |
|
268 void setJSHTMLLinkElementHref(ExecState* exec, JSObject* thisObject, JSValue value) |
|
269 { |
|
270 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject); |
|
271 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
272 imp->setAttribute(WebCore::HTMLNames::hrefAttr, valueToStringWithNullCheck(exec, value)); |
|
273 } |
|
274 |
|
275 void setJSHTMLLinkElementHreflang(ExecState* exec, JSObject* thisObject, JSValue value) |
|
276 { |
|
277 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject); |
|
278 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
279 imp->setAttribute(WebCore::HTMLNames::hreflangAttr, valueToStringWithNullCheck(exec, value)); |
|
280 } |
|
281 |
|
282 void setJSHTMLLinkElementMedia(ExecState* exec, JSObject* thisObject, JSValue value) |
|
283 { |
|
284 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject); |
|
285 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
286 imp->setAttribute(WebCore::HTMLNames::mediaAttr, valueToStringWithNullCheck(exec, value)); |
|
287 } |
|
288 |
|
289 void setJSHTMLLinkElementRel(ExecState* exec, JSObject* thisObject, JSValue value) |
|
290 { |
|
291 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject); |
|
292 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
293 imp->setAttribute(WebCore::HTMLNames::relAttr, valueToStringWithNullCheck(exec, value)); |
|
294 } |
|
295 |
|
296 void setJSHTMLLinkElementRev(ExecState* exec, JSObject* thisObject, JSValue value) |
|
297 { |
|
298 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject); |
|
299 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
300 imp->setAttribute(WebCore::HTMLNames::revAttr, valueToStringWithNullCheck(exec, value)); |
|
301 } |
|
302 |
|
303 void setJSHTMLLinkElementTarget(ExecState* exec, JSObject* thisObject, JSValue value) |
|
304 { |
|
305 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject); |
|
306 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
307 imp->setAttribute(WebCore::HTMLNames::targetAttr, valueToStringWithNullCheck(exec, value)); |
|
308 } |
|
309 |
|
310 void setJSHTMLLinkElementType(ExecState* exec, JSObject* thisObject, JSValue value) |
|
311 { |
|
312 JSHTMLLinkElement* castedThis = static_cast<JSHTMLLinkElement*>(thisObject); |
|
313 HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(castedThis->impl()); |
|
314 imp->setAttribute(WebCore::HTMLNames::typeAttr, valueToStringWithNullCheck(exec, value)); |
|
315 } |
|
316 |
|
317 JSValue JSHTMLLinkElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
318 { |
|
319 return getDOMConstructor<JSHTMLLinkElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
320 } |
|
321 |
|
322 |
|
323 } |