2006-05-17 Eric Seidel <eseidel@apple.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 May 2006 00:44:11 +0000 (00:44 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 May 2006 00:44:11 +0000 (00:44 +0000)
        Reviewed by andersca.

        Autogenerate button, optgroup, option, input and textarea js bindings
        http://bugzilla.opendarwin.org/show_bug.cgi?id=8953

        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSHTMLElementWrapperFactory.cpp:
        (WebCore::createButtonWrapper):
        (WebCore::createInputWrapper):
        (WebCore::createOptGroupWrapper):
        (WebCore::createOptionWrapper):
        (WebCore::createTextAreaWrapper):
        (WebCore::createJSWrapper):
        * bindings/js/JSHTMLInputElementBase.cpp: Added.
        (WebCore::JSHTMLInputElementBaseProtoFunc::callAsFunction):
        (WebCore::):
        (WebCore::JSHTMLInputElementBase::JSHTMLInputElementBase):
        (WebCore::JSHTMLInputElementBase::getOwnPropertySlot):
        * bindings/js/JSHTMLInputElementBase.h: Added.
        (WebCore::JSHTMLInputElementBase::classInfo):
        (WebCore::JSHTMLInputElementBase::):
        (WebCore::JSHTMLInputElementBase::impl):
        * bindings/js/JSHTMLOptionElementConstructor.cpp: Added.
        (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
        (WebCore::JSHTMLOptionElementConstructor::implementsConstruct):
        (WebCore::JSHTMLOptionElementConstructor::construct):
        * bindings/js/JSHTMLOptionElementConstructor.h: Added.
        * bindings/js/kjs_domnode.h:
        * bindings/js/kjs_html.cpp:
        (KJS::):
        (KJS::JSHTMLElement::classInfo):
        (KJS::JSHTMLElement::accessors):
        (KJS::JSHTMLElement::getOwnPropertySlot):
        (KJS::HTMLElementFunction::callAsFunction):
        (KJS::JSHTMLElement::put):
        (KJS::JSHTMLElement::htmlSetter):
        * bindings/js/kjs_html.h:
        (KJS::JSHTMLElement::):
        * bindings/js/kjs_window.cpp:
        (KJS::Window::getValueProperty):
        * bindings/scripts/CodeGeneratorJS.pm:
        * html/HTMLButtonElement.idl: Added.
        * html/HTMLInputElement.idl: Added.
        * html/HTMLOptGroupElement.idl: Added.
        * html/HTMLOptionElement.idl: Added.
        * html/HTMLTextAreaElement.idl: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14453 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
LayoutTests/ChangeLog
WebCore/ChangeLog
WebCore/DerivedSources.make
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/JSHTMLElementWrapperFactory.cpp
WebCore/bindings/js/JSHTMLInputElementBase.cpp [new file with mode: 0644]
WebCore/bindings/js/JSHTMLInputElementBase.h [new file with mode: 0644]
WebCore/bindings/js/JSHTMLOptionElementConstructor.cpp [new file with mode: 0644]
WebCore/bindings/js/JSHTMLOptionElementConstructor.h [new file with mode: 0644]
WebCore/bindings/js/kjs_domnode.h
WebCore/bindings/js/kjs_html.cpp
WebCore/bindings/js/kjs_html.h
WebCore/bindings/js/kjs_window.cpp
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/html/HTMLButtonElement.idl [new file with mode: 0644]
WebCore/html/HTMLInputElement.idl [new file with mode: 0644]
WebCore/html/HTMLOptGroupElement.idl [new file with mode: 0644]
WebCore/html/HTMLOptionElement.idl [new file with mode: 0644]
WebCore/html/HTMLTextAreaElement.idl [new file with mode: 0644]

index 6961e41761866aff39203bbeb6b9986f8b01bbbb..95b6eee9f0338b49b822aae792e4f6098cc1690e 100644 (file)
@@ -1,3 +1,17 @@
+2006-05-17  Eric Seidel  <eseidel@apple.com>
+
+        Reviewed by andersca.
+        
+        Autogenerate more HTML js bindings.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=8953
+
+        * fast/dom/HTMLHtmlElement: Added.
+        * fast/dom/HTMLHtmlElement/set-version.html: Added.
+        * fast/dom/HTMLHtmlElement/set-version-expected.txt: Added.
+        * fast/dom/HTMLInputElement: Added.
+        * fast/dom/HTMLInputElement/size-as-number.html: Added.
+        * fast/dom/HTMLInputElement/size-as-number-expected.txt: Added.
+
 2006-05-17  Adele Peterson  <adele@apple.com>
 
         Reviewed by Hyatt.
index da56822c9beb34aea7f4c0dd6b12a9420ef2a13d..6682fc81d66e3792316441139f0e270b4fcea774 100644 (file)
@@ -1,3 +1,53 @@
+2006-05-17  Eric Seidel  <eseidel@apple.com>
+
+        Reviewed by andersca.
+
+        Autogenerate button, optgroup, option, input and textarea js bindings
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=8953
+
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSHTMLElementWrapperFactory.cpp:
+        (WebCore::createButtonWrapper):
+        (WebCore::createInputWrapper):
+        (WebCore::createOptGroupWrapper):
+        (WebCore::createOptionWrapper):
+        (WebCore::createTextAreaWrapper):
+        (WebCore::createJSWrapper):
+        * bindings/js/JSHTMLInputElementBase.cpp: Added.
+        (WebCore::JSHTMLInputElementBaseProtoFunc::callAsFunction):
+        (WebCore::):
+        (WebCore::JSHTMLInputElementBase::JSHTMLInputElementBase):
+        (WebCore::JSHTMLInputElementBase::getOwnPropertySlot):
+        * bindings/js/JSHTMLInputElementBase.h: Added.
+        (WebCore::JSHTMLInputElementBase::classInfo):
+        (WebCore::JSHTMLInputElementBase::):
+        (WebCore::JSHTMLInputElementBase::impl):
+        * bindings/js/JSHTMLOptionElementConstructor.cpp: Added.
+        (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
+        (WebCore::JSHTMLOptionElementConstructor::implementsConstruct):
+        (WebCore::JSHTMLOptionElementConstructor::construct):
+        * bindings/js/JSHTMLOptionElementConstructor.h: Added.
+        * bindings/js/kjs_domnode.h:
+        * bindings/js/kjs_html.cpp:
+        (KJS::):
+        (KJS::JSHTMLElement::classInfo):
+        (KJS::JSHTMLElement::accessors):
+        (KJS::JSHTMLElement::getOwnPropertySlot):
+        (KJS::HTMLElementFunction::callAsFunction):
+        (KJS::JSHTMLElement::put):
+        (KJS::JSHTMLElement::htmlSetter):
+        * bindings/js/kjs_html.h:
+        (KJS::JSHTMLElement::):
+        * bindings/js/kjs_window.cpp:
+        (KJS::Window::getValueProperty):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * html/HTMLButtonElement.idl: Added.
+        * html/HTMLInputElement.idl: Added.
+        * html/HTMLOptGroupElement.idl: Added.
+        * html/HTMLOptionElement.idl: Added.
+        * html/HTMLTextAreaElement.idl: Added.
+
 2006-05-17  Adele Peterson  <adele@apple.com>
 
         Reviewed by Hyatt.
index da67ed953cb5ce5073451f18633a8e43c6ec2eaa..5d9622f72b915d8c40fd268af0e1f36a3a47bf78 100644 (file)
@@ -62,14 +62,20 @@ all : \
     JSElement.h \
     JSEvent.h \
     JSEntity.h \
+    JSHTMLButtonElement.h \
     JSHTMLBaseElement.h \
     JSHTMLCanvasElement.h \
     JSHTMLDocument.h \
     JSHTMLElement.h \
     JSHTMLHeadElement.h \
+    JSHTMLInputElement.h \
+    JSHTMLInputElementBaseTable.cpp \
     JSHTMLLinkElement.h \
+    JSHTMLOptionElement.h \
+    JSHTMLOptGroupElement.h \
     JSHTMLMetaElement.h \
     JSHTMLStyleElement.h \
+    JSHTMLTextAreaElement.h \
     JSHTMLTitleElement.h \
     JSKeyboardEvent.h \
     JSMouseEvent.h \
index f84d7ccf82765df42902db26a08f796bc94a0dba..e09305e0d0d160b0d699c0f7df443830ecd7cfd3 100644 (file)
                A80E7B130A19D606007FB8C5 /* JSHTMLTitleElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E7B090A19D606007FB8C5 /* JSHTMLTitleElement.cpp */; };
                A80E7B140A19D606007FB8C5 /* JSHTMLHeadElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E7B0A0A19D606007FB8C5 /* JSHTMLHeadElement.cpp */; };
                A80E7B150A19D606007FB8C5 /* JSHTMLHeadElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E7B0B0A19D606007FB8C5 /* JSHTMLHeadElement.h */; };
+               A80E7E1A0A1A7CCB007FB8C5 /* HTMLTextAreaElement.idl in Resources */ = {isa = PBXBuildFile; fileRef = A80E7E160A1A7CCB007FB8C5 /* HTMLTextAreaElement.idl */; };
+               A80E7E1B0A1A7CCB007FB8C5 /* HTMLInputElement.idl in Resources */ = {isa = PBXBuildFile; fileRef = A80E7E170A1A7CCB007FB8C5 /* HTMLInputElement.idl */; };
+               A80E7E1C0A1A7CCB007FB8C5 /* HTMLOptionElement.idl in Resources */ = {isa = PBXBuildFile; fileRef = A80E7E180A1A7CCB007FB8C5 /* HTMLOptionElement.idl */; };
+               A80E7E1D0A1A7CCB007FB8C5 /* HTMLOptGroupElement.idl in Resources */ = {isa = PBXBuildFile; fileRef = A80E7E190A1A7CCB007FB8C5 /* HTMLOptGroupElement.idl */; };
+               A80E7E560A1A7FB3007FB8C5 /* HTMLButtonElement.idl in Resources */ = {isa = PBXBuildFile; fileRef = A80E7E550A1A7FB3007FB8C5 /* HTMLButtonElement.idl */; };
+               A80E7E650A1A82EC007FB8C5 /* JSHTMLInputElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E7E630A1A82EC007FB8C5 /* JSHTMLInputElementBase.h */; };
+               A80E7E660A1A82EC007FB8C5 /* JSHTMLInputElementBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E7E640A1A82EC007FB8C5 /* JSHTMLInputElementBase.cpp */; };
+               A80E7E970A1A83E3007FB8C5 /* JSHTMLInputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E7E8D0A1A83E3007FB8C5 /* JSHTMLInputElement.h */; };
+               A80E7E980A1A83E3007FB8C5 /* JSHTMLInputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E7E8E0A1A83E3007FB8C5 /* JSHTMLInputElement.cpp */; };
+               A80E7E990A1A83E3007FB8C5 /* JSHTMLOptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E7E8F0A1A83E3007FB8C5 /* JSHTMLOptionElement.h */; };
+               A80E7E9A0A1A83E3007FB8C5 /* JSHTMLOptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E7E900A1A83E3007FB8C5 /* JSHTMLOptionElement.cpp */; };
+               A80E7E9B0A1A83E3007FB8C5 /* JSHTMLOptGroupElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E7E910A1A83E3007FB8C5 /* JSHTMLOptGroupElement.h */; };
+               A80E7E9C0A1A83E3007FB8C5 /* JSHTMLOptGroupElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E7E920A1A83E3007FB8C5 /* JSHTMLOptGroupElement.cpp */; };
+               A80E7E9D0A1A83E3007FB8C5 /* JSHTMLTextAreaElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E7E930A1A83E3007FB8C5 /* JSHTMLTextAreaElement.h */; };
+               A80E7E9E0A1A83E3007FB8C5 /* JSHTMLTextAreaElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E7E940A1A83E3007FB8C5 /* JSHTMLTextAreaElement.cpp */; };
+               A80E7E9F0A1A83E3007FB8C5 /* JSHTMLButtonElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E7E950A1A83E3007FB8C5 /* JSHTMLButtonElement.h */; };
+               A80E7EA00A1A83E3007FB8C5 /* JSHTMLButtonElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E7E960A1A83E3007FB8C5 /* JSHTMLButtonElement.cpp */; };
                A81369CA097374F600D74463 /* HTMLIsIndexElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369AE097374F500D74463 /* HTMLIsIndexElement.h */; };
                A81369CB097374F600D74463 /* HTMLIsIndexElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81369AF097374F500D74463 /* HTMLIsIndexElement.cpp */; };
                A81369CC097374F600D74463 /* HTMLInputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369B0097374F500D74463 /* HTMLInputElement.h */; };
                A8239E0009B3CF8A00B60641 /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8239DFE09B3CF8A00B60641 /* Logging.cpp */; };
                A8239E0109B3CF8A00B60641 /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = A8239DFF09B3CF8A00B60641 /* Logging.h */; };
                A823A75C09B6E53900B60641 /* GraphicsContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A823A75B09B6E53900B60641 /* GraphicsContext.cpp */; };
+               A826E8AE0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A826E8AC0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h */; };
+               A826EC480A1B0CBE00CD1BB6 /* JSHTMLOptionElementConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A826E8AD0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.cpp */; };
                A86629CF09DA2B47009633A5 /* JSUIEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A86629C909DA2B47009633A5 /* JSUIEvent.h */; };
                A86629D009DA2B48009633A5 /* JSUIEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A86629CA09DA2B47009633A5 /* JSUIEvent.cpp */; };
                A86629D109DA2B48009633A5 /* JSMouseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A86629CB09DA2B47009633A5 /* JSMouseEvent.h */; };
                FAE04190097596C9000540BE /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE0418E097596C9000540BE /* SVGImageLoader.h */; };
 /* End PBXBuildFile section */
 
+/* Begin PBXBuildStyle section */
+               A826F3BF0A1BD11D00CD1BB6 /* Development */ = {
+                       isa = PBXBuildStyle;
+                       buildSettings = {
+                               COPY_PHASE_STRIP = NO;
+                       };
+                       name = Development;
+               };
+               A826F3C00A1BD11D00CD1BB6 /* Deployment */ = {
+                       isa = PBXBuildStyle;
+                       buildSettings = {
+                               COPY_PHASE_STRIP = YES;
+                       };
+                       name = Deployment;
+               };
+/* End PBXBuildStyle section */
+
 /* Begin PBXContainerItemProxy section */
                DD041FF009D9E3250010AF2A /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                A80E7B090A19D606007FB8C5 /* JSHTMLTitleElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLTitleElement.cpp; sourceTree = "<group>"; };
                A80E7B0A0A19D606007FB8C5 /* JSHTMLHeadElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLHeadElement.cpp; sourceTree = "<group>"; };
                A80E7B0B0A19D606007FB8C5 /* JSHTMLHeadElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLHeadElement.h; sourceTree = "<group>"; };
+               A80E7E160A1A7CCB007FB8C5 /* HTMLTextAreaElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLTextAreaElement.idl; sourceTree = "<group>"; };
+               A80E7E170A1A7CCB007FB8C5 /* HTMLInputElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLInputElement.idl; sourceTree = "<group>"; };
+               A80E7E180A1A7CCB007FB8C5 /* HTMLOptionElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLOptionElement.idl; sourceTree = "<group>"; };
+               A80E7E190A1A7CCB007FB8C5 /* HTMLOptGroupElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLOptGroupElement.idl; sourceTree = "<group>"; };
+               A80E7E550A1A7FB3007FB8C5 /* HTMLButtonElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLButtonElement.idl; sourceTree = "<group>"; };
+               A80E7E630A1A82EC007FB8C5 /* JSHTMLInputElementBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLInputElementBase.h; sourceTree = "<group>"; };
+               A80E7E640A1A82EC007FB8C5 /* JSHTMLInputElementBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLInputElementBase.cpp; sourceTree = "<group>"; };
+               A80E7E8D0A1A83E3007FB8C5 /* JSHTMLInputElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLInputElement.h; sourceTree = "<group>"; };
+               A80E7E8E0A1A83E3007FB8C5 /* JSHTMLInputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLInputElement.cpp; sourceTree = "<group>"; };
+               A80E7E8F0A1A83E3007FB8C5 /* JSHTMLOptionElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLOptionElement.h; sourceTree = "<group>"; };
+               A80E7E900A1A83E3007FB8C5 /* JSHTMLOptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOptionElement.cpp; sourceTree = "<group>"; };
+               A80E7E910A1A83E3007FB8C5 /* JSHTMLOptGroupElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLOptGroupElement.h; sourceTree = "<group>"; };
+               A80E7E920A1A83E3007FB8C5 /* JSHTMLOptGroupElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOptGroupElement.cpp; sourceTree = "<group>"; };
+               A80E7E930A1A83E3007FB8C5 /* JSHTMLTextAreaElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLTextAreaElement.h; sourceTree = "<group>"; };
+               A80E7E940A1A83E3007FB8C5 /* JSHTMLTextAreaElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLTextAreaElement.cpp; sourceTree = "<group>"; };
+               A80E7E950A1A83E3007FB8C5 /* JSHTMLButtonElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLButtonElement.h; sourceTree = "<group>"; };
+               A80E7E960A1A83E3007FB8C5 /* JSHTMLButtonElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLButtonElement.cpp; sourceTree = "<group>"; };
                A810E39308A4160F00333D98 /* KCanvasTreeDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasTreeDebug.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A810E39408A4160F00333D98 /* KCanvasTreeDebug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasTreeDebug.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8122C7E08D564B000844FA3 /* GetSVGDocument.idl */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; path = GetSVGDocument.idl; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8239DFE09B3CF8A00B60641 /* Logging.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Logging.cpp; sourceTree = "<group>"; };
                A8239DFF09B3CF8A00B60641 /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = "<group>"; };
                A823A75B09B6E53900B60641 /* GraphicsContext.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext.cpp; sourceTree = "<group>"; };
+               A826E8AC0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLOptionElementConstructor.h; sourceTree = "<group>"; };
+               A826E8AD0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOptionElementConstructor.cpp; sourceTree = "<group>"; };
                A82FC33B08CBB07C00EFEE23 /* SVGCursorElement.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGCursorElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A82FC33C08CBB07C00EFEE23 /* SVGCursorElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGCursorElement.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
                                14E8378D09F85D4F00B85AE4 /* JSEvent.h */,
                                A80E7B080A19D606007FB8C5 /* JSHTMLBaseElement.cpp */,
                                A80E7B070A19D606007FB8C5 /* JSHTMLBaseElement.h */,
+                               A80E7E960A1A83E3007FB8C5 /* JSHTMLButtonElement.cpp */,
+                               A80E7E950A1A83E3007FB8C5 /* JSHTMLButtonElement.h */,
                                938E665F09F09B81008A48EC /* JSHTMLCanvasElement.cpp */,
                                938E666109F09B87008A48EC /* JSHTMLCanvasElement.h */,
                                1A494E320A12358A00FDAFC1 /* JSHTMLDocument.cpp */,
                                1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */,
                                A80E7B0A0A19D606007FB8C5 /* JSHTMLHeadElement.cpp */,
                                A80E7B0B0A19D606007FB8C5 /* JSHTMLHeadElement.h */,
+                               A80E7E8E0A1A83E3007FB8C5 /* JSHTMLInputElement.cpp */,
+                               A80E7E8D0A1A83E3007FB8C5 /* JSHTMLInputElement.h */,
                                A80E7B060A19D606007FB8C5 /* JSHTMLLinkElement.cpp */,
                                A80E7B030A19D606007FB8C5 /* JSHTMLLinkElement.h */,
                                A80E7A150A19C3D6007FB8C5 /* JSHTMLMetaElement.cpp */,
                                A80E7A160A19C3D6007FB8C5 /* JSHTMLMetaElement.h */,
+                               A80E7E920A1A83E3007FB8C5 /* JSHTMLOptGroupElement.cpp */,
+                               A80E7E910A1A83E3007FB8C5 /* JSHTMLOptGroupElement.h */,
+                               A80E7E900A1A83E3007FB8C5 /* JSHTMLOptionElement.cpp */,
+                               A80E7E8F0A1A83E3007FB8C5 /* JSHTMLOptionElement.h */,
                                A80E7B050A19D606007FB8C5 /* JSHTMLStyleElement.cpp */,
                                A80E7B040A19D606007FB8C5 /* JSHTMLStyleElement.h */,
+                               A80E7E940A1A83E3007FB8C5 /* JSHTMLTextAreaElement.cpp */,
+                               A80E7E930A1A83E3007FB8C5 /* JSHTMLTextAreaElement.h */,
                                A80E7B090A19D606007FB8C5 /* JSHTMLTitleElement.cpp */,
                                A80E7B020A19D606007FB8C5 /* JSHTMLTitleElement.h */,
                                A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */,
                                A8CFF7A00A156978000A4234 /* HTMLBRElement.h */,
                                A81369B7097374F500D74463 /* HTMLButtonElement.cpp */,
                                A81369B6097374F500D74463 /* HTMLButtonElement.h */,
+                               A80E7E550A1A7FB3007FB8C5 /* HTMLButtonElement.idl */,
                                51F6A3D50663BF04004D2919 /* HTMLCanvasElement.cpp */,
                                51F6A3D60663BF04004D2919 /* HTMLCanvasElement.h */,
                                938E662509F09956008A48EC /* HTMLCanvasElement.idl */,
                                A8EA7D230A19385500A8EF5F /* HTMLImageLoader.h */,
                                A81369B1097374F500D74463 /* HTMLInputElement.cpp */,
                                A81369B0097374F500D74463 /* HTMLInputElement.h */,
+                               A80E7E170A1A7CCB007FB8C5 /* HTMLInputElement.idl */,
                                A81369AF097374F500D74463 /* HTMLIsIndexElement.cpp */,
                                A81369AE097374F500D74463 /* HTMLIsIndexElement.h */,
                                A81369C9097374F600D74463 /* HTMLKeygenElement.cpp */,
                                A8EA79E50A1916DF00A8EF5F /* HTMLOListElement.h */,
                                A81369C3097374F500D74463 /* HTMLOptGroupElement.cpp */,
                                A81369C2097374F500D74463 /* HTMLOptGroupElement.h */,
+                               A80E7E190A1A7CCB007FB8C5 /* HTMLOptGroupElement.idl */,
                                A81369C1097374F500D74463 /* HTMLOptionElement.cpp */,
                                A81369C0097374F500D74463 /* HTMLOptionElement.h */,
+                               A80E7E180A1A7CCB007FB8C5 /* HTMLOptionElement.idl */,
                                9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */,
                                A81369BE097374F500D74463 /* HTMLOptionsCollection.h */,
                                A8EA7CA40A192B9C00A8EF5F /* HTMLParagraphElement.cpp */,
                                A871DB170A150BD600B12A68 /* HTMLTableSectionElement.h */,
                                A81369BB097374F500D74463 /* HTMLTextAreaElement.cpp */,
                                A81369BA097374F500D74463 /* HTMLTextAreaElement.h */,
+                               A80E7E160A1A7CCB007FB8C5 /* HTMLTextAreaElement.idl */,
                                AB23A31009BBA7760067CC53 /* HTMLTextFieldInnerElement.cpp */,
                                AB23A31109BBA7760067CC53 /* HTMLTextFieldInnerElement.h */,
                                A871DC1D0A15205700B12A68 /* HTMLTitleElement.cpp */,
                                93B70D4009EB0C7C009D8468 /* JSDOMParser.h */,
                                938E65F609F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp */,
                                938E65F009F09840008A48EC /* JSHTMLElementWrapperFactory.h */,
+                               A80E7E640A1A82EC007FB8C5 /* JSHTMLInputElementBase.cpp */,
+                               A80E7E630A1A82EC007FB8C5 /* JSHTMLInputElementBase.h */,
+                               A826E8AD0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.cpp */,
+                               A826E8AC0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h */,
                                93B70D4109EB0C7C009D8468 /* JSXMLHttpRequest.cpp */,
                                93B70D4209EB0C7C009D8468 /* JSXMLHttpRequest.h */,
                                93B70D4309EB0C7C009D8468 /* JSXMLSerializer.cpp */,
                                A80E7B0E0A19D606007FB8C5 /* JSHTMLStyleElement.h in Headers */,
                                A80E7B110A19D606007FB8C5 /* JSHTMLBaseElement.h in Headers */,
                                A80E7B150A19D606007FB8C5 /* JSHTMLHeadElement.h in Headers */,
+                               A80E7E650A1A82EC007FB8C5 /* JSHTMLInputElementBase.h in Headers */,
+                               A80E7E970A1A83E3007FB8C5 /* JSHTMLInputElement.h in Headers */,
+                               A80E7E990A1A83E3007FB8C5 /* JSHTMLOptionElement.h in Headers */,
+                               A80E7E9B0A1A83E3007FB8C5 /* JSHTMLOptGroupElement.h in Headers */,
+                               A80E7E9D0A1A83E3007FB8C5 /* JSHTMLTextAreaElement.h in Headers */,
+                               A80E7E9F0A1A83E3007FB8C5 /* JSHTMLButtonElement.h in Headers */,
+                               A826E8AE0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
+                       buildSettings = {
+                       };
+                       buildStyles = (
+                               A826F3BF0A1BD11D00CD1BB6 /* Development */,
+                               A826F3C00A1BD11D00CD1BB6 /* Deployment */,
+                       );
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                                A80E7AB50A19D1F1007FB8C5 /* HTMLLinkElement.idl in Resources */,
                                A80E7AB60A19D1F1007FB8C5 /* HTMLHeadElement.idl in Resources */,
                                A80E7AB70A19D1F1007FB8C5 /* HTMLStyleElement.idl in Resources */,
+                               A80E7E1A0A1A7CCB007FB8C5 /* HTMLTextAreaElement.idl in Resources */,
+                               A80E7E1B0A1A7CCB007FB8C5 /* HTMLInputElement.idl in Resources */,
+                               A80E7E1C0A1A7CCB007FB8C5 /* HTMLOptionElement.idl in Resources */,
+                               A80E7E1D0A1A7CCB007FB8C5 /* HTMLOptGroupElement.idl in Resources */,
+                               A80E7E560A1A7FB3007FB8C5 /* HTMLButtonElement.idl in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                A80E7B120A19D606007FB8C5 /* JSHTMLBaseElement.cpp in Sources */,
                                A80E7B130A19D606007FB8C5 /* JSHTMLTitleElement.cpp in Sources */,
                                A80E7B140A19D606007FB8C5 /* JSHTMLHeadElement.cpp in Sources */,
+                               A80E7E660A1A82EC007FB8C5 /* JSHTMLInputElementBase.cpp in Sources */,
+                               A80E7E980A1A83E3007FB8C5 /* JSHTMLInputElement.cpp in Sources */,
+                               A80E7E9A0A1A83E3007FB8C5 /* JSHTMLOptionElement.cpp in Sources */,
+                               A80E7E9C0A1A83E3007FB8C5 /* JSHTMLOptGroupElement.cpp in Sources */,
+                               A80E7E9E0A1A83E3007FB8C5 /* JSHTMLTextAreaElement.cpp in Sources */,
+                               A80E7EA00A1A83E3007FB8C5 /* JSHTMLButtonElement.cpp in Sources */,
+                               A826EC480A1B0CBE00CD1BB6 /* JSHTMLOptionElementConstructor.cpp in Sources */,
                                BC6DB4740A1A90FB00E5CD14 /* GlyphMap.cpp in Sources */,
                                BC6DB4D40A1AFEEF00E5CD14 /* GlyphMapMac.cpp in Sources */,
                                1A9EF4570A1B957D00332B63 /* JSCanvasRenderingContext2DCustom.cpp in Sources */,
index a57160409d5cffda9b06fd5a4746bf2980effde0..33c2d5f15e75aafbda249089bf235be96495def5 100644 (file)
 #include "JSHTMLElementWrapperFactory.h"
 
 #include "HTMLBaseElement.h"
+#include "HTMLButtonElement.h"
 #include "HTMLCanvasElement.h"
 #include "HTMLHeadElement.h"
+#include "HTMLInputElement.h"
 #include "HTMLLinkElement.h"
 #include "HTMLMetaElement.h"
+#include "HTMLOptGroupElement.h"
+#include "HTMLOptionElement.h"
 #include "HTMLStyleElement.h"
+#include "HTMLTextAreaElement.h"
 #include "HTMLTitleElement.h"
+
 #include "HTMLNames.h"
+
 #include "JSHTMLBaseElement.h"
+#include "JSHTMLButtonElement.h"
 #include "JSHTMLCanvasElement.h"
 #include "JSHTMLHeadElement.h"
+#include "JSHTMLInputElement.h"
 #include "JSHTMLLinkElement.h"
 #include "JSHTMLMetaElement.h"
+#include "JSHTMLOptGroupElement.h"
+#include "JSHTMLOptionElement.h"
 #include "JSHTMLStyleElement.h"
+#include "JSHTMLTextAreaElement.h"
 #include "JSHTMLTitleElement.h"
+
 #include "kjs_html.h"
 
 using namespace KJS;
 
+// FIXME: Eventually this file should be autogenerated, just like HTMLNames, HTMLElementFactory, etc.
+
 namespace WebCore {
 
 using namespace HTMLNames;
@@ -49,6 +64,11 @@ static DOMNode* createBaseWrapper(ExecState* exec, PassRefPtr<HTMLElement> eleme
     return new JSHTMLBaseElement(exec, static_cast<HTMLBaseElement*>(element.get()));
 }
 
+static DOMNode* createButtonWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
+{
+    return new JSHTMLButtonElement(exec, static_cast<HTMLButtonElement*>(element.get()));
+}
+
 static DOMNode* createCanvasWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
 {
     return new JSHTMLCanvasElement(exec, static_cast<HTMLCanvasElement*>(element.get()));
@@ -64,16 +84,36 @@ static DOMNode* createLinkWrapper(ExecState* exec, PassRefPtr<HTMLElement> eleme
     return new JSHTMLLinkElement(exec, static_cast<HTMLLinkElement*>(element.get()));
 }
 
+static DOMNode* createInputWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
+{
+    return new JSHTMLInputElement(exec, static_cast<HTMLInputElement*>(element.get()));
+}
+
 static DOMNode* createMetaWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
 {
     return new JSHTMLMetaElement(exec, static_cast<HTMLMetaElement*>(element.get()));
 }
 
+static DOMNode* createOptGroupWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
+{
+    return new JSHTMLOptGroupElement(exec, static_cast<HTMLOptGroupElement*>(element.get()));
+}
+
+static DOMNode* createOptionWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
+{
+    return new JSHTMLOptionElement(exec, static_cast<HTMLOptionElement*>(element.get()));
+}
+
 static DOMNode* createStyleWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
 {
     return new JSHTMLStyleElement(exec, static_cast<HTMLStyleElement*>(element.get()));
 }
 
+static DOMNode* createTextAreaWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
+{
+    return new JSHTMLTextAreaElement(exec, static_cast<HTMLTextAreaElement*>(element.get()));
+}
+
 static DOMNode* createTitleWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
 {
     return new JSHTMLTitleElement(exec, static_cast<HTMLTitleElement*>(element.get()));
@@ -84,11 +124,16 @@ DOMNode* createJSWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
     static HashMap<WebCore::AtomicStringImpl*, CreateHTMLElementWrapperFunction> map;
     if (map.isEmpty()) {
         map.set(baseTag.localName().impl(), createBaseWrapper);
+        map.set(buttonTag.localName().impl(), createButtonWrapper);
         map.set(canvasTag.localName().impl(), createCanvasWrapper);
         map.set(headTag.localName().impl(), createHeadWrapper);
+        map.set(inputTag.localName().impl(), createInputWrapper);
         map.set(linkTag.localName().impl(), createLinkWrapper);
         map.set(metaTag.localName().impl(), createMetaWrapper);
+        map.set(optgroupTag.localName().impl(), createOptGroupWrapper);
+        map.set(optionTag.localName().impl(), createOptionWrapper);
         map.set(styleTag.localName().impl(), createStyleWrapper);
+        map.set(textareaTag.localName().impl(), createTextAreaWrapper);
         map.set(titleTag.localName().impl(), createTitleWrapper);
     }
     CreateHTMLElementWrapperFunction f = map.get(element->localName().impl());
diff --git a/WebCore/bindings/js/JSHTMLInputElementBase.cpp b/WebCore/bindings/js/JSHTMLInputElementBase.cpp
new file mode 100644 (file)
index 0000000..2e61fc1
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "JSHTMLInputElementBase.h"
+
+#include "HTMLInputElement.h"
+
+#include "JSHTMLInputElementBaseTable.cpp"
+
+using namespace KJS;
+
+namespace WebCore {
+
+/*
+@begin JSHTMLInputElementBaseTable 3
+  selectionStart        WebCore::JSHTMLInputElementBase::SelectionStart            DontDelete
+  selectionEnd          WebCore::JSHTMLInputElementBase::SelectionEnd              DontDelete
+@end
+@begin JSHTMLInputElementBaseProtoTable 0
+@end
+@begin JSHTMLInputElementBaseFunctionTable 1
+  setSelectionRange     WebCore::JSHTMLInputElementBase::SetSelectionRange         DontDelete|Function 2
+@end
+*/
+
+KJS_IMPLEMENT_PROTOFUNC(JSHTMLInputElementBaseProtoFunc)
+KJS_IMPLEMENT_PROTOTYPE("JSHTMLInputElementBase", JSHTMLInputElementBaseProto, JSHTMLInputElementBaseProtoFunc)
+
+JSValue* JSHTMLInputElementBaseProtoFunc::callAsFunction(ExecState*, JSObject*, const List&)
+{
+    return 0;
+}
+
+// SetSelectionRange is implemented on the class instead of on the prototype, intentionally.
+class JSHTMLInputElementBaseFunction : public InternalFunctionImp {
+public:
+    JSHTMLInputElementBaseFunction(ExecState*, int i, int len, const Identifier& name);
+    virtual JSValue *callAsFunction(ExecState*, JSObject* thisObj, const List& args);
+private:
+    int m_id;
+};
+
+JSHTMLInputElementBaseFunction::JSHTMLInputElementBaseFunction(ExecState* exec, int i, int len, const Identifier& name)
+    : InternalFunctionImp(static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype()), name)
+    , m_id(i)
+{
+    put(exec, lengthPropertyName, jsNumber(len), DontDelete|ReadOnly|DontEnum);
+}
+
+JSValue* JSHTMLInputElementBaseFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
+{
+    HTMLInputElement& input = *static_cast<HTMLInputElement*>(static_cast<JSHTMLInputElementBase*>(thisObj)->impl());
+    if (m_id == JSHTMLInputElementBase::SetSelectionRange) {
+        input.setSelectionRange(args[0]->toInt32(exec), args[1]->toInt32(exec));
+        return jsUndefined();
+    }
+    return jsUndefined();
+}
+
+const ClassInfo JSHTMLInputElementBase::info = { "JSHTMLInputElementBase", &KJS::JSHTMLElement::info, &JSHTMLInputElementBaseTable, 0 };
+
+JSHTMLInputElementBase::JSHTMLInputElementBase(ExecState* exec, PassRefPtr<HTMLInputElement> e)
+    : KJS::JSHTMLElement(exec, e.get())
+{
+    // We don't really need a prototype, just use our parent class's proto
+    setPrototype(KJS::JSHTMLElementProto::self(exec));
+}
+
+bool JSHTMLInputElementBase::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+    HTMLInputElement& input = *static_cast<HTMLInputElement*>(impl());
+    
+    // if this element doesn't support selection, we have nothing to do, try our parent
+    if (!input.canHaveSelection())
+        return KJS::JSHTMLElement::getOwnPropertySlot(exec, propertyName, slot);
+    
+    // otherwise, do our own function lookup on our function table
+    const HashEntry* entry = Lookup::findEntry(&JSHTMLInputElementBaseFunctionTable, propertyName);
+    if (entry && (entry->value == SetSelectionRange)) {
+        slot.setStaticEntry(this, entry, staticFunctionGetter<JSHTMLInputElementBaseFunction>); 
+        return true;
+    }
+    ASSERT(!entry);
+    
+    // finally try value lookup or walk the parent chain
+    return getStaticValueSlot<JSHTMLInputElementBase, KJS::JSHTMLElement>(exec, &JSHTMLInputElementBaseTable, this, propertyName, slot);
+}
+
+JSValue* JSHTMLInputElementBase::getValueProperty(ExecState* exec, int token) const
+{
+    HTMLInputElement& input = *static_cast<HTMLInputElement*>(impl());
+    ASSERT(input.canHaveSelection());
+    switch (token) {
+    case SelectionStart:
+        return jsNumber(input.selectionStart());
+    case SelectionEnd:
+        return jsNumber(input.selectionEnd());
+    }
+    ASSERT_NOT_REACHED();
+    return jsUndefined();
+}
+
+void JSHTMLInputElementBase::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
+{
+    lookupPut<JSHTMLInputElementBase, KJS::JSHTMLElement>(exec, propertyName, value, attr, &JSHTMLInputElementBaseTable, this);
+}
+
+void JSHTMLInputElementBase::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
+{
+    HTMLInputElement& input = *static_cast<HTMLInputElement*>(impl());
+    ASSERT(input.canHaveSelection());
+    switch (token) {
+    case SelectionStart:
+        input.setSelectionStart(value->toInt32(exec));
+        return;
+    case SelectionEnd:
+        input.setSelectionEnd(value->toInt32(exec));
+        return;
+    }
+    ASSERT_NOT_REACHED();
+}
+
+}
diff --git a/WebCore/bindings/js/JSHTMLInputElementBase.h b/WebCore/bindings/js/JSHTMLInputElementBase.h
new file mode 100644 (file)
index 0000000..e802734
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef JSHTMLInputElementBase_H
+#define JSHTMLInputElementBase_H
+
+#include "kjs_html.h"
+#include "kjs_binding.h"
+
+namespace WebCore {
+
+    class HTMLInputElement;
+
+    KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(JSHTMLInputElementBaseProto, KJS::JSHTMLElementProto)
+
+    class JSHTMLInputElementBase : public KJS::JSHTMLElement {
+    public:
+        JSHTMLInputElementBase(KJS::ExecState*, PassRefPtr<HTMLInputElement>);
+        virtual bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&);
+        KJS::JSValue* getValueProperty(KJS::ExecState*, int token) const;
+        virtual void put(KJS::ExecState*, const KJS::Identifier& propertyName, JSValue*, int attr);
+        void putValueProperty(KJS::ExecState*, int token, KJS::JSValue*, int attr);
+        virtual const KJS::ClassInfo* classInfo() const { return &info; }
+        static const KJS::ClassInfo info;
+        enum { SetSelectionRange, SelectionStart, SelectionEnd };
+    };
+}
+
+#endif
diff --git a/WebCore/bindings/js/JSHTMLOptionElementConstructor.cpp b/WebCore/bindings/js/JSHTMLOptionElementConstructor.cpp
new file mode 100644 (file)
index 0000000..430dfa5
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "JSHTMLOptionElementConstructor.h"
+
+#include "Document.h"
+#include "HTMLOptionElement.h"
+#include "JSHTMLOptionElement.h"
+#include "Text.h"
+
+using namespace KJS;
+
+namespace WebCore {
+
+JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor(ExecState* exec, Document* d)
+    : m_doc(d)
+{
+    put(exec, lengthPropertyName, jsNumber(4), ReadOnly|DontDelete|DontEnum);
+}
+
+bool JSHTMLOptionElementConstructor::implementsConstruct() const
+{
+    return true;
+}
+
+JSObject* JSHTMLOptionElementConstructor::construct(ExecState* exec, const List& args)
+{
+    int exception = 0;
+    RefPtr<Element> el(m_doc->createElement("option", exception));
+    HTMLOptionElement* opt = 0;
+    if (el) {
+        opt = static_cast<HTMLOptionElement*>(el.get());
+        int sz = args.size();
+        RefPtr<Text> text = m_doc->createTextNode("");
+        opt->appendChild(text, exception);
+        if (exception == 0 && sz > 0)
+            text->setData(args[0]->toString(exec), exception);
+        if (exception == 0 && sz > 1)
+            opt->setValue(args[1]->toString(exec));
+        if (exception == 0 && sz > 2)
+            opt->setDefaultSelected(args[2]->toBoolean(exec));
+        if (exception == 0 && sz > 3)
+            opt->setSelected(args[3]->toBoolean(exec));
+    }
+
+    setDOMException(exec, exception);
+    return static_cast<JSObject*>(toJS(exec, opt));
+}
+
+}
diff --git a/WebCore/bindings/js/JSHTMLOptionElementConstructor.h b/WebCore/bindings/js/JSHTMLOptionElementConstructor.h
new file mode 100644 (file)
index 0000000..3564124
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef JSHTMLOptionElementConstructor_H
+#define JSHTMLOptionElementConstructor_H
+
+#include "kjs_binding.h"
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+    class JSHTMLOptionElementConstructor : public KJS::DOMObject {
+    public:
+        JSHTMLOptionElementConstructor(KJS::ExecState*, Document*);
+        virtual bool implementsConstruct() const;
+        virtual KJS::JSObject *construct(KJS::ExecState*, const KJS::List& args);
+    private:
+        RefPtr<Document> m_doc;
+    };
+
+}
+
+#endif
index b6b3b08364ed669813f6f4df76901f45ac5be6ec..948bc492dad048b6b8c9867a9c9df557041f20d3 100644 (file)
@@ -35,18 +35,18 @@ KJS_DEFINE_PROTOTYPE(DOMNodeProto)
 class DOMNode : public DOMObject {
 public:
     virtual ~DOMNode();
-    virtual bool toBoolean(ExecState *) const;
-    virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
-    JSValue *getValueProperty(ExecState *exec, int token) const;
+    virtual bool toBoolean(ExecState*) const;
+    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+    JSValue *getValueProperty(ExecState*, int token) const;
     virtual void mark();
-    virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
-    void putValueProperty(ExecState *exec, int token, JSValue *value, int attr);
+    virtual void put(ExecState*, const Identifier &propertyName, JSValue*, int attr = None);
+    void putValueProperty(ExecState*, int token, JSValue*, int attr);
     WebCore::Node *impl() const { return m_impl.get(); }
     virtual const ClassInfo* classInfo() const { return &info; }
     static const ClassInfo info;
     
-    virtual JSValue *toPrimitive(ExecState *exec, JSType preferred = UndefinedType) const;
-    virtual UString toString(ExecState *exec) const;
+    virtual JSValue *toPrimitive(ExecState*, JSType preferred = UndefinedType) const;
+    virtual UString toString(ExecState*) const;
     
     enum { NodeName, NodeValue, NodeType, ParentNode, ParentElement,
         ChildNodes, FirstChild, LastChild, PreviousSibling, NextSibling, Item,
@@ -63,7 +63,7 @@ private:
     // Don't use this class directly -- use JSNode instead
     friend class WebCore::JSNode;
     DOMNode();
-    DOMNode(ExecState *exec, WebCore::Node *n);
+    DOMNode(ExecState*, WebCore::Node *n);
     DOMNode(WebCore::Node *n);
 };
 
index 9b51b63ede33fd008de60f1eb8e654befa1838e3..51f2cee6fb1dc2dddeeddb353d020e67e29a945e 100644 (file)
 #include "HTMLAnchorElement.h"
 #include "HTMLAppletElement.h"
 #include "HTMLAreaElement.h"
-#include "HTMLBaseElement.h"
 #include "HTMLBaseFontElement.h"
 #include "HTMLBlockquoteElement.h"
 #include "HTMLBodyElement.h"
 #include "HTMLBRElement.h"
-#include "HTMLButtonElement.h"
 #include "HTMLDirectoryElement.h"
 #include "HTMLDivElement.h"
 #include "HTMLDListElement.h"
@@ -43,7 +41,6 @@
 #include "HTMLFontElement.h"
 #include "HTMLFormElement.h"
 #include "HTMLFrameSetElement.h"
-#include "HTMLHeadElement.h"
 #include "HTMLHeadingElement.h"
 #include "HTMLHRElement.h"
 #include "HTMLHtmlElement.h"
 #include "HTMLLabelElement.h"
 #include "HTMLLegendElement.h"
 #include "HTMLLIElement.h"
-#include "HTMLLinkElement.h"
 #include "HTMLMapElement.h"
 #include "HTMLMenuElement.h"
-#include "HTMLMetaElement.h"
 #include "HTMLModElement.h"
 #include "HTMLNames.h"
 #include "HTMLObjectElement.h"
 #include "HTMLOListElement.h"
-#include "HTMLOptGroupElement.h"
 #include "HTMLOptionElement.h"
 #include "HTMLOptionsCollection.h"
 #include "HTMLParagraphElement.h"
 #include "HTMLPreElement.h"
 #include "HTMLScriptElement.h"
 #include "HTMLSelectElement.h"
-#include "HTMLStyleElement.h"
 #include "HTMLTableCaptionElement.h"
 #include "HTMLTableCellElement.h"
 #include "HTMLTableColElement.h"
 #include "HTMLTableElement.h"
 #include "HTMLTableRowElement.h"
 #include "HTMLTableSectionElement.h"
-#include "HTMLTextAreaElement.h"
-#include "HTMLTitleElement.h"
 #include "HTMLQuoteElement.h"
 #include "HTMLUListElement.h"
 #include "NameNodeList.h"
@@ -466,7 +457,6 @@ const ClassInfo JSHTMLElement::baseFont_info = { "HTMLBaseFontElement", &JSHTMLE
 const ClassInfo JSHTMLElement::blockQuote_info = { "HTMLBlockQuoteElement", &JSHTMLElement::info, &HTMLBlockQuoteElementTable, 0 };
 const ClassInfo JSHTMLElement::body_info = { "HTMLBodyElement", &JSHTMLElement::info, &HTMLBodyElementTable, 0 };
 const ClassInfo JSHTMLElement::br_info = { "HTMLBRElement", &JSHTMLElement::info, &HTMLBRElementTable, 0 };
-const ClassInfo JSHTMLElement::button_info = { "HTMLButtonElement", &JSHTMLElement::info, &HTMLButtonElementTable, 0 };
 const ClassInfo JSHTMLElement::caption_info = { "HTMLTableCaptionElement", &JSHTMLElement::info, &HTMLTableCaptionElementTable, 0 };
 const ClassInfo JSHTMLElement::col_info = { "HTMLTableColElement", &JSHTMLElement::info, &HTMLTableColElementTable, 0 };
 const ClassInfo JSHTMLElement::dir_info = { "HTMLDirectoryElement", &JSHTMLElement::info, &HTMLDirectoryElementTable, 0 };
@@ -484,7 +474,6 @@ const ClassInfo JSHTMLElement::html_info = { "HTMLHtmlElement", &JSHTMLElement::
 const ClassInfo JSHTMLElement::iFrame_info = { "HTMLIFrameElement", &JSHTMLElement::info, &HTMLIFrameElementTable, 0 };
 const ClassInfo JSHTMLElement::img_info = { "HTMLImageElement", &JSHTMLElement::info, &HTMLImageElementTable, 0 };
 const ClassInfo JSHTMLElement::info = { "HTMLElement", &JSElement::info, &HTMLElementTable, 0 };
-const ClassInfo JSHTMLElement::input_info = { "HTMLInputElement", &JSHTMLElement::info, &HTMLInputElementTable, 0 };
 const ClassInfo JSHTMLElement::isIndex_info = { "HTMLIsIndexElement", &JSHTMLElement::info, &HTMLIsIndexElementTable, 0 };
 const ClassInfo JSHTMLElement::label_info = { "HTMLLabelElement", &JSHTMLElement::info, &HTMLLabelElementTable, 0 };
 const ClassInfo JSHTMLElement::legend_info = { "HTMLLegendElement", &JSHTMLElement::info, &HTMLLegendElementTable, 0 };
@@ -495,8 +484,6 @@ const ClassInfo JSHTMLElement::menu_info = { "HTMLMenuElement", &JSHTMLElement::
 const ClassInfo JSHTMLElement::mod_info = { "HTMLModElement", &JSHTMLElement::info, &HTMLModElementTable, 0 };
 const ClassInfo JSHTMLElement::object_info = { "HTMLObjectElement", &JSHTMLElement::info, &HTMLObjectElementTable, 0 };
 const ClassInfo JSHTMLElement::ol_info = { "HTMLOListElement", &JSHTMLElement::info, &HTMLOListElementTable, 0 };
-const ClassInfo JSHTMLElement::optGroup_info = { "HTMLOptGroupElement", &JSHTMLElement::info, &HTMLOptGroupElementTable, 0 };
-const ClassInfo JSHTMLElement::option_info = { "HTMLOptionElement", &JSHTMLElement::info, &HTMLOptionElementTable, 0 };
 const ClassInfo JSHTMLElement::p_info = { "HTMLParagraphElement", &JSHTMLElement::info, &HTMLParagraphElementTable, 0 };
 const ClassInfo JSHTMLElement::param_info = { "HTMLParamElement", &JSHTMLElement::info, &HTMLParamElementTable, 0 };
 const ClassInfo JSHTMLElement::pre_info = { "HTMLPreElement", &JSHTMLElement::info, &HTMLPreElementTable, 0 };
@@ -506,7 +493,6 @@ const ClassInfo JSHTMLElement::select_info = { "HTMLSelectElement", &JSHTMLEleme
 const ClassInfo JSHTMLElement::table_info = { "HTMLTableElement", &JSHTMLElement::info, &HTMLTableElementTable, 0 };
 const ClassInfo JSHTMLElement::tablecell_info = { "HTMLTableCellElement", &JSHTMLElement::info, &HTMLTableCellElementTable, 0 };
 const ClassInfo JSHTMLElement::tablesection_info = { "HTMLTableSectionElement", &JSHTMLElement::info, &HTMLTableSectionElementTable, 0 };
-const ClassInfo JSHTMLElement::textArea_info = { "HTMLTextAreaElement", &JSHTMLElement::info, &HTMLTextAreaElementTable, 0 };
 const ClassInfo JSHTMLElement::tr_info = { "HTMLTableRowElement", &JSHTMLElement::info, &HTMLTableRowElementTable, 0 };
 const ClassInfo JSHTMLElement::ul_info = { "HTMLUListElement", &JSHTMLElement::info, &HTMLUListElementTable, 0 };
 
@@ -520,7 +506,6 @@ const ClassInfo* JSHTMLElement::classInfo() const
         classInfoMap.set(blockquoteTag.localName().impl(), &blockQuote_info);
         classInfoMap.set(bodyTag.localName().impl(), &body_info);
         classInfoMap.set(brTag.localName().impl(), &br_info);
-        classInfoMap.set(buttonTag.localName().impl(), &button_info);
         classInfoMap.set(captionTag.localName().impl(), &caption_info);
         classInfoMap.set(colTag.localName().impl(), &col_info);
         classInfoMap.set(colgroupTag.localName().impl(), &col_info);
@@ -544,7 +529,6 @@ const ClassInfo* JSHTMLElement::classInfo() const
         classInfoMap.set(htmlTag.localName().impl(), &html_info);
         classInfoMap.set(iframeTag.localName().impl(), &iFrame_info);
         classInfoMap.set(imgTag.localName().impl(), &img_info);
-        classInfoMap.set(inputTag.localName().impl(), &input_info);
         classInfoMap.set(insTag.localName().impl(), &mod_info);
         classInfoMap.set(isindexTag.localName().impl(), &isIndex_info);
         classInfoMap.set(labelTag.localName().impl(), &label_info);
@@ -556,8 +540,6 @@ const ClassInfo* JSHTMLElement::classInfo() const
         classInfoMap.set(menuTag.localName().impl(), &menu_info);
         classInfoMap.set(objectTag.localName().impl(), &object_info);
         classInfoMap.set(olTag.localName().impl(), &ol_info);
-        classInfoMap.set(optgroupTag.localName().impl(), &optGroup_info);
-        classInfoMap.set(optionTag.localName().impl(), &option_info);
         classInfoMap.set(pTag.localName().impl(), &p_info);
         classInfoMap.set(paramTag.localName().impl(), &param_info);
         classInfoMap.set(preTag.localName().impl(), &pre_info);
@@ -567,7 +549,6 @@ const ClassInfo* JSHTMLElement::classInfo() const
         classInfoMap.set(tableTag.localName().impl(), &table_info);
         classInfoMap.set(tbodyTag.localName().impl(), &tablesection_info);
         classInfoMap.set(tdTag.localName().impl(), &tablecell_info);
-        classInfoMap.set(textareaTag.localName().impl(), &textArea_info);
         classInfoMap.set(tfootTag.localName().impl(), &tablesection_info);
         classInfoMap.set(thTag.localName().impl(), &tablecell_info);
         classInfoMap.set(theadTag.localName().impl(), &tablesection_info);
@@ -588,11 +569,6 @@ const JSHTMLElement::Accessors JSHTMLElement::isIndex_accessors = { &JSHTMLEleme
 const JSHTMLElement::Accessors JSHTMLElement::body_accessors = { &JSHTMLElement::bodyGetter, &JSHTMLElement::bodySetter };
 const JSHTMLElement::Accessors JSHTMLElement::form_accessors = { &JSHTMLElement::formGetter, &JSHTMLElement::formSetter };
 const JSHTMLElement::Accessors JSHTMLElement::select_accessors = { &JSHTMLElement::selectGetter, &JSHTMLElement::selectSetter };
-const JSHTMLElement::Accessors JSHTMLElement::optGroup_accessors = { &JSHTMLElement::optGroupGetter, &JSHTMLElement::optGroupSetter };
-const JSHTMLElement::Accessors JSHTMLElement::option_accessors = { &JSHTMLElement::optionGetter, &JSHTMLElement::optionSetter };
-const JSHTMLElement::Accessors JSHTMLElement::input_accessors = { &JSHTMLElement::inputGetter, &JSHTMLElement::inputSetter };
-const JSHTMLElement::Accessors JSHTMLElement::textArea_accessors = { &JSHTMLElement::textAreaGetter, &JSHTMLElement::textAreaSetter };
-const JSHTMLElement::Accessors JSHTMLElement::button_accessors = { &JSHTMLElement::buttonGetter, &JSHTMLElement::buttonSetter };
 const JSHTMLElement::Accessors JSHTMLElement::label_accessors = { &JSHTMLElement::labelGetter, &JSHTMLElement::labelSetter };
 const JSHTMLElement::Accessors JSHTMLElement::fieldSet_accessors = { &JSHTMLElement::fieldSetGetter, &JSHTMLElement::fieldSetSetter };
 const JSHTMLElement::Accessors JSHTMLElement::legend_accessors = { &JSHTMLElement::legendGetter, &JSHTMLElement::legendSetter };
@@ -644,7 +620,6 @@ const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
         accessorMap.add(blockquoteTag.localName().impl(), &blockQuote_accessors); 
         accessorMap.add(bodyTag.localName().impl(), &body_accessors);
         accessorMap.add(brTag.localName().impl(), &br_accessors);
-        accessorMap.add(buttonTag.localName().impl(), &button_accessors);
         accessorMap.add(captionTag.localName().impl(), &caption_accessors);
         accessorMap.add(colTag.localName().impl(), &col_accessors);
         accessorMap.add(colgroupTag.localName().impl(), &col_accessors);
@@ -668,7 +643,6 @@ const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
         accessorMap.add(htmlTag.localName().impl(), &html_accessors);
         accessorMap.add(iframeTag.localName().impl(), &iFrame_accessors);
         accessorMap.add(imgTag.localName().impl(), &img_accessors);
-        accessorMap.add(inputTag.localName().impl(), &input_accessors);
         accessorMap.add(insTag.localName().impl(), &mod_accessors);
         accessorMap.add(isindexTag.localName().impl(), &isIndex_accessors);
         accessorMap.add(labelTag.localName().impl(), &label_accessors);
@@ -680,8 +654,6 @@ const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
         accessorMap.add(menuTag.localName().impl(), &menu_accessors);
         accessorMap.add(objectTag.localName().impl(), &object_accessors);
         accessorMap.add(olTag.localName().impl(), &ol_accessors);
-        accessorMap.add(optionTag.localName().impl(), &option_accessors);
-        accessorMap.add(optgroupTag.localName().impl(), &optGroup_accessors);
         accessorMap.add(pTag.localName().impl(), &p_accessors);
         accessorMap.add(paramTag.localName().impl(), &param_accessors);
         accessorMap.add(preTag.localName().impl(), &pre_accessors);
@@ -691,7 +663,6 @@ const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
         accessorMap.add(tableTag.localName().impl(), &table_accessors);
         accessorMap.add(tbodyTag.localName().impl(), &tablesection_accessors);
         accessorMap.add(tdTag.localName().impl(), &tablecell_accessors);
-        accessorMap.add(textareaTag.localName().impl(), &textArea_accessors);
         accessorMap.add(thTag.localName().impl(), &tablecell_accessors);
         accessorMap.add(theadTag.localName().impl(), &tablesection_accessors);
         accessorMap.add(tfootTag.localName().impl(), &tablesection_accessors);
@@ -727,44 +698,10 @@ const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
 @begin HTMLHtmlElementTable 1
   version       KJS::JSHTMLElement::HtmlVersion   DontDelete
 @end
-@begin HTMLHeadElementTable 1
-  profile       KJS::JSHTMLElement::HeadProfile   DontDelete
-@end
-@begin HTMLLinkElementTable 11
-  disabled      KJS::JSHTMLElement::LinkDisabled  DontDelete
-  charset       KJS::JSHTMLElement::LinkCharset   DontDelete
-  href          KJS::JSHTMLElement::LinkHref      DontDelete
-  hreflang      KJS::JSHTMLElement::LinkHrefLang  DontDelete
-  media         KJS::JSHTMLElement::LinkMedia     DontDelete
-  rel           KJS::JSHTMLElement::LinkRel       DontDelete
-  rev           KJS::JSHTMLElement::LinkRev       DontDelete
-  target        KJS::JSHTMLElement::LinkTarget    DontDelete
-  type          KJS::JSHTMLElement::LinkType      DontDelete
-  sheet         KJS::JSHTMLElement::LinkSheet     DontDelete|ReadOnly
-@end
-@begin HTMLTitleElementTable 1
-  text          KJS::JSHTMLElement::TitleText     DontDelete
-@end
-@begin HTMLMetaElementTable 4
-  content       KJS::JSHTMLElement::MetaContent   DontDelete
-  httpEquiv     KJS::JSHTMLElement::MetaHttpEquiv DontDelete
-  name          KJS::JSHTMLElement::MetaName      DontDelete
-  scheme        KJS::JSHTMLElement::MetaScheme    DontDelete
-@end
-@begin HTMLBaseElementTable 2
-  href          KJS::JSHTMLElement::BaseHref      DontDelete
-  target        KJS::JSHTMLElement::BaseTarget    DontDelete
-@end
 @begin HTMLIsIndexElementTable 2
   form          KJS::JSHTMLElement::IsIndexForm   DontDelete|ReadOnly
   prompt        KJS::JSHTMLElement::IsIndexPrompt DontDelete
 @end
-@begin HTMLStyleElementTable 4
-  disabled      KJS::JSHTMLElement::StyleDisabled DontDelete
-  media         KJS::JSHTMLElement::StyleMedia    DontDelete
-  type          KJS::JSHTMLElement::StyleType     DontDelete
-  sheet         KJS::JSHTMLElement::StyleSheet    DontDelete|ReadOnly
-@end
 @begin HTMLBodyElementTable 10
   aLink         KJS::JSHTMLElement::BodyALink     DontDelete
   background    KJS::JSHTMLElement::BodyBackground        DontDelete
@@ -808,78 +745,6 @@ const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
   blur          KJS::JSHTMLElement::SelectBlur    DontDelete|Function 0
   focus         KJS::JSHTMLElement::SelectFocus   DontDelete|Function 0
 @end
-@begin HTMLOptGroupElementTable 2
-  disabled      KJS::JSHTMLElement::OptGroupDisabled      DontDelete
-  label         KJS::JSHTMLElement::OptGroupLabel         DontDelete
-@end
-@begin HTMLOptionElementTable 8
-  form          KJS::JSHTMLElement::OptionForm            DontDelete|ReadOnly
-  defaultSelected KJS::JSHTMLElement::OptionDefaultSelected       DontDelete
-  text          KJS::JSHTMLElement::OptionText            DontDelete
-  index         KJS::JSHTMLElement::OptionIndex           DontDelete|ReadOnly
-  disabled      KJS::JSHTMLElement::OptionDisabled        DontDelete
-  label         KJS::JSHTMLElement::OptionLabel           DontDelete
-  selected      KJS::JSHTMLElement::OptionSelected        DontDelete
-  value         KJS::JSHTMLElement::OptionValue           DontDelete
-@end
-@begin HTMLInputElementTable 24
-  defaultValue  KJS::JSHTMLElement::InputDefaultValue     DontDelete
-  defaultChecked KJS::JSHTMLElement::InputDefaultChecked  DontDelete
-  form          KJS::JSHTMLElement::InputForm             DontDelete|ReadOnly
-  accept        KJS::JSHTMLElement::InputAccept           DontDelete
-  accessKey     KJS::JSHTMLElement::InputAccessKey        DontDelete
-  align         KJS::JSHTMLElement::InputAlign            DontDelete
-  alt           KJS::JSHTMLElement::InputAlt              DontDelete
-  checked       KJS::JSHTMLElement::InputChecked          DontDelete
-  disabled      KJS::JSHTMLElement::InputDisabled         DontDelete
-  indeterminate KJS::JSHTMLElement::InputIndeterminate    DontDelete
-  maxLength     KJS::JSHTMLElement::InputMaxLength        DontDelete
-  name          KJS::JSHTMLElement::InputName             DontDelete
-  readOnly      KJS::JSHTMLElement::InputReadOnly         DontDelete
-  selectionStart        KJS::JSHTMLElement::InputSelectionStart   DontDelete
-  selectionEnd  KJS::JSHTMLElement::InputSelectionEnd     DontDelete
-  size          KJS::JSHTMLElement::InputSize             DontDelete
-  src           KJS::JSHTMLElement::InputSrc              DontDelete
-  tabIndex      KJS::JSHTMLElement::InputTabIndex         DontDelete
-  type          KJS::JSHTMLElement::InputType             DontDelete
-  useMap        KJS::JSHTMLElement::InputUseMap           DontDelete
-  value         KJS::JSHTMLElement::InputValue            DontDelete
-  blur          KJS::JSHTMLElement::InputBlur             DontDelete|Function 0
-  focus         KJS::JSHTMLElement::InputFocus            DontDelete|Function 0
-  select        KJS::JSHTMLElement::InputSelect           DontDelete|Function 0
-  click         KJS::JSHTMLElement::InputClick            DontDelete|Function 0
-  setSelectionRange     KJS::JSHTMLElement::InputSetSelectionRange        DontDelete|Function 2
-@end
-@begin HTMLTextAreaElementTable 17
-  defaultValue  KJS::JSHTMLElement::TextAreaDefaultValue  DontDelete
-  form          KJS::JSHTMLElement::TextAreaForm          DontDelete|ReadOnly
-  accessKey     KJS::JSHTMLElement::TextAreaAccessKey     DontDelete
-  cols          KJS::JSHTMLElement::TextAreaCols          DontDelete
-  disabled      KJS::JSHTMLElement::TextAreaDisabled      DontDelete
-  name          KJS::JSHTMLElement::TextAreaName          DontDelete
-  readOnly      KJS::JSHTMLElement::TextAreaReadOnly      DontDelete
-  rows          KJS::JSHTMLElement::TextAreaRows          DontDelete
-  selectionStart        KJS::JSHTMLElement::TextAreaSelectionStart        DontDelete
-  selectionEnd  KJS::JSHTMLElement::TextAreaSelectionEnd  DontDelete
-  tabIndex      KJS::JSHTMLElement::TextAreaTabIndex      DontDelete
-  type          KJS::JSHTMLElement::TextAreaType          DontDelete|ReadOnly
-  value         KJS::JSHTMLElement::TextAreaValue         DontDelete
-  blur          KJS::JSHTMLElement::TextAreaBlur          DontDelete|Function 0
-  focus         KJS::JSHTMLElement::TextAreaFocus         DontDelete|Function 0
-  select        KJS::JSHTMLElement::TextAreaSelect        DontDelete|Function 0
-  setSelectionRange     KJS::JSHTMLElement::TextAreaSetSelectionRange     DontDelete|Function 2
-@end
-@begin HTMLButtonElementTable 7
-  form          KJS::JSHTMLElement::ButtonForm            DontDelete|ReadOnly
-  accessKey     KJS::JSHTMLElement::ButtonAccessKey       DontDelete
-  disabled      KJS::JSHTMLElement::ButtonDisabled        DontDelete
-  name          KJS::JSHTMLElement::ButtonName            DontDelete
-  tabIndex      KJS::JSHTMLElement::ButtonTabIndex        DontDelete
-  type          KJS::JSHTMLElement::ButtonType            DontDelete|ReadOnly
-  value         KJS::JSHTMLElement::ButtonValue           DontDelete
-  blur          KJS::JSHTMLElement::ButtonBlur            DontDelete|Function 0
-  focus         KJS::JSHTMLElement::ButtonFocus           DontDelete|Function 0
-@end
 @begin HTMLLabelElementTable 4
   form          KJS::JSHTMLElement::LabelForm             DontDelete|ReadOnly
   accessKey     KJS::JSHTMLElement::LabelAccessKey        DontDelete
@@ -1314,27 +1179,11 @@ bool JSHTMLElement::getOwnPropertySlot(ExecState *exec, const Identifier& proper
     const HashTable* table = classInfo()->propHashTable; // get the right hashtable
     const HashEntry* entry = Lookup::findEntry(table, propertyName);
     if (entry) {
-        // don't expose selection properties for input types that can't have a selection
-        if (element.hasLocalName(inputTag) && !static_cast<HTMLInputElement*>(impl())->canHaveSelection()) {
-            switch (entry->value) {
-            case InputSetSelectionRange:
-            case InputSelectionStart:
-            case InputSelectionEnd:
-                break;
-            default:
-                if (entry->attr & Function)
-                    slot.setStaticEntry(this, entry, staticFunctionGetter<HTMLElementFunction>); 
-                else
-                    slot.setStaticEntry(this, entry, staticValueGetter<JSHTMLElement>);
-                return true;
-            }
-        } else {
-            if (entry->attr & Function)
-                slot.setStaticEntry(this, entry, staticFunctionGetter<HTMLElementFunction>); 
-            else
-                slot.setStaticEntry(this, entry, staticValueGetter<JSHTMLElement>);
-            return true;
-        }
+        if (entry->attr & Function)
+            slot.setStaticEntry(this, entry, staticFunctionGetter<HTMLElementFunction>); 
+        else
+            slot.setStaticEntry(this, entry, staticValueGetter<JSHTMLElement>);
+        return true;
     }
 
     // Base JSHTMLElement stuff or parent class forward, as usual
@@ -1447,111 +1296,6 @@ JSValue *JSHTMLElement::selectGetter(ExecState* exec, int token) const
     return jsUndefined();
 }
 
-JSValue *JSHTMLElement::optGroupGetter(ExecState* exec, int token) const
-{
-    HTMLOptGroupElement& optgroup = *static_cast<HTMLOptGroupElement*>(impl());
-    switch (token) {
-        case OptGroupDisabled:        return jsBoolean(optgroup.disabled());
-        case OptGroupLabel:           return jsString(optgroup.label());
-    }
-    return jsUndefined();
-}
-
-JSValue *JSHTMLElement::optionGetter(ExecState* exec, int token) const
-{
-    HTMLOptionElement& option = *static_cast<HTMLOptionElement*>(impl());
-    switch (token) {
-        case OptionForm:            return toJS(exec,option.form()); // type HTMLFormElement
-        case OptionDefaultSelected: return jsBoolean(option.defaultSelected());
-        case OptionText:            return jsString(option.text());
-        case OptionIndex:           return jsNumber(option.index());
-        case OptionDisabled:        return jsBoolean(option.disabled());
-        case OptionLabel:           return jsString(option.label());
-        case OptionSelected:        return jsBoolean(option.selected());
-        case OptionValue:           return jsString(option.value());
-    }
-    return jsUndefined();
-}
-
-static JSValue *getInputSelectionStart(HTMLInputElement &input)
-{
-    if (input.canHaveSelection())
-        return jsNumber(input.selectionStart());
-    return jsUndefined();
-}
-
-static JSValue *getInputSelectionEnd(HTMLInputElement &input)
-{
-    if (input.canHaveSelection())
-        return jsNumber(input.selectionEnd());
-    return jsUndefined();
-}
-
-JSValue *JSHTMLElement::inputGetter(ExecState* exec, int token) const
-{
-    HTMLInputElement& input = *static_cast<HTMLInputElement*>(impl());
-    switch (token) {
-        case InputDefaultValue:    return jsString(input.defaultValue());
-        case InputDefaultChecked:  return jsBoolean(input.defaultChecked());
-        case InputForm:            return toJS(exec,input.form()); // type HTMLFormElement
-        case InputAccept:          return jsString(input.accept());
-        case InputAccessKey:       return jsString(input.accessKey());
-        case InputAlign:           return jsString(input.align());
-        case InputAlt:             return jsString(input.alt());
-        case InputChecked:         return jsBoolean(input.checked());
-        case InputDisabled:        return jsBoolean(input.disabled());
-        case InputIndeterminate:   return jsBoolean(input.indeterminate());
-        case InputMaxLength:       return jsNumber(input.maxLength());
-        case InputName:            return jsString(input.name());
-        case InputReadOnly:        return jsBoolean(input.readOnly());
-        case InputSelectionStart:  return getInputSelectionStart(input);
-        case InputSelectionEnd:    return getInputSelectionEnd(input);
-        case InputSize:            return jsNumber(input.size());
-        case InputSrc:             return jsString(input.src());
-        case InputTabIndex:        return jsNumber(input.tabIndex());
-        case InputType:            return jsString(input.type());
-        case InputUseMap:          return jsString(input.useMap());
-        case InputValue:           return jsString(input.value());
-    }
-    return jsUndefined();
-}
-
-JSValue *JSHTMLElement::textAreaGetter(ExecState* exec, int token) const
-{
-    HTMLTextAreaElement& textarea = *static_cast<HTMLTextAreaElement*>(impl());
-    switch (token) {
-        case TextAreaDefaultValue:    return jsString(textarea.defaultValue());
-        case TextAreaForm:            return toJS(exec,textarea.form()); // type HTMLFormElement
-        case TextAreaAccessKey:       return jsString(textarea.accessKey());
-        case TextAreaCols:            return jsNumber(textarea.cols());
-        case TextAreaDisabled:        return jsBoolean(textarea.disabled());
-        case TextAreaName:            return jsString(textarea.name());
-        case TextAreaReadOnly:        return jsBoolean(textarea.readOnly());
-        case TextAreaRows:            return jsNumber(textarea.rows());
-        case TextAreaSelectionStart:  return jsNumber(textarea.selectionStart());
-        case TextAreaSelectionEnd:    return jsNumber(textarea.selectionEnd());
-        case TextAreaTabIndex:        return jsNumber(textarea.tabIndex());
-        case TextAreaType:            return jsString(textarea.type());
-        case TextAreaValue:           return jsString(textarea.value());
-    }
-    return jsUndefined();
-}
-
-JSValue *JSHTMLElement::buttonGetter(ExecState* exec, int token) const
-{
-    HTMLButtonElement& button = *static_cast<HTMLButtonElement*>(impl());
-    switch (token) {
-        case ButtonForm:            return toJS(exec,button.form()); // type HTMLFormElement
-        case ButtonAccessKey:       return jsString(button.accessKey());
-        case ButtonDisabled:        return jsBoolean(button.disabled());
-        case ButtonName:            return jsString(button.name());
-        case ButtonTabIndex:        return jsNumber(button.tabIndex());
-        case ButtonType:            return jsString(button.type());
-        case ButtonValue:           return jsString(button.value());
-    }
-    return jsUndefined();
-}
-
 JSValue *JSHTMLElement::labelGetter(ExecState* exec, int token) const
 {
     HTMLLabelElement& label = *static_cast<HTMLLabelElement*>(impl());
@@ -2220,40 +1964,6 @@ JSValue *HTMLElementFunction::callAsFunction(ExecState *exec, JSObject *thisObj,
             return jsUndefined();
         }
     }
-    else if (element.hasLocalName(inputTag)) {
-        HTMLInputElement &input = static_cast<HTMLInputElement &>(element);
-        if (id == JSHTMLElement::InputBlur) {
-            input.blur();
-            return jsUndefined();
-        }
-        else if (id == JSHTMLElement::InputFocus) {
-            input.focus();
-            return jsUndefined();
-        }
-        else if (id == JSHTMLElement::InputSelect) {
-            input.select();
-            return jsUndefined();
-        }
-        else if (id == JSHTMLElement::InputClick) {
-            input.click();
-            return jsUndefined();
-        }
-        else if (id == JSHTMLElement::InputSetSelectionRange) {
-            input.setSelectionRange(args[0]->toInt32(exec), args[1]->toInt32(exec));
-            return jsUndefined();
-        }
-    }
-    else if (element.hasLocalName(buttonTag)) {
-        HTMLButtonElement &button = static_cast<HTMLButtonElement &>(element);
-        if (id == JSHTMLElement::ButtonBlur) {
-            button.blur();
-            return jsUndefined();
-        }
-        else if (id == JSHTMLElement::ButtonFocus) {
-            button.focus();
-            return jsUndefined();
-        }
-    }
     else if (element.hasLocalName(labelTag)) {
         HTMLLabelElement &label = static_cast<HTMLLabelElement &>(element);
         if (id == JSHTMLElement::LabelFocus) {
@@ -2268,25 +1978,6 @@ JSValue *HTMLElementFunction::callAsFunction(ExecState *exec, JSObject *thisObj,
             return jsUndefined();
         }
     }
-    else if (element.hasLocalName(textareaTag)) {
-        HTMLTextAreaElement &textarea = static_cast<HTMLTextAreaElement &>(element);
-        if (id == JSHTMLElement::TextAreaBlur) {
-            textarea.blur();
-            return jsUndefined();
-        }
-        else if (id == JSHTMLElement::TextAreaFocus) {
-            textarea.focus();
-            return jsUndefined();
-        }
-        else if (id == JSHTMLElement::TextAreaSelect) {
-            textarea.select();
-            return jsUndefined();
-        }
-        else if (id == JSHTMLElement::TextAreaSetSelectionRange) {
-            textarea.setSelectionRange(args[0]->toInt32(exec), args[1]->toInt32(exec));
-            return jsUndefined();
-        }
-    }
     else if (element.hasLocalName(aTag)) {
         HTMLAnchorElement &anchor = static_cast<HTMLAnchorElement &>(element);
         if (id == JSHTMLElement::AnchorBlur) {
@@ -2393,8 +2084,7 @@ void JSHTMLElement::put(ExecState *exec, const Identifier &propertyName, JSValue
         if (entry->attr & Function) { // function: put as override property
             JSObject::put(exec, propertyName, value, attr);
             return;
-        }
-        else if (!(entry->attr & ReadOnly)) { // let lookupPut print the warning if read-only
+        } else if (!(entry->attr & ReadOnly)) { // let lookupPut print the warning if read-only
             putValueProperty(exec, entry->value, value, attr);
             return;
         }
@@ -2405,9 +2095,9 @@ void JSHTMLElement::put(ExecState *exec, const Identifier &propertyName, JSValue
 
 void JSHTMLElement::htmlSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
 {
-    HTMLHeadElement &head = *static_cast<HTMLHeadElement*>(impl());
-    if (token == HeadProfile) 
-        head.setProfile(str);
+    HTMLHtmlElement& html = *static_cast<HTMLHtmlElement*>(impl());
+    if (token == HtmlVersion)
+        html.setVersion(str);
 }
 
 void JSHTMLElement::isIndexSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
@@ -2480,93 +2170,6 @@ void JSHTMLElement::selectSetter(ExecState *exec, int token, JSValue *value, con
     }
 }
 
-void JSHTMLElement::optGroupSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
-{
-    HTMLOptGroupElement& optgroup = *static_cast<HTMLOptGroupElement*>(impl());
-    switch (token) {
-        case OptGroupDisabled:        { optgroup.setDisabled(value->toBoolean(exec)); return; }
-        case OptGroupLabel:           { optgroup.setLabel(str); return; }
-    }
-}
-
-void JSHTMLElement::optionSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
-{
-    DOMExceptionTranslator exception(exec);
-    HTMLOptionElement& option = *static_cast<HTMLOptionElement*>(impl());
-    switch (token) {
-        // read-only: form
-        case OptionDefaultSelected: { option.setDefaultSelected(value->toBoolean(exec)); return; }
-        case OptionText:            { option.setText(str, exception); return; }
-        // read-only: index
-        case OptionDisabled:        { option.setDisabled(value->toBoolean(exec)); return; }
-        case OptionLabel:           { option.setLabel(str); return; }
-        case OptionSelected:        { option.setSelected(value->toBoolean(exec)); return; }
-        case OptionValue:           { option.setValue(str); return; }
-    }
-}
-
-void JSHTMLElement::inputSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
-{
-    HTMLInputElement& input = *static_cast<HTMLInputElement*>(impl());
-    switch (token) {
-        case InputDefaultValue:    { input.setDefaultValue(str); return; }
-        case InputDefaultChecked:  { input.setDefaultChecked(value->toBoolean(exec)); return; }
-        // read-only: form
-        case InputAccept:          { input.setAccept(str); return; }
-        case InputAccessKey:       { input.setAccessKey(str); return; }
-        case InputAlign:           { input.setAlign(str); return; }
-        case InputAlt:             { input.setAlt(str); return; }
-        case InputChecked:         { input.setChecked(value->toBoolean(exec)); return; }
-        case InputDisabled:        { input.setDisabled(value->toBoolean(exec)); return; }
-        case InputIndeterminate:   { input.setIndeterminate(value->toBoolean(exec)); return; }
-        case InputMaxLength:       { input.setMaxLength(value->toInt32(exec)); return; }
-        case InputName:            { input.setName(AtomicString(str)); return; }
-        case InputReadOnly:        { input.setReadOnly(value->toBoolean(exec)); return; }
-        case InputSize:            { input.setSize(value->toInt32(exec)); return; }
-        case InputSelectionStart:  { input.setSelectionStart(value->toInt32(exec)); return; }
-        case InputSelectionEnd:    { input.setSelectionEnd(value->toInt32(exec)); return; }
-        case InputSrc:             { input.setSrc(str); return; }
-        case InputTabIndex:        { input.setTabIndex(value->toInt32(exec)); return; }
-        case InputType:            { input.setType(str); return; }
-        case InputUseMap:          { input.setUseMap(str); return; }
-        case InputValue:           { input.setValue(str); return; }
-    }
-}
-
-void JSHTMLElement::textAreaSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
-{
-    HTMLTextAreaElement& textarea = *static_cast<HTMLTextAreaElement*>(impl());
-    switch (token) {
-        case TextAreaDefaultValue:    { textarea.setDefaultValue(str); return; }
-        // read-only: form
-        case TextAreaAccessKey:       { textarea.setAccessKey(str); return; }
-        case TextAreaCols:            { textarea.setCols(value->toInt32(exec)); return; }
-        case TextAreaDisabled:        { textarea.setDisabled(value->toBoolean(exec)); return; }
-        case TextAreaName:            { textarea.setName(AtomicString(str)); return; }
-        case TextAreaReadOnly:        { textarea.setReadOnly(value->toBoolean(exec)); return; }
-        case TextAreaRows:            { textarea.setRows(value->toInt32(exec)); return; }
-        case TextAreaSelectionStart:  { textarea.setSelectionStart(value->toInt32(exec)); return; }
-        case TextAreaSelectionEnd:    { textarea.setSelectionEnd(value->toInt32(exec)); return; }
-        case TextAreaTabIndex:        { textarea.setTabIndex(value->toInt32(exec)); return; }
-        // read-only: type
-        case TextAreaValue:           { textarea.setValue(str); return; }
-    }
-}
-
-void JSHTMLElement::buttonSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
-{
-    HTMLButtonElement& button = *static_cast<HTMLButtonElement*>(impl());
-    switch (token) {
-        // read-only: form
-        case ButtonAccessKey:       { button.setAccessKey(str); return; }
-        case ButtonDisabled:        { button.setDisabled(value->toBoolean(exec)); return; }
-        case ButtonName:            { button.setName(AtomicString(str)); return; }
-        case ButtonTabIndex:        { button.setTabIndex(value->toInt32(exec)); return; }
-        // read-only: type
-        case ButtonValue:           { button.setValue(str); return; }
-    }
-}
-
 void JSHTMLElement::labelSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
 {
     HTMLLabelElement& label = *static_cast<HTMLLabelElement*>(impl());
@@ -3324,43 +2927,6 @@ void JSHTMLSelectCollection::put(ExecState *exec, const Identifier &propertyName
   setDOMException(exec, exception);
 }
 
-////////////////////// Option Object ////////////////////////
-
-OptionConstructorImp::OptionConstructorImp(ExecState *exec, Document *d)
-    : m_doc(d)
-{
-  put(exec,lengthPropertyName, jsNumber(4), ReadOnly|DontDelete|DontEnum);
-}
-
-bool OptionConstructorImp::implementsConstruct() const
-{
-  return true;
-}
-
-JSObject *OptionConstructorImp::construct(ExecState *exec, const List &args)
-{
-  int exception = 0;
-  RefPtr<Element> el(m_doc->createElement("option", exception));
-  HTMLOptionElement *opt = 0;
-  if (el) {
-    opt = static_cast<HTMLOptionElement*>(el.get());
-    int sz = args.size();
-    RefPtr<Text> t = m_doc->createTextNode("");
-    opt->appendChild(t, exception);
-    if (exception == 0 && sz > 0)
-      t->setData(args[0]->toString(exec), exception); // set the text
-    if (exception == 0 && sz > 1)
-      opt->setValue(args[1]->toString(exec));
-    if (exception == 0 && sz > 2)
-      opt->setDefaultSelected(args[2]->toBoolean(exec));
-    if (exception == 0 && sz > 3)
-      opt->setSelected(args[3]->toBoolean(exec));
-  }
-
-  setDOMException(exec, exception);
-  return static_cast<JSObject*>(toJS(exec,opt));
-}
-
 ////////////////////// Image Object ////////////////////////
 
 ImageConstructorImp::ImageConstructorImp(ExecState *, Document *d)
index 6a7793561a09e88a82a7d6cdcb9abf5f32856648..d9102e6bccdcb4fced455f0ef4d0222ff9e666ae 100644 (file)
@@ -79,8 +79,7 @@ namespace KJS {
     static const ClassInfo info;
 
     static const ClassInfo html_info, isIndex_info, body_info, form_info,
-      select_info, optGroup_info, option_info, input_info, textArea_info,
-      button_info, label_info, fieldSet_info, legend_info, ul_info, ol_info,
+      select_info, label_info, fieldSet_info, legend_info, ul_info, ol_info,
       dl_info, dir_info, menu_info, li_info, div_info, p_info, heading_info,
       blockQuote_info, q_info, pre_info, br_info, baseFont_info, font_info,
       hr_info, mod_info, a_info, img_info, object_info, param_info,
@@ -94,8 +93,7 @@ namespace KJS {
     struct Accessors { GetterFunction m_getter; SetterFunction m_setter; };
     const Accessors* accessors() const;
     static const Accessors html_accessors, isIndex_accessors, body_accessors, form_accessors,
-      select_accessors, optGroup_accessors, option_accessors, input_accessors, textArea_accessors,
-      button_accessors, label_accessors, fieldSet_accessors, legend_accessors, ul_accessors, ol_accessors,
+      select_accessors, label_accessors, fieldSet_accessors, legend_accessors, ul_accessors, ol_accessors,
       dl_accessors, dir_accessors, menu_accessors, li_accessors, div_accessors, p_accessors, heading_accessors,
       blockQuote_accessors, q_accessors, pre_accessors, br_accessors, baseFont_accessors, font_accessors,
       hr_accessors, mod_accessors, a_accessors, img_accessors, object_accessors, param_accessors,
@@ -113,16 +111,6 @@ namespace KJS {
     void  formSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
     JSValue *selectGetter(ExecState* exec, int token) const;
     void  selectSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
-    JSValue *optGroupGetter(ExecState* exec, int token) const;
-    void  optGroupSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
-    JSValue *optionGetter(ExecState* exec, int token) const;
-    void  optionSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
-    JSValue *inputGetter(ExecState* exec, int token) const;
-    void  inputSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
-    JSValue *textAreaGetter(ExecState* exec, int token) const;
-    void  textAreaSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
-    JSValue *buttonGetter(ExecState* exec, int token) const;
-    void  buttonSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
     JSValue *labelGetter(ExecState* exec, int token) const;
     void  labelSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
     JSValue *fieldSetGetter(ExecState* exec, int token) const;
@@ -202,31 +190,15 @@ namespace KJS {
     JSValue *marqueeGetter(ExecState* exec, int token) const;
     void  marqueeSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
 
-    enum { HtmlVersion, HeadProfile, LinkHref, LinkRel, LinkMedia,
-           LinkCharset, LinkDisabled, LinkHrefLang, LinkRev, LinkTarget, LinkType,
-           LinkSheet, TitleText, MetaName, MetaHttpEquiv, MetaContent, MetaScheme,
-           BaseHref, BaseTarget, IsIndexForm, IsIndexPrompt, StyleDisabled,
-           StyleSheet, StyleType, StyleMedia, BodyBackground, BodyVLink, BodyText,
+    enum { HtmlVersion, IsIndexForm, IsIndexPrompt,
+           BodyBackground, BodyVLink, BodyText,
            BodyLink, BodyALink, BodyBgColor, BodyScrollLeft, BodyScrollTop, BodyScrollHeight, BodyScrollWidth,
            FormAction, FormEncType, FormElements, FormLength, FormAcceptCharset,
            FormReset, FormTarget, FormName, FormMethod, FormSubmit, SelectAdd,
            SelectTabIndex, SelectValue, SelectSelectedIndex, SelectLength,
            SelectRemove, SelectForm, SelectBlur, SelectType, SelectOptions,
            SelectDisabled, SelectMultiple, SelectName, SelectSize, SelectFocus,
-           OptGroupDisabled, OptGroupLabel, OptionIndex, OptionSelected,
-           OptionForm, OptionText, OptionDefaultSelected, OptionDisabled,
-           OptionLabel, OptionValue, InputBlur, InputReadOnly, InputAccept,
-           InputSize, InputDefaultValue, InputTabIndex, InputValue, InputType,
-           InputFocus, InputMaxLength, InputDefaultChecked, InputDisabled,
-           InputChecked, InputIndeterminate, InputForm, InputAccessKey, InputAlign, InputAlt,
-           InputName, InputSrc, InputUseMap, InputSelect, InputClick,
-           InputSelectionStart, InputSelectionEnd, InputSetSelectionRange,
-           TextAreaAccessKey, TextAreaName, TextAreaDefaultValue, TextAreaSelect, TextAreaSetSelectionRange,
-           TextAreaCols, TextAreaDisabled, TextAreaForm, TextAreaType,
-           TextAreaTabIndex, TextAreaReadOnly, TextAreaRows, TextAreaValue,
-           TextAreaSelectionStart, TextAreaSelectionEnd,
-           TextAreaBlur, TextAreaFocus, ButtonBlur, ButtonFocus, ButtonForm, ButtonTabIndex, ButtonName,
-           ButtonDisabled, ButtonAccessKey, ButtonType, ButtonValue, LabelHtmlFor,
+           LabelHtmlFor,
            LabelForm, LabelFocus, LabelAccessKey, FieldSetForm, LegendForm, LegendAccessKey,
            LegendAlign, LegendFocus, UListType, UListCompact, OListStart, OListCompact,
            OListType, DListCompact, DirectoryCompact, MenuCompact, LIType,
@@ -332,17 +304,6 @@ namespace KJS {
     virtual bool masqueradeAsUndefined() const { return true; }
   };
   
-  ////////////////////// Option Object ////////////////////////
-
-  class OptionConstructorImp : public DOMObject {
-  public:
-    OptionConstructorImp(ExecState *exec, WebCore::Document *d);
-    virtual bool implementsConstruct() const;
-    virtual JSObject *construct(ExecState *exec, const List &args);
-  private:
-    RefPtr<WebCore::Document> m_doc;
-  };
-
   ////////////////////// Image Object ////////////////////////
 
   class ImageConstructorImp : public DOMObject {
index 43028fff1d8cf7bc23c71ba70b8b1a6043934b7d..b856041b89b5fc69dc9454fe7a6fff803bbf2400 100644 (file)
@@ -34,6 +34,7 @@
 #include "JSDOMParser.h"
 #include "JSDOMWindow.h"
 #include "JSEvent.h"
+#include "JSHTMLOptionElementConstructor.h"
 #include "JSMutationEvent.h"
 #include "JSNode.h"
 #include "JSNodeFilter.h"
@@ -771,7 +772,7 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
       // time
       return new ImageConstructorImp(exec, m_frame->document());
     case Option:
-      return new OptionConstructorImp(exec, m_frame->document());
+      return new JSHTMLOptionElementConstructor(exec, m_frame->document());
     case XMLHttpRequest:
       return new JSXMLHttpRequestConstructorImp(exec, m_frame->document());
     case XMLSerializer:
index fda9deda4e72b7919576f6ac09f1e931c5d2a3a2..d47007e4be4bf253abb32ef16ea03feb72c97821 100644 (file)
@@ -118,7 +118,9 @@ sub GetParentClassName
 sub GetLegacyHeaderIncludes
 {
   my $legacyParent = shift;
-  if ($legacyParent eq "KJS::Window") {
+  if ($legacyParent eq "JSHTMLInputElementBase") {
+      return "#include \"JSHTMLInputElementBase.h\"\n\n";
+  } elsif ($legacyParent eq "KJS::Window") {
       return "#include \"kjs_window.h\"\n\n";
   } elsif ($legacyParent eq "KJS::DOMNode") {
       return "#include \"kjs_domnode.h\"\n\n";
@@ -636,7 +638,7 @@ sub GenerateImplementation
     push(@implContent, "    return getStaticValueSlot<$className, $parentClassName>(exec, &${className}Table, this, propertyName, slot);\n");
     push(@implContent, "}\n\n");
   
-    push(@implContent, "JSValue* ${className}::getValueProperty(ExecState *exec, int token) const\n{\n");
+    push(@implContent, "JSValue* ${className}::getValueProperty(ExecStateexec, int token) const\n{\n");
     push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(${className}::impl());\n\n");
     push(@implContent, "    switch (token) {\n");
 
@@ -1056,6 +1058,10 @@ sub NativeToJSValue
   } elsif ($type eq "DOMObject") {
     $implIncludes{"JSCanvasRenderingContext2D.h"} = 1;
     return "toJS(exec, $value)";
+  } elsif ($type eq "HTMLFormElement") {
+    $implIncludes{"kjs_html.h"} = 1;
+    $implIncludes{"HTMLFormElement.h"} = 1;
+    return "toJS(exec, $value)";
   } else {
     $implIncludes{"JS$type.h"} = 1;
     return "toJS(exec, $value)";
@@ -1283,7 +1289,7 @@ EOF
     if ($canConstruct) {
 $implContent .= << "EOF";
     virtual bool implementsConstruct() const { return true; }
-    virtual JSObject* construct(ExecState* exec, const List &args) { return static_cast<JSObject *>(toJS(exec, new $interfaceName)); }
+    virtual JSObject* construct(ExecState* exec, const List& args) { return static_cast<JSObject*>(toJS(exec, new $interfaceName)); }
 EOF
     }
 
diff --git a/WebCore/html/HTMLButtonElement.idl b/WebCore/html/HTMLButtonElement.idl
new file mode 100644 (file)
index 0000000..710a452
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module html {
+
+    interface [LegacyParent=KJS::JSHTMLElement] HTMLButtonElement : HTMLElement {
+        readonly attribute  HTMLFormElement      form;
+                 attribute  DOMString            accessKey;
+                 attribute  boolean              disabled;
+                 attribute  DOMString            name;
+                 attribute  long                 tabIndex;
+        readonly attribute  DOMString            type;
+                 attribute  DOMString            value;
+    };
+
+}
diff --git a/WebCore/html/HTMLInputElement.idl b/WebCore/html/HTMLInputElement.idl
new file mode 100644 (file)
index 0000000..2ae2a89
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module html {
+
+    interface [LegacyParent=JSHTMLInputElementBase] HTMLInputElement : HTMLElement {
+                 attribute  DOMString            defaultValue;
+                 attribute  boolean              defaultChecked;
+        readonly attribute  HTMLFormElement      form;
+                 attribute  DOMString            accept;
+                 attribute  DOMString            accessKey;
+                 attribute  DOMString            align;
+                 attribute  DOMString            alt;
+                 attribute  boolean              checked;
+                 attribute  boolean              disabled;
+                 attribute  long                 maxLength;
+                 attribute  DOMString            name;
+                 attribute  boolean              readOnly;
+                 attribute  unsigned long        size; // Changed string -> long as part of DOM level 2
+                 attribute  DOMString            src;
+                 attribute  long                 tabIndex;
+                 attribute  DOMString            type; // readonly dropped as part of DOM level 2
+                 attribute  DOMString            useMap;
+                 attribute  DOMString            value;
+        
+        void    blur();
+        void    focus();
+        void    select();
+        void    click();
+        
+                 attribute boolean indeterminate; // WinIE extension
+        
+        // WinIE & FireFox extension:
+        
+        // Handled by JSHTMLInputElementBase to allow hiding based on input type
+        // attribute long selectionStart;
+        // attribute long selectionEnd;
+        // void setSelectionRange(in long start, in long end);
+    };
+
+}
diff --git a/WebCore/html/HTMLOptGroupElement.idl b/WebCore/html/HTMLOptGroupElement.idl
new file mode 100644 (file)
index 0000000..560c73d
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module html {
+
+    interface [LegacyParent=KJS::JSHTMLElement] HTMLOptGroupElement : HTMLElement {
+        attribute  boolean              disabled;
+        attribute  DOMString            label;
+    };
+
+}
diff --git a/WebCore/html/HTMLOptionElement.idl b/WebCore/html/HTMLOptionElement.idl
new file mode 100644 (file)
index 0000000..449f12a
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module html {
+
+    interface [LegacyParent=KJS::JSHTMLElement] HTMLOptionElement : HTMLElement {
+        readonly attribute  HTMLFormElement      form;
+                 attribute  boolean              defaultSelected;
+        readonly attribute  DOMString            text;
+                 attribute  long                 index
+                        setter raises (dom::DOMException); // FIXME: We disallow setting in violation of DOM 1 HTML.
+                 attribute  boolean              disabled;
+                 attribute  DOMString            label;
+        readonly attribute  boolean              selected;
+                 attribute  DOMString            value;
+    };
+
+}
diff --git a/WebCore/html/HTMLTextAreaElement.idl b/WebCore/html/HTMLTextAreaElement.idl
new file mode 100644 (file)
index 0000000..f4a6322
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module html {
+
+    interface [LegacyParent=KJS::JSHTMLElement] HTMLTextAreaElement : HTMLElement {
+                 attribute  DOMString            defaultValue;
+        readonly attribute  HTMLFormElement      form;
+                 attribute  DOMString            accessKey;
+                 attribute  long                 cols;
+                 attribute  boolean              disabled;
+                 attribute  DOMString            name;
+                 attribute  boolean              readOnly;
+                 attribute  long                 rows;
+                 attribute  long                 tabIndex;
+        readonly attribute  DOMString            type;
+                 attribute  DOMString            value;
+        
+        void     blur();
+        void     focus();
+        void     select();
+
+       // WinIE & FireFox extension:
+                 attribute long selectionStart;
+                 attribute long selectionEnd;
+        void setSelectionRange(in long start, in long end);
+    };
+
+}