LayoutTests:
[WebKit-https.git] / WebCore / bindings / js / kjs_html.cpp
1 // -*- c-basic-offset: 4 -*-
2 /*
3  *  This file is part of the KDE libraries
4  *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
5  *  Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
6  *
7  *  This library is free software; you can redistribute it and/or
8  *  modify it under the terms of the GNU Lesser General Public
9  *  License as published by the Free Software Foundation; either
10  *  version 2 of the License, or (at your option) any later version.
11  *
12  *  This library is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  *  Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public
18  *  License along with this library; if not, write to the Free Software
19  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 #include "config.h"
23 #include "kjs_html.h"
24
25 #include "DocLoader.h"
26 #include "EventNames.h"
27 #include "Frame.h"
28 #include "HTMLBaseFontElement.h"
29 #include "HTMLButtonElement.h"
30 #include "HTMLDocument.h"
31 #include "HTMLFieldSetElement.h"
32 #include "HTMLFormElement.h"
33 #include "HTMLIsIndexElement.h"
34 #include "HTMLLabelElement.h"
35 #include "HTMLLegendElement.h"
36 #include "HTMLOptGroupElement.h"
37 #include "HTMLOptionElement.h"
38 #include "HTMLOptionsCollection.h"
39 #include "HTMLSelectElement.h"
40 #include "HTMLTextAreaElement.h"
41 #include "NameNodeList.h"
42 #include "RenderLayer.h"
43 #include "Text.h"
44 #include "css_ruleimpl.h"
45 #include "dom2_eventsimpl.h"
46 #include "html_baseimpl.h"
47 #include "html_blockimpl.h"
48 #include "html_headimpl.h"
49 #include "html_imageimpl.h"
50 #include "html_inlineimpl.h"
51 #include "html_listimpl.h"
52 #include "html_objectimpl.h"
53 #include "html_tableimpl.h"
54 #include "kjs_css.h"
55 #include "kjs_events.h"
56 #include "kjs_proxy.h"
57 #include "kjs_window.h"
58
59 #include "kjs_html.lut.h"
60
61 using namespace WebCore;
62 using namespace HTMLNames;
63 using namespace EventNames;
64
65 namespace KJS {
66
67 class HTMLElementFunction : public InternalFunctionImp {
68 public:
69   HTMLElementFunction(ExecState *exec, int i, int len, const Identifier& name);
70   virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List&args);
71 private:
72   int id;
73 };
74
75 KJS_IMPLEMENT_PROTOFUNC(HTMLDocFunction)
76
77 JSValue *HTMLDocFunction::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
78 {
79   if (!thisObj->inherits(&JSHTMLDocument::info))
80     return throwError(exec, TypeError);
81   HTMLDocument &doc = *static_cast<HTMLDocument *>(static_cast<JSHTMLDocument *>(thisObj)->impl());
82
83   switch (id) {
84   case JSHTMLDocument::Clear: // even IE doesn't support that one...
85     //doc.clear(); // TODO
86     return jsUndefined();
87   case JSHTMLDocument::Open:
88     // For compatibility with other browsers, pass open calls with more than 2 parameters to the window.
89     if (args.size() > 2) {
90       Frame *frame = doc.frame();
91       if (frame) {
92         Window *window = Window::retrieveWindow(frame);
93         if (window) {
94           JSObject *functionObject = window->get(exec, "open")->getObject();
95           if (!functionObject || !functionObject->implementsCall())
96             return throwError(exec, TypeError);
97           return functionObject->call(exec, window, args);
98         }
99       }
100       return jsUndefined();
101     }
102     // In the case of two parameters or fewer, do a normal document open.
103     doc.open();
104     return jsUndefined();
105   case JSHTMLDocument::Close:
106     doc.close();
107     return jsUndefined();
108   case JSHTMLDocument::Write:
109   case JSHTMLDocument::WriteLn: {
110     // DOM only specifies single string argument, but NS & IE allow multiple
111     // or no arguments
112     String str = "";
113     for (int i = 0; i < args.size(); i++)
114       str += args[i]->toString(exec);
115     if (id == JSHTMLDocument::WriteLn)
116       str += "\n";
117     doc.write(str);
118     return jsUndefined();
119   }
120   case JSHTMLDocument::GetElementsByName:
121     return toJS(exec, doc.getElementsByName(args[0]->toString(exec)).get());
122   case JSHTMLDocument::CaptureEvents:
123   case JSHTMLDocument::ReleaseEvents:
124     // Do nothing for now. These are NS-specific legacy calls.
125     break;
126   }
127
128   return jsUndefined();
129 }
130
131 // FIXME: functions should be in the prototype
132 const ClassInfo JSHTMLDocument::info =
133   { "HTMLDocument", &JSDocument::info, &HTMLDocumentTable, 0 };
134 /* Source for HTMLDocumentTable. Use "make hashtables" to regenerate.
135 @begin HTMLDocumentTable 30
136   title                 JSHTMLDocument::Title             DontDelete
137   referrer              JSHTMLDocument::Referrer          DontDelete|ReadOnly
138   domain                JSHTMLDocument::Domain            DontDelete
139   URL                   JSHTMLDocument::URL               DontDelete|ReadOnly
140   body                  JSHTMLDocument::Body              DontDelete
141   location              JSHTMLDocument::Location          DontDelete
142   cookie                JSHTMLDocument::Cookie            DontDelete
143   images                JSHTMLDocument::Images            DontDelete|ReadOnly
144   embeds                JSHTMLDocument::Embeds            DontDelete|ReadOnly
145   plugins               JSHTMLDocument::Embeds            DontDelete|ReadOnly
146   applets               JSHTMLDocument::Applets           DontDelete|ReadOnly
147   links                 JSHTMLDocument::Links             DontDelete|ReadOnly
148   forms                 JSHTMLDocument::Forms             DontDelete|ReadOnly
149   anchors               JSHTMLDocument::Anchors           DontDelete|ReadOnly
150   scripts               JSHTMLDocument::Scripts           DontDelete|ReadOnly
151   all                   JSHTMLDocument::All               
152   clear                 JSHTMLDocument::Clear             DontDelete|Function 0
153   open                  JSHTMLDocument::Open              DontDelete|Function 0
154   close                 JSHTMLDocument::Close             DontDelete|Function 0
155   write                 JSHTMLDocument::Write             DontDelete|Function 1
156   writeln               JSHTMLDocument::WriteLn           DontDelete|Function 1
157   getElementsByName     JSHTMLDocument::GetElementsByName DontDelete|Function 1
158   captureEvents         JSHTMLDocument::CaptureEvents     DontDelete|Function 0
159   releaseEvents         JSHTMLDocument::ReleaseEvents     DontDelete|Function 0
160   bgColor               JSHTMLDocument::BgColor           DontDelete
161   fgColor               JSHTMLDocument::FgColor           DontDelete
162   alinkColor            JSHTMLDocument::AlinkColor        DontDelete
163   linkColor             JSHTMLDocument::LinkColor         DontDelete
164   vlinkColor            JSHTMLDocument::VlinkColor        DontDelete
165   lastModified          JSHTMLDocument::LastModified      DontDelete|ReadOnly
166   height                JSHTMLDocument::Height            DontDelete|ReadOnly
167   width                 JSHTMLDocument::Width             DontDelete|ReadOnly
168   dir                   JSHTMLDocument::Dir               DontDelete
169   designMode            JSHTMLDocument::DesignMode        DontDelete
170 #potentially obsolete array properties
171 # layers
172 # plugins
173 # tags
174 #potentially obsolete properties
175 # embeds
176 # ids
177 @end
178 */
179
180 JSHTMLDocument::JSHTMLDocument(ExecState *exec, HTMLDocument *d)
181   : JSDocument(exec, d)
182 {
183 }
184
185 JSValue *JSHTMLDocument::namedItemGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
186 {
187   JSHTMLDocument *thisObj = static_cast<JSHTMLDocument *>(slot.slotBase());
188   HTMLDocument &doc = *static_cast<HTMLDocument *>(thisObj->impl());
189
190   String name = propertyName;
191   RefPtr<WebCore::HTMLCollection> collection = doc.documentNamedItems(name);
192
193   if (collection->length() == 1) {
194     WebCore::Node* node = collection->firstItem();
195     Frame *frame;
196     if (node->hasTagName(iframeTag) && (frame = static_cast<WebCore::HTMLIFrameElement *>(node)->contentFrame()))
197       return Window::retrieve(frame);
198     return toJS(exec, node);
199   }
200
201   return getHTMLCollection(exec, collection.get());
202 }
203
204 JSValue *JSHTMLDocument::getValueProperty(ExecState *exec, int token) const
205 {
206   HTMLDocument &doc = *static_cast<HTMLDocument *>(impl());
207
208   FrameView *view = doc.view();
209   Frame *frame = doc.frame();
210
211   HTMLElement *body = doc.body();
212   HTMLBodyElement *bodyElement = (body && body->hasTagName(bodyTag)) ? static_cast<HTMLBodyElement *>(body) : 0;
213     
214   switch (token) {
215   case Title:
216     return jsString(doc.title());
217   case Referrer:
218     return jsString(doc.referrer());
219   case Domain:
220     return jsString(doc.domain());
221   case URL:
222     return jsString(doc.URL());
223   case Body:
224     return toJS(exec, body);
225   case Location:
226     if (Window* win = Window::retrieveWindow(frame))
227       return win->location();
228     return jsUndefined();
229   case Cookie:
230     return jsString(doc.cookie());
231   case Images:
232     return getHTMLCollection(exec, doc.images().get());
233   case Embeds:
234     return getHTMLCollection(exec, doc.embeds().get());
235   case Applets:
236     return getHTMLCollection(exec, doc.applets().get());
237   case Links:
238     return getHTMLCollection(exec, doc.links().get());
239   case Forms:
240     return getHTMLCollection(exec, doc.forms().get());
241   case Anchors:
242     return getHTMLCollection(exec, doc.anchors().get());
243   case Scripts: // TODO (IE-specific)
244     {
245       // To be implemented. Meanwhile, return an object with a length property set to 0
246       JSObject *obj = new JSObject;
247       obj->put(exec, lengthPropertyName, jsNumber(0));
248       return obj;
249     }
250   case All:
251     // If "all" has been overwritten, return the overwritten value
252     if (JSValue *v = getDirect("all"))
253       return v;
254     else
255       return getAllHTMLCollection(exec, doc.all().get());
256   case BgColor:
257     if (!bodyElement)
258       return jsUndefined();
259     return jsString(bodyElement->bgColor());
260   case FgColor:
261     if (!bodyElement)
262       return jsUndefined();
263     return jsString(bodyElement->text());
264   case AlinkColor:
265     if (!bodyElement)
266       return jsUndefined();
267     return jsString(bodyElement->aLink());
268   case LinkColor:
269     if (!bodyElement)
270       return jsUndefined();
271     return jsString(bodyElement->link());
272   case VlinkColor:
273     if (!bodyElement)
274       return jsUndefined();
275     return jsString(bodyElement->vLink());
276   case LastModified:
277     return jsString(doc.lastModified());
278   case Height:
279     return jsNumber(view ? view->contentsHeight() : 0);
280   case Width:
281     return jsNumber(view ? view->contentsWidth() : 0);
282   case Dir:
283     if (!bodyElement)
284       return jsUndefined();
285     return jsString(bodyElement->dir());
286   case DesignMode:
287     return jsString(doc.inDesignMode() ? "on" : "off");
288   default:
289     assert(0);
290     return jsUndefined();
291   }
292 }
293
294 bool JSHTMLDocument::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
295 {
296   HTMLDocument &doc = *static_cast<HTMLDocument *>(impl());
297
298   String name = propertyName;
299   if (doc.hasNamedItem(name) || doc.hasDocExtraNamedItem(name)) {
300     slot.setCustom(this, namedItemGetter);
301     return true;
302   }
303
304   const HashEntry* entry = Lookup::findEntry(&HTMLDocumentTable, propertyName);
305   if (entry) {
306     if (entry->attr & Function)
307       slot.setStaticEntry(this, entry, staticFunctionGetter<HTMLDocFunction>);
308     else 
309       slot.setStaticEntry(this, entry, staticValueGetter<JSHTMLDocument>);
310     return true;
311   }
312
313   return JSDocument::getOwnPropertySlot(exec, propertyName, slot);
314 }
315
316 void JSHTMLDocument::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
317 {
318     lookupPut<JSHTMLDocument, JSDocument>(exec, propertyName, value, attr, &HTMLDocumentTable, this);
319 }
320
321 void JSHTMLDocument::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
322 {
323   DOMExceptionTranslator exception(exec);
324   HTMLDocument &doc = *static_cast<HTMLDocument *>(impl());
325   HTMLElement *body = doc.body();
326   HTMLBodyElement *bodyElement = (body && body->hasTagName(bodyTag)) ? static_cast<HTMLBodyElement *>(body) : 0;
327
328   switch (token) {
329   case Title:
330     doc.setTitle(value->toString(exec));
331     break;
332   case Body:
333     doc.setBody(toHTMLElement(value), exception);
334     break;
335   case Domain: // not part of the DOM
336     doc.setDomain(value->toString(exec));
337     break;
338   case Cookie:
339     doc.setCookie(value->toString(exec));
340     break;
341   case Location: {
342     Frame *frame = doc.frame();
343     if (frame)
344     {
345       DeprecatedString str = value->toString(exec);
346
347       // When assigning location, IE and Mozilla both resolve the URL
348       // relative to the frame where the JavaScript is executing not
349       // the target frame.
350       Frame *activePart = static_cast<ScriptInterpreter *>( exec->dynamicInterpreter() )->frame();
351       if (activePart)
352         str = activePart->document()->completeURL(str);
353
354       // We want a new history item if this JS was called via a user gesture
355       bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
356       frame->scheduleLocationChange(str, activePart->referrer(), !userGesture);
357     }
358     break;
359   }
360   case BgColor:
361     if (bodyElement)
362       bodyElement->setBgColor(value->toString(exec));
363     break;
364   case FgColor:
365     if (bodyElement)
366       bodyElement->setText(value->toString(exec));
367     break;
368   case AlinkColor:
369     if (bodyElement) {
370       // this check is a bit silly, but some benchmarks like to set the
371       // document's link colors over and over to the same value and we
372       // don't want to incur a style update each time.
373       String newColor = value->toString(exec);
374       if (bodyElement->aLink() != newColor)
375         bodyElement->setALink(newColor);
376     }
377     break;
378   case LinkColor:
379     if (bodyElement) {
380       // this check is a bit silly, but some benchmarks like to set the
381       // document's link colors over and over to the same value and we
382       // don't want to incur a style update each time.
383       String newColor = value->toString(exec);
384       if (bodyElement->link() != newColor)
385         bodyElement->setLink(newColor);
386     }
387     break;
388   case VlinkColor:
389     if (bodyElement) {
390       // this check is a bit silly, but some benchmarks like to set the
391       // document's link colors over and over to the same value and we
392       // don't want to incur a style update each time.
393       String newColor = value->toString(exec);
394       if (bodyElement->vLink() != newColor)
395         bodyElement->setVLink(newColor);
396     }
397     break;
398   case Dir:
399     body->setDir(value->toString(exec));
400     break;
401   case DesignMode:
402     {
403       String modeString = value->toString(exec);
404       Document::InheritedBool mode;
405       if (equalIgnoringCase(modeString, "on"))
406         mode = Document::on;
407       else if (equalIgnoringCase(modeString, "off"))
408         mode = Document::off;
409       else
410         mode = Document::inherit;
411       doc.setDesignMode(mode);
412       break;
413     }
414   case All:
415     // Add "all" to the property map.
416     putDirect("all", value);
417     break;
418   }
419 }
420
421 // -------------------------------------------------------------------------
422
423 const ClassInfo JSHTMLElement::a_info = { "HTMLAnchorElement", &JSHTMLElement::info, &HTMLAnchorElementTable, 0 };
424 const ClassInfo JSHTMLElement::applet_info = { "HTMLAppletElement", &JSHTMLElement::info, &HTMLAppletElementTable, 0 };
425 const ClassInfo JSHTMLElement::area_info = { "HTMLAreaElement", &JSHTMLElement::info, &HTMLAreaElementTable, 0 };
426 const ClassInfo JSHTMLElement::baseFont_info = { "HTMLBaseFontElement", &JSHTMLElement::info, &HTMLBaseFontElementTable, 0 };
427 const ClassInfo JSHTMLElement::base_info = { "HTMLBaseElement", &JSHTMLElement::info, &HTMLBaseElementTable, 0 };
428 const ClassInfo JSHTMLElement::blockQuote_info = { "HTMLBlockQuoteElement", &JSHTMLElement::info, &HTMLBlockQuoteElementTable, 0 };
429 const ClassInfo JSHTMLElement::body_info = { "HTMLBodyElement", &JSHTMLElement::info, &HTMLBodyElementTable, 0 };
430 const ClassInfo JSHTMLElement::br_info = { "HTMLBRElement", &JSHTMLElement::info, &HTMLBRElementTable, 0 };
431 const ClassInfo JSHTMLElement::button_info = { "HTMLButtonElement", &JSHTMLElement::info, &HTMLButtonElementTable, 0 };
432 const ClassInfo JSHTMLElement::caption_info = { "HTMLTableCaptionElement", &JSHTMLElement::info, &HTMLTableCaptionElementTable, 0 };
433 const ClassInfo JSHTMLElement::col_info = { "HTMLTableColElement", &JSHTMLElement::info, &HTMLTableColElementTable, 0 };
434 const ClassInfo JSHTMLElement::dir_info = { "HTMLDirectoryElement", &JSHTMLElement::info, &HTMLDirectoryElementTable, 0 };
435 const ClassInfo JSHTMLElement::div_info = { "HTMLDivElement", &JSHTMLElement::info, &HTMLDivElementTable, 0 };
436 const ClassInfo JSHTMLElement::dl_info = { "HTMLDListElement", &JSHTMLElement::info, &HTMLDListElementTable, 0 };
437 const ClassInfo JSHTMLElement::embed_info = { "HTMLEmbedElement", &JSHTMLElement::info, &HTMLEmbedElementTable, 0 };
438 const ClassInfo JSHTMLElement::fieldSet_info = { "HTMLFieldSetElement", &JSHTMLElement::info, &HTMLFieldSetElementTable, 0 };
439 const ClassInfo JSHTMLElement::font_info = { "HTMLFontElement", &JSHTMLElement::info, &HTMLFontElementTable, 0 };
440 const ClassInfo JSHTMLElement::form_info = { "HTMLFormElement", &JSHTMLElement::info, &HTMLFormElementTable, 0 };
441 const ClassInfo JSHTMLElement::frameSet_info = { "HTMLFrameSetElement", &JSHTMLElement::info, &HTMLFrameSetElementTable, 0 };
442 const ClassInfo JSHTMLElement::frame_info = { "HTMLFrameElement", &JSHTMLElement::info, &HTMLFrameElementTable, 0 };
443 const ClassInfo JSHTMLElement::head_info = { "HTMLHeadElement", &JSHTMLElement::info, &HTMLHeadElementTable, 0 };
444 const ClassInfo JSHTMLElement::heading_info = { "HTMLHeadingElement", &JSHTMLElement::info, &HTMLHeadingElementTable, 0 };
445 const ClassInfo JSHTMLElement::hr_info = { "HTMLHRElement", &JSHTMLElement::info, &HTMLHRElementTable, 0 };
446 const ClassInfo JSHTMLElement::html_info = { "HTMLHtmlElement", &JSHTMLElement::info, &HTMLHtmlElementTable, 0 };
447 const ClassInfo JSHTMLElement::iFrame_info = { "HTMLIFrameElement", &JSHTMLElement::info, &HTMLIFrameElementTable, 0 };
448 const ClassInfo JSHTMLElement::img_info = { "HTMLImageElement", &JSHTMLElement::info, &HTMLImageElementTable, 0 };
449 const ClassInfo JSHTMLElement::info = { "HTMLElement", &JSElement::info, &HTMLElementTable, 0 };
450 const ClassInfo JSHTMLElement::input_info = { "HTMLInputElement", &JSHTMLElement::info, &HTMLInputElementTable, 0 };
451 const ClassInfo JSHTMLElement::isIndex_info = { "HTMLIsIndexElement", &JSHTMLElement::info, &HTMLIsIndexElementTable, 0 };
452 const ClassInfo JSHTMLElement::label_info = { "HTMLLabelElement", &JSHTMLElement::info, &HTMLLabelElementTable, 0 };
453 const ClassInfo JSHTMLElement::legend_info = { "HTMLLegendElement", &JSHTMLElement::info, &HTMLLegendElementTable, 0 };
454 const ClassInfo JSHTMLElement::li_info = { "HTMLLIElement", &JSHTMLElement::info, &HTMLLIElementTable, 0 };
455 const ClassInfo JSHTMLElement::link_info = { "HTMLLinkElement", &JSHTMLElement::info, &HTMLLinkElementTable, 0 };
456 const ClassInfo JSHTMLElement::map_info = { "HTMLMapElement", &JSHTMLElement::info, &HTMLMapElementTable, 0 };
457 const ClassInfo JSHTMLElement::marquee_info = { "HTMLMarqueeElement", &JSHTMLElement::info, &HTMLMarqueeElementTable, 0 };
458 const ClassInfo JSHTMLElement::menu_info = { "HTMLMenuElement", &JSHTMLElement::info, &HTMLMenuElementTable, 0 };
459 const ClassInfo JSHTMLElement::meta_info = { "HTMLMetaElement", &JSHTMLElement::info, &HTMLMetaElementTable, 0 };
460 const ClassInfo JSHTMLElement::mod_info = { "HTMLModElement", &JSHTMLElement::info, &HTMLModElementTable, 0 };
461 const ClassInfo JSHTMLElement::object_info = { "HTMLObjectElement", &JSHTMLElement::info, &HTMLObjectElementTable, 0 };
462 const ClassInfo JSHTMLElement::ol_info = { "HTMLOListElement", &JSHTMLElement::info, &HTMLOListElementTable, 0 };
463 const ClassInfo JSHTMLElement::optGroup_info = { "HTMLOptGroupElement", &JSHTMLElement::info, &HTMLOptGroupElementTable, 0 };
464 const ClassInfo JSHTMLElement::option_info = { "HTMLOptionElement", &JSHTMLElement::info, &HTMLOptionElementTable, 0 };
465 const ClassInfo JSHTMLElement::p_info = { "HTMLParagraphElement", &JSHTMLElement::info, &HTMLParagraphElementTable, 0 };
466 const ClassInfo JSHTMLElement::param_info = { "HTMLParamElement", &JSHTMLElement::info, &HTMLParamElementTable, 0 };
467 const ClassInfo JSHTMLElement::pre_info = { "HTMLPreElement", &JSHTMLElement::info, &HTMLPreElementTable, 0 };
468 const ClassInfo JSHTMLElement::q_info = { "HTMLQuoteElement", &JSHTMLElement::info, &HTMLQuoteElementTable, 0 };
469 const ClassInfo JSHTMLElement::script_info = { "HTMLScriptElement", &JSHTMLElement::info, &HTMLScriptElementTable, 0 };
470 const ClassInfo JSHTMLElement::select_info = { "HTMLSelectElement", &JSHTMLElement::info, &HTMLSelectElementTable, 0 };
471 const ClassInfo JSHTMLElement::style_info = { "HTMLStyleElement", &JSHTMLElement::info, &HTMLStyleElementTable, 0 };
472 const ClassInfo JSHTMLElement::table_info = { "HTMLTableElement", &JSHTMLElement::info, &HTMLTableElementTable, 0 };
473 const ClassInfo JSHTMLElement::tablecell_info = { "HTMLTableCellElement", &JSHTMLElement::info, &HTMLTableCellElementTable, 0 };
474 const ClassInfo JSHTMLElement::tablesection_info = { "HTMLTableSectionElement", &JSHTMLElement::info, &HTMLTableSectionElementTable, 0 };
475 const ClassInfo JSHTMLElement::textArea_info = { "HTMLTextAreaElement", &JSHTMLElement::info, &HTMLTextAreaElementTable, 0 };
476 const ClassInfo JSHTMLElement::title_info = { "HTMLTitleElement", &JSHTMLElement::info, &HTMLTitleElementTable, 0 };
477 const ClassInfo JSHTMLElement::tr_info = { "HTMLTableRowElement", &JSHTMLElement::info, &HTMLTableRowElementTable, 0 };
478 const ClassInfo JSHTMLElement::ul_info = { "HTMLUListElement", &JSHTMLElement::info, &HTMLUListElementTable, 0 };
479
480 const ClassInfo* JSHTMLElement::classInfo() const
481 {
482     static HashMap<WebCore::AtomicStringImpl*, const ClassInfo*> classInfoMap;
483     if (classInfoMap.isEmpty()) {
484         classInfoMap.set(appletTag.localName().impl(), &applet_info);
485         classInfoMap.set(areaTag.localName().impl(), &area_info);
486         classInfoMap.set(baseTag.localName().impl(), &base_info);
487         classInfoMap.set(basefontTag.localName().impl(), &baseFont_info);
488         classInfoMap.set(blockquoteTag.localName().impl(), &blockQuote_info);
489         classInfoMap.set(bodyTag.localName().impl(), &body_info);
490         classInfoMap.set(brTag.localName().impl(), &br_info);
491         classInfoMap.set(buttonTag.localName().impl(), &button_info);
492         classInfoMap.set(captionTag.localName().impl(), &caption_info);
493         classInfoMap.set(colTag.localName().impl(), &col_info);
494         classInfoMap.set(colgroupTag.localName().impl(), &col_info);
495         classInfoMap.set(delTag.localName().impl(), &mod_info);
496         classInfoMap.set(dirTag.localName().impl(), &dir_info);
497         classInfoMap.set(divTag.localName().impl(), &div_info);
498         classInfoMap.set(dlTag.localName().impl(), &dl_info);
499         classInfoMap.set(embedTag.localName().impl(), &embed_info);
500         classInfoMap.set(fieldsetTag.localName().impl(), &fieldSet_info);
501         classInfoMap.set(fontTag.localName().impl(), &font_info);
502         classInfoMap.set(formTag.localName().impl(), &form_info);
503         classInfoMap.set(frameTag.localName().impl(), &frame_info);
504         classInfoMap.set(framesetTag.localName().impl(), &frameSet_info);
505         classInfoMap.set(h1Tag.localName().impl(), &heading_info);
506         classInfoMap.set(h2Tag.localName().impl(), &heading_info);
507         classInfoMap.set(h3Tag.localName().impl(), &heading_info);
508         classInfoMap.set(h4Tag.localName().impl(), &heading_info);
509         classInfoMap.set(h5Tag.localName().impl(), &heading_info);
510         classInfoMap.set(h6Tag.localName().impl(), &heading_info);
511         classInfoMap.set(headTag.localName().impl(), &head_info);
512         classInfoMap.set(hrTag.localName().impl(), &hr_info);
513         classInfoMap.set(htmlTag.localName().impl(), &html_info);
514         classInfoMap.set(iframeTag.localName().impl(), &iFrame_info);
515         classInfoMap.set(imgTag.localName().impl(), &img_info);
516         classInfoMap.set(inputTag.localName().impl(), &input_info);
517         classInfoMap.set(insTag.localName().impl(), &mod_info);
518         classInfoMap.set(isindexTag.localName().impl(), &isIndex_info);
519         classInfoMap.set(labelTag.localName().impl(), &label_info);
520         classInfoMap.set(legendTag.localName().impl(), &legend_info);
521         classInfoMap.set(liTag.localName().impl(), &li_info);
522         classInfoMap.set(linkTag.localName().impl(), &link_info);
523         classInfoMap.set(listingTag.localName().impl(), &pre_info);
524         classInfoMap.set(mapTag.localName().impl(), &map_info);
525         classInfoMap.set(marqueeTag.localName().impl(), &marquee_info);
526         classInfoMap.set(menuTag.localName().impl(), &menu_info);
527         classInfoMap.set(metaTag.localName().impl(), &meta_info);
528         classInfoMap.set(objectTag.localName().impl(), &object_info);
529         classInfoMap.set(olTag.localName().impl(), &ol_info);
530         classInfoMap.set(optgroupTag.localName().impl(), &optGroup_info);
531         classInfoMap.set(optionTag.localName().impl(), &option_info);
532         classInfoMap.set(pTag.localName().impl(), &p_info);
533         classInfoMap.set(paramTag.localName().impl(), &param_info);
534         classInfoMap.set(preTag.localName().impl(), &pre_info);
535         classInfoMap.set(qTag.localName().impl(), &q_info);
536         classInfoMap.set(scriptTag.localName().impl(), &script_info);
537         classInfoMap.set(selectTag.localName().impl(), &select_info);
538         classInfoMap.set(styleTag.localName().impl(), &style_info);
539         classInfoMap.set(tableTag.localName().impl(), &table_info);
540         classInfoMap.set(tbodyTag.localName().impl(), &tablesection_info);
541         classInfoMap.set(tdTag.localName().impl(), &tablecell_info);
542         classInfoMap.set(textareaTag.localName().impl(), &textArea_info);
543         classInfoMap.set(tfootTag.localName().impl(), &tablesection_info);
544         classInfoMap.set(thTag.localName().impl(), &tablecell_info);
545         classInfoMap.set(theadTag.localName().impl(), &tablesection_info);
546         classInfoMap.set(titleTag.localName().impl(), &title_info);
547         classInfoMap.set(trTag.localName().impl(), &tr_info);
548         classInfoMap.set(ulTag.localName().impl(), &ul_info);
549         classInfoMap.set(aTag.localName().impl(), &a_info);
550     }
551     
552     HTMLElement* element = static_cast<HTMLElement*>(impl());
553     const ClassInfo* result = classInfoMap.get(element->localName().impl());
554     if (result)
555         return result;
556     return &info;
557 }
558
559 const JSHTMLElement::Accessors JSHTMLElement::html_accessors = { &JSHTMLElement::htmlGetter, &JSHTMLElement::htmlSetter };
560 const JSHTMLElement::Accessors JSHTMLElement::head_accessors = { &JSHTMLElement::headGetter, &JSHTMLElement::headSetter };
561 const JSHTMLElement::Accessors JSHTMLElement::link_accessors = { &JSHTMLElement::linkGetter, &JSHTMLElement::linkSetter };
562 const JSHTMLElement::Accessors JSHTMLElement::title_accessors = { &JSHTMLElement::titleGetter, &JSHTMLElement::titleSetter };
563 const JSHTMLElement::Accessors JSHTMLElement::meta_accessors = { &JSHTMLElement::metaGetter, &JSHTMLElement::metaSetter };
564 const JSHTMLElement::Accessors JSHTMLElement::base_accessors = { &JSHTMLElement::baseGetter, &JSHTMLElement::baseSetter };
565 const JSHTMLElement::Accessors JSHTMLElement::isIndex_accessors = { &JSHTMLElement::isIndexGetter, &JSHTMLElement::isIndexSetter };
566 const JSHTMLElement::Accessors JSHTMLElement::style_accessors = { &JSHTMLElement::styleGetter, &JSHTMLElement::styleSetter };
567 const JSHTMLElement::Accessors JSHTMLElement::body_accessors = { &JSHTMLElement::bodyGetter, &JSHTMLElement::bodySetter };
568 const JSHTMLElement::Accessors JSHTMLElement::form_accessors = { &JSHTMLElement::formGetter, &JSHTMLElement::formSetter };
569 const JSHTMLElement::Accessors JSHTMLElement::select_accessors = { &JSHTMLElement::selectGetter, &JSHTMLElement::selectSetter };
570 const JSHTMLElement::Accessors JSHTMLElement::optGroup_accessors = { &JSHTMLElement::optGroupGetter, &JSHTMLElement::optGroupSetter };
571 const JSHTMLElement::Accessors JSHTMLElement::option_accessors = { &JSHTMLElement::optionGetter, &JSHTMLElement::optionSetter };
572 const JSHTMLElement::Accessors JSHTMLElement::input_accessors = { &JSHTMLElement::inputGetter, &JSHTMLElement::inputSetter };
573 const JSHTMLElement::Accessors JSHTMLElement::textArea_accessors = { &JSHTMLElement::textAreaGetter, &JSHTMLElement::textAreaSetter };
574 const JSHTMLElement::Accessors JSHTMLElement::button_accessors = { &JSHTMLElement::buttonGetter, &JSHTMLElement::buttonSetter };
575 const JSHTMLElement::Accessors JSHTMLElement::label_accessors = { &JSHTMLElement::labelGetter, &JSHTMLElement::labelSetter };
576 const JSHTMLElement::Accessors JSHTMLElement::fieldSet_accessors = { &JSHTMLElement::fieldSetGetter, &JSHTMLElement::fieldSetSetter };
577 const JSHTMLElement::Accessors JSHTMLElement::legend_accessors = { &JSHTMLElement::legendGetter, &JSHTMLElement::legendSetter };
578 const JSHTMLElement::Accessors JSHTMLElement::ul_accessors = { &JSHTMLElement::uListGetter, &JSHTMLElement::uListSetter };
579 const JSHTMLElement::Accessors JSHTMLElement::ol_accessors = { &JSHTMLElement::oListGetter, &JSHTMLElement::oListSetter };
580 const JSHTMLElement::Accessors JSHTMLElement::dl_accessors = { &JSHTMLElement::dListGetter, &JSHTMLElement::dListSetter };
581 const JSHTMLElement::Accessors JSHTMLElement::dir_accessors = { &JSHTMLElement::dirGetter, &JSHTMLElement::dirSetter };
582 const JSHTMLElement::Accessors JSHTMLElement::menu_accessors = { &JSHTMLElement::menuGetter, &JSHTMLElement::menuSetter };
583 const JSHTMLElement::Accessors JSHTMLElement::li_accessors = { &JSHTMLElement::liGetter, &JSHTMLElement::liSetter };
584 const JSHTMLElement::Accessors JSHTMLElement::div_accessors = { &JSHTMLElement::divGetter, &JSHTMLElement::divSetter };
585 const JSHTMLElement::Accessors JSHTMLElement::p_accessors = { &JSHTMLElement::paragraphGetter, &JSHTMLElement::paragraphSetter };
586 const JSHTMLElement::Accessors JSHTMLElement::heading_accessors = { &JSHTMLElement::headingGetter, &JSHTMLElement::headingSetter };
587 const JSHTMLElement::Accessors JSHTMLElement::blockQuote_accessors = { &JSHTMLElement::blockQuoteGetter, &JSHTMLElement::blockQuoteSetter };
588 const JSHTMLElement::Accessors JSHTMLElement::q_accessors = { &JSHTMLElement::quoteGetter, &JSHTMLElement::quoteSetter };
589 const JSHTMLElement::Accessors JSHTMLElement::pre_accessors = { &JSHTMLElement::preGetter, &JSHTMLElement::preSetter };
590 const JSHTMLElement::Accessors JSHTMLElement::br_accessors = { &JSHTMLElement::brGetter, &JSHTMLElement::brSetter };
591 const JSHTMLElement::Accessors JSHTMLElement::baseFont_accessors = { &JSHTMLElement::baseFontGetter, &JSHTMLElement::baseFontSetter };
592 const JSHTMLElement::Accessors JSHTMLElement::font_accessors = { &JSHTMLElement::fontGetter, &JSHTMLElement::fontSetter };
593 const JSHTMLElement::Accessors JSHTMLElement::hr_accessors = { &JSHTMLElement::hrGetter, &JSHTMLElement::hrSetter };
594 const JSHTMLElement::Accessors JSHTMLElement::mod_accessors = { &JSHTMLElement::modGetter, &JSHTMLElement::modSetter };
595 const JSHTMLElement::Accessors JSHTMLElement::a_accessors = { &JSHTMLElement::anchorGetter, &JSHTMLElement::anchorSetter };
596 const JSHTMLElement::Accessors JSHTMLElement::img_accessors = { &JSHTMLElement::imageGetter, &JSHTMLElement::imageSetter };
597 const JSHTMLElement::Accessors JSHTMLElement::object_accessors = { &JSHTMLElement::objectGetter, &JSHTMLElement::objectSetter };
598 const JSHTMLElement::Accessors JSHTMLElement::param_accessors = { &JSHTMLElement::paramGetter, &JSHTMLElement::paramSetter };
599 const JSHTMLElement::Accessors JSHTMLElement::applet_accessors = { &JSHTMLElement::appletGetter, &JSHTMLElement::appletSetter };
600 const JSHTMLElement::Accessors JSHTMLElement::embed_accessors = { &JSHTMLElement::embedGetter, &JSHTMLElement::embedSetter };
601 const JSHTMLElement::Accessors JSHTMLElement::map_accessors = { &JSHTMLElement::mapGetter, &JSHTMLElement::mapSetter };
602 const JSHTMLElement::Accessors JSHTMLElement::area_accessors = { &JSHTMLElement::areaGetter, &JSHTMLElement::areaSetter };
603 const JSHTMLElement::Accessors JSHTMLElement::script_accessors = { &JSHTMLElement::scriptGetter, &JSHTMLElement::scriptSetter };
604 const JSHTMLElement::Accessors JSHTMLElement::table_accessors = { &JSHTMLElement::tableGetter, &JSHTMLElement::tableSetter };
605 const JSHTMLElement::Accessors JSHTMLElement::caption_accessors = { &JSHTMLElement::tableCaptionGetter, &JSHTMLElement::tableCaptionSetter };
606 const JSHTMLElement::Accessors JSHTMLElement::col_accessors = { &JSHTMLElement::tableColGetter, &JSHTMLElement::tableColSetter };
607 const JSHTMLElement::Accessors JSHTMLElement::tablesection_accessors = { &JSHTMLElement::tableSectionGetter, &JSHTMLElement::tableSectionSetter };
608 const JSHTMLElement::Accessors JSHTMLElement::tr_accessors = { &JSHTMLElement::tableRowGetter, &JSHTMLElement::tableRowSetter };
609 const JSHTMLElement::Accessors JSHTMLElement::tablecell_accessors = { &JSHTMLElement::tableCellGetter, &JSHTMLElement::tableCellSetter };
610 const JSHTMLElement::Accessors JSHTMLElement::frameSet_accessors = { &JSHTMLElement::frameSetGetter, &JSHTMLElement::frameSetSetter };
611 const JSHTMLElement::Accessors JSHTMLElement::frame_accessors = { &JSHTMLElement::frameGetter, &JSHTMLElement::frameSetter };
612 const JSHTMLElement::Accessors JSHTMLElement::iFrame_accessors = { &JSHTMLElement::iFrameGetter, &JSHTMLElement::iFrameSetter };
613 const JSHTMLElement::Accessors JSHTMLElement::marquee_accessors = { &JSHTMLElement::marqueeGetter, &JSHTMLElement::marqueeSetter };
614
615 const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
616 {
617     static HashMap<WebCore::AtomicStringImpl*, const Accessors*> accessorMap;
618     if (accessorMap.isEmpty()) {
619         accessorMap.add(aTag.localName().impl(), &a_accessors);
620         accessorMap.add(appletTag.localName().impl(), &applet_accessors);
621         accessorMap.add(areaTag.localName().impl(), &area_accessors);
622         accessorMap.add(baseTag.localName().impl(), &base_accessors);
623         accessorMap.add(basefontTag.localName().impl(), &baseFont_accessors);
624         accessorMap.add(blockquoteTag.localName().impl(), &blockQuote_accessors); 
625         accessorMap.add(bodyTag.localName().impl(), &body_accessors);
626         accessorMap.add(brTag.localName().impl(), &br_accessors);
627         accessorMap.add(buttonTag.localName().impl(), &button_accessors);
628         accessorMap.add(captionTag.localName().impl(), &caption_accessors);
629         accessorMap.add(colTag.localName().impl(), &col_accessors);
630         accessorMap.add(colgroupTag.localName().impl(), &col_accessors);
631         accessorMap.add(delTag.localName().impl(), &mod_accessors);
632         accessorMap.add(dirTag.localName().impl(), &dir_accessors);
633         accessorMap.add(divTag.localName().impl(), &div_accessors);
634         accessorMap.add(dlTag.localName().impl(), &dl_accessors);
635         accessorMap.add(embedTag.localName().impl(), &embed_accessors);
636         accessorMap.add(fieldsetTag.localName().impl(), &fieldSet_accessors);
637         accessorMap.add(fontTag.localName().impl(), &font_accessors);
638         accessorMap.add(formTag.localName().impl(), &form_accessors);
639         accessorMap.add(frameTag.localName().impl(), &frame_accessors);
640         accessorMap.add(framesetTag.localName().impl(), &frameSet_accessors);
641         accessorMap.add(h1Tag.localName().impl(), &heading_accessors);
642         accessorMap.add(h2Tag.localName().impl(), &heading_accessors);
643         accessorMap.add(h3Tag.localName().impl(), &heading_accessors);
644         accessorMap.add(h4Tag.localName().impl(), &heading_accessors);
645         accessorMap.add(h5Tag.localName().impl(), &heading_accessors);
646         accessorMap.add(h6Tag.localName().impl(), &heading_accessors);
647         accessorMap.add(headTag.localName().impl(), &head_accessors);
648         accessorMap.add(hrTag.localName().impl(), &hr_accessors); 
649         accessorMap.add(htmlTag.localName().impl(), &html_accessors);
650         accessorMap.add(iframeTag.localName().impl(), &iFrame_accessors);
651         accessorMap.add(imgTag.localName().impl(), &img_accessors);
652         accessorMap.add(inputTag.localName().impl(), &input_accessors);
653         accessorMap.add(insTag.localName().impl(), &mod_accessors);
654         accessorMap.add(isindexTag.localName().impl(), &isIndex_accessors);
655         accessorMap.add(labelTag.localName().impl(), &label_accessors);
656         accessorMap.add(legendTag.localName().impl(), &legend_accessors);
657         accessorMap.add(liTag.localName().impl(), &li_accessors);
658         accessorMap.add(linkTag.localName().impl(), &link_accessors);
659         accessorMap.set(listingTag.localName().impl(), &pre_accessors);
660         accessorMap.add(mapTag.localName().impl(), &map_accessors);
661         accessorMap.add(marqueeTag.localName().impl(), &marquee_accessors);
662         accessorMap.add(menuTag.localName().impl(), &menu_accessors);
663         accessorMap.add(metaTag.localName().impl(), &meta_accessors);
664         accessorMap.add(objectTag.localName().impl(), &object_accessors);
665         accessorMap.add(olTag.localName().impl(), &ol_accessors);
666         accessorMap.add(optionTag.localName().impl(), &option_accessors);
667         accessorMap.add(optgroupTag.localName().impl(), &optGroup_accessors);
668         accessorMap.add(pTag.localName().impl(), &p_accessors);
669         accessorMap.add(paramTag.localName().impl(), &param_accessors);
670         accessorMap.add(preTag.localName().impl(), &pre_accessors);
671         accessorMap.add(qTag.localName().impl(), &q_accessors);
672         accessorMap.add(scriptTag.localName().impl(), &script_accessors);
673         accessorMap.add(selectTag.localName().impl(), &select_accessors);
674         accessorMap.add(styleTag.localName().impl(), &style_accessors);
675         accessorMap.add(tableTag.localName().impl(), &table_accessors);
676         accessorMap.add(tbodyTag.localName().impl(), &tablesection_accessors);
677         accessorMap.add(tdTag.localName().impl(), &tablecell_accessors);
678         accessorMap.add(textareaTag.localName().impl(), &textArea_accessors);
679         accessorMap.add(thTag.localName().impl(), &tablecell_accessors);
680         accessorMap.add(theadTag.localName().impl(), &tablesection_accessors);
681         accessorMap.add(tfootTag.localName().impl(), &tablesection_accessors);
682         accessorMap.add(titleTag.localName().impl(), &title_accessors);
683         accessorMap.add(trTag.localName().impl(), &tr_accessors);
684         accessorMap.add(ulTag.localName().impl(), &ul_accessors);
685     }
686     
687     HTMLElement* element = static_cast<HTMLElement*>(impl());
688     return accessorMap.get(element->localName().impl());
689 }
690
691 /*
692
693 @begin JSHTMLElementProtoTable 0
694 @end
695
696 @begin HTMLElementTable 14
697   id            KJS::JSHTMLElement::ElementId     DontDelete
698   title         KJS::JSHTMLElement::ElementTitle  DontDelete
699   lang          KJS::JSHTMLElement::ElementLang   DontDelete
700   dir           KJS::JSHTMLElement::ElementDir    DontDelete
701 ### isn't this "class" in the HTML spec?
702   className     KJS::JSHTMLElement::ElementClassName DontDelete
703   innerHTML     KJS::JSHTMLElement::ElementInnerHTML DontDelete
704   innerText     KJS::JSHTMLElement::ElementInnerText DontDelete
705   outerHTML     KJS::JSHTMLElement::ElementOuterHTML DontDelete
706   outerText     KJS::JSHTMLElement::ElementOuterText DontDelete
707   document      KJS::JSHTMLElement::ElementDocument  DontDelete|ReadOnly
708 # IE extension
709   children      KJS::JSHTMLElement::ElementChildren  DontDelete|ReadOnly
710   contentEditable   KJS::JSHTMLElement::ElementContentEditable  DontDelete
711   isContentEditable KJS::JSHTMLElement::ElementIsContentEditable  DontDelete|ReadOnly
712 @end
713 @begin HTMLHtmlElementTable 1
714   version       KJS::JSHTMLElement::HtmlVersion   DontDelete
715 @end
716 @begin HTMLHeadElementTable 1
717   profile       KJS::JSHTMLElement::HeadProfile   DontDelete
718 @end
719 @begin HTMLLinkElementTable 11
720   disabled      KJS::JSHTMLElement::LinkDisabled  DontDelete
721   charset       KJS::JSHTMLElement::LinkCharset   DontDelete
722   href          KJS::JSHTMLElement::LinkHref      DontDelete
723   hreflang      KJS::JSHTMLElement::LinkHrefLang  DontDelete
724   media         KJS::JSHTMLElement::LinkMedia     DontDelete
725   rel           KJS::JSHTMLElement::LinkRel       DontDelete
726   rev           KJS::JSHTMLElement::LinkRev       DontDelete
727   target        KJS::JSHTMLElement::LinkTarget    DontDelete
728   type          KJS::JSHTMLElement::LinkType      DontDelete
729   sheet         KJS::JSHTMLElement::LinkSheet     DontDelete|ReadOnly
730 @end
731 @begin HTMLTitleElementTable 1
732   text          KJS::JSHTMLElement::TitleText     DontDelete
733 @end
734 @begin HTMLMetaElementTable 4
735   content       KJS::JSHTMLElement::MetaContent   DontDelete
736   httpEquiv     KJS::JSHTMLElement::MetaHttpEquiv DontDelete
737   name          KJS::JSHTMLElement::MetaName      DontDelete
738   scheme        KJS::JSHTMLElement::MetaScheme    DontDelete
739 @end
740 @begin HTMLBaseElementTable 2
741   href          KJS::JSHTMLElement::BaseHref      DontDelete
742   target        KJS::JSHTMLElement::BaseTarget    DontDelete
743 @end
744 @begin HTMLIsIndexElementTable 2
745   form          KJS::JSHTMLElement::IsIndexForm   DontDelete|ReadOnly
746   prompt        KJS::JSHTMLElement::IsIndexPrompt DontDelete
747 @end
748 @begin HTMLStyleElementTable 4
749   disabled      KJS::JSHTMLElement::StyleDisabled DontDelete
750   media         KJS::JSHTMLElement::StyleMedia    DontDelete
751   type          KJS::JSHTMLElement::StyleType     DontDelete
752   sheet         KJS::JSHTMLElement::StyleSheet    DontDelete|ReadOnly
753 @end
754 @begin HTMLBodyElementTable 10
755   aLink         KJS::JSHTMLElement::BodyALink     DontDelete
756   background    KJS::JSHTMLElement::BodyBackground        DontDelete
757   bgColor       KJS::JSHTMLElement::BodyBgColor   DontDelete
758   link          KJS::JSHTMLElement::BodyLink      DontDelete
759   text          KJS::JSHTMLElement::BodyText      DontDelete
760   vLink         KJS::JSHTMLElement::BodyVLink     DontDelete
761   scrollLeft    KJS::JSHTMLElement::BodyScrollLeft        DontDelete
762   scrollTop     KJS::JSHTMLElement::BodyScrollTop         DontDelete
763   scrollHeight  KJS::JSHTMLElement::BodyScrollHeight      DontDelete|ReadOnly
764   scrollWidth   KJS::JSHTMLElement::BodyScrollWidth       DontDelete|ReadOnly
765 @end
766 @begin HTMLFormElementTable 11
767 # Also supported, by name/index
768   elements      KJS::JSHTMLElement::FormElements  DontDelete|ReadOnly
769   length        KJS::JSHTMLElement::FormLength    DontDelete|ReadOnly
770   name          KJS::JSHTMLElement::FormName      DontDelete
771   acceptCharset KJS::JSHTMLElement::FormAcceptCharset     DontDelete
772   action        KJS::JSHTMLElement::FormAction    DontDelete
773   enctype       KJS::JSHTMLElement::FormEncType   DontDelete
774   method        KJS::JSHTMLElement::FormMethod    DontDelete
775   target        KJS::JSHTMLElement::FormTarget    DontDelete
776   submit        KJS::JSHTMLElement::FormSubmit    DontDelete|Function 0
777   reset         KJS::JSHTMLElement::FormReset     DontDelete|Function 0
778 @end
779 @begin HTMLSelectElementTable 11
780 # Also supported, by index
781   type          KJS::JSHTMLElement::SelectType    DontDelete|ReadOnly
782   selectedIndex KJS::JSHTMLElement::SelectSelectedIndex   DontDelete
783   value         KJS::JSHTMLElement::SelectValue   DontDelete
784   length        KJS::JSHTMLElement::SelectLength  DontDelete
785   form          KJS::JSHTMLElement::SelectForm    DontDelete|ReadOnly
786   options       KJS::JSHTMLElement::SelectOptions DontDelete|ReadOnly
787   disabled      KJS::JSHTMLElement::SelectDisabled        DontDelete
788   multiple      KJS::JSHTMLElement::SelectMultiple        DontDelete
789   name          KJS::JSHTMLElement::SelectName    DontDelete
790   size          KJS::JSHTMLElement::SelectSize    DontDelete
791   tabIndex      KJS::JSHTMLElement::SelectTabIndex        DontDelete
792   add           KJS::JSHTMLElement::SelectAdd     DontDelete|Function 2
793   remove        KJS::JSHTMLElement::SelectRemove  DontDelete|Function 1
794   blur          KJS::JSHTMLElement::SelectBlur    DontDelete|Function 0
795   focus         KJS::JSHTMLElement::SelectFocus   DontDelete|Function 0
796 @end
797 @begin HTMLOptGroupElementTable 2
798   disabled      KJS::JSHTMLElement::OptGroupDisabled      DontDelete
799   label         KJS::JSHTMLElement::OptGroupLabel         DontDelete
800 @end
801 @begin HTMLOptionElementTable 8
802   form          KJS::JSHTMLElement::OptionForm            DontDelete|ReadOnly
803   defaultSelected KJS::JSHTMLElement::OptionDefaultSelected       DontDelete
804   text          KJS::JSHTMLElement::OptionText            DontDelete
805   index         KJS::JSHTMLElement::OptionIndex           DontDelete|ReadOnly
806   disabled      KJS::JSHTMLElement::OptionDisabled        DontDelete
807   label         KJS::JSHTMLElement::OptionLabel           DontDelete
808   selected      KJS::JSHTMLElement::OptionSelected        DontDelete
809   value         KJS::JSHTMLElement::OptionValue           DontDelete
810 @end
811 @begin HTMLInputElementTable 24
812   defaultValue  KJS::JSHTMLElement::InputDefaultValue     DontDelete
813   defaultChecked KJS::JSHTMLElement::InputDefaultChecked  DontDelete
814   form          KJS::JSHTMLElement::InputForm             DontDelete|ReadOnly
815   accept        KJS::JSHTMLElement::InputAccept           DontDelete
816   accessKey     KJS::JSHTMLElement::InputAccessKey        DontDelete
817   align         KJS::JSHTMLElement::InputAlign            DontDelete
818   alt           KJS::JSHTMLElement::InputAlt              DontDelete
819   checked       KJS::JSHTMLElement::InputChecked          DontDelete
820   disabled      KJS::JSHTMLElement::InputDisabled         DontDelete
821   indeterminate KJS::JSHTMLElement::InputIndeterminate    DontDelete
822   maxLength     KJS::JSHTMLElement::InputMaxLength        DontDelete
823   name          KJS::JSHTMLElement::InputName             DontDelete
824   readOnly      KJS::JSHTMLElement::InputReadOnly         DontDelete
825   selectionStart        KJS::JSHTMLElement::InputSelectionStart   DontDelete
826   selectionEnd  KJS::JSHTMLElement::InputSelectionEnd     DontDelete
827   size          KJS::JSHTMLElement::InputSize             DontDelete
828   src           KJS::JSHTMLElement::InputSrc              DontDelete
829   tabIndex      KJS::JSHTMLElement::InputTabIndex         DontDelete
830   type          KJS::JSHTMLElement::InputType             DontDelete
831   useMap        KJS::JSHTMLElement::InputUseMap           DontDelete
832   value         KJS::JSHTMLElement::InputValue            DontDelete
833   blur          KJS::JSHTMLElement::InputBlur             DontDelete|Function 0
834   focus         KJS::JSHTMLElement::InputFocus            DontDelete|Function 0
835   select        KJS::JSHTMLElement::InputSelect           DontDelete|Function 0
836   click         KJS::JSHTMLElement::InputClick            DontDelete|Function 0
837   setSelectionRange     KJS::JSHTMLElement::InputSetSelectionRange        DontDelete|Function 2
838 @end
839 @begin HTMLTextAreaElementTable 17
840   defaultValue  KJS::JSHTMLElement::TextAreaDefaultValue  DontDelete
841   form          KJS::JSHTMLElement::TextAreaForm          DontDelete|ReadOnly
842   accessKey     KJS::JSHTMLElement::TextAreaAccessKey     DontDelete
843   cols          KJS::JSHTMLElement::TextAreaCols          DontDelete
844   disabled      KJS::JSHTMLElement::TextAreaDisabled      DontDelete
845   name          KJS::JSHTMLElement::TextAreaName          DontDelete
846   readOnly      KJS::JSHTMLElement::TextAreaReadOnly      DontDelete
847   rows          KJS::JSHTMLElement::TextAreaRows          DontDelete
848   selectionStart        KJS::JSHTMLElement::TextAreaSelectionStart        DontDelete
849   selectionEnd  KJS::JSHTMLElement::TextAreaSelectionEnd  DontDelete
850   tabIndex      KJS::JSHTMLElement::TextAreaTabIndex      DontDelete
851   type          KJS::JSHTMLElement::TextAreaType          DontDelete|ReadOnly
852   value         KJS::JSHTMLElement::TextAreaValue         DontDelete
853   blur          KJS::JSHTMLElement::TextAreaBlur          DontDelete|Function 0
854   focus         KJS::JSHTMLElement::TextAreaFocus         DontDelete|Function 0
855   select        KJS::JSHTMLElement::TextAreaSelect        DontDelete|Function 0
856   setSelectionRange     KJS::JSHTMLElement::TextAreaSetSelectionRange     DontDelete|Function 2
857 @end
858 @begin HTMLButtonElementTable 7
859   form          KJS::JSHTMLElement::ButtonForm            DontDelete|ReadOnly
860   accessKey     KJS::JSHTMLElement::ButtonAccessKey       DontDelete
861   disabled      KJS::JSHTMLElement::ButtonDisabled        DontDelete
862   name          KJS::JSHTMLElement::ButtonName            DontDelete
863   tabIndex      KJS::JSHTMLElement::ButtonTabIndex        DontDelete
864   type          KJS::JSHTMLElement::ButtonType            DontDelete|ReadOnly
865   value         KJS::JSHTMLElement::ButtonValue           DontDelete
866   blur          KJS::JSHTMLElement::ButtonBlur            DontDelete|Function 0
867   focus         KJS::JSHTMLElement::ButtonFocus           DontDelete|Function 0
868 @end
869 @begin HTMLLabelElementTable 4
870   form          KJS::JSHTMLElement::LabelForm             DontDelete|ReadOnly
871   accessKey     KJS::JSHTMLElement::LabelAccessKey        DontDelete
872   htmlFor       KJS::JSHTMLElement::LabelHtmlFor          DontDelete
873   focus     KJS::JSHTMLElement::LabelFocus        DontDelete|Function 0
874 @end
875 @begin HTMLFieldSetElementTable 1
876   form          KJS::JSHTMLElement::FieldSetForm          DontDelete|ReadOnly
877 @end
878 @begin HTMLLegendElementTable 4
879   form          KJS::JSHTMLElement::LegendForm            DontDelete|ReadOnly
880   accessKey     KJS::JSHTMLElement::LegendAccessKey       DontDelete
881   align         KJS::JSHTMLElement::LegendAlign           DontDelete
882   focus     KJS::JSHTMLElement::LegendFocus     DontDelete|Function 0
883 @end
884 @begin HTMLUListElementTable 2
885   compact       KJS::JSHTMLElement::UListCompact          DontDelete
886   type          KJS::JSHTMLElement::UListType             DontDelete
887 @end
888 @begin HTMLOListElementTable 3
889   compact       KJS::JSHTMLElement::OListCompact          DontDelete
890   start         KJS::JSHTMLElement::OListStart            DontDelete
891   type          KJS::JSHTMLElement::OListType             DontDelete
892 @end
893 @begin HTMLDListElementTable 1
894   compact       KJS::JSHTMLElement::DListCompact          DontDelete
895 @end
896 @begin HTMLDirectoryElementTable 1
897   compact       KJS::JSHTMLElement::DirectoryCompact      DontDelete
898 @end
899 @begin HTMLMenuElementTable 1
900   compact       KJS::JSHTMLElement::MenuCompact           DontDelete
901 @end
902 @begin HTMLLIElementTable 2
903   type          KJS::JSHTMLElement::LIType                DontDelete
904   value         KJS::JSHTMLElement::LIValue               DontDelete
905 @end
906 @begin HTMLDivElementTable 1
907   align         KJS::JSHTMLElement::DivAlign              DontDelete
908 @end
909 @begin HTMLParagraphElementTable 1
910   align         KJS::JSHTMLElement::ParagraphAlign        DontDelete
911 @end
912 @begin HTMLHeadingElementTable 1
913   align         KJS::JSHTMLElement::HeadingAlign          DontDelete
914 @end
915 @begin HTMLBlockQuoteElementTable 1
916   cite          KJS::JSHTMLElement::BlockQuoteCite        DontDelete
917 @end
918 @begin HTMLQuoteElementTable 1
919   cite          KJS::JSHTMLElement::QuoteCite             DontDelete
920 @end
921 @begin HTMLPreElementTable 1
922   width         KJS::JSHTMLElement::PreWidth              DontDelete
923 @end
924 @begin HTMLBRElementTable 1
925   clear         KJS::JSHTMLElement::BRClear               DontDelete
926 @end
927 @begin HTMLBaseFontElementTable 3
928   color         KJS::JSHTMLElement::BaseFontColor         DontDelete
929   face          KJS::JSHTMLElement::BaseFontFace          DontDelete
930   size          KJS::JSHTMLElement::BaseFontSize          DontDelete
931 @end
932 @begin HTMLFontElementTable 3
933   color         KJS::JSHTMLElement::FontColor             DontDelete
934   face          KJS::JSHTMLElement::FontFace              DontDelete
935   size          KJS::JSHTMLElement::FontSize              DontDelete
936 @end
937 @begin HTMLHRElementTable 4
938   align         KJS::JSHTMLElement::HRAlign               DontDelete
939   noShade       KJS::JSHTMLElement::HRNoShade             DontDelete
940   size          KJS::JSHTMLElement::HRSize                DontDelete
941   width         KJS::JSHTMLElement::HRWidth               DontDelete
942 @end
943 @begin HTMLModElementTable 2
944   cite          KJS::JSHTMLElement::ModCite               DontDelete
945   dateTime      KJS::JSHTMLElement::ModDateTime           DontDelete
946 @end
947 @begin HTMLAnchorElementTable 24
948   accessKey     KJS::JSHTMLElement::AnchorAccessKey       DontDelete
949   charset       KJS::JSHTMLElement::AnchorCharset         DontDelete
950   coords        KJS::JSHTMLElement::AnchorCoords          DontDelete
951   href          KJS::JSHTMLElement::AnchorHref            DontDelete
952   hreflang      KJS::JSHTMLElement::AnchorHrefLang        DontDelete
953   hash          KJS::JSHTMLElement::AnchorHash            DontDelete|ReadOnly
954   host          KJS::JSHTMLElement::AnchorHost            DontDelete|ReadOnly
955   hostname      KJS::JSHTMLElement::AnchorHostname        DontDelete|ReadOnly
956   name          KJS::JSHTMLElement::AnchorName            DontDelete
957   pathname      KJS::JSHTMLElement::AnchorPathName        DontDelete|ReadOnly
958   port          KJS::JSHTMLElement::AnchorPort            DontDelete|ReadOnly
959   protocol      KJS::JSHTMLElement::AnchorProtocol        DontDelete|ReadOnly
960   rel           KJS::JSHTMLElement::AnchorRel             DontDelete
961   rev           KJS::JSHTMLElement::AnchorRev             DontDelete
962   search        KJS::JSHTMLElement::AnchorSearch          DontDelete|ReadOnly
963   shape         KJS::JSHTMLElement::AnchorShape           DontDelete
964   tabIndex      KJS::JSHTMLElement::AnchorTabIndex        DontDelete
965   target        KJS::JSHTMLElement::AnchorTarget          DontDelete
966   text          KJS::JSHTMLElement::AnchorText            DontDelete|ReadOnly
967   type          KJS::JSHTMLElement::AnchorType            DontDelete
968   blur          KJS::JSHTMLElement::AnchorBlur            DontDelete|Function 0
969   focus         KJS::JSHTMLElement::AnchorFocus           DontDelete|Function 0
970   toString      KJS::JSHTMLElement::AnchorToString        DontDelete|Function 0
971 @end
972 @begin HTMLImageElementTable 14
973   name          KJS::JSHTMLElement::ImageName             DontDelete
974   align         KJS::JSHTMLElement::ImageAlign            DontDelete
975   alt           KJS::JSHTMLElement::ImageAlt              DontDelete
976   border        KJS::JSHTMLElement::ImageBorder           DontDelete
977   complete      KJS::JSHTMLElement::ImageComplete         DontDelete|ReadOnly
978   height        KJS::JSHTMLElement::ImageHeight           DontDelete
979   hspace        KJS::JSHTMLElement::ImageHspace           DontDelete
980   isMap         KJS::JSHTMLElement::ImageIsMap            DontDelete
981   longDesc      KJS::JSHTMLElement::ImageLongDesc         DontDelete
982   src           KJS::JSHTMLElement::ImageSrc              DontDelete
983   useMap        KJS::JSHTMLElement::ImageUseMap           DontDelete
984   vspace        KJS::JSHTMLElement::ImageVspace           DontDelete
985   width         KJS::JSHTMLElement::ImageWidth            DontDelete
986   x         KJS::JSHTMLElement::ImageX            DontDelete|ReadOnly
987   y         KJS::JSHTMLElement::ImageY            DontDelete|ReadOnly
988 @end
989 @begin HTMLObjectElementTable 20
990   form            KJS::JSHTMLElement::ObjectForm            DontDelete|ReadOnly
991   code            KJS::JSHTMLElement::ObjectCode            DontDelete
992   align           KJS::JSHTMLElement::ObjectAlign           DontDelete
993   archive         KJS::JSHTMLElement::ObjectArchive         DontDelete
994   border          KJS::JSHTMLElement::ObjectBorder          DontDelete
995   codeBase        KJS::JSHTMLElement::ObjectCodeBase        DontDelete
996   codeType        KJS::JSHTMLElement::ObjectCodeType        DontDelete
997   contentDocument KJS::JSHTMLElement::ObjectContentDocument DontDelete|ReadOnly
998   data            KJS::JSHTMLElement::ObjectData            DontDelete
999   declare         KJS::JSHTMLElement::ObjectDeclare         DontDelete
1000   height          KJS::JSHTMLElement::ObjectHeight          DontDelete
1001   hspace          KJS::JSHTMLElement::ObjectHspace          DontDelete
1002   name            KJS::JSHTMLElement::ObjectName            DontDelete
1003   standby         KJS::JSHTMLElement::ObjectStandby         DontDelete
1004   tabIndex        KJS::JSHTMLElement::ObjectTabIndex        DontDelete
1005   type            KJS::JSHTMLElement::ObjectType            DontDelete
1006   useMap          KJS::JSHTMLElement::ObjectUseMap          DontDelete
1007   vspace          KJS::JSHTMLElement::ObjectVspace          DontDelete
1008   width           KJS::JSHTMLElement::ObjectWidth           DontDelete
1009 @end
1010 @begin HTMLParamElementTable 4
1011   name          KJS::JSHTMLElement::ParamName             DontDelete
1012   type          KJS::JSHTMLElement::ParamType             DontDelete
1013   value         KJS::JSHTMLElement::ParamValue            DontDelete
1014   valueType     KJS::JSHTMLElement::ParamValueType        DontDelete
1015 @end
1016 @begin HTMLAppletElementTable 11
1017   align         KJS::JSHTMLElement::AppletAlign           DontDelete
1018   alt           KJS::JSHTMLElement::AppletAlt             DontDelete
1019   archive       KJS::JSHTMLElement::AppletArchive         DontDelete
1020   code          KJS::JSHTMLElement::AppletCode            DontDelete
1021   codeBase      KJS::JSHTMLElement::AppletCodeBase        DontDelete
1022   height        KJS::JSHTMLElement::AppletHeight          DontDelete
1023   hspace        KJS::JSHTMLElement::AppletHspace          DontDelete
1024   name          KJS::JSHTMLElement::AppletName            DontDelete
1025   object        KJS::JSHTMLElement::AppletObject          DontDelete
1026   vspace        KJS::JSHTMLElement::AppletVspace          DontDelete
1027   width         KJS::JSHTMLElement::AppletWidth           DontDelete
1028 @end
1029 @begin HTMLEmbedElementTable 6
1030   align         KJS::JSHTMLElement::EmbedAlign           DontDelete
1031   height        KJS::JSHTMLElement::EmbedHeight          DontDelete
1032   name          KJS::JSHTMLElement::EmbedName            DontDelete
1033   src           KJS::JSHTMLElement::EmbedSrc             DontDelete
1034   type          KJS::JSHTMLElement::EmbedType            DontDelete
1035   width         KJS::JSHTMLElement::EmbedWidth           DontDelete
1036 @end
1037 @begin HTMLMapElementTable 2
1038   areas         KJS::JSHTMLElement::MapAreas              DontDelete|ReadOnly
1039   name          KJS::JSHTMLElement::MapName               DontDelete
1040 @end
1041 @begin HTMLAreaElementTable 15
1042   accessKey     KJS::JSHTMLElement::AreaAccessKey         DontDelete
1043   alt           KJS::JSHTMLElement::AreaAlt               DontDelete
1044   coords        KJS::JSHTMLElement::AreaCoords            DontDelete
1045   href          KJS::JSHTMLElement::AreaHref              DontDelete
1046   hash          KJS::JSHTMLElement::AreaHash              DontDelete|ReadOnly
1047   host          KJS::JSHTMLElement::AreaHost              DontDelete|ReadOnly
1048   hostname      KJS::JSHTMLElement::AreaHostName          DontDelete|ReadOnly
1049   pathname      KJS::JSHTMLElement::AreaPathName          DontDelete|ReadOnly
1050   port          KJS::JSHTMLElement::AreaPort              DontDelete|ReadOnly
1051   protocol      KJS::JSHTMLElement::AreaProtocol          DontDelete|ReadOnly
1052   search        KJS::JSHTMLElement::AreaSearch            DontDelete|ReadOnly
1053   noHref        KJS::JSHTMLElement::AreaNoHref            DontDelete
1054   shape         KJS::JSHTMLElement::AreaShape             DontDelete
1055   tabIndex      KJS::JSHTMLElement::AreaTabIndex          DontDelete
1056   target        KJS::JSHTMLElement::AreaTarget            DontDelete
1057 @end
1058 @begin HTMLScriptElementTable 7
1059   text          KJS::JSHTMLElement::ScriptText            DontDelete
1060   htmlFor       KJS::JSHTMLElement::ScriptHtmlFor         DontDelete
1061   event         KJS::JSHTMLElement::ScriptEvent           DontDelete
1062   charset       KJS::JSHTMLElement::ScriptCharset         DontDelete
1063   defer         KJS::JSHTMLElement::ScriptDefer           DontDelete
1064   src           KJS::JSHTMLElement::ScriptSrc             DontDelete
1065   type          KJS::JSHTMLElement::ScriptType            DontDelete
1066 @end
1067 @begin HTMLTableElementTable 23
1068   caption       KJS::JSHTMLElement::TableCaption          DontDelete
1069   tHead         KJS::JSHTMLElement::TableTHead            DontDelete
1070   tFoot         KJS::JSHTMLElement::TableTFoot            DontDelete
1071   rows          KJS::JSHTMLElement::TableRows             DontDelete|ReadOnly
1072   tBodies       KJS::JSHTMLElement::TableTBodies          DontDelete|ReadOnly
1073   align         KJS::JSHTMLElement::TableAlign            DontDelete
1074   bgColor       KJS::JSHTMLElement::TableBgColor          DontDelete
1075   border        KJS::JSHTMLElement::TableBorder           DontDelete
1076   cellPadding   KJS::JSHTMLElement::TableCellPadding      DontDelete
1077   cellSpacing   KJS::JSHTMLElement::TableCellSpacing      DontDelete
1078   frame         KJS::JSHTMLElement::TableFrame            DontDelete
1079   rules         KJS::JSHTMLElement::TableRules            DontDelete
1080   summary       KJS::JSHTMLElement::TableSummary          DontDelete
1081   width         KJS::JSHTMLElement::TableWidth            DontDelete
1082   createTHead   KJS::JSHTMLElement::TableCreateTHead      DontDelete|Function 0
1083   deleteTHead   KJS::JSHTMLElement::TableDeleteTHead      DontDelete|Function 0
1084   createTFoot   KJS::JSHTMLElement::TableCreateTFoot      DontDelete|Function 0
1085   deleteTFoot   KJS::JSHTMLElement::TableDeleteTFoot      DontDelete|Function 0
1086   createCaption KJS::JSHTMLElement::TableCreateCaption    DontDelete|Function 0
1087   deleteCaption KJS::JSHTMLElement::TableDeleteCaption    DontDelete|Function 0
1088   insertRow     KJS::JSHTMLElement::TableInsertRow        DontDelete|Function 1
1089   deleteRow     KJS::JSHTMLElement::TableDeleteRow        DontDelete|Function 1
1090 @end
1091 @begin HTMLTableCaptionElementTable 1
1092   align         KJS::JSHTMLElement::TableCaptionAlign     DontDelete
1093 @end
1094 @begin HTMLTableColElementTable 7
1095   align         KJS::JSHTMLElement::TableColAlign         DontDelete
1096   ch            KJS::JSHTMLElement::TableColCh            DontDelete
1097   chOff         KJS::JSHTMLElement::TableColChOff         DontDelete
1098   span          KJS::JSHTMLElement::TableColSpan          DontDelete
1099   vAlign        KJS::JSHTMLElement::TableColVAlign        DontDelete
1100   width         KJS::JSHTMLElement::TableColWidth         DontDelete
1101 @end
1102 @begin HTMLTableSectionElementTable 7
1103   align         KJS::JSHTMLElement::TableSectionAlign             DontDelete
1104   ch            KJS::JSHTMLElement::TableSectionCh                DontDelete
1105   chOff         KJS::JSHTMLElement::TableSectionChOff             DontDelete
1106   vAlign        KJS::JSHTMLElement::TableSectionVAlign            DontDelete
1107   rows          KJS::JSHTMLElement::TableSectionRows              DontDelete|ReadOnly
1108   insertRow     KJS::JSHTMLElement::TableSectionInsertRow         DontDelete|Function 1
1109   deleteRow     KJS::JSHTMLElement::TableSectionDeleteRow         DontDelete|Function 1
1110 @end
1111 @begin HTMLTableRowElementTable 11
1112   rowIndex      KJS::JSHTMLElement::TableRowRowIndex              DontDelete|ReadOnly
1113   sectionRowIndex KJS::JSHTMLElement::TableRowSectionRowIndex     DontDelete|ReadOnly
1114   cells         KJS::JSHTMLElement::TableRowCells                 DontDelete|ReadOnly
1115   align         KJS::JSHTMLElement::TableRowAlign                 DontDelete
1116   bgColor       KJS::JSHTMLElement::TableRowBgColor               DontDelete
1117   ch            KJS::JSHTMLElement::TableRowCh                    DontDelete
1118   chOff         KJS::JSHTMLElement::TableRowChOff                 DontDelete
1119   vAlign        KJS::JSHTMLElement::TableRowVAlign                DontDelete
1120   insertCell    KJS::JSHTMLElement::TableRowInsertCell            DontDelete|Function 1
1121   deleteCell    KJS::JSHTMLElement::TableRowDeleteCell            DontDelete|Function 1
1122 @end
1123 @begin HTMLTableCellElementTable 15
1124   cellIndex     KJS::JSHTMLElement::TableCellCellIndex            DontDelete|ReadOnly
1125   abbr          KJS::JSHTMLElement::TableCellAbbr                 DontDelete
1126   align         KJS::JSHTMLElement::TableCellAlign                DontDelete
1127   axis          KJS::JSHTMLElement::TableCellAxis                 DontDelete
1128   bgColor       KJS::JSHTMLElement::TableCellBgColor              DontDelete
1129   ch            KJS::JSHTMLElement::TableCellCh                   DontDelete
1130   chOff         KJS::JSHTMLElement::TableCellChOff                DontDelete
1131   colSpan       KJS::JSHTMLElement::TableCellColSpan              DontDelete
1132   headers       KJS::JSHTMLElement::TableCellHeaders              DontDelete
1133   height        KJS::JSHTMLElement::TableCellHeight               DontDelete
1134   noWrap        KJS::JSHTMLElement::TableCellNoWrap               DontDelete
1135   rowSpan       KJS::JSHTMLElement::TableCellRowSpan              DontDelete
1136   scope         KJS::JSHTMLElement::TableCellScope                DontDelete
1137   vAlign        KJS::JSHTMLElement::TableCellVAlign               DontDelete
1138   width         KJS::JSHTMLElement::TableCellWidth                DontDelete
1139 @end
1140 @begin HTMLFrameSetElementTable 2
1141   cols          KJS::JSHTMLElement::FrameSetCols                  DontDelete
1142   rows          KJS::JSHTMLElement::FrameSetRows                  DontDelete
1143 @end
1144 @begin HTMLFrameElementTable 9
1145   contentDocument KJS::JSHTMLElement::FrameContentDocument        DontDelete|ReadOnly
1146   contentWindow   KJS::JSHTMLElement::FrameContentWindow          DontDelete|ReadOnly
1147   frameBorder     KJS::JSHTMLElement::FrameFrameBorder            DontDelete
1148   longDesc        KJS::JSHTMLElement::FrameLongDesc               DontDelete
1149   marginHeight    KJS::JSHTMLElement::FrameMarginHeight           DontDelete
1150   marginWidth     KJS::JSHTMLElement::FrameMarginWidth            DontDelete
1151   name            KJS::JSHTMLElement::FrameName                   DontDelete
1152   noResize        KJS::JSHTMLElement::FrameNoResize               DontDelete
1153   width           KJS::JSHTMLElement::FrameWidth                  DontDelete|ReadOnly
1154   height          KJS::JSHTMLElement::FrameHeight                 DontDelete|ReadOnly
1155   scrolling       KJS::JSHTMLElement::FrameScrolling              DontDelete
1156   src             KJS::JSHTMLElement::FrameSrc                    DontDelete
1157   location        KJS::JSHTMLElement::FrameLocation               DontDelete
1158 @end
1159 @begin HTMLIFrameElementTable 12
1160   align           KJS::JSHTMLElement::IFrameAlign                 DontDelete
1161   contentDocument KJS::JSHTMLElement::IFrameContentDocument       DontDelete|ReadOnly
1162   contentWindow   KJS::JSHTMLElement::IFrameContentWindow         DontDelete|ReadOnly
1163   document        KJS::JSHTMLElement::IFrameDocument              DontDelete|ReadOnly
1164   frameBorder     KJS::JSHTMLElement::IFrameFrameBorder           DontDelete
1165   height          KJS::JSHTMLElement::IFrameHeight                DontDelete
1166   longDesc        KJS::JSHTMLElement::IFrameLongDesc              DontDelete
1167   marginHeight    KJS::JSHTMLElement::IFrameMarginHeight          DontDelete
1168   marginWidth     KJS::JSHTMLElement::IFrameMarginWidth           DontDelete
1169   name            KJS::JSHTMLElement::IFrameName                  DontDelete
1170   scrolling       KJS::JSHTMLElement::IFrameScrolling             DontDelete
1171   src             KJS::JSHTMLElement::IFrameSrc                   DontDelete
1172   width           KJS::JSHTMLElement::IFrameWidth                 DontDelete
1173 @end
1174
1175 @begin HTMLMarqueeElementTable 2
1176   start           KJS::JSHTMLElement::MarqueeStart                DontDelete|Function 0
1177   stop            KJS::JSHTMLElement::MarqueeStop                 DontDelete|Function 0
1178 @end
1179 */
1180
1181 KJS_IMPLEMENT_PROTOFUNC(JSHTMLElementProtoFunc)
1182 KJS_IMPLEMENT_PROTOTYPE("HTMLElement", JSHTMLElementProto, JSHTMLElementProtoFunc)
1183
1184 JSValue* JSHTMLElementProtoFunc::callAsFunction(ExecState*, JSObject*, const List&)
1185 {
1186     return 0;
1187 }
1188
1189 JSHTMLElement::JSHTMLElement(ExecState *exec, HTMLElement *e)
1190     : JSElement(exec, e)
1191 {
1192 }
1193
1194 JSValue *JSHTMLElement::formIndexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
1195 {
1196     JSHTMLElement *thisObj = static_cast<JSHTMLElement *>(slot.slotBase());
1197     HTMLFormElement *form = static_cast<HTMLFormElement *>(thisObj->impl());
1198
1199     return toJS(exec, form->elements()->item(slot.index()));
1200 }
1201
1202 JSValue *JSHTMLElement::formNameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
1203 {
1204     JSHTMLElement *thisObj = static_cast<JSHTMLElement *>(slot.slotBase());
1205     HTMLFormElement *form = static_cast<HTMLFormElement *>(thisObj->impl());
1206     
1207     return JSHTMLCollection(exec, form->elements().get()).getNamedItems(exec, propertyName);
1208 }
1209
1210 JSValue *JSHTMLElement::selectIndexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
1211 {
1212     JSHTMLElement *thisObj = static_cast<JSHTMLElement *>(slot.slotBase());
1213     HTMLSelectElement *select = static_cast<HTMLSelectElement *>(thisObj->impl());
1214
1215     return toJS(exec, select->options()->item(slot.index()));
1216 }
1217
1218 JSValue *JSHTMLElement::framesetNameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
1219 {
1220     JSHTMLElement *thisObj = static_cast<JSHTMLElement *>(slot.slotBase());
1221     HTMLElement *element = static_cast<HTMLElement *>(thisObj->impl());
1222
1223     WebCore::Node *frame = element->children()->namedItem(propertyName);
1224     if (Document* doc = static_cast<HTMLFrameElement *>(frame)->contentDocument())
1225         if (Window *window = Window::retrieveWindow(doc->frame()))
1226             return window;
1227
1228     return jsUndefined();
1229 }
1230
1231 JSValue *JSHTMLElement::runtimeObjectGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
1232 {
1233     JSHTMLElement *thisObj = static_cast<JSHTMLElement *>(slot.slotBase());
1234     HTMLElement *element = static_cast<HTMLElement *>(thisObj->impl());
1235
1236     return getRuntimeObject(exec, element);
1237 }
1238
1239 JSValue *JSHTMLElement::runtimeObjectPropertyGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
1240 {
1241     JSHTMLElement *thisObj = static_cast<JSHTMLElement *>(slot.slotBase());
1242     HTMLElement *element = static_cast<HTMLElement *>(thisObj->impl());
1243
1244     if (JSValue *runtimeObject = getRuntimeObject(exec, element))
1245         return static_cast<JSObject *>(runtimeObject)->get(exec, propertyName);
1246     return jsUndefined();
1247 }
1248
1249 bool JSHTMLElement::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
1250 {
1251     HTMLElement &element = *static_cast<HTMLElement *>(impl());
1252
1253     // First look at dynamic properties
1254     if (element.hasLocalName(formTag)) {
1255         HTMLFormElement &form = static_cast<HTMLFormElement &>(element);
1256         // Check if we're retrieving an element (by index or by name)
1257         bool ok;
1258         unsigned u = propertyName.toUInt32(&ok);
1259         if (ok) {
1260             slot.setCustomIndex(this, u, formIndexGetter);
1261             return true;
1262         }
1263
1264         // FIXME: need faster way to check for a named item and/or a way to pass on the named items subcollection
1265         JSValue *namedItems = JSHTMLCollection(exec, form.elements().get()).getNamedItems(exec, propertyName);
1266         if (!namedItems->isUndefined()) {
1267             slot.setCustom(this, formNameGetter);
1268             return true;
1269         }
1270     } else if (element.hasLocalName(selectTag)) {
1271         bool ok;
1272         unsigned u = propertyName.toUInt32(&ok);
1273         if (ok) {
1274             // not specified by DOM(?) but supported in netscape/IE
1275             slot.setCustomIndex(this, u, selectIndexGetter);
1276             return true;
1277         }
1278     } else if (element.hasLocalName(framesetTag)) {
1279         WebCore::Node *frame = element.children()->namedItem(propertyName);
1280         if (frame && frame->hasTagName(frameTag)) {
1281             slot.setCustom(this, framesetNameGetter);
1282             return true;
1283         }
1284     } else if (element.hasLocalName(embedTag) || element.hasLocalName(objectTag) || element.hasLocalName(appletTag)) {
1285         if (propertyName == "__apple_runtime_object") {
1286             slot.setCustom(this, runtimeObjectGetter);
1287             return true;
1288         }
1289         JSValue *runtimeObject = getRuntimeObject(exec,&element);
1290         if (runtimeObject) {
1291             JSObject *imp = static_cast<JSObject *>(runtimeObject);
1292             if (imp->hasProperty(exec, propertyName)) {
1293                 slot.setCustom(this, runtimeObjectPropertyGetter);
1294                 return true;
1295             }
1296         }
1297     }
1298
1299     const HashTable* table = classInfo()->propHashTable; // get the right hashtable
1300     const HashEntry* entry = Lookup::findEntry(table, propertyName);
1301     if (entry) {
1302         // don't expose selection properties for input types that can't have a selection
1303         if (element.hasLocalName(inputTag) && !static_cast<HTMLInputElement *>(impl())->canHaveSelection()) {
1304             switch (entry->value) {
1305             case InputSetSelectionRange:
1306             case InputSelectionStart:
1307             case InputSelectionEnd:
1308                 break;
1309             default:
1310                 if (entry->attr & Function)
1311                     slot.setStaticEntry(this, entry, staticFunctionGetter<HTMLElementFunction>); 
1312                 else
1313                     slot.setStaticEntry(this, entry, staticValueGetter<JSHTMLElement>);
1314                 return true;
1315             }
1316         } else {
1317             if (entry->attr & Function)
1318                 slot.setStaticEntry(this, entry, staticFunctionGetter<HTMLElementFunction>); 
1319             else
1320                 slot.setStaticEntry(this, entry, staticValueGetter<JSHTMLElement>);
1321             return true;
1322         }
1323     }
1324
1325     // Base JSHTMLElement stuff or parent class forward, as usual
1326     return getStaticPropertySlot<HTMLElementFunction, JSHTMLElement, JSElement>(exec, &HTMLElementTable, this, propertyName, slot);
1327 }
1328
1329 bool JSHTMLElement::implementsCall() const
1330 {
1331     HTMLElement *element = static_cast<HTMLElement *>(impl());
1332     if (element->hasTagName(embedTag) || element->hasTagName(objectTag) || element->hasTagName(appletTag)) {
1333         Document* doc = element->document();
1334         KJSProxy *proxy = doc->frame()->jScript();
1335         ExecState *exec = proxy->interpreter()->globalExec();
1336         if (JSValue *runtimeObject = getRuntimeObject(exec, element))
1337             return static_cast<JSObject *>(runtimeObject)->implementsCall();
1338     }
1339     return false;
1340 }
1341
1342 JSValue *JSHTMLElement::callAsFunction(ExecState *exec, JSObject *thisObj, const List&args)
1343 {
1344     HTMLElement *element = static_cast<HTMLElement *>(impl());
1345     if (element->hasTagName(embedTag) || element->hasTagName(objectTag) || element->hasTagName(appletTag)) {
1346         if (JSValue *runtimeObject = getRuntimeObject(exec, element))
1347             return static_cast<JSObject *>(runtimeObject)->call(exec, thisObj, args);
1348     }
1349     return jsUndefined();
1350 }
1351
1352 JSValue *JSHTMLElement::htmlGetter(ExecState* exec, int token) const
1353 {
1354     HTMLHtmlElement& html = *static_cast<HTMLHtmlElement*>(impl());
1355     if (token == HtmlVersion)
1356         return jsString(html.version());
1357     return jsUndefined();
1358 }
1359
1360 JSValue *JSHTMLElement::headGetter(ExecState* exec, int token) const
1361 {
1362     HTMLHeadElement &head = *static_cast<HTMLHeadElement*>(impl());
1363     if (token == HeadProfile)
1364         return jsString(head.profile());
1365     return jsUndefined();
1366 }
1367
1368 JSValue *JSHTMLElement::linkGetter(ExecState* exec, int token) const
1369 {
1370     HTMLLinkElement &link = *static_cast<HTMLLinkElement*>(impl());
1371     switch (token) {
1372         case LinkDisabled:
1373             return jsBoolean(link.disabled());
1374         case LinkCharset:
1375             return jsString(link.charset());
1376         case LinkHref:
1377             return jsString(link.href());
1378         case LinkHrefLang:
1379             return jsString(link.hreflang());
1380         case LinkMedia:           
1381             return jsString(link.media());
1382         case LinkRel:             
1383             return jsString(link.rel());
1384         case LinkRev:            
1385             return jsString(link.rev());
1386         case LinkTarget:          
1387             return jsString(link.target());
1388         case LinkType:            
1389             return jsString(link.type());
1390         case LinkSheet:           
1391             return toJS(exec, link.sheet());
1392     }
1393     return jsUndefined();
1394 }
1395
1396 JSValue *JSHTMLElement::titleGetter(ExecState* exec, int token) const
1397 {
1398     HTMLTitleElement& title = *static_cast<HTMLTitleElement*>(impl());
1399     if (token == TitleText)
1400         return jsString(title.text());
1401     return jsUndefined();
1402 }
1403
1404 JSValue *JSHTMLElement::metaGetter(ExecState* exec, int token) const
1405 {
1406     HTMLMetaElement& meta = *static_cast<HTMLMetaElement*>(impl());
1407     switch (token) {
1408         case MetaContent:         return jsString(meta.content());
1409         case MetaHttpEquiv:       return jsString(meta.httpEquiv());
1410         case MetaName:            return jsString(meta.name());
1411         case MetaScheme:          return jsString(meta.scheme());
1412     }
1413     return jsUndefined();
1414 }
1415
1416 JSValue *JSHTMLElement::baseGetter(ExecState* exec, int token) const
1417 {
1418     HTMLBaseElement& base = *static_cast<HTMLBaseElement*>(impl());
1419     switch (token) {
1420         case BaseHref:            return jsString(base.href());
1421         case BaseTarget:          return jsString(base.target());
1422     }
1423     return jsUndefined();
1424 }
1425
1426 JSValue *JSHTMLElement::isIndexGetter(ExecState* exec, int token) const
1427 {
1428     HTMLIsIndexElement& isindex = *static_cast<HTMLIsIndexElement*>(impl());
1429     switch (token) {
1430         case IsIndexForm:            return toJS(exec, isindex.form()); // type HTMLFormElement
1431         case IsIndexPrompt:          return jsString(isindex.prompt());
1432     }
1433     return jsUndefined();
1434 }
1435
1436 JSValue *JSHTMLElement::styleGetter(ExecState* exec, int token) const
1437 {
1438     HTMLStyleElement& style = *static_cast<HTMLStyleElement*>(impl());
1439     switch (token) {
1440         case StyleDisabled:        return jsBoolean(style.disabled());
1441         case StyleMedia:           return jsString(style.media());
1442         case StyleType:            return jsString(style.type());
1443         case StyleSheet:           return toJS(exec, style.sheet());
1444     }
1445     return jsUndefined();
1446 }
1447
1448 JSValue *JSHTMLElement::bodyGetter(ExecState* exec, int token) const
1449 {
1450     HTMLBodyElement& body = *static_cast<HTMLBodyElement*>(impl());
1451     switch (token) {
1452         case BodyALink:           return jsString(body.aLink());
1453         case BodyBackground:      return jsString(body.background());
1454         case BodyBgColor:         return jsString(body.bgColor());
1455         case BodyLink:            return jsString(body.link());
1456         case BodyText:            return jsString(body.text());
1457         case BodyVLink:           return jsString(body.vLink());
1458         default: {
1459             // Update the document's layout before we compute these attributes.
1460             Document *doc = body.document();
1461             doc->updateLayoutIgnorePendingStylesheets();
1462             FrameView *view = doc->view();
1463             switch (token) {
1464                 case BodyScrollLeft:
1465                     return jsNumber(view ? view->contentsX() : 0);
1466                 case BodyScrollTop:
1467                     return jsNumber(view ? view->contentsY() : 0);
1468                 case BodyScrollHeight:
1469                     return jsNumber(view ? view->contentsHeight() : 0);
1470                 case BodyScrollWidth:
1471                     return jsNumber(view ? view->contentsWidth() : 0);
1472             }
1473         }
1474     }
1475     return jsUndefined();
1476 }
1477
1478 JSValue *JSHTMLElement::formGetter(ExecState* exec, int token) const
1479 {
1480     HTMLFormElement& form = *static_cast<HTMLFormElement*>(impl());
1481     switch (token) {
1482         case FormElements:        return getHTMLCollection(exec, form.elements().get());
1483         case FormLength:          return jsNumber(form.length());
1484         case FormName:            return jsString(form.name());
1485         case FormAcceptCharset:   return jsString(form.acceptCharset());
1486         case FormAction:          return jsString(form.action());
1487         case FormEncType:         return jsString(form.enctype());
1488         case FormMethod:          return jsString(form.method());
1489         case FormTarget:          return jsString(form.target());
1490     }
1491     return jsUndefined();
1492 }
1493
1494 JSValue *JSHTMLElement::selectGetter(ExecState* exec, int token) const
1495 {
1496     HTMLSelectElement& select = *static_cast<HTMLSelectElement*>(impl());
1497     switch (token) {
1498         case SelectType:            return jsString(select.type());
1499         case SelectSelectedIndex:   return jsNumber(select.selectedIndex());
1500         case SelectValue:           return jsString(select.value());
1501         case SelectLength:          return jsNumber(select.length());
1502         case SelectForm:            return toJS(exec, select.form()); // type HTMLFormElement
1503         case SelectOptions:         return getSelectHTMLCollection(exec, select.options().get(), &select); // type JSHTMLCollection
1504         case SelectDisabled:        return jsBoolean(select.disabled());
1505         case SelectMultiple:        return jsBoolean(select.multiple());
1506         case SelectName:            return jsString(select.name());
1507         case SelectSize:            return jsNumber(select.size());
1508         case SelectTabIndex:        return jsNumber(select.tabIndex());
1509     }
1510     return jsUndefined();
1511 }
1512
1513 JSValue *JSHTMLElement::optGroupGetter(ExecState* exec, int token) const
1514 {
1515     HTMLOptGroupElement& optgroup = *static_cast<HTMLOptGroupElement*>(impl());
1516     switch (token) {
1517         case OptGroupDisabled:        return jsBoolean(optgroup.disabled());
1518         case OptGroupLabel:           return jsString(optgroup.label());
1519     }
1520     return jsUndefined();
1521 }
1522
1523 JSValue *JSHTMLElement::optionGetter(ExecState* exec, int token) const
1524 {
1525     HTMLOptionElement& option = *static_cast<HTMLOptionElement*>(impl());
1526     switch (token) {
1527         case OptionForm:            return toJS(exec,option.form()); // type HTMLFormElement
1528         case OptionDefaultSelected: return jsBoolean(option.defaultSelected());
1529         case OptionText:            return jsString(option.text());
1530         case OptionIndex:           return jsNumber(option.index());
1531         case OptionDisabled:        return jsBoolean(option.disabled());
1532         case OptionLabel:           return jsString(option.label());
1533         case OptionSelected:        return jsBoolean(option.selected());
1534         case OptionValue:           return jsString(option.value());
1535     }
1536     return jsUndefined();
1537 }
1538
1539 static JSValue *getInputSelectionStart(HTMLInputElement &input)
1540 {
1541     if (input.canHaveSelection())
1542         return jsNumber(input.selectionStart());
1543     return jsUndefined();
1544 }
1545
1546 static JSValue *getInputSelectionEnd(HTMLInputElement &input)
1547 {
1548     if (input.canHaveSelection())
1549         return jsNumber(input.selectionEnd());
1550     return jsUndefined();
1551 }
1552
1553 JSValue *JSHTMLElement::inputGetter(ExecState* exec, int token) const
1554 {
1555     HTMLInputElement& input = *static_cast<HTMLInputElement*>(impl());
1556     switch (token) {
1557         case InputDefaultValue:    return jsString(input.defaultValue());
1558         case InputDefaultChecked:  return jsBoolean(input.defaultChecked());
1559         case InputForm:            return toJS(exec,input.form()); // type HTMLFormElement
1560         case InputAccept:          return jsString(input.accept());
1561         case InputAccessKey:       return jsString(input.accessKey());
1562         case InputAlign:           return jsString(input.align());
1563         case InputAlt:             return jsString(input.alt());
1564         case InputChecked:         return jsBoolean(input.checked());
1565         case InputDisabled:        return jsBoolean(input.disabled());
1566         case InputIndeterminate:   return jsBoolean(input.indeterminate());
1567         case InputMaxLength:       return jsNumber(input.maxLength());
1568         case InputName:            return jsString(input.name());
1569         case InputReadOnly:        return jsBoolean(input.readOnly());
1570         case InputSelectionStart:  return getInputSelectionStart(input);
1571         case InputSelectionEnd:    return getInputSelectionEnd(input);
1572         case InputSize:            return jsNumber(input.size());
1573         case InputSrc:             return jsString(input.src());
1574         case InputTabIndex:        return jsNumber(input.tabIndex());
1575         case InputType:            return jsString(input.type());
1576         case InputUseMap:          return jsString(input.useMap());
1577         case InputValue:           return jsString(input.value());
1578     }
1579     return jsUndefined();
1580 }
1581
1582 JSValue *JSHTMLElement::textAreaGetter(ExecState* exec, int token) const
1583 {
1584     HTMLTextAreaElement& textarea = *static_cast<HTMLTextAreaElement*>(impl());
1585     switch (token) {
1586         case TextAreaDefaultValue:    return jsString(textarea.defaultValue());
1587         case TextAreaForm:            return toJS(exec,textarea.form()); // type HTMLFormElement
1588         case TextAreaAccessKey:       return jsString(textarea.accessKey());
1589         case TextAreaCols:            return jsNumber(textarea.cols());
1590         case TextAreaDisabled:        return jsBoolean(textarea.disabled());
1591         case TextAreaName:            return jsString(textarea.name());
1592         case TextAreaReadOnly:        return jsBoolean(textarea.readOnly());
1593         case TextAreaRows:            return jsNumber(textarea.rows());
1594         case TextAreaSelectionStart:  return jsNumber(textarea.selectionStart());
1595         case TextAreaSelectionEnd:    return jsNumber(textarea.selectionEnd());
1596         case TextAreaTabIndex:        return jsNumber(textarea.tabIndex());
1597         case TextAreaType:            return jsString(textarea.type());
1598         case TextAreaValue:           return jsString(textarea.value());
1599     }
1600     return jsUndefined();
1601 }
1602
1603 JSValue *JSHTMLElement::buttonGetter(ExecState* exec, int token) const
1604 {
1605     HTMLButtonElement& button = *static_cast<HTMLButtonElement*>(impl());
1606     switch (token) {
1607         case ButtonForm:            return toJS(exec,button.form()); // type HTMLFormElement
1608         case ButtonAccessKey:       return jsString(button.accessKey());
1609         case ButtonDisabled:        return jsBoolean(button.disabled());
1610         case ButtonName:            return jsString(button.name());
1611         case ButtonTabIndex:        return jsNumber(button.tabIndex());
1612         case ButtonType:            return jsString(button.type());
1613         case ButtonValue:           return jsString(button.value());
1614     }
1615     return jsUndefined();
1616 }
1617
1618 JSValue *JSHTMLElement::labelGetter(ExecState* exec, int token) const
1619 {
1620     HTMLLabelElement& label = *static_cast<HTMLLabelElement*>(impl());
1621     switch (token) {
1622         case LabelForm:            return toJS(exec,label.form()); // type HTMLFormElement
1623         case LabelAccessKey:       return jsString(label.accessKey());
1624         case LabelHtmlFor:         return jsString(label.htmlFor());
1625     }
1626     return jsUndefined();
1627 }
1628
1629 JSValue *JSHTMLElement::fieldSetGetter(ExecState* exec, int token) const
1630 {
1631     HTMLFieldSetElement& fieldSet = *static_cast<HTMLFieldSetElement*>(impl());
1632     if (token == FieldSetForm)
1633         return toJS(exec,fieldSet.form()); // type HTMLFormElement
1634     return jsUndefined();
1635 }
1636
1637 JSValue *JSHTMLElement::legendGetter(ExecState* exec, int token) const
1638 {
1639     HTMLLegendElement& legend = *static_cast<HTMLLegendElement*>(impl());
1640     switch (token) {
1641         case LegendForm:            return toJS(exec,legend.form()); // type HTMLFormElement
1642         case LegendAccessKey:       return jsString(legend.accessKey());
1643         case LegendAlign:           return jsString(legend.align());
1644     }
1645     return jsUndefined();
1646 }
1647
1648 JSValue *JSHTMLElement::uListGetter(ExecState* exec, int token) const
1649 {
1650     HTMLUListElement& uList = *static_cast<HTMLUListElement*>(impl());
1651     switch (token) {
1652         case UListCompact:         return jsBoolean(uList.compact());
1653         case UListType:            return jsString(uList.type());
1654     }
1655     return jsUndefined();
1656 }
1657
1658 JSValue *JSHTMLElement::oListGetter(ExecState* exec, int token) const
1659 {
1660     HTMLOListElement& oList = *static_cast<HTMLOListElement*>(impl());
1661     switch (token) {
1662         case OListCompact:         return jsBoolean(oList.compact());
1663         case OListStart:           return jsNumber(oList.start());
1664         case OListType:            return jsString(oList.type());
1665     }
1666     return jsUndefined();
1667 }
1668
1669 JSValue *JSHTMLElement::dListGetter(ExecState* exec, int token) const
1670 {
1671     HTMLDListElement& dList = *static_cast<HTMLDListElement*>(impl());
1672     if (token == DListCompact)
1673         return jsBoolean(dList.compact());
1674     return jsUndefined();
1675 }
1676
1677 JSValue *JSHTMLElement::dirGetter(ExecState* exec, int token) const
1678 {
1679     HTMLDirectoryElement& dir = *static_cast<HTMLDirectoryElement*>(impl());
1680     if (token == DirectoryCompact)
1681         return jsBoolean(dir.compact());
1682     return jsUndefined();
1683 }
1684
1685 JSValue *JSHTMLElement::menuGetter(ExecState* exec, int token) const
1686 {
1687     HTMLMenuElement& menu = *static_cast<HTMLMenuElement*>(impl());
1688     if (token == MenuCompact)
1689         return jsBoolean(menu.compact());
1690     return jsUndefined();
1691 }
1692
1693 JSValue *JSHTMLElement::liGetter(ExecState* exec, int token) const
1694 {
1695     HTMLLIElement& li = *static_cast<HTMLLIElement*>(impl());
1696     switch (token) {
1697         case LIType:            return jsString(li.type());
1698         case LIValue:           return jsNumber(li.value());
1699     }
1700     return jsUndefined();
1701 }
1702
1703 JSValue *JSHTMLElement::divGetter(ExecState* exec, int token) const
1704 {
1705     HTMLDivElement& div = *static_cast<HTMLDivElement*>(impl());
1706     if (token == DivAlign)
1707         return jsString(div.align());
1708     return jsUndefined();
1709 }
1710
1711 JSValue *JSHTMLElement::paragraphGetter(ExecState* exec, int token) const
1712 {
1713     HTMLParagraphElement& p = *static_cast<HTMLParagraphElement*>(impl());
1714     if (token == ParagraphAlign)
1715         return jsString(p.align());
1716     return jsUndefined();
1717 }
1718
1719 JSValue *JSHTMLElement::headingGetter(ExecState* exec, int token) const
1720 {
1721     HTMLHeadingElement& h = *static_cast<HTMLHeadingElement*>(impl());
1722     if (token == HeadingAlign)
1723         return jsString(h.align());
1724     return jsUndefined();
1725 }
1726
1727 JSValue *JSHTMLElement::blockQuoteGetter(ExecState* exec, int token) const
1728 {
1729     HTMLBlockquoteElement& blockQuote = *static_cast<HTMLBlockquoteElement*>(impl());
1730     if (token == BlockQuoteCite)
1731         return jsString(blockQuote.cite());
1732     return jsUndefined();
1733 }
1734
1735 JSValue *JSHTMLElement::quoteGetter(ExecState* exec, int token) const
1736 {
1737     HTMLQuoteElement& quote = *static_cast<HTMLQuoteElement*>(impl());
1738     if (token == QuoteCite)
1739         return jsString(quote.cite());
1740     return jsUndefined();
1741 }
1742
1743 JSValue *JSHTMLElement::preGetter(ExecState* exec, int token) const
1744 {
1745     // FIXME: Add support for 'wrap' when white-space: pre-wrap is implemented.
1746     HTMLPreElement& pre = *static_cast<HTMLPreElement*>(impl());
1747     if (token == PreWidth)
1748         return jsNumber(pre.width());
1749     if (token == PreWrap)
1750         return jsBoolean(pre.wrap());
1751     return jsUndefined();
1752 }
1753
1754 JSValue *JSHTMLElement::brGetter(ExecState* exec, int token) const
1755 {
1756     HTMLBRElement& br = *static_cast<HTMLBRElement*>(impl());
1757     if (token == BRClear)
1758         return jsString(br.clear());
1759     return jsUndefined();
1760 }
1761
1762 JSValue *JSHTMLElement::baseFontGetter(ExecState* exec, int token) const
1763 {
1764     HTMLBaseFontElement& baseFont = *static_cast<HTMLBaseFontElement*>(impl());
1765     switch (token) {
1766         case BaseFontColor:           return jsString(baseFont.color());
1767         case BaseFontFace:            return jsString(baseFont.face());
1768         case BaseFontSize:            return jsString(baseFont.size());
1769     }
1770     return jsUndefined();
1771 }
1772
1773 JSValue *JSHTMLElement::fontGetter(ExecState* exec, int token) const
1774 {
1775     HTMLFontElement& font = *static_cast<HTMLFontElement*>(impl());
1776     switch (token) {
1777         case FontColor:           return jsString(font.color());
1778         case FontFace:            return jsString(font.face());
1779         case FontSize:            return jsString(font.size());
1780     }
1781     return jsUndefined();
1782 }
1783
1784 JSValue *JSHTMLElement::hrGetter(ExecState* exec, int token) const
1785 {
1786     HTMLHRElement& hr = *static_cast<HTMLHRElement*>(impl());
1787     switch (token) {
1788         case HRAlign:           return jsString(hr.align());
1789         case HRNoShade:         return jsBoolean(hr.noShade());
1790         case HRSize:            return jsString(hr.size());
1791         case HRWidth:           return jsString(hr.width());
1792     }
1793     return jsUndefined();
1794 }
1795
1796 JSValue *JSHTMLElement::modGetter(ExecState* exec, int token) const
1797 {
1798     HTMLModElement& mod = *static_cast<HTMLModElement*>(impl());
1799     switch (token) {
1800         case ModCite:            return jsString(mod.cite());
1801         case ModDateTime:        return jsString(mod.dateTime());
1802     }
1803     return jsUndefined();
1804 }
1805
1806 JSValue *JSHTMLElement::anchorGetter(ExecState* exec, int token) const
1807 {
1808     HTMLAnchorElement& anchor = *static_cast<HTMLAnchorElement*>(impl());
1809     switch (token) {
1810         case AnchorAccessKey:       return jsString(anchor.accessKey());
1811         case AnchorCharset:         return jsString(anchor.charset());
1812         case AnchorCoords:          return jsString(anchor.coords());
1813         case AnchorHref:            return jsString(anchor.href());
1814         case AnchorHrefLang:        return jsString(anchor.hreflang());
1815         case AnchorHash:            return jsString('#'+KURL(anchor.href().deprecatedString()).ref());
1816         case AnchorHost:            return jsString(KURL(anchor.href().deprecatedString()).host());
1817         case AnchorHostname: {
1818             KURL url(anchor.href().deprecatedString());
1819             if (url.port()==0)
1820                 return jsString(url.host());
1821             else
1822                 return jsString(url.host() + ":" + DeprecatedString::number(url.port()));
1823         }
1824         case AnchorPathName:        return jsString(KURL(anchor.href().deprecatedString()).path());
1825         case AnchorPort:            return jsString(DeprecatedString::number(KURL(anchor.href().deprecatedString()).port()));
1826         case AnchorProtocol:        return jsString(KURL(anchor.href().deprecatedString()).protocol()+":");
1827         case AnchorSearch:          return jsString(KURL(anchor.href().deprecatedString()).query());
1828         case AnchorName:            return jsString(anchor.name());
1829         case AnchorRel:             return jsString(anchor.rel());
1830         case AnchorRev:             return jsString(anchor.rev());
1831         case AnchorShape:           return jsString(anchor.shape());
1832         case AnchorTabIndex:        return jsNumber(anchor.tabIndex());
1833         case AnchorTarget:          return jsString(anchor.target());
1834         case AnchorType:            return jsString(anchor.type());
1835         case AnchorText:
1836             anchor.document()->updateLayoutIgnorePendingStylesheets();
1837             return jsString(anchor.innerText());
1838     }
1839     return jsUndefined();
1840 }
1841
1842 JSValue *JSHTMLElement::imageGetter(ExecState* exec, int token) const
1843 {
1844     HTMLImageElement& image = *static_cast<HTMLImageElement*>(impl());
1845     switch (token) {
1846         case ImageName:            return jsString(image.name());
1847         case ImageAlign:           return jsString(image.align());
1848         case ImageAlt:             return jsString(image.alt());
1849         case ImageBorder:          return jsNumber(image.border());
1850         case ImageComplete:        return jsBoolean(image.complete());
1851         case ImageHeight:          return jsNumber(image.height(true));
1852         case ImageHspace:          return jsNumber(image.hspace());
1853         case ImageIsMap:           return jsBoolean(image.isMap());
1854         case ImageLongDesc:        return jsString(image.longDesc());
1855         case ImageSrc:             return jsString(image.src());
1856         case ImageUseMap:          return jsString(image.useMap());
1857         case ImageVspace:          return jsNumber(image.vspace());
1858         case ImageWidth:           return jsNumber(image.width(true));
1859         case ImageX:               return jsNumber(image.x());
1860         case ImageY:               return jsNumber(image.y());
1861     }
1862     return jsUndefined();
1863 }
1864
1865 JSValue *JSHTMLElement::objectGetter(ExecState* exec, int token) const
1866 {
1867     HTMLObjectElement& object = *static_cast<HTMLObjectElement*>(impl());
1868     switch (token) {
1869         case ObjectForm:            return toJS(exec,object.form()); // type HTMLFormElement
1870         case ObjectCode:            return jsString(object.code());
1871         case ObjectAlign:           return jsString(object.align());
1872         case ObjectArchive:         return jsString(object.archive());
1873         case ObjectBorder:          return jsString(object.border());
1874         case ObjectCodeBase:        return jsString(object.codeBase());
1875         case ObjectCodeType:        return jsString(object.codeType());
1876         case ObjectContentDocument: return checkNodeSecurity(exec,object.contentDocument()) ? 
1877                                            toJS(exec, object.contentDocument()) : jsUndefined();
1878         case ObjectData:            return jsString(object.data());
1879         case ObjectDeclare:         return jsBoolean(object.declare());
1880         case ObjectHeight:          return jsString(object.height());
1881         case ObjectHspace:          return jsString(object.hspace());
1882         case ObjectName:            return jsString(object.name());
1883         case ObjectStandby:         return jsString(object.standby());
1884         case ObjectTabIndex:        return jsNumber(object.tabIndex());
1885         case ObjectType:            return jsString(object.type());
1886         case ObjectUseMap:          return jsString(object.useMap());
1887         case ObjectVspace:          return jsString(object.vspace());
1888         case ObjectWidth:           return jsString(object.width());
1889     }
1890     return jsUndefined();
1891 }
1892
1893 JSValue *JSHTMLElement::paramGetter(ExecState* exec, int token) const
1894 {
1895     HTMLParamElement& param = *static_cast<HTMLParamElement*>(impl());
1896     switch (token) {
1897         case ParamName:            return jsString(param.name());
1898         case ParamType:            return jsString(param.type());
1899         case ParamValue:           return jsString(param.value());
1900         case ParamValueType:       return jsString(param.valueType());
1901     }
1902     return jsUndefined();
1903 }
1904
1905 JSValue *JSHTMLElement::appletGetter(ExecState* exec, int token) const
1906 {
1907     HTMLAppletElement& applet = *static_cast<HTMLAppletElement*>(impl());
1908     switch (token) {
1909         case AppletAlign:           return jsString(applet.align());
1910         case AppletAlt:             return jsString(applet.alt());
1911         case AppletArchive:         return jsString(applet.archive());
1912         case AppletCode:            return jsString(applet.code());
1913         case AppletCodeBase:        return jsString(applet.codeBase());
1914         case AppletHeight:          return jsString(applet.height());
1915         case AppletHspace:          return jsString(applet.hspace());
1916         case AppletName:            return jsString(applet.name());
1917         case AppletObject:          return jsString(applet.object());
1918         case AppletVspace:          return jsString(applet.vspace());
1919         case AppletWidth:           return jsString(applet.width());
1920     }
1921     return jsUndefined();
1922 }
1923
1924 JSValue *JSHTMLElement::embedGetter(ExecState* exec, int token) const
1925 {
1926     HTMLEmbedElement& embed = *static_cast<HTMLEmbedElement*>(impl());
1927     switch (token) {
1928         case EmbedAlign:           return jsString(embed.align());
1929         case EmbedHeight:          return jsString(embed.height());
1930         case EmbedName:            return jsString(embed.name());
1931         case EmbedSrc:             return jsString(embed.src());
1932         case EmbedType:            return jsString(embed.type());
1933         case EmbedWidth:           return jsString(embed.width());
1934     }
1935     return jsUndefined();
1936 }
1937
1938 JSValue *JSHTMLElement::mapGetter(ExecState* exec, int token) const
1939 {
1940     HTMLMapElement& map = *static_cast<HTMLMapElement*>(impl());
1941     switch (token) {
1942         case MapAreas:           return getHTMLCollection(exec, map.areas().get()); // type JSHTMLCollection
1943         case MapName:            return jsString(map.name());
1944     }
1945     return jsUndefined();
1946 }
1947
1948 JSValue *JSHTMLElement::areaGetter(ExecState* exec, int token) const
1949 {
1950     HTMLAreaElement& area = *static_cast<HTMLAreaElement*>(impl());
1951     switch (token) {
1952         case AreaAccessKey:       return jsString(area.accessKey());
1953         case AreaAlt:             return jsString(area.alt());
1954         case AreaCoords:          return jsString(area.coords());
1955         case AreaHref:            return jsString(area.href());
1956         case AreaHash:            return jsString('#'+KURL(area.href().deprecatedString()).ref());
1957         case AreaHost:            return jsString(KURL(area.href().deprecatedString()).host());
1958         case AreaHostName: {
1959             KURL url(area.href().deprecatedString());
1960             if (url.port()==0)
1961                 return jsString(url.host());
1962             else
1963                 return jsString(url.host() + ":" + DeprecatedString::number(url.port()));
1964         }
1965         case AreaPathName:        return jsString(KURL(area.href().deprecatedString()).path());
1966         case AreaPort:            return jsString(DeprecatedString::number(KURL(area.href().deprecatedString()).port()));
1967         case AreaProtocol:        return jsString(KURL(area.href().deprecatedString()).protocol()+":");
1968         case AreaSearch:          return jsString(KURL(area.href().deprecatedString()).query());
1969         case AreaNoHref:          return jsBoolean(area.noHref());
1970         case AreaShape:           return jsString(area.shape());
1971         case AreaTabIndex:        return jsNumber(area.tabIndex());
1972         case AreaTarget:          return jsString(area.target());
1973     }
1974     return jsUndefined();
1975 }
1976
1977 JSValue *JSHTMLElement::scriptGetter(ExecState* exec, int token) const
1978 {
1979     HTMLScriptElement& script = *static_cast<HTMLScriptElement*>(impl());
1980     switch (token) {
1981         case ScriptText:            return jsString(script.text());
1982         case ScriptHtmlFor:         return jsString(script.htmlFor());
1983         case ScriptEvent:           return jsString(script.event());
1984         case ScriptCharset:         return jsString(script.charset());
1985         case ScriptDefer:           return jsBoolean(script.defer());
1986         case ScriptSrc:             return jsString(script.src());
1987         case ScriptType:            return jsString(script.type());
1988     }
1989     return jsUndefined();
1990 }
1991
1992 JSValue *JSHTMLElement::tableGetter(ExecState* exec, int token) const
1993 {
1994     HTMLTableElement& table = *static_cast<HTMLTableElement*>(impl());
1995     switch (token) {
1996         case TableCaption:         return toJS(exec,table.caption()); // type HTMLTableCaptionElement
1997         case TableTHead:           return toJS(exec,table.tHead()); // type HTMLTableSectionElement
1998         case TableTFoot:           return toJS(exec,table.tFoot()); // type HTMLTableSectionElement
1999         case TableRows:            return getHTMLCollection(exec, table.rows().get()); // type JSHTMLCollection
2000         case TableTBodies:         return getHTMLCollection(exec, table.tBodies().get()); // type JSHTMLCollection
2001         case TableAlign:           return jsString(table.align());
2002         case TableBgColor:         return jsString(table.bgColor());
2003         case TableBorder:          return jsString(table.border());
2004         case TableCellPadding:     return jsString(table.cellPadding());
2005         case TableCellSpacing:     return jsString(table.cellSpacing());
2006         case TableFrame:           return jsString(table.frame());
2007         case TableRules:           return jsString(table.rules());
2008         case TableSummary:         return jsString(table.summary());
2009         case TableWidth:           return jsString(table.width());
2010     }
2011     return jsUndefined();
2012 }
2013
2014 JSValue *JSHTMLElement::tableCaptionGetter(ExecState* exec, int token) const
2015 {
2016     HTMLTableCaptionElement& tableCaption = *static_cast<HTMLTableCaptionElement*>(impl());
2017     if (token == TableCaptionAlign)
2018         return jsString(tableCaption.align());
2019     return jsUndefined();
2020 }
2021
2022 JSValue *JSHTMLElement::tableColGetter(ExecState* exec, int token) const
2023 {
2024     HTMLTableColElement& tableCol = *static_cast<HTMLTableColElement*>(impl());
2025     switch (token) {
2026         case TableColAlign:           return jsString(tableCol.align());
2027         case TableColCh:              return jsString(tableCol.ch());
2028         case TableColChOff:           return jsString(tableCol.chOff());
2029         case TableColSpan:            return jsNumber(tableCol.span());
2030         case TableColVAlign:          return jsString(tableCol.vAlign());
2031         case TableColWidth:           return jsString(tableCol.width());
2032     }
2033     return jsUndefined();
2034 }
2035
2036 JSValue *JSHTMLElement::tableSectionGetter(ExecState* exec, int token) const
2037 {
2038     HTMLTableSectionElement& tableSection = *static_cast<HTMLTableSectionElement*>(impl());
2039     switch (token) {
2040         case TableSectionAlign:           return jsString(tableSection.align());
2041         case TableSectionCh:              return jsString(tableSection.ch());
2042         case TableSectionChOff:           return jsString(tableSection.chOff());
2043         case TableSectionVAlign:          return jsString(tableSection.vAlign());
2044         case TableSectionRows:            return getHTMLCollection(exec, tableSection.rows().get()); // type JSHTMLCollection
2045     }
2046     return jsUndefined();
2047 }
2048
2049 JSValue *JSHTMLElement::tableRowGetter(ExecState* exec, int token) const
2050 {
2051     HTMLTableRowElement& tableRow = *static_cast<HTMLTableRowElement*>(impl());
2052     switch (token) {
2053         case TableRowRowIndex:        return jsNumber(tableRow.rowIndex());
2054         case TableRowSectionRowIndex: return jsNumber(tableRow.sectionRowIndex());
2055         case TableRowCells:           return getHTMLCollection(exec, tableRow.cells().get()); // type JSHTMLCollection
2056         case TableRowAlign:           return jsString(tableRow.align());
2057         case TableRowBgColor:         return jsString(tableRow.bgColor());
2058         case TableRowCh:              return jsString(tableRow.ch());
2059         case TableRowChOff:           return jsString(tableRow.chOff());
2060         case TableRowVAlign:          return jsString(tableRow.vAlign());
2061     }
2062     return jsUndefined();
2063 }
2064
2065 JSValue *JSHTMLElement::tableCellGetter(ExecState* exec, int token) const
2066 {
2067     HTMLTableCellElement& tableCell = *static_cast<HTMLTableCellElement*>(impl());
2068     switch (token) {
2069         case TableCellCellIndex:       return jsNumber(tableCell.cellIndex());
2070         case TableCellAbbr:            return jsString(tableCell.abbr());
2071         case TableCellAlign:           return jsString(tableCell.align());
2072         case TableCellAxis:            return jsString(tableCell.axis());
2073         case TableCellBgColor:         return jsString(tableCell.bgColor());
2074         case TableCellCh:              return jsString(tableCell.ch());
2075         case TableCellChOff:           return jsString(tableCell.chOff());
2076         case TableCellColSpan:         return jsNumber(tableCell.colSpan());
2077         case TableCellHeaders:         return jsString(tableCell.headers());
2078         case TableCellHeight:          return jsString(tableCell.height());
2079         case TableCellNoWrap:          return jsBoolean(tableCell.noWrap());
2080         case TableCellRowSpan:         return jsNumber(tableCell.rowSpan());
2081         case TableCellScope:           return jsString(tableCell.scope());
2082         case TableCellVAlign:          return jsString(tableCell.vAlign());
2083         case TableCellWidth:           return jsString(tableCell.width());
2084     }
2085     return jsUndefined();
2086 }
2087
2088 JSValue *JSHTMLElement::frameSetGetter(ExecState* exec, int token) const
2089 {
2090     HTMLFrameSetElement& frameSet = *static_cast<HTMLFrameSetElement*>(impl());
2091     switch (token) {
2092         case FrameSetCols:            return jsString(frameSet.cols());
2093         case FrameSetRows:            return jsString(frameSet.rows());
2094     }
2095     return jsUndefined();
2096 }
2097
2098 JSValue *JSHTMLElement::frameGetter(ExecState* exec, int token) const
2099 {
2100     HTMLFrameElement& frameElement = *static_cast<HTMLFrameElement*>(impl());
2101     switch (token) {
2102         case FrameContentDocument: return checkNodeSecurity(exec,frameElement.contentDocument()) ? 
2103                                           toJS(exec, frameElement.contentDocument()) : jsUndefined();
2104         case FrameContentWindow:   return checkNodeSecurity(exec,frameElement.contentDocument())
2105                                         ? Window::retrieve(frameElement.contentFrame())
2106                                         : jsUndefined();
2107         case FrameFrameBorder:     return jsString(frameElement.frameBorder());
2108         case FrameLongDesc:        return jsString(frameElement.longDesc());
2109         case FrameMarginHeight:    return jsString(frameElement.marginHeight());
2110         case FrameMarginWidth:     return jsString(frameElement.marginWidth());
2111         case FrameName:            return jsString(frameElement.name());
2112         case FrameNoResize:        return jsBoolean(frameElement.noResize());
2113         case FrameWidth:           return jsNumber(frameElement.frameWidth());
2114         case FrameHeight:          return jsNumber(frameElement.frameHeight());
2115         case FrameScrolling:       return jsString(frameElement.scrolling());
2116         case FrameSrc:
2117         case FrameLocation:        return jsString(frameElement.src());
2118     }
2119     return jsUndefined();
2120 }
2121
2122 JSValue *JSHTMLElement::iFrameGetter(ExecState* exec, int token) const
2123 {
2124     HTMLIFrameElement& iFrame = *static_cast<HTMLIFrameElement*>(impl());
2125     switch (token) {
2126         case IFrameAlign:                return jsString(iFrame.align());
2127           // ### security check ?
2128         case IFrameDocument: // non-standard, mapped to contentDocument
2129         case IFrameContentDocument: return checkNodeSecurity(exec,iFrame.contentDocument()) ? 
2130                                       toJS(exec, iFrame.contentDocument()) : jsUndefined();
2131         case IFrameContentWindow:   return checkNodeSecurity(exec,iFrame.contentDocument()) 
2132                                         ? Window::retrieve(iFrame.contentFrame())
2133                                         : jsUndefined();
2134         case IFrameFrameBorder:     return jsString(iFrame.frameBorder());
2135         case IFrameHeight:          return jsString(iFrame.height());
2136         case IFrameLongDesc:        return jsString(iFrame.longDesc());
2137         case IFrameMarginHeight:    return jsString(iFrame.marginHeight());
2138         case IFrameMarginWidth:     return jsString(iFrame.marginWidth());
2139         case IFrameName:            return jsString(iFrame.name());
2140         case IFrameScrolling:       return jsString(iFrame.scrolling());
2141         case IFrameSrc:             return jsString(iFrame.src());
2142         case IFrameWidth:           return jsString(iFrame.width());
2143     }
2144     return jsUndefined();
2145 }
2146
2147 JSValue *JSHTMLElement::marqueeGetter(ExecState* exec, int token) const
2148 {
2149     // FIXME: Find out what WinIE exposes as properties and implement this.
2150     return jsUndefined();
2151 }
2152
2153 JSValue *JSHTMLElement::getValueProperty(ExecState *exec, int token) const
2154 {
2155     // Check our set of generic properties first.
2156     HTMLElement &element = *static_cast<HTMLElement *>(impl());
2157     switch (token) {
2158         case ElementId:
2159             // iht.com relies on this value being "" when no id is present. Other browsers do this as well.
2160             // So we use jsString() instead of jsStringOrNull() here.
2161             return jsString(element.id());
2162         case ElementTitle:
2163             return jsString(element.title());
2164         case ElementLang:
2165             return jsString(element.lang());
2166         case ElementDir:
2167             return jsString(element.dir());
2168         case ElementClassName:
2169             return jsString(element.className());
2170         case ElementInnerHTML:
2171             return jsString(element.innerHTML());
2172         case ElementInnerText:
2173             impl()->document()->updateLayoutIgnorePendingStylesheets();
2174             return jsString(element.innerText());
2175         case ElementOuterHTML:
2176             return jsString(element.outerHTML());
2177         case ElementOuterText:
2178             return jsString(element.outerText());
2179         case ElementDocument:
2180             return toJS(exec,element.ownerDocument());
2181         case ElementChildren:
2182             return getHTMLCollection(exec, element.children().get());
2183         case ElementContentEditable:
2184             return jsString(element.contentEditable());
2185         case ElementIsContentEditable:
2186             return jsBoolean(element.isContentEditable());
2187     }
2188
2189     // Now check the properties specific to our element type.
2190     const Accessors* access = accessors();
2191     if (access && access->m_getter)
2192         return (this->*(access->m_getter))(exec, token);
2193     return jsUndefined();
2194 }
2195
2196 UString JSHTMLElement::toString(ExecState *exec) const
2197 {
2198     if (impl()->hasTagName(aTag))
2199         return UString(static_cast<const HTMLAnchorElement *>(impl())->href());
2200     else
2201         return JSElement::toString(exec);
2202 }
2203
2204 static HTMLFormElement *getForm(HTMLElement *element)
2205 {
2206     if (element->isGenericFormElement())
2207         return static_cast<HTMLGenericFormElement *>(element)->form();
2208     if (element->hasTagName(labelTag))
2209         return static_cast<HTMLLabelElement *>(element)->form();
2210     if (element->hasTagName(objectTag))
2211         return static_cast<HTMLObjectElement *>(element)->form();
2212
2213     return 0;
2214 }
2215
2216 void JSHTMLElement::pushEventHandlerScope(ExecState *exec, ScopeChain &scope) const
2217 {
2218   HTMLElement *element = static_cast<HTMLElement *>(impl());
2219
2220   // The document is put on first, fall back to searching it only after the element and form.
2221   scope.push(static_cast<JSObject *>(toJS(exec, element->ownerDocument())));
2222
2223   // The form is next, searched before the document, but after the element itself.
2224   
2225   // First try to obtain the form from the element itself.  We do this to deal with
2226   // the malformed case where <form>s aren't in our parent chain (e.g., when they were inside 
2227   // <table> or <tbody>.
2228   HTMLFormElement *form = getForm(element);
2229   if (form)
2230     scope.push(static_cast<JSObject *>(toJS(exec, form)));
2231   else {
2232     WebCore::Node* form = element->parentNode();
2233     while (form && !form->hasTagName(formTag))
2234       form = form->parentNode();
2235     
2236     if (form)
2237       scope.push(static_cast<JSObject *>(toJS(exec, form)));
2238   }
2239   
2240   // The element is on top, searched first.
2241   scope.push(static_cast<JSObject *>(toJS(exec, element)));
2242 }
2243
2244 HTMLElementFunction::HTMLElementFunction(ExecState *exec, int i, int len, const Identifier& name)
2245   : InternalFunctionImp(static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype()), name)
2246   , id(i)
2247 {
2248   put(exec,lengthPropertyName,jsNumber(len),DontDelete|ReadOnly|DontEnum);
2249 }
2250
2251 JSValue *HTMLElementFunction::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
2252 {
2253     if (!thisObj->inherits(&JSHTMLElement::info))
2254         return throwError(exec, TypeError);
2255     DOMExceptionTranslator exception(exec);
2256     HTMLElement &element = *static_cast<HTMLElement *>(static_cast<JSHTMLElement *>(thisObj)->impl());
2257
2258     if (element.hasLocalName(formTag)) {
2259         HTMLFormElement &form = static_cast<HTMLFormElement &>(element);
2260         if (id == JSHTMLElement::FormSubmit) {
2261             form.submit();
2262             return jsUndefined();
2263         }
2264         else if (id == JSHTMLElement::FormReset) {
2265             form.reset();
2266             return jsUndefined();
2267         }
2268     }
2269     else if (element.hasLocalName(selectTag)) {
2270         HTMLSelectElement &select = static_cast<HTMLSelectElement &>(element);
2271         if (id == JSHTMLElement::SelectAdd) {
2272             select.add(toHTMLElement(args[0]), toHTMLElement(args[1]), exception);
2273             return jsUndefined();
2274         }
2275         else if (id == JSHTMLElement::SelectRemove) {
2276             select.remove(int(args[0]->toNumber(exec)));
2277             return jsUndefined();
2278         }
2279         else if (id == JSHTMLElement::SelectBlur) {
2280             select.blur();
2281             return jsUndefined();
2282         }
2283         else if (id == JSHTMLElement::SelectFocus) {
2284             select.focus();
2285             return jsUndefined();
2286         }
2287     }
2288     else if (element.hasLocalName(inputTag)) {
2289         HTMLInputElement &input = static_cast<HTMLInputElement &>(element);
2290         if (id == JSHTMLElement::InputBlur) {
2291             input.blur();
2292             return jsUndefined();
2293         }
2294         else if (id == JSHTMLElement::InputFocus) {
2295             input.focus();
2296             return jsUndefined();
2297         }
2298         else if (id == JSHTMLElement::InputSelect) {
2299             input.select();
2300             return jsUndefined();
2301         }
2302         else if (id == JSHTMLElement::InputClick) {
2303             input.click();
2304             return jsUndefined();
2305         }
2306         else if (id == JSHTMLElement::InputSetSelectionRange) {
2307             input.setSelectionRange(args[0]->toInt32(exec), args[1]->toInt32(exec));
2308             return jsUndefined();
2309         }
2310     }
2311     else if (element.hasLocalName(buttonTag)) {
2312         HTMLButtonElement &button = static_cast<HTMLButtonElement &>(element);
2313         if (id == JSHTMLElement::ButtonBlur) {
2314             button.blur();
2315             return jsUndefined();
2316         }
2317         else if (id == JSHTMLElement::ButtonFocus) {
2318             button.focus();
2319             return jsUndefined();
2320         }
2321     }
2322     else if (element.hasLocalName(labelTag)) {
2323         HTMLLabelElement &label = static_cast<HTMLLabelElement &>(element);
2324         if (id == JSHTMLElement::LabelFocus) {
2325             label.focus();
2326             return jsUndefined();
2327         }
2328     }
2329     else if (element.hasLocalName(legendTag)) {
2330         HTMLLegendElement &legend = static_cast<HTMLLegendElement &>(element);
2331         if (id == JSHTMLElement::LegendFocus) {
2332             legend.focus();
2333             return jsUndefined();
2334         }
2335     }
2336     else if (element.hasLocalName(textareaTag)) {
2337         HTMLTextAreaElement &textarea = static_cast<HTMLTextAreaElement &>(element);
2338         if (id == JSHTMLElement::TextAreaBlur) {
2339             textarea.blur();
2340             return jsUndefined();
2341         }
2342         else if (id == JSHTMLElement::TextAreaFocus) {
2343             textarea.focus();
2344             return jsUndefined();
2345         }
2346         else if (id == JSHTMLElement::TextAreaSelect) {
2347             textarea.select();
2348             return jsUndefined();
2349         }
2350         else if (id == JSHTMLElement::TextAreaSetSelectionRange) {
2351             textarea.setSelectionRange(args[0]->toInt32(exec), args[1]->toInt32(exec));
2352             return jsUndefined();
2353         }
2354     }
2355     else if (element.hasLocalName(aTag)) {
2356         HTMLAnchorElement &anchor = static_cast<HTMLAnchorElement &>(element);
2357         if (id == JSHTMLElement::AnchorBlur) {
2358             anchor.blur();
2359             return jsUndefined();
2360         }
2361         else if (id == JSHTMLElement::AnchorFocus) {
2362             anchor.focus();
2363             return jsUndefined();
2364         }
2365         else if (id == JSHTMLElement::AnchorToString)
2366             return jsString(thisObj->toString(exec));
2367     }
2368     else if (element.hasLocalName(tableTag)) {
2369         HTMLTableElement &table = static_cast<HTMLTableElement &>(element);
2370         if (id == JSHTMLElement::TableCreateTHead)
2371             return toJS(exec,table.createTHead());
2372         else if (id == JSHTMLElement::TableDeleteTHead) {
2373             table.deleteTHead();
2374             return jsUndefined();
2375         }
2376         else if (id == JSHTMLElement::TableCreateTFoot)
2377             return toJS(exec,table.createTFoot());
2378         else if (id == JSHTMLElement::TableDeleteTFoot) {
2379             table.deleteTFoot();
2380             return jsUndefined();
2381         }
2382         else if (id == JSHTMLElement::TableCreateCaption)
2383             return toJS(exec,table.createCaption());
2384         else if (id == JSHTMLElement::TableDeleteCaption) {
2385             table.deleteCaption();
2386             return jsUndefined();
2387         }
2388         else if (id == JSHTMLElement::TableInsertRow)
2389             return toJS(exec,table.insertRow(args[0]->toInt32(exec), exception));
2390         else if (id == JSHTMLElement::TableDeleteRow) {
2391             table.deleteRow(args[0]->toInt32(exec), exception);
2392             return jsUndefined();
2393         }
2394     }
2395     else if (element.hasLocalName(theadTag) ||
2396              element.hasLocalName(tbodyTag) ||
2397              element.hasLocalName(tfootTag)) {
2398         HTMLTableSectionElement &tableSection = static_cast<HTMLTableSectionElement &>(element);
2399         if (id == JSHTMLElement::TableSectionInsertRow)
2400             return toJS(exec, tableSection.insertRow(args[0]->toInt32(exec), exception));
2401         else if (id == JSHTMLElement::TableSectionDeleteRow) {
2402             tableSection.deleteRow(args[0]->toInt32(exec), exception);
2403             return jsUndefined();
2404         }
2405     }
2406     else if (element.hasLocalName(trTag)) {
2407         HTMLTableRowElement &tableRow = static_cast<HTMLTableRowElement &>(element);
2408         if (id == JSHTMLElement::TableRowInsertCell)
2409             return toJS(exec,tableRow.insertCell(args[0]->toInt32(exec), exception));
2410         else if (id == JSHTMLElement::TableRowDeleteCell) {
2411             tableRow.deleteCell(args[0]->toInt32(exec), exception);
2412             return jsUndefined();
2413         }
2414     }
2415     else if (element.hasLocalName(marqueeTag)) {
2416         if (id == JSHTMLElement::MarqueeStart && element.renderer() && 
2417             element.renderer()->layer() &&
2418             element.renderer()->layer()->marquee()) {
2419             element.renderer()->layer()->marquee()->start();
2420             return jsUndefined();
2421         }
2422         if (id == JSHTMLElement::MarqueeStop && element.renderer() && 
2423             element.renderer()->layer() &&
2424             element.renderer()->layer()->marquee()) {
2425             element.renderer()->layer()->marquee()->stop();
2426             return jsUndefined();
2427         }
2428     }
2429
2430     return jsUndefined();
2431 }
2432
2433 void JSHTMLElement::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
2434 {
2435     HTMLElement &element = *static_cast<HTMLElement *>(impl());
2436     // First look at dynamic properties
2437     if (element.hasLocalName(selectTag)) {
2438         HTMLSelectElement &select = static_cast<HTMLSelectElement &>(element);
2439         bool ok;
2440         /*unsigned u =*/ propertyName.toUInt32(&ok);
2441         if (ok) {
2442             JSObject *coll = static_cast<JSObject *>(getSelectHTMLCollection(exec, select.options().get(), &select));
2443             coll->put(exec,propertyName,value);
2444             return;
2445         }
2446     }
2447     else if (element.hasLocalName(embedTag) || element.hasLocalName(objectTag) || element.hasLocalName(appletTag)) {
2448         if (JSValue *runtimeObject = getRuntimeObject(exec, &element)) {
2449             JSObject *imp = static_cast<JSObject *>(runtimeObject);
2450             if (imp->canPut(exec, propertyName))
2451                 return imp->put(exec, propertyName, value);
2452         }
2453     }
2454
2455     const HashTable* table = classInfo()->propHashTable; // get the right hashtable
2456     const HashEntry* entry = Lookup::findEntry(table, propertyName);
2457     if (entry) {
2458         if (entry->attr & Function) { // function: put as override property
2459             JSObject::put(exec, propertyName, value, attr);
2460             return;
2461         }
2462         else if (!(entry->attr & ReadOnly)) { // let lookupPut print the warning if read-only
2463             putValueProperty(exec, entry->value, value, attr);
2464             return;
2465         }
2466     }
2467
2468     lookupPut<JSHTMLElement, JSElement>(exec, propertyName, value, attr, &HTMLElementTable, this);
2469 }
2470
2471 void JSHTMLElement::htmlSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2472 {
2473     HTMLHeadElement &head = *static_cast<HTMLHeadElement*>(impl());
2474     if (token == HeadProfile) 
2475         head.setProfile(str);
2476 }
2477
2478 void JSHTMLElement::headSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2479 {
2480     HTMLHeadElement &head = *static_cast<HTMLHeadElement*>(impl());
2481     if (token == HeadProfile) 
2482         head.setProfile(str);
2483 }
2484
2485 void JSHTMLElement::linkSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2486 {
2487     HTMLLinkElement &link = *static_cast<HTMLLinkElement*>(impl());
2488     switch (token) {
2489         case LinkDisabled:        { link.setDisabled(value->toBoolean(exec)); return; }
2490         case LinkCharset:         { link.setCharset(str); return; }
2491         case LinkHref:            { link.setHref(str); return; }
2492         case LinkHrefLang:        { link.setHreflang(str); return; }
2493         case LinkMedia:           { link.setMedia(str); return; }
2494         case LinkRel:             { link.setRel(str); return; }
2495         case LinkRev:             { link.setRev(str); return; }
2496         case LinkTarget:          { link.setTarget(str); return; }
2497         case LinkType:            { link.setType(str); return; }
2498     }
2499 }
2500
2501 void JSHTMLElement::titleSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2502 {
2503      HTMLTitleElement& title = *static_cast<HTMLTitleElement*>(impl());
2504      if (token == TitleText)
2505         title.setText(str);
2506 }
2507
2508 void JSHTMLElement::metaSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2509 {
2510     HTMLMetaElement& meta = *static_cast<HTMLMetaElement*>(impl());
2511     switch (token) {
2512         case MetaContent:         { meta.setContent(str); return; }
2513         case MetaHttpEquiv:       { meta.setHttpEquiv(str); return; }
2514         case MetaName:            { meta.setName(str); return; }
2515         case MetaScheme:          { meta.setScheme(str); return; }
2516     }
2517 }
2518
2519 void JSHTMLElement::baseSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2520 {
2521     HTMLBaseElement& base = *static_cast<HTMLBaseElement*>(impl());
2522     switch (token) {
2523         case BaseHref:            { base.setHref(str); return; }
2524         case BaseTarget:          { base.setTarget(str); return; }
2525     }
2526 }
2527
2528 void JSHTMLElement::isIndexSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2529 {
2530     HTMLIsIndexElement& isindex = *static_cast<HTMLIsIndexElement*>(impl());
2531     if (token == IsIndexPrompt)
2532         isindex.setPrompt(str);
2533 }
2534
2535 void JSHTMLElement::styleSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2536 {
2537     HTMLStyleElement& style = *static_cast<HTMLStyleElement*>(impl());
2538     switch (token) {
2539         case StyleDisabled:        { style.setDisabled(value->toBoolean(exec)); return; }
2540         case StyleMedia:           { style.setMedia(str); return; }
2541         case StyleType:            { style.setType(str); return; }
2542     }
2543 }
2544
2545 void JSHTMLElement::bodySetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2546 {
2547     HTMLBodyElement& body = *static_cast<HTMLBodyElement*>(impl());
2548     switch (token) {
2549         case BodyALink:           { body.setALink(str); return; }
2550         case BodyBackground:      { body.setBackground(str); return; }
2551         case BodyBgColor:         { body.setBgColor(str); return; }
2552         case BodyLink:            { body.setLink(str); return; }
2553         case BodyText:            { body.setText(str); return; }
2554         case BodyVLink:           { body.setVLink(str); return; }
2555         case BodyScrollLeft:
2556         case BodyScrollTop: {
2557             FrameView* sview = body.ownerDocument()->view();
2558             if (sview) {
2559                 // Update the document's layout before we compute these attributes.
2560                 body.document()->updateLayoutIgnorePendingStylesheets();
2561                 if (token == BodyScrollLeft)
2562                     sview->setContentsPos(value->toInt32(exec), sview->contentsY());
2563                 else
2564                     sview->setContentsPos(sview->contentsX(), value->toInt32(exec));
2565             }
2566             return;
2567         }
2568     }
2569 }
2570
2571 void JSHTMLElement::formSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2572 {
2573     HTMLFormElement& form = *static_cast<HTMLFormElement*>(impl());
2574     switch (token) {
2575         // read-only: elements
2576         // read-only: length
2577         case FormName:            { form.setName(str); return; }
2578         case FormAcceptCharset:   { form.setAcceptCharset(str); return; }
2579         case FormAction:          { form.setAction(str); return; }
2580         case FormEncType:         { form.setEnctype(str); return; }
2581         case FormMethod:          { form.setMethod(str); return; }
2582         case FormTarget:          { form.setTarget(str); return; }
2583     }
2584 }
2585
2586 void JSHTMLElement::selectSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2587 {
2588     HTMLSelectElement& select = *static_cast<HTMLSelectElement*>(impl());
2589     switch (token) {
2590         // read-only: type
2591         case SelectSelectedIndex:   { select.setSelectedIndex(value->toInt32(exec)); return; }
2592         case SelectValue:           { select.setValue(str); return; }
2593         case SelectLength:          { // read-only according to the NS spec, but webpages need it writeable
2594                                         JSObject *coll = static_cast<JSObject *>(getSelectHTMLCollection(exec, select.options().get(), &select));
2595                                         coll->put(exec,lengthPropertyName,value);
2596                                         return;
2597                                     }
2598         // read-only: form
2599         // read-only: options
2600         case SelectDisabled:        { select.setDisabled(value->toBoolean(exec)); return; }
2601         case SelectMultiple:        { select.setMultiple(value->toBoolean(exec)); return; }
2602         case SelectName:            { select.setName(AtomicString(str)); return; }
2603         case SelectSize:            { select.setSize(value->toInt32(exec)); return; }
2604         case SelectTabIndex:        { select.setTabIndex(value->toInt32(exec)); return; }
2605     }
2606 }
2607
2608 void JSHTMLElement::optGroupSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2609 {
2610     HTMLOptGroupElement& optgroup = *static_cast<HTMLOptGroupElement*>(impl());
2611     switch (token) {
2612         case OptGroupDisabled:        { optgroup.setDisabled(value->toBoolean(exec)); return; }
2613         case OptGroupLabel:           { optgroup.setLabel(str); return; }
2614     }
2615 }
2616
2617 void JSHTMLElement::optionSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2618 {
2619     DOMExceptionTranslator exception(exec);
2620     HTMLOptionElement& option = *static_cast<HTMLOptionElement*>(impl());
2621     switch (token) {
2622         // read-only: form
2623         case OptionDefaultSelected: { option.setDefaultSelected(value->toBoolean(exec)); return; }
2624         case OptionText:            { option.setText(str, exception); return; }
2625         // read-only: index
2626         case OptionDisabled:        { option.setDisabled(value->toBoolean(exec)); return; }
2627         case OptionLabel:           { option.setLabel(str); return; }
2628         case OptionSelected:        { option.setSelected(value->toBoolean(exec)); return; }
2629         case OptionValue:           { option.setValue(str); return; }
2630     }
2631 }
2632
2633 void JSHTMLElement::inputSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2634 {
2635     HTMLInputElement& input = *static_cast<HTMLInputElement*>(impl());
2636     switch (token) {
2637         case InputDefaultValue:    { input.setDefaultValue(str); return; }
2638         case InputDefaultChecked:  { input.setDefaultChecked(value->toBoolean(exec)); return; }
2639         // read-only: form
2640         case InputAccept:          { input.setAccept(str); return; }
2641         case InputAccessKey:       { input.setAccessKey(str); return; }
2642         case InputAlign:           { input.setAlign(str); return; }
2643         case InputAlt:             { input.setAlt(str); return; }
2644         case InputChecked:         { input.setChecked(value->toBoolean(exec)); return; }
2645         case InputDisabled:        { input.setDisabled(value->toBoolean(exec)); return; }
2646         case InputIndeterminate:   { input.setIndeterminate(value->toBoolean(exec)); return; }
2647         case InputMaxLength:       { input.setMaxLength(value->toInt32(exec)); return; }
2648         case InputName:            { input.setName(AtomicString(str)); return; }
2649         case InputReadOnly:        { input.setReadOnly(value->toBoolean(exec)); return; }
2650         case InputSize:            { input.setSize(value->toInt32(exec)); return; }
2651         case InputSelectionStart:  { input.setSelectionStart(value->toInt32(exec)); return; }
2652         case InputSelectionEnd:    { input.setSelectionEnd(value->toInt32(exec)); return; }
2653         case InputSrc:             { input.setSrc(str); return; }
2654         case InputTabIndex:        { input.setTabIndex(value->toInt32(exec)); return; }
2655         case InputType:            { input.setType(str); return; }
2656         case InputUseMap:          { input.setUseMap(str); return; }
2657         case InputValue:           { input.setValue(str); return; }
2658     }
2659 }
2660
2661 void JSHTMLElement::textAreaSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2662 {
2663     HTMLTextAreaElement& textarea = *static_cast<HTMLTextAreaElement*>(impl());
2664     switch (token) {
2665         case TextAreaDefaultValue:    { textarea.setDefaultValue(str); return; }
2666         // read-only: form
2667         case TextAreaAccessKey:       { textarea.setAccessKey(str); return; }
2668         case TextAreaCols:            { textarea.setCols(value->toInt32(exec)); return; }
2669         case TextAreaDisabled:        { textarea.setDisabled(value->toBoolean(exec)); return; }
2670         case TextAreaName:            { textarea.setName(AtomicString(str)); return; }
2671         case TextAreaReadOnly:        { textarea.setReadOnly(value->toBoolean(exec)); return; }
2672         case TextAreaRows:            { textarea.setRows(value->toInt32(exec)); return; }
2673         case TextAreaSelectionStart:  { textarea.setSelectionStart(value->toInt32(exec)); return; }
2674         case TextAreaSelectionEnd:    { textarea.setSelectionEnd(value->toInt32(exec)); return; }
2675         case TextAreaTabIndex:        { textarea.setTabIndex(value->toInt32(exec)); return; }
2676         // read-only: type
2677         case TextAreaValue:           { textarea.setValue(str); return; }
2678     }
2679 }
2680
2681 void JSHTMLElement::buttonSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2682 {
2683     HTMLButtonElement& button = *static_cast<HTMLButtonElement*>(impl());
2684     switch (token) {
2685         // read-only: form
2686         case ButtonAccessKey:       { button.setAccessKey(str); return; }
2687         case ButtonDisabled:        { button.setDisabled(value->toBoolean(exec)); return; }
2688         case ButtonName:            { button.setName(AtomicString(str)); return; }
2689         case ButtonTabIndex:        { button.setTabIndex(value->toInt32(exec)); return; }
2690         // read-only: type
2691         case ButtonValue:           { button.setValue(str); return; }
2692     }
2693 }
2694
2695 void JSHTMLElement::labelSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2696 {
2697     HTMLLabelElement& label = *static_cast<HTMLLabelElement*>(impl());
2698     switch (token) {
2699         // read-only: form
2700         case LabelAccessKey:       { label.setAccessKey(str); return; }
2701         case LabelHtmlFor:         { label.setHtmlFor(str); return; }
2702     }
2703 }
2704
2705 void JSHTMLElement::fieldSetSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2706 {
2707 }
2708
2709 void JSHTMLElement::legendSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2710 {
2711     HTMLLegendElement& legend = *static_cast<HTMLLegendElement*>(impl());
2712     switch (token) {
2713         // read-only: form
2714         case LegendAccessKey:       { legend.setAccessKey(str); return; }
2715         case LegendAlign:           { legend.setAlign(str); return; }
2716     }
2717 }
2718
2719 void JSHTMLElement::uListSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2720 {
2721     HTMLUListElement& uList = *static_cast<HTMLUListElement*>(impl());
2722     switch (token) {
2723         case UListCompact:         { uList.setCompact(value->toBoolean(exec)); return; }
2724         case UListType:            { uList.setType(str); return; }
2725     }
2726 }
2727
2728 void JSHTMLElement::oListSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2729 {
2730     HTMLOListElement& oList = *static_cast<HTMLOListElement*>(impl());
2731     switch (token) {
2732         case OListCompact:         { oList.setCompact(value->toBoolean(exec)); return; }
2733         case OListStart:           { oList.setStart(value->toInt32(exec)); return; }
2734         case OListType:            { oList.setType(str); return; }
2735     }
2736 }
2737
2738 void JSHTMLElement::dListSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2739 {
2740     HTMLDListElement& dList = *static_cast<HTMLDListElement*>(impl());
2741     if (token == DListCompact)
2742         dList.setCompact(value->toBoolean(exec));
2743 }
2744
2745 void JSHTMLElement::dirSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2746 {
2747     HTMLDirectoryElement& directory = *static_cast<HTMLDirectoryElement*>(impl());
2748     if (token == DirectoryCompact)
2749         directory.setCompact(value->toBoolean(exec));
2750 }
2751
2752 void JSHTMLElement::menuSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2753 {
2754     HTMLMenuElement& menu = *static_cast<HTMLMenuElement*>(impl());
2755     if (token == MenuCompact)
2756         menu.setCompact(value->toBoolean(exec));
2757 }
2758
2759 void JSHTMLElement::liSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2760 {
2761     HTMLLIElement& li = *static_cast<HTMLLIElement*>(impl());
2762     switch (token) {
2763         case LIType:            { li.setType(str); return; }
2764         case LIValue:           { li.setValue(value->toInt32(exec)); return; }
2765     }
2766 }
2767
2768 void JSHTMLElement::divSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2769 {
2770     HTMLDivElement& div = *static_cast<HTMLDivElement*>(impl());
2771     if (token == DivAlign)
2772         div.setAlign(str);
2773 }
2774
2775 void JSHTMLElement::paragraphSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2776 {
2777     HTMLParagraphElement& paragraph = *static_cast<HTMLParagraphElement*>(impl());
2778     if (token == ParagraphAlign)
2779         paragraph.setAlign(str);
2780 }
2781
2782 void JSHTMLElement::headingSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2783 {
2784     HTMLHeadingElement& heading = *static_cast<HTMLHeadingElement*>(impl());
2785     if (token == HeadingAlign)
2786         heading.setAlign(str);
2787 }
2788
2789 void JSHTMLElement::blockQuoteSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2790 {
2791     HTMLBlockquoteElement& blockQuote = *static_cast<HTMLBlockquoteElement*>(impl());
2792     if (token == BlockQuoteCite)
2793         blockQuote.setCite(str);
2794 }
2795
2796 void JSHTMLElement::quoteSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2797 {
2798     HTMLQuoteElement& quote = *static_cast<HTMLQuoteElement*>(impl());
2799     if (token == QuoteCite)
2800         quote.setCite(str);
2801 }
2802
2803 void JSHTMLElement::preSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2804 {
2805     HTMLPreElement& pre = *static_cast<HTMLPreElement*>(impl());
2806     if (token == PreWidth)
2807         pre.setWidth(value->toInt32(exec));
2808     else if (token == PreWrap)
2809         pre.setWrap(value->toBoolean(exec));
2810 }
2811
2812 void JSHTMLElement::brSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2813 {
2814     HTMLBRElement& br = *static_cast<HTMLBRElement*>(impl());
2815     if (token == BRClear)
2816         br.setClear(str);
2817 }
2818
2819 void JSHTMLElement::baseFontSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2820 {
2821     HTMLBaseFontElement& baseFont = *static_cast<HTMLBaseFontElement*>(impl());
2822     switch (token) {
2823         case BaseFontColor:           { baseFont.setColor(str); return; }
2824         case BaseFontFace:            { baseFont.setFace(str); return; }
2825         case BaseFontSize:            { baseFont.setSize(str); return; }
2826     }
2827 }
2828
2829 void JSHTMLElement::fontSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2830 {
2831     HTMLFontElement& font = *static_cast<HTMLFontElement*>(impl());
2832     switch (token) {
2833         case FontColor:           { font.setColor(str); return; }
2834         case FontFace:            { font.setFace(str); return; }
2835         case FontSize:            { font.setSize(str); return; }
2836     }
2837 }
2838
2839 void JSHTMLElement::hrSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2840 {
2841     HTMLHRElement& hr = *static_cast<HTMLHRElement*>(impl());
2842     switch (token) {
2843         case HRAlign:           { hr.setAlign(str); return; }
2844         case HRNoShade:         { hr.setNoShade(value->toBoolean(exec)); return; }
2845         case HRSize:            { hr.setSize(str); return; }
2846         case HRWidth:           { hr.setWidth(str); return; }
2847     }
2848 }
2849
2850 void JSHTMLElement::modSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2851 {
2852     HTMLModElement& mod = *static_cast<HTMLModElement*>(impl());
2853     switch (token) {
2854         case ModCite:            { mod.setCite(str); return; }
2855         case ModDateTime:        { mod.setDateTime(str); return; }
2856     }
2857 }
2858
2859 void JSHTMLElement::anchorSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2860 {
2861     HTMLAnchorElement& anchor = *static_cast<HTMLAnchorElement*>(impl());
2862     switch (token) {
2863         case AnchorAccessKey:       { anchor.setAccessKey(str); return; }
2864         case AnchorCharset:         { anchor.setCharset(str); return; }
2865         case AnchorCoords:          { anchor.setCoords(str); return; }
2866         case AnchorHref:            { anchor.setHref(str); return; }
2867         case AnchorHrefLang:        { anchor.setHreflang(str); return; }
2868         case AnchorName:            { anchor.setName(str); return; }
2869         case AnchorRel:             { anchor.setRel(str); return; }
2870         case AnchorRev:             { anchor.setRev(str); return; }
2871         case AnchorShape:           { anchor.setShape(str); return; }
2872         case AnchorTabIndex:        { anchor.setTabIndex(value->toInt32(exec)); return; }
2873         case AnchorTarget:          { anchor.setTarget(str); return; }
2874         case AnchorType:            { anchor.setType(str); return; }
2875     }
2876 }
2877
2878 void JSHTMLElement::imageSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2879 {
2880     HTMLImageElement& image = *static_cast<HTMLImageElement*>(impl());
2881     switch (token) {
2882         case ImageName:            { image.setName(str); return; }
2883         case ImageAlign:           { image.setAlign(str); return; }
2884         case ImageAlt:             { image.setAlt(str); return; }
2885         case ImageBorder:          { image.setBorder(value->toInt32(exec)); return; }
2886         case ImageHeight:          { image.setHeight(value->toInt32(exec)); return; }
2887         case ImageHspace:          { image.setHspace(value->toInt32(exec)); return; }
2888         case ImageIsMap:           { image.setIsMap(value->toBoolean(exec)); return; }
2889         case ImageLongDesc:        { image.setLongDesc(str); return; }
2890         case ImageSrc:             { image.setSrc(str); return; }
2891         case ImageUseMap:          { image.setUseMap(str); return; }
2892         case ImageVspace:          { image.setVspace(value->toInt32(exec)); return; }
2893         case ImageWidth:           { image.setWidth(value->toInt32(exec)); return; }
2894     }
2895 }
2896
2897 void JSHTMLElement::objectSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2898 {
2899     HTMLObjectElement& object = *static_cast<HTMLObjectElement*>(impl());
2900     switch (token) {
2901         // read-only: form
2902         case ObjectCode:            { object.setCode(str); return; }
2903         case ObjectAlign:           { object.setAlign(str); return; }
2904         case ObjectArchive:         { object.setArchive(str); return; }
2905         case ObjectBorder:          { object.setBorder(str); return; }
2906         case ObjectCodeBase:        { object.setCodeBase(str); return; }
2907         case ObjectCodeType:        { object.setCodeType(str); return; }
2908         // read-only: ObjectContentDocument
2909         case ObjectData:            { object.setData(str); return; }
2910         case ObjectDeclare:         { object.setDeclare(value->toBoolean(exec)); return; }
2911         case ObjectHeight:          { object.setHeight(str); return; }
2912         case ObjectHspace:          { object.setHspace(str); return; }
2913         case ObjectName:            { object.setName(str); return; }
2914         case ObjectStandby:         { object.setStandby(str); return; }
2915         case ObjectTabIndex:        { object.setTabIndex(value->toInt32(exec)); return; }
2916         case ObjectType:            { object.setType(str); return; }
2917         case ObjectUseMap:          { object.setUseMap(str); return; }
2918         case ObjectVspace:          { object.setVspace(str); return; }
2919         case ObjectWidth:           { object.setWidth(str); return; }
2920     }
2921 }
2922
2923 void JSHTMLElement::paramSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2924 {
2925     HTMLParamElement& param = *static_cast<HTMLParamElement*>(impl());
2926     switch (token) {
2927         case ParamName:            { param.setName(str); return; }
2928         case ParamType:            { param.setType(str); return; }
2929         case ParamValue:           { param.setValue(str); return; }
2930         case ParamValueType:       { param.setValueType(str); return; }
2931     }
2932 }
2933
2934 void JSHTMLElement::appletSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2935 {
2936     HTMLAppletElement& applet = *static_cast<HTMLAppletElement*>(impl());
2937     switch (token) {
2938         case AppletAlign:           { applet.setAlign(str); return; }
2939         case AppletAlt:             { applet.setAlt(str); return; }
2940         case AppletArchive:         { applet.setArchive(str); return; }
2941         case AppletCode:            { applet.setCode(str); return; }
2942         case AppletCodeBase:        { applet.setCodeBase(str); return; }
2943         case AppletHeight:          { applet.setHeight(str); return; }
2944         case AppletHspace:          { applet.setHspace(str); return; }
2945         case AppletName:            { applet.setName(str); return; }
2946         case AppletObject:          { applet.setObject(str); return; }
2947         case AppletVspace:          { applet.setVspace(str); return; }
2948         case AppletWidth:           { applet.setWidth(str); return; }
2949     }
2950 }
2951
2952 void JSHTMLElement::embedSetter(ExecState*, int token, JSValue*, const WebCore::String& str)
2953 {
2954     HTMLEmbedElement& embed = *static_cast<HTMLEmbedElement*>(impl());
2955     switch (token) {
2956         case EmbedAlign:           { embed.setAlign(str); return; }
2957         case EmbedHeight:          { embed.setHeight(str); return; }
2958         case EmbedName:            { embed.setName(str); return; }
2959         case EmbedSrc:             { embed.setSrc(str); return; }
2960         case EmbedType:            { embed.setType(str); return; }
2961         case EmbedWidth:           { embed.setWidth(str); return; }
2962     }
2963 }
2964
2965 void JSHTMLElement::mapSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2966 {
2967     HTMLMapElement& map = *static_cast<HTMLMapElement*>(impl());
2968     if (token == MapName)
2969         // read-only: areas
2970         map.setName(str);
2971 }
2972
2973 void JSHTMLElement::areaSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2974 {
2975     HTMLAreaElement& area = *static_cast<HTMLAreaElement*>(impl());
2976     switch (token) {
2977         case AreaAccessKey:       { area.setAccessKey(str); return; }
2978         case AreaAlt:             { area.setAlt(str); return; }
2979         case AreaCoords:          { area.setCoords(str); return; }
2980         case AreaHref:            { area.setHref(str); return; }
2981         case AreaNoHref:          { area.setNoHref(value->toBoolean(exec)); return; }
2982         case AreaShape:           { area.setShape(str); return; }
2983         case AreaTabIndex:        { area.setTabIndex(value->toInt32(exec)); return; }
2984         case AreaTarget:          { area.setTarget(str); return; }
2985     }
2986 }
2987
2988 void JSHTMLElement::scriptSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
2989 {
2990     HTMLScriptElement& script = *static_cast<HTMLScriptElement*>(impl());
2991     switch (token) {
2992         case ScriptText:            { script.setText(str); return; }
2993         case ScriptHtmlFor:         { script.setHtmlFor(str); return; }
2994         case ScriptEvent:           { script.setEvent(str); return; }
2995         case ScriptCharset:         { script.setCharset(str); return; }
2996         case ScriptDefer:           { script.setDefer(value->toBoolean(exec)); return; }
2997         case ScriptSrc:             { script.setSrc(str); return; }
2998         case ScriptType:            { script.setType(str); return; }
2999     }
3000 }
3001
3002 void JSHTMLElement::tableSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
3003 {
3004     HTMLTableElement& table = *static_cast<HTMLTableElement*>(impl());
3005     switch (token) {
3006         case TableCaption:         { table.setCaption(toHTMLTableCaptionElement(value)); return; }
3007         case TableTHead:           { table.setTHead(toHTMLTableSectionElement(value)); return; }
3008         case TableTFoot:           { table.setTFoot(toHTMLTableSectionElement(value)); return; }
3009         // read-only: rows
3010         // read-only: tbodies
3011         case TableAlign:           { table.setAlign(str); return; }
3012         case TableBgColor:         { table.setBgColor(str); return; }
3013         case TableBorder:          { table.setBorder(str); return; }
3014         case TableCellPadding:     { table.setCellPadding(str); return; }
3015         case TableCellSpacing:     { table.setCellSpacing(str); return; }
3016         case TableFrame:           { table.setFrame(str); return; }
3017         case TableRules:           { table.setRules(str); return; }
3018         case TableSummary:         { table.setSummary(str); return; }
3019         case TableWidth:           { table.setWidth(str); return; }
3020     }
3021 }
3022
3023 void JSHTMLElement::tableCaptionSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
3024 {
3025     HTMLTableCaptionElement& tableCaption = *static_cast<HTMLTableCaptionElement*>(impl());
3026     if (token == TableCaptionAlign)
3027         tableCaption.setAlign(str);
3028 }
3029
3030 void JSHTMLElement::tableColSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
3031 {
3032     HTMLTableColElement& tableCol = *static_cast<HTMLTableColElement*>(impl());
3033     switch (token) {
3034         case TableColAlign:           { tableCol.setAlign(str); return; }
3035         case TableColCh:              { tableCol.setCh(str); return; }
3036         case TableColChOff:           { tableCol.setChOff(str); return; }
3037         case TableColSpan:            { tableCol.setSpan(value->toInt32(exec)); return; }
3038         case TableColVAlign:          { tableCol.setVAlign(str); return; }
3039         case TableColWidth:           { tableCol.setWidth(str); return; }
3040     }
3041 }
3042
3043 void JSHTMLElement::tableSectionSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
3044 {
3045     HTMLTableSectionElement& tableSection = *static_cast<HTMLTableSectionElement*>(impl());
3046     switch (token) {
3047         case TableSectionAlign:           { tableSection.setAlign(str); return; }
3048         case TableSectionCh:              { tableSection.setCh(str); return; }
3049         case TableSectionChOff:           { tableSection.setChOff(str); return; }
3050         case TableSectionVAlign:          { tableSection.setVAlign(str); return; }
3051         // read-only: rows
3052     }
3053 }
3054
3055 void JSHTMLElement::tableRowSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
3056 {
3057     HTMLTableRowElement& tableRow = *static_cast<HTMLTableRowElement*>(impl());
3058     switch (token) {
3059         // read-only: rowIndex
3060         // read-only: sectionRowIndex
3061         // read-only: cells
3062         case TableRowAlign:           { tableRow.setAlign(str); return; }
3063         case TableRowBgColor:         { tableRow.setBgColor(str); return; }
3064         case TableRowCh:              { tableRow.setCh(str); return; }
3065         case TableRowChOff:           { tableRow.setChOff(str); return; }
3066         case TableRowVAlign:          { tableRow.setVAlign(str); return; }
3067     }
3068 }
3069
3070 void JSHTMLElement::tableCellSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
3071 {
3072     HTMLTableCellElement& tableCell = *static_cast<HTMLTableCellElement*>(impl());
3073     switch (token) {
3074         // read-only: cellIndex
3075         case TableCellAbbr:            { tableCell.setAbbr(str); return; }
3076         case TableCellAlign:           { tableCell.setAlign(str); return; }
3077         case TableCellAxis:            { tableCell.setAxis(str); return; }
3078         case TableCellBgColor:         { tableCell.setBgColor(str); return; }
3079         case TableCellCh:              { tableCell.setCh(str); return; }
3080         case TableCellChOff:           { tableCell.setChOff(str); return; }
3081         case TableCellColSpan:         { tableCell.setColSpan(value->toInt32(exec)); return; }
3082         case TableCellHeaders:         { tableCell.setHeaders(str); return; }
3083         case TableCellHeight:          { tableCell.setHeight(str); return; }
3084         case TableCellNoWrap:          { tableCell.setNoWrap(value->toBoolean(exec)); return; }
3085         case TableCellRowSpan:         { tableCell.setRowSpan(value->toInt32(exec)); return; }
3086         case TableCellScope:           { tableCell.setScope(str); return; }
3087         case TableCellVAlign:          { tableCell.setVAlign(str); return; }
3088         case TableCellWidth:           { tableCell.setWidth(str); return; }
3089     }
3090 }
3091
3092 void JSHTMLElement::frameSetSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
3093 {
3094     HTMLFrameSetElement& frameSet = *static_cast<HTMLFrameSetElement*>(impl());
3095     switch (token) {
3096         case FrameSetCols:            { frameSet.setCols(str); return; }
3097         case FrameSetRows:            { frameSet.setRows(str); return; }
3098     }
3099 }
3100
3101 void JSHTMLElement::frameSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
3102 {
3103     HTMLFrameElement& frameElement = *static_cast<HTMLFrameElement*>(impl());
3104     switch (token) {
3105         // read-only: FrameContentDocument:
3106         case FrameFrameBorder:     { frameElement.setFrameBorder(str); return; }
3107         case FrameLongDesc:        { frameElement.setLongDesc(str); return; }
3108         case FrameMarginHeight:    { frameElement.setMarginHeight(str); return; }
3109         case FrameMarginWidth:     { frameElement.setMarginWidth(str); return; }
3110         case FrameName:            { frameElement.setName(str); return; }
3111         case FrameNoResize:        { frameElement.setNoResize(value->toBoolean(exec)); return; }
3112         case FrameScrolling:       { frameElement.setScrolling(str); return; }
3113         case FrameSrc:             { frameElement.setSrc(str); return; }
3114         case FrameLocation:        { frameElement.setLocation(str); return; }
3115     }
3116 }
3117
3118 void JSHTMLElement::iFrameSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
3119 {
3120     HTMLIFrameElement& iFrame = *static_cast<HTMLIFrameElement*>(impl());
3121     switch (token) {
3122         case IFrameAlign:           { iFrame.setAlign(str); return; }
3123         // read-only: IFrameContentDocument
3124         case IFrameFrameBorder:     { iFrame.setFrameBorder(str); return; }
3125         case IFrameHeight:          { iFrame.setHeight(str); return; }
3126         case IFrameLongDesc:        { iFrame.setLongDesc(str); return; }
3127         case IFrameMarginHeight:    { iFrame.setMarginHeight(str); return; }
3128         case IFrameMarginWidth:     { iFrame.setMarginWidth(str); return; }
3129         case IFrameName:            { iFrame.setName(str); return; }
3130         case IFrameScrolling:       { iFrame.setScrolling(str); return; }
3131         case IFrameSrc:             { iFrame.setSrc(str); return; }
3132         case IFrameWidth:           { iFrame.setWidth(str); return; }
3133     }
3134 }
3135
3136 void JSHTMLElement::marqueeSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
3137 {
3138     // FIXME: Find out what WinIE supports and implement it.
3139 }
3140
3141 void JSHTMLElement::putValueProperty(ExecState *exec, int token, JSValue *value, int)
3142 {
3143     DOMExceptionTranslator exception(exec);
3144     WebCore::String str = value->toString(exec);
3145  
3146     // Check our set of generic properties first.
3147     HTMLElement &element = *static_cast<HTMLElement *>(impl());
3148     switch (token) {
3149         case ElementId:
3150             element.setId(str);
3151             return;
3152         case ElementTitle:
3153             element.setTitle(str);
3154             return;
3155         case ElementLang:
3156             element.setLang(str);
3157             return;
3158         case ElementDir:
3159             element.setDir(str);
3160             return;
3161         case ElementClassName:
3162             element.setClassName(str);
3163             return;
3164         case ElementInnerHTML:
3165             element.setInnerHTML(str, exception);
3166             return;
3167         case ElementInnerText:
3168             element.setInnerText(str, exception);
3169             return;
3170         case ElementOuterHTML:
3171             element.setOuterHTML(str, exception);
3172             return;
3173         case ElementOuterText:
3174             element.setOuterText(str, exception);
3175             return;
3176         case ElementContentEditable:
3177             element.setContentEditable(str);
3178             return;
3179     }
3180
3181     // Now check for properties that apply to a specific element type.
3182     const Accessors* access = accessors();
3183     if (access && access->m_setter)
3184         return (this->*(access->m_setter))(exec, token, value, str);  
3185 }
3186
3187 HTMLElement *toHTMLElement(JSValue *val)
3188 {
3189     if (!val || !val->isObject(&JSHTMLElement::info))
3190         return 0;
3191     return static_cast<HTMLElement *>(static_cast<JSHTMLElement *>(val)->impl());
3192 }
3193
3194 HTMLTableCaptionElement *toHTMLTableCaptionElement(JSValue *val)
3195 {
3196     HTMLElement *e = toHTMLElement(val);
3197     if (e && e->hasTagName(captionTag))
3198         return static_cast<HTMLTableCaptionElement *>(e);
3199     return 0;
3200 }
3201
3202 HTMLTableSectionElement *toHTMLTableSectionElement(JSValue *val)
3203 {
3204     HTMLElement