1 // -*- c-basic-offset: 2 -*-
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999 Harri Porten (porten@kde.org)
5 * Copyright (C) 2004, 2006 Apple Computer, Inc.
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.
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.
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
25 #include "JSDocument.h"
26 #include "JSElement.h"
32 class HTMLSelectElement;
33 class HTMLTableCaptionElement;
34 class HTMLTableSectionElement;
39 class JSAbstractEventListener;
41 class JSHTMLDocument : public WebCore::JSDocument {
43 JSHTMLDocument(ExecState *exec, WebCore::HTMLDocument *d);
44 virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
45 JSValue *getValueProperty(ExecState *exec, int token) const;
46 virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
47 void putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/);
48 virtual const ClassInfo* classInfo() const { return &info; }
49 static const ClassInfo info;
50 enum { Title, Referrer, Domain, URL, Body, Location, Cookie,
51 Images, Applets, Embeds, Links, Forms, Anchors, Scripts, All, Clear, Open, Close,
52 Write, WriteLn, GetElementsByName, CaptureEvents, ReleaseEvents,
53 BgColor, FgColor, AlinkColor, LinkColor, VlinkColor, LastModified, Height, Width, Dir, DesignMode };
55 static JSValue *namedItemGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
58 KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(JSHTMLElementProto, WebCore::JSElementProto)
60 class JSHTMLElement : public WebCore::JSElement {
62 JSHTMLElement(ExecState *exec, WebCore::HTMLElement *e);
63 virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
64 JSValue *getValueProperty(ExecState *exec, int token) const;
65 virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
66 void putValueProperty(ExecState *exec, int token, JSValue *value, int);
67 virtual UString toString(ExecState *exec) const;
68 virtual void pushEventHandlerScope(ExecState *exec, ScopeChain &scope) const;
69 virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List&args);
70 virtual bool implementsCall() const;
71 virtual const ClassInfo* classInfo() const;
72 static const ClassInfo info;
74 static const ClassInfo html_info, head_info, link_info, title_info,
75 meta_info, base_info, isIndex_info, style_info, body_info, form_info,
76 select_info, optGroup_info, option_info, input_info, textArea_info,
77 button_info, label_info, fieldSet_info, legend_info, ul_info, ol_info,
78 dl_info, dir_info, menu_info, li_info, div_info, p_info, heading_info,
79 blockQuote_info, q_info, pre_info, br_info, baseFont_info, font_info,
80 hr_info, mod_info, a_info, img_info, object_info, param_info,
81 applet_info, embed_info, map_info, area_info, script_info, table_info,
82 caption_info, col_info, tablesection_info, tr_info,
83 tablecell_info, frameSet_info, frame_info, iFrame_info, marquee_info;
85 // FIXME: Might make sense to combine this with ClassInfo some day.
86 typedef JSValue *(JSHTMLElement::*GetterFunction)(ExecState *exec, int token) const;
87 typedef void (JSHTMLElement::*SetterFunction)(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
88 struct Accessors { GetterFunction m_getter; SetterFunction m_setter; };
89 const Accessors* accessors() const;
90 static const Accessors html_accessors, head_accessors, link_accessors, title_accessors,
91 meta_accessors, base_accessors, isIndex_accessors, style_accessors, body_accessors, form_accessors,
92 select_accessors, optGroup_accessors, option_accessors, input_accessors, textArea_accessors,
93 button_accessors, label_accessors, fieldSet_accessors, legend_accessors, ul_accessors, ol_accessors,
94 dl_accessors, dir_accessors, menu_accessors, li_accessors, div_accessors, p_accessors, heading_accessors,
95 blockQuote_accessors, q_accessors, pre_accessors, br_accessors, baseFont_accessors, font_accessors,
96 hr_accessors, mod_accessors, a_accessors, img_accessors, object_accessors, param_accessors,
97 applet_accessors, embed_accessors, map_accessors, area_accessors, script_accessors, table_accessors,
98 caption_accessors, col_accessors, tablesection_accessors, tr_accessors,
99 tablecell_accessors, frameSet_accessors, frame_accessors, iFrame_accessors, marquee_accessors;
101 JSValue *htmlGetter(ExecState* exec, int token) const;
102 void htmlSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
103 JSValue *headGetter(ExecState* exec, int token) const;
104 void headSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
105 JSValue *linkGetter(ExecState* exec, int token) const;
106 void linkSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
107 JSValue *titleGetter(ExecState* exec, int token) const;
108 void titleSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
109 JSValue *metaGetter(ExecState* exec, int token) const;
110 void metaSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
111 JSValue *baseGetter(ExecState* exec, int token) const;
112 void baseSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
113 JSValue *isIndexGetter(ExecState* exec, int token) const;
114 void isIndexSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
115 JSValue *styleGetter(ExecState* exec, int token) const;
116 void styleSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
117 JSValue *bodyGetter(ExecState* exec, int token) const;
118 void bodySetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
119 JSValue *formGetter(ExecState* exec, int token) const;
120 void formSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
121 JSValue *selectGetter(ExecState* exec, int token) const;
122 void selectSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
123 JSValue *optGroupGetter(ExecState* exec, int token) const;
124 void optGroupSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
125 JSValue *optionGetter(ExecState* exec, int token) const;
126 void optionSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
127 JSValue *inputGetter(ExecState* exec, int token) const;
128 void inputSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
129 JSValue *textAreaGetter(ExecState* exec, int token) const;
130 void textAreaSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
131 JSValue *buttonGetter(ExecState* exec, int token) const;
132 void buttonSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
133 JSValue *labelGetter(ExecState* exec, int token) const;
134 void labelSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
135 JSValue *fieldSetGetter(ExecState* exec, int token) const;
136 void fieldSetSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
137 JSValue *legendGetter(ExecState* exec, int token) const;
138 void legendSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
139 JSValue *uListGetter(ExecState* exec, int token) const;
140 void uListSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
141 JSValue *oListGetter(ExecState* exec, int token) const;
142 void oListSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
143 JSValue *dListGetter(ExecState* exec, int token) const;
144 void dListSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
145 JSValue *dirGetter(ExecState* exec, int token) const;
146 void dirSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
147 JSValue *menuGetter(ExecState* exec, int token) const;
148 void menuSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
149 JSValue *liGetter(ExecState* exec, int token) const;
150 void liSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
151 JSValue *divGetter(ExecState* exec, int token) const;
152 void divSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
153 JSValue *paragraphGetter(ExecState* exec, int token) const;
154 void paragraphSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
155 JSValue *headingGetter(ExecState* exec, int token) const;
156 void headingSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
157 JSValue *blockQuoteGetter(ExecState* exec, int token) const;
158 void blockQuoteSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
159 JSValue *quoteGetter(ExecState* exec, int token) const;
160 void quoteSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
161 JSValue *preGetter(ExecState* exec, int token) const;
162 void preSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
163 JSValue *brGetter(ExecState* exec, int token) const;
164 void brSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
165 JSValue *baseFontGetter(ExecState* exec, int token) const;
166 void baseFontSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
167 JSValue *fontGetter(ExecState* exec, int token) const;
168 void fontSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
169 JSValue *hrGetter(ExecState* exec, int token) const;
170 void hrSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
171 JSValue *modGetter(ExecState* exec, int token) const;
172 void modSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
173 JSValue *anchorGetter(ExecState* exec, int token) const;
174 void anchorSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
175 JSValue *imageGetter(ExecState* exec, int token) const;
176 void imageSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
177 JSValue *objectGetter(ExecState* exec, int token) const;
178 void objectSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
179 JSValue *paramGetter(ExecState* exec, int token) const;
180 void paramSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
181 JSValue *appletGetter(ExecState* exec, int token) const;
182 void appletSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
183 JSValue *embedGetter(ExecState*, int token) const;
184 void embedSetter(ExecState*, int token, JSValue*, const WebCore::String&);
185 JSValue *mapGetter(ExecState* exec, int token) const;
186 void mapSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
187 JSValue *areaGetter(ExecState* exec, int token) const;
188 void areaSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
189 JSValue *scriptGetter(ExecState* exec, int token) const;
190 void scriptSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
191 JSValue *tableGetter(ExecState* exec, int token) const;
192 void tableSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
193 JSValue *tableCaptionGetter(ExecState* exec, int token) const;
194 void tableCaptionSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
195 JSValue *tableColGetter(ExecState* exec, int token) const;
196 void tableColSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
197 JSValue *tableSectionGetter(ExecState* exec, int token) const;
198 void tableSectionSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
199 JSValue *tableRowGetter(ExecState* exec, int token) const;
200 void tableRowSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
201 JSValue *tableCellGetter(ExecState* exec, int token) const;
202 void tableCellSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
203 JSValue *frameSetGetter(ExecState* exec, int token) const;
204 void frameSetSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
205 JSValue *frameGetter(ExecState* exec, int token) const;
206 void frameSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
207 JSValue *iFrameGetter(ExecState* exec, int token) const;
208 void iFrameSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
209 JSValue *marqueeGetter(ExecState* exec, int token) const;
210 void marqueeSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
212 enum { HtmlVersion, HeadProfile, LinkHref, LinkRel, LinkMedia,
213 LinkCharset, LinkDisabled, LinkHrefLang, LinkRev, LinkTarget, LinkType,
214 LinkSheet, TitleText, MetaName, MetaHttpEquiv, MetaContent, MetaScheme,
215 BaseHref, BaseTarget, IsIndexForm, IsIndexPrompt, StyleDisabled,
216 StyleSheet, StyleType, StyleMedia, BodyBackground, BodyVLink, BodyText,
217 BodyLink, BodyALink, BodyBgColor, BodyScrollLeft, BodyScrollTop, BodyScrollHeight, BodyScrollWidth,
218 FormAction, FormEncType, FormElements, FormLength, FormAcceptCharset,
219 FormReset, FormTarget, FormName, FormMethod, FormSubmit, SelectAdd,
220 SelectTabIndex, SelectValue, SelectSelectedIndex, SelectLength,
221 SelectRemove, SelectForm, SelectBlur, SelectType, SelectOptions,
222 SelectDisabled, SelectMultiple, SelectName, SelectSize, SelectFocus,
223 OptGroupDisabled, OptGroupLabel, OptionIndex, OptionSelected,
224 OptionForm, OptionText, OptionDefaultSelected, OptionDisabled,
225 OptionLabel, OptionValue, InputBlur, InputReadOnly, InputAccept,
226 InputSize, InputDefaultValue, InputTabIndex, InputValue, InputType,
227 InputFocus, InputMaxLength, InputDefaultChecked, InputDisabled,
228 InputChecked, InputIndeterminate, InputForm, InputAccessKey, InputAlign, InputAlt,
229 InputName, InputSrc, InputUseMap, InputSelect, InputClick,
230 InputSelectionStart, InputSelectionEnd, InputSetSelectionRange,
231 TextAreaAccessKey, TextAreaName, TextAreaDefaultValue, TextAreaSelect, TextAreaSetSelectionRange,
232 TextAreaCols, TextAreaDisabled, TextAreaForm, TextAreaType,
233 TextAreaTabIndex, TextAreaReadOnly, TextAreaRows, TextAreaValue,
234 TextAreaSelectionStart, TextAreaSelectionEnd,
235 TextAreaBlur, TextAreaFocus, ButtonBlur, ButtonFocus, ButtonForm, ButtonTabIndex, ButtonName,
236 ButtonDisabled, ButtonAccessKey, ButtonType, ButtonValue, LabelHtmlFor,
237 LabelForm, LabelFocus, LabelAccessKey, FieldSetForm, LegendForm, LegendAccessKey,
238 LegendAlign, LegendFocus, UListType, UListCompact, OListStart, OListCompact,
239 OListType, DListCompact, DirectoryCompact, MenuCompact, LIType,
240 LIValue, DivAlign, ParagraphAlign, HeadingAlign, BlockQuoteCite,
241 QuoteCite, PreWidth, PreWrap, BRClear, BaseFontColor, BaseFontSize,
242 BaseFontFace, FontColor, FontSize, FontFace, HRWidth, HRNoShade,
243 HRAlign, HRSize, ModCite, ModDateTime, AnchorShape, AnchorRel,
244 AnchorAccessKey, AnchorCoords, AnchorHref, AnchorProtocol, AnchorHost,
245 AnchorCharset, AnchorHrefLang, AnchorHostname, AnchorType, AnchorFocus,
246 AnchorPort, AnchorPathName, AnchorHash, AnchorSearch, AnchorName,
247 AnchorRev, AnchorTabIndex, AnchorTarget, AnchorText, AnchorBlur, AnchorToString,
248 ImageName, ImageAlign, ImageHspace, ImageVspace, ImageUseMap, ImageAlt,
249 ImageLowSrc, ImageWidth, ImageIsMap, ImageBorder, ImageHeight, ImageComplete,
250 ImageLongDesc, ImageSrc, ImageX, ImageY, ObjectHspace, ObjectHeight, ObjectAlign,
251 ObjectBorder, ObjectCode, ObjectType, ObjectVspace, ObjectArchive,
252 ObjectDeclare, ObjectForm, ObjectCodeBase, ObjectCodeType, ObjectData,
253 ObjectName, ObjectStandby, ObjectTabIndex, ObjectUseMap, ObjectWidth, ObjectContentDocument,
254 ParamName, ParamType, ParamValueType, ParamValue, AppletArchive,
255 AppletAlt, AppletCode, AppletWidth, AppletAlign, AppletCodeBase,
256 AppletName, AppletHeight, AppletHspace, AppletObject, AppletVspace,
257 EmbedAlign, EmbedHeight, EmbedName, EmbedSrc, EmbedType, EmbedWidth,
258 MapAreas, MapName, AreaHash, AreaHref, AreaTarget, AreaPort, AreaShape,
259 AreaCoords, AreaAlt, AreaAccessKey, AreaNoHref, AreaHost, AreaProtocol,
260 AreaHostName, AreaPathName, AreaSearch, AreaTabIndex, ScriptEvent,
261 ScriptType, ScriptHtmlFor, ScriptText, ScriptSrc, ScriptCharset,
262 ScriptDefer, TableSummary, TableTBodies, TableTHead, TableCellPadding,
263 TableDeleteCaption, TableCreateCaption, TableCaption, TableWidth,
264 TableCreateTFoot, TableAlign, TableTFoot, TableDeleteRow,
265 TableCellSpacing, TableRows, TableBgColor, TableBorder, TableFrame,
266 TableRules, TableCreateTHead, TableDeleteTHead, TableDeleteTFoot,
267 TableInsertRow, TableCaptionAlign, TableColCh, TableColChOff,
268 TableColAlign, TableColSpan, TableColVAlign, TableColWidth,
269 TableSectionCh, TableSectionDeleteRow, TableSectionChOff,
270 TableSectionRows, TableSectionAlign, TableSectionVAlign,
271 TableSectionInsertRow, TableRowSectionRowIndex, TableRowRowIndex,
272 TableRowChOff, TableRowCells, TableRowVAlign, TableRowCh,
273 TableRowAlign, TableRowBgColor, TableRowDeleteCell, TableRowInsertCell,
274 TableCellColSpan, TableCellNoWrap, TableCellAbbr, TableCellHeight,
275 TableCellWidth, TableCellCellIndex, TableCellChOff, TableCellBgColor,
276 TableCellCh, TableCellVAlign, TableCellRowSpan, TableCellHeaders,
277 TableCellAlign, TableCellAxis, TableCellScope, FrameSetCols,
278 FrameSetRows, FrameSrc, FrameLocation, FrameFrameBorder, FrameScrolling,
279 FrameMarginWidth, FrameLongDesc, FrameMarginHeight, FrameName, FrameContentDocument, FrameContentWindow,
280 FrameNoResize, FrameWidth, FrameHeight, IFrameLongDesc, IFrameDocument, IFrameAlign,
281 IFrameFrameBorder, IFrameSrc, IFrameName, IFrameHeight,
282 IFrameMarginHeight, IFrameMarginWidth, IFrameScrolling, IFrameWidth, IFrameContentDocument, IFrameContentWindow,
283 MarqueeStart, MarqueeStop,
285 ElementInnerHTML, ElementTitle, ElementId, ElementDir, ElementLang,
286 ElementClassName, ElementInnerText, ElementDocument, ElementChildren, ElementContentEditable,
287 ElementIsContentEditable, ElementOuterHTML, ElementOuterText};
289 static JSValue *formIndexGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
290 static JSValue *formNameGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
291 static JSValue *selectIndexGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
292 static JSValue *framesetNameGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
293 static JSValue *frameWindowPropertyGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
294 static JSValue *runtimeObjectGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
295 static JSValue *runtimeObjectPropertyGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
298 WebCore::HTMLElement *toHTMLElement(JSValue *); // returns 0 if passed-in value is not a JSHTMLElement object
299 WebCore::HTMLTableCaptionElement *toHTMLTableCaptionElement(JSValue *); // returns 0 if passed-in value is not a JSHTMLElement object for a HTMLTableCaptionElement
300 WebCore::HTMLTableSectionElement *toHTMLTableSectionElement(JSValue *); // returns 0 if passed-in value is not a JSHTMLElement object for a HTMLTableSectionElement
302 class JSHTMLCollection : public DOMObject {
304 JSHTMLCollection(ExecState *exec, WebCore::HTMLCollection *c);
306 virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
307 virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List&args);
308 virtual bool implementsCall() const { return true; }
309 virtual bool toBoolean(ExecState *) const { return true; }
310 enum { Item, NamedItem, Tags };
311 JSValue *getNamedItems(ExecState *exec, const Identifier &propertyName) const;
312 virtual const ClassInfo* classInfo() const { return &info; }
313 static const ClassInfo info;
314 WebCore::HTMLCollection *impl() const { return m_impl.get(); }
316 RefPtr<WebCore::HTMLCollection> m_impl;
318 static JSValue *lengthGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
319 static JSValue *indexGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
320 static JSValue *nameGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
323 class JSHTMLSelectCollection : public JSHTMLCollection {
325 JSHTMLSelectCollection(ExecState *exec, WebCore::HTMLCollection *c, WebCore::HTMLSelectElement *e);
326 virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
327 virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
329 static JSValue *selectedIndexGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
331 RefPtr<WebCore::HTMLSelectElement> m_element;
334 class HTMLAllCollection : public JSHTMLCollection {
336 HTMLAllCollection(ExecState *exec, WebCore::HTMLCollection *c) :
337 JSHTMLCollection(exec, c) { }
338 virtual bool toBoolean(ExecState *) const { return false; }
339 virtual bool masqueradeAsUndefined() const { return true; }
342 ////////////////////// Option Object ////////////////////////
344 class OptionConstructorImp : public DOMObject {
346 OptionConstructorImp(ExecState *exec, WebCore::Document *d);
347 virtual bool implementsConstruct() const;
348 virtual JSObject *construct(ExecState *exec, const List &args);
350 RefPtr<WebCore::Document> m_doc;
353 ////////////////////// Image Object ////////////////////////
355 class ImageConstructorImp : public DOMObject {
357 ImageConstructorImp(ExecState *exec, WebCore::Document *d);
358 virtual bool implementsConstruct() const;
359 virtual JSObject *construct(ExecState *exec, const List &args);
361 RefPtr<WebCore::Document> m_doc;
364 JSValue *getHTMLCollection(ExecState *exec, WebCore::HTMLCollection *c);
365 JSValue *getSelectHTMLCollection(ExecState *exec, WebCore::HTMLCollection *c, WebCore::HTMLSelectElement *e);
366 JSValue *getAllHTMLCollection(ExecState *exec, WebCore::HTMLCollection *c);