2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
22 #include "JSHTMLDocument.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"
32 #include "wtf/text/AtomicString.h"
33 #include <runtime/Error.h>
34 #include <runtime/JSString.h>
35 #include <wtf/GetPtr.h>
41 ASSERT_CLASS_FITS_IN_CELL(JSHTMLDocument);
45 #define THUNK_GENERATOR(generator) , generator
47 #define THUNK_GENERATOR(generator)
50 #define INTRINSIC(intrinsic) , intrinsic
52 #define INTRINSIC(intrinsic)
55 static const HashTableValue JSHTMLDocumentTableValues[] =
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) }
74 #undef THUNK_GENERATOR
75 static const HashTable JSHTMLDocumentTable = { 36, 31, JSHTMLDocumentTableValues, 0 };
76 /* Hash table for constructor */
78 #define THUNK_GENERATOR(generator) , generator
80 #define THUNK_GENERATOR(generator)
83 #define INTRINSIC(intrinsic) , intrinsic
85 #define INTRINSIC(intrinsic)
88 static const HashTableValue JSHTMLDocumentConstructorTableValues[] =
90 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
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) };
97 JSHTMLDocumentConstructor::JSHTMLDocumentConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
98 : DOMConstructorObject(structure, globalObject)
102 void JSHTMLDocumentConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
104 Base::finishCreation(exec->globalData());
105 ASSERT(inherits(&s_info));
106 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLDocumentPrototype::self(exec, globalObject), DontDelete | ReadOnly);
109 bool JSHTMLDocumentConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
111 return getStaticValueSlot<JSHTMLDocumentConstructor, JSDOMWrapper>(exec, &JSHTMLDocumentConstructorTable, static_cast<JSHTMLDocumentConstructor*>(cell), propertyName, slot);
114 bool JSHTMLDocumentConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
116 return getStaticValueDescriptor<JSHTMLDocumentConstructor, JSDOMWrapper>(exec, &JSHTMLDocumentConstructorTable, static_cast<JSHTMLDocumentConstructor*>(object), propertyName, descriptor);
119 /* Hash table for prototype */
121 #define THUNK_GENERATOR(generator) , generator
123 #define THUNK_GENERATOR(generator)
126 #define INTRINSIC(intrinsic) , intrinsic
128 #define INTRINSIC(intrinsic)
131 static const HashTableValue JSHTMLDocumentPrototypeTableValues[] =
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) }
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) };
148 JSObject* JSHTMLDocumentPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
150 return getDOMPrototype<JSHTMLDocument>(exec, globalObject);
153 bool JSHTMLDocumentPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
155 JSHTMLDocumentPrototype* thisObject = jsCast<JSHTMLDocumentPrototype*>(cell);
156 return getStaticFunctionSlot<JSObject>(exec, &JSHTMLDocumentPrototypeTable, thisObject, propertyName, slot);
159 bool JSHTMLDocumentPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
161 JSHTMLDocumentPrototype* thisObject = jsCast<JSHTMLDocumentPrototype*>(object);
162 return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLDocumentPrototypeTable, thisObject, propertyName, descriptor);
165 const ClassInfo JSHTMLDocument::s_info = { "HTMLDocument", &JSDocument::s_info, &JSHTMLDocumentTable, 0 , CREATE_METHOD_TABLE(JSHTMLDocument) };
167 JSHTMLDocument::JSHTMLDocument(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLDocument> impl)
168 : JSDocument(structure, globalObject, impl)
172 void JSHTMLDocument::finishCreation(JSGlobalData& globalData)
174 Base::finishCreation(globalData);
175 ASSERT(inherits(&s_info));
178 JSObject* JSHTMLDocument::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
180 return JSHTMLDocumentPrototype::create(exec->globalData(), globalObject, JSHTMLDocumentPrototype::createStructure(exec->globalData(), globalObject, JSDocumentPrototype::self(exec, globalObject)));
183 bool JSHTMLDocument::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
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);
191 return getStaticValueSlot<JSHTMLDocument, Base>(exec, &JSHTMLDocumentTable, thisObject, propertyName, slot);
194 bool JSHTMLDocument::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
196 JSHTMLDocument* thisObject = jsCast<JSHTMLDocument*>(object);
197 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
198 if (canGetItemsForName(exec, static_cast<HTMLDocument*>(thisObject->impl()), propertyName)) {
200 slot.setCustom(thisObject, nameGetter);
201 descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
204 return getStaticValueDescriptor<JSHTMLDocument, Base>(exec, &JSHTMLDocumentTable, thisObject, propertyName, descriptor);
207 JSValue jsHTMLDocumentEmbeds(ExecState* exec, JSValue slotBase, const Identifier&)
209 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
211 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
212 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->embeds()));
217 JSValue jsHTMLDocumentPlugins(ExecState* exec, JSValue slotBase, const Identifier&)
219 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
221 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
222 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->plugins()));
227 JSValue jsHTMLDocumentScripts(ExecState* exec, JSValue slotBase, const Identifier&)
229 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
231 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
232 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->scripts()));
237 JSValue jsHTMLDocumentAll(ExecState* exec, JSValue slotBase, const Identifier&)
239 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
240 return castedThis->all(exec);
244 JSValue jsHTMLDocumentDir(ExecState* exec, JSValue slotBase, const Identifier&)
246 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
248 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
249 JSValue result = jsString(exec, imp->dir());
254 JSValue jsHTMLDocumentDesignMode(ExecState* exec, JSValue slotBase, const Identifier&)
256 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
258 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
259 JSValue result = jsString(exec, imp->designMode());
264 JSValue jsHTMLDocumentCompatMode(ExecState* exec, JSValue slotBase, const Identifier&)
266 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
268 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
269 JSValue result = jsString(exec, imp->compatMode());
274 JSValue jsHTMLDocumentActiveElement(ExecState* exec, JSValue slotBase, const Identifier&)
276 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
278 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
279 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->activeElement()));
284 JSValue jsHTMLDocumentBgColor(ExecState* exec, JSValue slotBase, const Identifier&)
286 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
288 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
289 JSValue result = jsString(exec, imp->bgColor());
294 JSValue jsHTMLDocumentFgColor(ExecState* exec, JSValue slotBase, const Identifier&)
296 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
298 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
299 JSValue result = jsString(exec, imp->fgColor());
304 JSValue jsHTMLDocumentAlinkColor(ExecState* exec, JSValue slotBase, const Identifier&)
306 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
308 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
309 JSValue result = jsString(exec, imp->alinkColor());
314 JSValue jsHTMLDocumentLinkColor(ExecState* exec, JSValue slotBase, const Identifier&)
316 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
318 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
319 JSValue result = jsString(exec, imp->linkColor());
324 JSValue jsHTMLDocumentVlinkColor(ExecState* exec, JSValue slotBase, const Identifier&)
326 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
328 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
329 JSValue result = jsString(exec, imp->vlinkColor());
334 JSValue jsHTMLDocumentConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
336 JSHTMLDocument* domObject = static_cast<JSHTMLDocument*>(asObject(slotBase));
337 return JSHTMLDocument::getConstructor(exec, domObject->globalObject());
340 void JSHTMLDocument::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
342 JSHTMLDocument* thisObject = jsCast<JSHTMLDocument*>(cell);
343 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
344 lookupPut<JSHTMLDocument, Base>(exec, propertyName, value, &JSHTMLDocumentTable, thisObject, slot);
347 void setJSHTMLDocumentAll(ExecState* exec, JSObject* thisObject, JSValue value)
349 static_cast<JSHTMLDocument*>(thisObject)->setAll(exec, value);
353 void setJSHTMLDocumentDir(ExecState* exec, JSObject* thisObject, JSValue value)
355 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
356 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
357 imp->setDir(valueToStringWithNullCheck(exec, value));
361 void setJSHTMLDocumentDesignMode(ExecState* exec, JSObject* thisObject, JSValue value)
363 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
364 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
365 imp->setDesignMode(valueToStringWithNullCheck(exec, value));
369 void setJSHTMLDocumentBgColor(ExecState* exec, JSObject* thisObject, JSValue value)
371 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
372 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
373 imp->setBgColor(valueToStringWithNullCheck(exec, value));
377 void setJSHTMLDocumentFgColor(ExecState* exec, JSObject* thisObject, JSValue value)
379 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
380 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
381 imp->setFgColor(valueToStringWithNullCheck(exec, value));
385 void setJSHTMLDocumentAlinkColor(ExecState* exec, JSObject* thisObject, JSValue value)
387 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
388 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
389 imp->setAlinkColor(valueToStringWithNullCheck(exec, value));
393 void setJSHTMLDocumentLinkColor(ExecState* exec, JSObject* thisObject, JSValue value)
395 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
396 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
397 imp->setLinkColor(valueToStringWithNullCheck(exec, value));
401 void setJSHTMLDocumentVlinkColor(ExecState* exec, JSObject* thisObject, JSValue value)
403 JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
404 HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
405 imp->setVlinkColor(valueToStringWithNullCheck(exec, value));
409 JSValue JSHTMLDocument::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
411 return getDOMConstructor<JSHTMLDocumentConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
414 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionOpen(ExecState* exec)
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));
424 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionClose(ExecState* exec)
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());
433 return JSValue::encode(jsUndefined());
436 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionWrite(ExecState* exec)
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));
446 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionWriteln(ExecState* exec)
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));
456 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionClear(ExecState* exec)
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());
465 return JSValue::encode(jsUndefined());
468 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionCaptureEvents(ExecState* exec)
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());
480 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionReleaseEvents(ExecState* exec)
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());
492 EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionHasFocus(ExecState* exec)
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());
501 JSC::JSValue result = jsBoolean(imp->hasFocus());
502 return JSValue::encode(result);