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