tizen beta release
[framework/web/webkit-efl.git] / DerivedSources / WebCore / JSHTMLDocument.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 "JSHTMLDocument.h"
23
24 #include "Element.h"
25 #include "ExceptionCode.h"
26 #include "HTMLCollection.h"
27 #include "HTMLDocument.h"
28 #include "JSDOMBinding.h"
29 #include "JSElement.h"
30 #include "JSHTMLCollection.h"
31 #include "KURL.h"
32 #include "wtf/text/AtomicString.h"
33 #include <runtime/Error.h>
34 #include <runtime/JSString.h>
35 #include <wtf/GetPtr.h>
36
37 using namespace JSC;
38
39 namespace WebCore {
40
41 ASSERT_CLASS_FITS_IN_CELL(JSHTMLDocument);
42
43 /* Hash table */
44 #if ENABLE(JIT)
45 #define THUNK_GENERATOR(generator) , generator
46 #else
47 #define THUNK_GENERATOR(generator)
48 #endif
49 #if ENABLE(DFG_JIT)
50 #define INTRINSIC(intrinsic) , intrinsic
51 #else
52 #define INTRINSIC(intrinsic)
53 #endif
54
55 static const HashTableValue JSHTMLDocumentTableValues[] =
56 {
57     { "embeds", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentEmbeds), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58     { "plugins", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentPlugins), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59     { "scripts", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentScripts), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60     { "all", 0, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentAll), (intptr_t)setJSHTMLDocumentAll THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
61     { "dir", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentDir), (intptr_t)setJSHTMLDocumentDir THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
62     { "designMode", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentDesignMode), (intptr_t)setJSHTMLDocumentDesignMode THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
63     { "compatMode", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentCompatMode), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
64     { "activeElement", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentActiveElement), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
65     { "bgColor", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentBgColor), (intptr_t)setJSHTMLDocumentBgColor THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
66     { "fgColor", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentFgColor), (intptr_t)setJSHTMLDocumentFgColor THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
67     { "alinkColor", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentAlinkColor), (intptr_t)setJSHTMLDocumentAlinkColor THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
68     { "linkColor", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentLinkColor), (intptr_t)setJSHTMLDocumentLinkColor THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
69     { "vlinkColor", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentVlinkColor), (intptr_t)setJSHTMLDocumentVlinkColor THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
70     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLDocumentConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
71     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
72 };
73
74 #undef THUNK_GENERATOR
75 static const HashTable JSHTMLDocumentTable = { 36, 31, JSHTMLDocumentTableValues, 0 };
76 /* Hash table for constructor */
77 #if ENABLE(JIT)
78 #define THUNK_GENERATOR(generator) , generator
79 #else
80 #define THUNK_GENERATOR(generator)
81 #endif
82 #if ENABLE(DFG_JIT)
83 #define INTRINSIC(intrinsic) , intrinsic
84 #else
85 #define INTRINSIC(intrinsic)
86 #endif
87
88 static const HashTableValue JSHTMLDocumentConstructorTableValues[] =
89 {
90     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
91 };
92
93 #undef THUNK_GENERATOR
94 static const HashTable JSHTMLDocumentConstructorTable = { 1, 0, JSHTMLDocumentConstructorTableValues, 0 };
95 const ClassInfo JSHTMLDocumentConstructor::s_info = { "HTMLDocumentConstructor", &DOMConstructorObject::s_info, &JSHTMLDocumentConstructorTable, 0, CREATE_METHOD_TABLE(JSHTMLDocumentConstructor) };
96
97 JSHTMLDocumentConstructor::JSHTMLDocumentConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
98     : DOMConstructorObject(structure, globalObject)
99 {
100 }
101
102 void JSHTMLDocumentConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
103 {
104     Base::finishCreation(exec->globalData());
105     ASSERT(inherits(&s_info));
106     putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLDocumentPrototype::self(exec, globalObject), DontDelete | ReadOnly);
107 }
108
109 bool JSHTMLDocumentConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
110 {
111     return getStaticValueSlot<JSHTMLDocumentConstructor, JSDOMWrapper>(exec, &JSHTMLDocumentConstructorTable, static_cast<JSHTMLDocumentConstructor*>(cell), propertyName, slot);
112 }
113
114 bool JSHTMLDocumentConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
115 {
116     return getStaticValueDescriptor<JSHTMLDocumentConstructor, JSDOMWrapper>(exec, &JSHTMLDocumentConstructorTable, static_cast<JSHTMLDocumentConstructor*>(object), propertyName, descriptor);
117 }
118
119 /* Hash table for prototype */
120 #if ENABLE(JIT)
121 #define THUNK_GENERATOR(generator) , generator
122 #else
123 #define THUNK_GENERATOR(generator)
124 #endif
125 #if ENABLE(DFG_JIT)
126 #define INTRINSIC(intrinsic) , intrinsic
127 #else
128 #define INTRINSIC(intrinsic)
129 #endif
130
131 static const HashTableValue JSHTMLDocumentPrototypeTableValues[] =
132 {
133     { "open", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLDocumentPrototypeFunctionOpen), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
134     { "close", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLDocumentPrototypeFunctionClose), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
135     { "write", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLDocumentPrototypeFunctionWrite), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
136     { "writeln", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLDocumentPrototypeFunctionWriteln), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
137     { "clear", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLDocumentPrototypeFunctionClear), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
138     { "captureEvents", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLDocumentPrototypeFunctionCaptureEvents), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
139     { "releaseEvents", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLDocumentPrototypeFunctionReleaseEvents), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
140     { "hasFocus", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLDocumentPrototypeFunctionHasFocus), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
141     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
142 };
143
144 #undef THUNK_GENERATOR
145 static const HashTable JSHTMLDocumentPrototypeTable = { 17, 15, JSHTMLDocumentPrototypeTableValues, 0 };
146 const ClassInfo JSHTMLDocumentPrototype::s_info = { "HTMLDocumentPrototype", &JSC::JSNonFinalObject::s_info, &JSHTMLDocumentPrototypeTable, 0, CREATE_METHOD_TABLE(JSHTMLDocumentPrototype) };
147
148 JSObject* JSHTMLDocumentPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
149 {
150     return getDOMPrototype<JSHTMLDocument>(exec, globalObject);
151 }
152
153 bool JSHTMLDocumentPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
154 {
155     JSHTMLDocumentPrototype* thisObject = jsCast<JSHTMLDocumentPrototype*>(cell);
156     return getStaticFunctionSlot<JSObject>(exec, &JSHTMLDocumentPrototypeTable, thisObject, propertyName, slot);
157 }
158
159 bool JSHTMLDocumentPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
160 {
161     JSHTMLDocumentPrototype* thisObject = jsCast<JSHTMLDocumentPrototype*>(object);
162     return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLDocumentPrototypeTable, thisObject, propertyName, descriptor);
163 }
164
165 const ClassInfo JSHTMLDocument::s_info = { "HTMLDocument", &JSDocument::s_info, &JSHTMLDocumentTable, 0 , CREATE_METHOD_TABLE(JSHTMLDocument) };
166
167 JSHTMLDocument::JSHTMLDocument(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLDocument> impl)
168     : JSDocument(structure, globalObject, impl)
169 {
170 }
171
172 void JSHTMLDocument::finishCreation(JSGlobalData& globalData)
173 {
174     Base::finishCreation(globalData);
175     ASSERT(inherits(&s_info));
176 }
177
178 JSObject* JSHTMLDocument::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
179 {
180     return JSHTMLDocumentPrototype::create(exec->globalData(), globalObject, JSHTMLDocumentPrototype::createStructure(exec->globalData(), globalObject, JSDocumentPrototype::self(exec, globalObject)));
181 }
182
183 bool JSHTMLDocument::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
184 {
185     JSHTMLDocument* thisObject = jsCast<JSHTMLDocument*>(cell);
186     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
187     if (canGetItemsForName(exec, static_cast<HTMLDocument*>(thisObject->impl()), propertyName)) {
188         slot.setCustom(thisObject, thisObject->nameGetter);
189         return true;
190     }
191     return getStaticValueSlot<JSHTMLDocument, Base>(exec, &JSHTMLDocumentTable, thisObject, propertyName, slot);
192 }
193
194 bool JSHTMLDocument::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
195 {
196     JSHTMLDocument* thisObject = jsCast<JSHTMLDocument*>(object);
197     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
198     if (canGetItemsForName(exec, static_cast<HTMLDocument*>(thisObject->impl()), propertyName)) {
199         PropertySlot slot;
200         slot.setCustom(thisObject, nameGetter);
201         descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
202         return true;
203     }
204     return getStaticValueDescriptor<JSHTMLDocument, Base>(exec, &JSHTMLDocumentTable, thisObject, propertyName, descriptor);
205 }
206
207 JSValue jsHTMLDocumentEmbeds(ExecState* exec, JSValue slotBase, const Identifier&)
208 {
209     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
210     UNUSED_PARAM(exec);
211     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
212     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->embeds()));
213     return result;
214 }
215
216
217 JSValue jsHTMLDocumentPlugins(ExecState* exec, JSValue slotBase, const Identifier&)
218 {
219     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
220     UNUSED_PARAM(exec);
221     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
222     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->plugins()));
223     return result;
224 }
225
226
227 JSValue jsHTMLDocumentScripts(ExecState* exec, JSValue slotBase, const Identifier&)
228 {
229     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
230     UNUSED_PARAM(exec);
231     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
232     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->scripts()));
233     return result;
234 }
235
236
237 JSValue jsHTMLDocumentAll(ExecState* exec, JSValue slotBase, const Identifier&)
238 {
239     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
240     return castedThis->all(exec);
241 }
242
243
244 JSValue jsHTMLDocumentDir(ExecState* exec, JSValue slotBase, const Identifier&)
245 {
246     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
247     UNUSED_PARAM(exec);
248     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
249     JSValue result = jsString(exec, imp->dir());
250     return result;
251 }
252
253
254 JSValue jsHTMLDocumentDesignMode(ExecState* exec, JSValue slotBase, const Identifier&)
255 {
256     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
257     UNUSED_PARAM(exec);
258     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
259     JSValue result = jsString(exec, imp->designMode());
260     return result;
261 }
262
263
264 JSValue jsHTMLDocumentCompatMode(ExecState* exec, JSValue slotBase, const Identifier&)
265 {
266     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
267     UNUSED_PARAM(exec);
268     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
269     JSValue result = jsString(exec, imp->compatMode());
270     return result;
271 }
272
273
274 JSValue jsHTMLDocumentActiveElement(ExecState* exec, JSValue slotBase, const Identifier&)
275 {
276     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
277     UNUSED_PARAM(exec);
278     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
279     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->activeElement()));
280     return result;
281 }
282
283
284 JSValue jsHTMLDocumentBgColor(ExecState* exec, JSValue slotBase, const Identifier&)
285 {
286     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
287     UNUSED_PARAM(exec);
288     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
289     JSValue result = jsString(exec, imp->bgColor());
290     return result;
291 }
292
293
294 JSValue jsHTMLDocumentFgColor(ExecState* exec, JSValue slotBase, const Identifier&)
295 {
296     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
297     UNUSED_PARAM(exec);
298     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
299     JSValue result = jsString(exec, imp->fgColor());
300     return result;
301 }
302
303
304 JSValue jsHTMLDocumentAlinkColor(ExecState* exec, JSValue slotBase, const Identifier&)
305 {
306     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
307     UNUSED_PARAM(exec);
308     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
309     JSValue result = jsString(exec, imp->alinkColor());
310     return result;
311 }
312
313
314 JSValue jsHTMLDocumentLinkColor(ExecState* exec, JSValue slotBase, const Identifier&)
315 {
316     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
317     UNUSED_PARAM(exec);
318     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
319     JSValue result = jsString(exec, imp->linkColor());
320     return result;
321 }
322
323
324 JSValue jsHTMLDocumentVlinkColor(ExecState* exec, JSValue slotBase, const Identifier&)
325 {
326     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
327     UNUSED_PARAM(exec);
328     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
329     JSValue result = jsString(exec, imp->vlinkColor());
330     return result;
331 }
332
333
334 JSValue jsHTMLDocumentConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
335 {
336     JSHTMLDocument* domObject = static_cast<JSHTMLDocument*>(asObject(slotBase));
337     return JSHTMLDocument::getConstructor(exec, domObject->globalObject());
338 }
339
340 void JSHTMLDocument::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
341 {
342     JSHTMLDocument* thisObject = jsCast<JSHTMLDocument*>(cell);
343     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
344     lookupPut<JSHTMLDocument, Base>(exec, propertyName, value, &JSHTMLDocumentTable, thisObject, slot);
345 }
346
347 void setJSHTMLDocumentAll(ExecState* exec, JSObject* thisObject, JSValue value)
348 {
349     static_cast<JSHTMLDocument*>(thisObject)->setAll(exec, value);
350 }
351
352
353 void setJSHTMLDocumentDir(ExecState* exec, JSObject* thisObject, JSValue value)
354 {
355     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
356     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
357     imp->setDir(valueToStringWithNullCheck(exec, value));
358 }
359
360
361 void setJSHTMLDocumentDesignMode(ExecState* exec, JSObject* thisObject, JSValue value)
362 {
363     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
364     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
365     imp->setDesignMode(valueToStringWithNullCheck(exec, value));
366 }
367
368
369 void setJSHTMLDocumentBgColor(ExecState* exec, JSObject* thisObject, JSValue value)
370 {
371     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
372     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
373     imp->setBgColor(valueToStringWithNullCheck(exec, value));
374 }
375
376
377 void setJSHTMLDocumentFgColor(ExecState* exec, JSObject* thisObject, JSValue value)
378 {
379     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
380     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
381     imp->setFgColor(valueToStringWithNullCheck(exec, value));
382 }
383
384
385 void setJSHTMLDocumentAlinkColor(ExecState* exec, JSObject* thisObject, JSValue value)
386 {
387     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
388     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
389     imp->setAlinkColor(valueToStringWithNullCheck(exec, value));
390 }
391
392
393 void setJSHTMLDocumentLinkColor(ExecState* exec, JSObject* thisObject, JSValue value)
394 {
395     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
396     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
397     imp->setLinkColor(valueToStringWithNullCheck(exec, value));
398 }
399
400
401 void setJSHTMLDocumentVlinkColor(ExecState* exec, JSObject* thisObject, JSValue value)
402 {
403     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
404     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
405     imp->setVlinkColor(valueToStringWithNullCheck(exec, value));
406 }
407
408
409 JSValue JSHTMLDocument::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
410 {
411     return getDOMConstructor<JSHTMLDocumentConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
412 }
413
414 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionOpen(ExecState* exec)
415 {
416     JSValue thisValue = exec->hostThisValue();
417     if (!thisValue.inherits(&JSHTMLDocument::s_info))
418         return throwVMTypeError(exec);
419     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(thisValue));
420     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLDocument::s_info);
421     return JSValue::encode(castedThis->open(exec));
422 }
423
424 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionClose(ExecState* exec)
425 {
426     JSValue thisValue = exec->hostThisValue();
427     if (!thisValue.inherits(&JSHTMLDocument::s_info))
428         return throwVMTypeError(exec);
429     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(thisValue));
430     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLDocument::s_info);
431     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
432     imp->close();
433     return JSValue::encode(jsUndefined());
434 }
435
436 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionWrite(ExecState* exec)
437 {
438     JSValue thisValue = exec->hostThisValue();
439     if (!thisValue.inherits(&JSHTMLDocument::s_info))
440         return throwVMTypeError(exec);
441     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(thisValue));
442     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLDocument::s_info);
443     return JSValue::encode(castedThis->write(exec));
444 }
445
446 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionWriteln(ExecState* exec)
447 {
448     JSValue thisValue = exec->hostThisValue();
449     if (!thisValue.inherits(&JSHTMLDocument::s_info))
450         return throwVMTypeError(exec);
451     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(thisValue));
452     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLDocument::s_info);
453     return JSValue::encode(castedThis->writeln(exec));
454 }
455
456 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionClear(ExecState* exec)
457 {
458     JSValue thisValue = exec->hostThisValue();
459     if (!thisValue.inherits(&JSHTMLDocument::s_info))
460         return throwVMTypeError(exec);
461     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(thisValue));
462     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLDocument::s_info);
463     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
464     imp->clear();
465     return JSValue::encode(jsUndefined());
466 }
467
468 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionCaptureEvents(ExecState* exec)
469 {
470     JSValue thisValue = exec->hostThisValue();
471     if (!thisValue.inherits(&JSHTMLDocument::s_info))
472         return throwVMTypeError(exec);
473     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(thisValue));
474     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLDocument::s_info);
475     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
476     imp->captureEvents();
477     return JSValue::encode(jsUndefined());
478 }
479
480 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionReleaseEvents(ExecState* exec)
481 {
482     JSValue thisValue = exec->hostThisValue();
483     if (!thisValue.inherits(&JSHTMLDocument::s_info))
484         return throwVMTypeError(exec);
485     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(thisValue));
486     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLDocument::s_info);
487     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
488     imp->releaseEvents();
489     return JSValue::encode(jsUndefined());
490 }
491
492 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionHasFocus(ExecState* exec)
493 {
494     JSValue thisValue = exec->hostThisValue();
495     if (!thisValue.inherits(&JSHTMLDocument::s_info))
496         return throwVMTypeError(exec);
497     JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(thisValue));
498     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLDocument::s_info);
499     HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
500
501     JSC::JSValue result = jsBoolean(imp->hasFocus());
502     return JSValue::encode(result);
503 }
504
505
506 }