2006-05-23 Eric Seidel <eric@eseidel.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 May 2006 21:41:29 +0000 (21:41 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 May 2006 21:41:29 +0000 (21:41 +0000)
        Reviewed by andersca.

        Add "HasIndexGetter" support to bindings autogen system.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=9057

        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSHTMLInputElementBase.cpp:
        * bindings/js/kjs_css.cpp:
        (KJS::toJS):
        * bindings/js/kjs_css.h:
        * bindings/js/kjs_dom.cpp:
        (KJS::DOMNamedNodeMap::getOwnPropertySlot):
        * bindings/scripts/CodeGeneratorJS.pm:
        * css/CSSValueList.idl: Added.

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

29 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/document-scripts-expected.txt
WebCore/ChangeLog
WebCore/DerivedSources.make
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/JSHTMLElementWrapperFactory.cpp
WebCore/bindings/js/JSHTMLFormElementCustom.cpp [new file with mode: 0644]
WebCore/bindings/js/JSHTMLInputElementBase.cpp
WebCore/bindings/js/kjs_css.cpp
WebCore/bindings/js/kjs_css.h
WebCore/bindings/js/kjs_dom.cpp
WebCore/bindings/js/kjs_html.cpp
WebCore/bindings/js/kjs_html.h
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/css/CSSRuleList.idl [new file with mode: 0644]
WebCore/css/CSSValueList.idl [new file with mode: 0644]
WebCore/css/MediaList.idl [new file with mode: 0644]
WebCore/dom/NamedAttrMap.cpp
WebCore/dom/NodeList.cpp
WebCore/dom/NodeList.h
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLFormElement.h
WebCore/html/HTMLFormElement.idl [new file with mode: 0644]
WebCore/html/HTMLTableElement.cpp
WebCore/html/HTMLTableElement.h
WebCore/html/HTMLTableRowElement.cpp
WebCore/html/HTMLTableRowElement.h
WebCore/html/HTMLTableSectionElement.cpp
WebCore/html/HTMLTableSectionElement.h

index c4613d040eb0ebcb3e78bfb1de82e807cd30f0dc..b48c2a21920d265e778b9903df938a0c2eb787d6 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-25  Eric Seidel  <eric@eseidel.com>
+
+        Reviewed by andersca.
+
+        * fast/dom/document-scripts-expected.txt: correct results.
+
 2006-05-24  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by Geoff.
index f6d3b1298498290a729a7a92c79c24508d43dd46..8ee0ebe4c93fa69386b4e3358deb794f8246be9b 100644 (file)
@@ -1,5 +1,5 @@
 This tests that document.scripts works correctly.
 PASS: 2 should be 2 and is.
-FAIL: first should be first but instead is [object SCRIPT]
-FAIL: second should be second but instead is [object SCRIPT]
+PASS: document.scripts[0].id should be first and is.
+PASS: document.scripts[1].id should be second and is.
 
index 5e97d727a0a068c9e9fdf1292c03658a9dceae2f..dc5a89a4129c1c4559eb10bdddf1b7cb3d74122d 100644 (file)
@@ -1,3 +1,21 @@
+2006-05-23  Eric Seidel  <eric@eseidel.com>
+
+        Reviewed by andersca.
+
+        Add "HasIndexGetter" support to bindings autogen system.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=9057
+
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSHTMLInputElementBase.cpp:
+        * bindings/js/kjs_css.cpp:
+        (KJS::toJS):
+        * bindings/js/kjs_css.h:
+        * bindings/js/kjs_dom.cpp:
+        (KJS::DOMNamedNodeMap::getOwnPropertySlot):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * css/CSSValueList.idl: Added.
+
 2006-05-24  David Hyatt  <hyatt@apple.com>
 
         Implement font aliasing of family names for Courier/Courier New,
index c79a9abbe182cc7645aafa07a60caa737a6f8d55..cd1f3986026b504895a8cf4b72ce4e5bb4be2d16 100644 (file)
@@ -46,7 +46,9 @@ all : \
     JSAttr.h \
     JSCSSPrimitiveValue.h \
     JSCSSRule.h \
+    JSCSSRuleList.h \
     JSCSSValue.h \
+    JSCSSValueList.h \
     JSCanvasGradient.h \
     JSCanvasPattern.h \
     JSCanvasRenderingContext2D.h \
@@ -79,6 +81,7 @@ all : \
     JSHTMLElement.h \
     JSHTMLFieldSetElement.h \
        JSHTMLFontElement.h \
+       JSHTMLFormElement.h \
     JSHTMLHeadElement.h \
     JSHTMLHeadingElement.h \
     JSHTMLHRElement.h \
index f784d6f476a5f4c48518766e98e209fdd2fdac53..897fd703b08befdd257d205448f4dddfc96e7dba 100644 (file)
                A8CFF7A90A156978000A4234 /* HTMLModElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8CFF79F0A156978000A4234 /* HTMLModElement.cpp */; };
                A8CFF7AA0A156978000A4234 /* HTMLBRElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF7A00A156978000A4234 /* HTMLBRElement.h */; };
                A8CFF7AB0A156978000A4234 /* HTMLAnchorElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF7A10A156978000A4234 /* HTMLAnchorElement.h */; };
+               A8D05FA70A23B301005E7203 /* JSCSSRuleList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8D05FA50A23B301005E7203 /* JSCSSRuleList.cpp */; };
+               A8D05FA80A23B301005E7203 /* JSCSSRuleList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8D05FA60A23B301005E7203 /* JSCSSRuleList.h */; };
+               A8D05FAB0A23B30F005E7203 /* JSCSSValueList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8D05FA90A23B30F005E7203 /* JSCSSValueList.cpp */; };
+               A8D05FAC0A23B30F005E7203 /* JSCSSValueList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8D05FAA0A23B30F005E7203 /* JSCSSValueList.h */; };
+               A8D064F00A23BFEA005E7203 /* HTMLFormElement.idl in Resources */ = {isa = PBXBuildFile; fileRef = A8D064EF0A23BFEA005E7203 /* HTMLFormElement.idl */; };
+               A8D064FB0A23C0CC005E7203 /* JSHTMLFormElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8D064F90A23C0CC005E7203 /* JSHTMLFormElement.cpp */; };
+               A8D064FC0A23C0CC005E7203 /* JSHTMLFormElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8D064FA0A23C0CC005E7203 /* JSHTMLFormElement.h */; };
+               A8D0651D0A23C1FE005E7203 /* CSSRuleList.idl in Resources */ = {isa = PBXBuildFile; fileRef = A8D0651B0A23C1FE005E7203 /* CSSRuleList.idl */; };
+               A8D0651E0A23C1FE005E7203 /* CSSValueList.idl in Resources */ = {isa = PBXBuildFile; fileRef = A8D0651C0A23C1FE005E7203 /* CSSValueList.idl */; };
+               A8D065AE0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8D065AD0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp */; };
                A8DF3FCE097FA0FC0052981B /* HTMLFormCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = A8DF3FC6097FA0FB0052981B /* HTMLFormCollection.h */; };
                A8DF3FCF097FA0FC0052981B /* HTMLFormCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8DF3FC7097FA0FB0052981B /* HTMLFormCollection.cpp */; };
                A8DF3FD0097FA0FC0052981B /* HTMLCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = A8DF3FC8097FA0FB0052981B /* HTMLCollection.h */; };
                930CAAD609C495B600229C04 /* CanvasRenderingContext2D.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CanvasRenderingContext2D.idl; sourceTree = "<group>"; };
                930CAB8809C49EFA00229C04 /* CanvasGradient.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CanvasGradient.idl; sourceTree = "<group>"; };
                930CAB8F09C49F1B00229C04 /* CanvasPattern.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CanvasPattern.idl; sourceTree = "<group>"; };
-               930CAB9609C49FAA00229C04 /* CodeGeneratorJS.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = CodeGeneratorJS.pm; path = ../scripts/CodeGeneratorJS.pm; sourceTree = "<group>"; };
                93126F6009D7A736008D9626 /* StringHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringHash.h; sourceTree = "<group>"; };
                9326DC0A09DAD5BE00AFC847 /* CharsetData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharsetData.h; sourceTree = "<group>"; };
                9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLOptionsCollection.cpp; sourceTree = "<group>"; };
                A8CFF79F0A156978000A4234 /* HTMLModElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLModElement.cpp; sourceTree = "<group>"; };
                A8CFF7A00A156978000A4234 /* HTMLBRElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLBRElement.h; sourceTree = "<group>"; };
                A8CFF7A10A156978000A4234 /* HTMLAnchorElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLAnchorElement.h; sourceTree = "<group>"; };
+               A8D05FA50A23B301005E7203 /* JSCSSRuleList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSRuleList.cpp; sourceTree = "<group>"; };
+               A8D05FA60A23B301005E7203 /* JSCSSRuleList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSRuleList.h; sourceTree = "<group>"; };
+               A8D05FA90A23B30F005E7203 /* JSCSSValueList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSValueList.cpp; sourceTree = "<group>"; };
+               A8D05FAA0A23B30F005E7203 /* JSCSSValueList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSValueList.h; sourceTree = "<group>"; };
+               A8D064EF0A23BFEA005E7203 /* HTMLFormElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLFormElement.idl; sourceTree = "<group>"; };
+               A8D064F90A23C0CC005E7203 /* JSHTMLFormElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFormElement.cpp; sourceTree = "<group>"; };
+               A8D064FA0A23C0CC005E7203 /* JSHTMLFormElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLFormElement.h; sourceTree = "<group>"; };
+               A8D0651B0A23C1FE005E7203 /* CSSRuleList.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSRuleList.idl; sourceTree = "<group>"; };
+               A8D0651C0A23C1FE005E7203 /* CSSValueList.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSValueList.idl; sourceTree = "<group>"; };
+               A8D065AD0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFormElementCustom.cpp; sourceTree = "<group>"; };
                A8DF3FC6097FA0FB0052981B /* HTMLFormCollection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLFormCollection.h; sourceTree = "<group>"; };
                A8DF3FC7097FA0FB0052981B /* HTMLFormCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLFormCollection.cpp; sourceTree = "<group>"; };
                A8DF3FC8097FA0FB0052981B /* HTMLCollection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLCollection.h; sourceTree = "<group>"; };
                                930705EA09E0C9F600B17FE4 /* JSCSSPrimitiveValue.h */,
                                14CF7B3109F6ECD700EB3665 /* JSCSSRule.cpp */,
                                14CF7B3209F6ECD700EB3665 /* JSCSSRule.h */,
+                               A8D05FA50A23B301005E7203 /* JSCSSRuleList.cpp */,
+                               A8D05FA60A23B301005E7203 /* JSCSSRuleList.h */,
                                142011B40A003133008303F9 /* JSCSSStyleDeclaration.cpp */,
                                142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */,
                                14CF78A309F58CBF00EB3665 /* JSCSSValue.cpp */,
                                14CF78A509F58CD800EB3665 /* JSCSSValue.h */,
+                               A8D05FA90A23B30F005E7203 /* JSCSSValueList.cpp */,
+                               A8D05FAA0A23B30F005E7203 /* JSCSSValueList.h */,
                                659DDC8009E198BA001BF3C6 /* JSDocument.cpp */,
                                659DDC8109E198BA001BF3C6 /* JSDocument.h */,
                                1A494EDC0A123F4C00FDAFC1 /* JSDocumentFragment.cpp */,
                                1AE2AA130A1CDAB300B42B25 /* JSHTMLFieldSetElement.h */,
                                1AE2AA140A1CDAB300B42B25 /* JSHTMLFontElement.cpp */,
                                1AE2AA150A1CDAB300B42B25 /* JSHTMLFontElement.h */,
+                               A8D064F90A23C0CC005E7203 /* JSHTMLFormElement.cpp */,
+                               A8D064FA0A23C0CC005E7203 /* JSHTMLFormElement.h */,
                                A80E7B0A0A19D606007FB8C5 /* JSHTMLHeadElement.cpp */,
                                A80E7B0B0A19D606007FB8C5 /* JSHTMLHeadElement.h */,
                                1AE2AA1A0A1CDAB400B42B25 /* JSHTMLHeadingElement.cpp */,
                                1A85B18E0A1B18A200D8C87C /* JSHTMLHtmlElement.h */,
                                1AE2AA930A1CDD2D00B42B25 /* JSHTMLImageElement.cpp */,
                                1AE2AA940A1CDD2D00B42B25 /* JSHTMLImageElement.h */,
-                               1AE2AA950A1CDD2D00B42B25 /* JSHTMLIsIndexElement.cpp */,
-                               1AE2AA960A1CDD2D00B42B25 /* JSHTMLIsIndexElement.h */,
                                A80E7E8E0A1A83E3007FB8C5 /* JSHTMLInputElement.cpp */,
                                A80E7E8D0A1A83E3007FB8C5 /* JSHTMLInputElement.h */,
-                               A80E7B060A19D606007FB8C5 /* JSHTMLLinkElement.cpp */,
-                               A80E7B030A19D606007FB8C5 /* JSHTMLLinkElement.h */,
-                               A80E7A150A19C3D6007FB8C5 /* JSHTMLMetaElement.cpp */,
-                               A80E7A160A19C3D6007FB8C5 /* JSHTMLMetaElement.h */,
+                               1AE2AA950A1CDD2D00B42B25 /* JSHTMLIsIndexElement.cpp */,
+                               1AE2AA960A1CDD2D00B42B25 /* JSHTMLIsIndexElement.h */,
                                1AE2AB170A1CE63B00B42B25 /* JSHTMLLabelElement.cpp */,
                                1AE2AB180A1CE63B00B42B25 /* JSHTMLLabelElement.h */,
                                1AE2AB190A1CE63B00B42B25 /* JSHTMLLegendElement.cpp */,
                                1AE2AB1A0A1CE63B00B42B25 /* JSHTMLLegendElement.h */,
                                1AE2AB1B0A1CE63B00B42B25 /* JSHTMLLIElement.cpp */,
                                1AE2AB1C0A1CE63B00B42B25 /* JSHTMLLIElement.h */,
+                               A80E7B060A19D606007FB8C5 /* JSHTMLLinkElement.cpp */,
+                               A80E7B030A19D606007FB8C5 /* JSHTMLLinkElement.h */,
                                1AE2AB1D0A1CE63B00B42B25 /* JSHTMLMapElement.cpp */,
                                1AE2AB1E0A1CE63B00B42B25 /* JSHTMLMapElement.h */,
                                1AE2AE590A1D26F200B42B25 /* JSHTMLMenuElement.cpp */,
                                1AE2AE5A0A1D26F200B42B25 /* JSHTMLMenuElement.h */,
+                               A80E7A150A19C3D6007FB8C5 /* JSHTMLMetaElement.cpp */,
+                               A80E7A160A19C3D6007FB8C5 /* JSHTMLMetaElement.h */,
                                1AE2AB1F0A1CE63B00B42B25 /* JSHTMLModElement.cpp */,
                                1AE2AB200A1CE63B00B42B25 /* JSHTMLModElement.h */,
                                1A85B1E40A1B240500D8C87C /* JSHTMLOListElement.cpp */,
                                A8DF3FC6097FA0FB0052981B /* HTMLFormCollection.h */,
                                A81369B5097374F500D74463 /* HTMLFormElement.cpp */,
                                A81369B4097374F500D74463 /* HTMLFormElement.h */,
+                               A8D064EF0A23BFEA005E7203 /* HTMLFormElement.idl */,
                                A871DE170A152AC800B12A68 /* HTMLFrameElement.cpp */,
                                A871DE1F0A152AC800B12A68 /* HTMLFrameElement.h */,
                                A871DE220A152AC800B12A68 /* HTMLFrameSetElement.cpp */,
                BC1A3793097C6FB10019F3D8 /* js */ = {
                        isa = PBXGroup;
                        children = (
-                               930CAB9609C49FAA00229C04 /* CodeGeneratorJS.pm */,
                                1A9EF4560A1B957D00332B63 /* JSCanvasRenderingContext2DCustom.cpp */,
                                93B70D3F09EB0C7C009D8468 /* JSDOMParser.cpp */,
                                93B70D4009EB0C7C009D8468 /* JSDOMParser.h */,
                                938E65F609F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp */,
                                938E65F009F09840008A48EC /* JSHTMLElementWrapperFactory.h */,
+                               A8D065AD0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp */,
                                A80E7E640A1A82EC007FB8C5 /* JSHTMLInputElementBase.cpp */,
                                A80E7E630A1A82EC007FB8C5 /* JSHTMLInputElementBase.h */,
                                A826E8AD0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.cpp */,
                                14CF7A7009F5CF9A00EB3665 /* CSSRule.idl */,
                                A80E6CDF0A1989CA007FB8C5 /* CSSRuleList.cpp */,
                                A80E6CC80A1989CA007FB8C5 /* CSSRuleList.h */,
+                               A8D0651B0A23C1FE005E7203 /* CSSRuleList.idl */,
                                A80E73480A199C77007FB8C5 /* CSSSelector.cpp */,
                                A80E734B0A199C77007FB8C5 /* CSSSelector.h */,
                                A80E6E0E0A19911C007FB8C5 /* CSSStyleDeclaration.cpp */,
                                BCEA478C097CAAC80094C9E4 /* CSSValueKeywords.in */,
                                A80E6CBA0A1989CA007FB8C5 /* CSSValueList.cpp */,
                                A80E6CBF0A1989CA007FB8C5 /* CSSValueList.h */,
+                               A8D0651C0A23C1FE005E7203 /* CSSValueList.idl */,
                                A80E6CE10A1989CA007FB8C5 /* DashboardRegion.h */,
                                A80E6CC20A1989CA007FB8C5 /* FontFamilyValue.cpp */,
                                A80E6CC90A1989CA007FB8C5 /* FontFamilyValue.h */,
                                1AE2AE5C0A1D26F200B42B25 /* JSHTMLMenuElement.h in Headers */,
                                1AE2AEC80A1D297B00B42B25 /* JSHTMLQuoteElement.h in Headers */,
                                1AE2AEE70A1D2A7500B42B25 /* JSHTMLBlockquoteElement.h in Headers */,
+                               A8D05FA80A23B301005E7203 /* JSCSSRuleList.h in Headers */,
+                               A8D05FAC0A23B30F005E7203 /* JSCSSValueList.h in Headers */,
+                               A8D064FC0A23C0CC005E7203 /* JSHTMLFormElement.h in Headers */,
                                DD7CDF250A23CF9800069928 /* CSSUnknownRule.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                                A7B97B820979C3A1000E8EB1 /* WKLinearTransferFilter.cikernel in Resources */,
                                A7B97B850979C3A1000E8EB1 /* WKTableTransferFilter.cikernel in Resources */,
                                A7638A92099592C30007E14F /* WKDisplacementMapFilter.cikernel in Resources */,
+                               A8D064F00A23BFEA005E7203 /* HTMLFormElement.idl in Resources */,
+                               A8D0651D0A23C1FE005E7203 /* CSSRuleList.idl in Resources */,
+                               A8D0651E0A23C1FE005E7203 /* CSSValueList.idl in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                1AE2AE5B0A1D26F200B42B25 /* JSHTMLMenuElement.cpp in Sources */,
                                1AE2AEC70A1D297B00B42B25 /* JSHTMLQuoteElement.cpp in Sources */,
                                1AE2AEE60A1D2A7500B42B25 /* JSHTMLBlockquoteElement.cpp in Sources */,
+                               A8D05FA70A23B301005E7203 /* JSCSSRuleList.cpp in Sources */,
+                               A8D05FAB0A23B30F005E7203 /* JSCSSValueList.cpp in Sources */,
+                               A8D064FB0A23C0CC005E7203 /* JSHTMLFormElement.cpp in Sources */,
+                               A8D065AE0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index a3a7a435dace4557c005e83340bcad3e282fae8b..e6f879f31cb2541370efd4a1bbf8e0787c09ad52 100644 (file)
@@ -34,6 +34,7 @@
 #include "HTMLDListElement.h"
 #include "HTMLFieldSetElement.h"
 #include "HTMLFontElement.h"
+#include "HTMLFormElement.h"
 #include "HTMLHeadElement.h"
 #include "HTMLHeadingElement.h"
 #include "HTMLHRElement.h"
@@ -79,6 +80,7 @@
 #include "JSHTMLDListElement.h"
 #include "JSHTMLFieldSetElement.h"
 #include "JSHTMLFontElement.h"
+#include "JSHTMLFormElement.h"
 #include "JSHTMLHeadElement.h"
 #include "JSHTMLHeadingElement.h"
 #include "JSHTMLHRElement.h"
@@ -135,6 +137,7 @@ typedef DOMNode* (*CreateHTMLElementWrapperFunction)(ExecState*, PassRefPtr<HTML
     macro(div, Div) \
     macro(dl, DList) \
     macro(fieldset, FieldSet) \
+    macro(form, Form) \
     macro(font, Font) \
     macro(h1, Heading) \
     macro(head, Head) \
@@ -188,9 +191,9 @@ FOR_EACH_TAG(ADD_TO_HASH_MAP)
         map.set(insTag.localName().impl(), createModWrapper);
         map.set(listingTag.localName().impl(), createPreWrapper);
     }
-    CreateHTMLElementWrapperFunction f = map.get(element->localName().impl());
-    if (f)
-        return f(exec, element);
+    CreateHTMLElementWrapperFunction createWrapperFunction = map.get(element->localName().impl());
+    if (createWrapperFunction)
+        return createWrapperFunction(exec, element);
     return new KJS::JSHTMLElement(exec, element.get());
 }
 
diff --git a/WebCore/bindings/js/JSHTMLFormElementCustom.cpp b/WebCore/bindings/js/JSHTMLFormElementCustom.cpp
new file mode 100644 (file)
index 0000000..6d72b69
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "JSHTMLFormElement.h"
+
+#include "HTMLFormElement.h"
+#include "HTMLCollection.h"
+
+using namespace KJS;
+
+namespace WebCore {
+
+bool JSHTMLFormElement::canGetItemsForName(ExecState* exec, HTMLFormElement* form, const AtomicString& propertyName)
+{
+    // FIXME: ideally there should be a lighter-weight way of doing this
+    JSValue* namedItems = JSHTMLCollection(exec, form->elements().get()).getNamedItems(exec, propertyName);
+    return !namedItems->isUndefined();
+}
+
+JSValue* JSHTMLFormElement::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
+{
+    JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
+    HTMLFormElement* form = static_cast<HTMLFormElement*>(thisObj->impl());
+    
+    return JSHTMLCollection(exec, form->elements().get()).getNamedItems(exec, propertyName);
+}
+
+}
index 2e61fc10df14a161b246d0502003616cae4c991b..3c5c1a2d183a4d5513ea05d9bf6f1cc9241b04e7 100644 (file)
@@ -48,7 +48,8 @@ JSValue* JSHTMLInputElementBaseProtoFunc::callAsFunction(ExecState*, JSObject*,
     return 0;
 }
 
-// SetSelectionRange is implemented on the class instead of on the prototype, intentionally.
+// SetSelectionRange is implemented on the class instead of on the prototype
+// to make it easier to enable/disable lookup of the function based on input type.
 class JSHTMLInputElementBaseFunction : public InternalFunctionImp {
 public:
     JSHTMLInputElementBaseFunction(ExecState*, int i, int len, const Identifier& name);
index 36181f0c307f99f2431320b579e0bca4c10a4c04..bca33e2e46221e641fe07928709c1037c97f0e69 100644 (file)
@@ -38,6 +38,8 @@
 #include "JSCSSPrimitiveValue.h"
 #include "JSCSSRule.h"
 #include "JSCSSStyleDeclaration.h"
+#include "JSCSSRuleList.h"
+#include "JSCSSValueList.h"
 #include "MediaList.h"
 #include "StyleSheetList.h"
 #include "kjs_dom.h"
@@ -638,86 +640,6 @@ JSValue* DOMCSSStyleSheetProtoFunc::callAsFunction(ExecState* exec, JSObject* th
 
 // -------------------------------------------------------------------------
 
-const ClassInfo DOMCSSRuleList::info = { "CSSRuleList", 0, &DOMCSSRuleListTable, 0 };
-/*
-@begin DOMCSSRuleListTable 2
-  length                DOMCSSRuleList::Length          DontDelete|ReadOnly
-  item                  DOMCSSRuleList::Item            DontDelete|Function 1
-@end
-*/
-KJS_IMPLEMENT_PROTOFUNC(DOMCSSRuleListFunc) // not really a proto, but doesn't matter
-
-DOMCSSRuleList::DOMCSSRuleList(ExecState *, WebCore::CSSRuleList *rl) 
-  : m_impl(rl) 
-{ 
-}
-
-DOMCSSRuleList::~DOMCSSRuleList()
-{
-  ScriptInterpreter::forgetDOMObject(m_impl.get());
-}
-
-JSValue* DOMCSSRuleList::getValueProperty(ExecState* exec, int token) const
-{
-  switch (token) {
-  case Length:
-    return jsNumber(m_impl->length());
-  default:
-    assert(0);
-    return jsUndefined();
-  }
-}
-
-JSValue* DOMCSSRuleList::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
-{
-  DOMCSSRuleList *thisObj = static_cast<DOMCSSRuleList*>(slot.slotBase());
-  return toJS(exec, thisObj->m_impl->item(slot.index()));
-}
-
-bool DOMCSSRuleList::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
-  const HashEntry* entry = Lookup::findEntry(&DOMCSSRuleListTable, propertyName);
-
-  if (entry) {
-    if (entry->attr & Function)
-      slot.setStaticEntry(this, entry, staticFunctionGetter<DOMCSSRuleListFunc>);
-    else
-      slot.setStaticEntry(this, entry, staticValueGetter<DOMCSSRuleList>);
-    return true;
-  }
-
-  CSSRuleList &cssRuleList = *m_impl;
-
-  bool ok;
-  unsigned u = propertyName.toUInt32(&ok);
-  if (ok && u < cssRuleList.length()) {
-    slot.setCustomIndex(this, u, indexGetter);
-    return true;
-  }
-
-  return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
-}
-
-JSValue* DOMCSSRuleListFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
-{
-  if (!thisObj->inherits(&KJS::DOMCSSRuleList::info))
-    return throwError(exec, TypeError);
-  CSSRuleList &cssRuleList = *static_cast<DOMCSSRuleList*>(thisObj)->impl();
-  switch (id) {
-    case DOMCSSRuleList::Item:
-      return toJS(exec,cssRuleList.item(args[0]->toInt32(exec)));
-    default:
-      return jsUndefined();
-  }
-}
-
-JSValue* toJS(ExecState* exec, CSSRuleList *rl)
-{
-  return cacheDOMObject<CSSRuleList, DOMCSSRuleList>(exec, rl);
-}
-
-// -------------------------------------------------------------------------
-
 KJS_IMPLEMENT_PROTOFUNC(DOMCSSRuleFunc) // Not a proto, but doesn't matter
 
 DOMCSSRule::DOMCSSRule(ExecState*, WebCore::CSSRule* r)
@@ -982,7 +904,7 @@ JSValue* toJS(ExecState* exec, CSSValue *v)
     return ret;
   else {
     if (v->isValueList())
-      ret = new DOMCSSValueList(exec, static_cast<CSSValueList*>(v));
+      ret = new JSCSSValueList(exec, static_cast<CSSValueList*>(v));
     else if (v->isPrimitiveValue())
       ret = new JSCSSPrimitiveValue(exec, static_cast<CSSPrimitiveValue*>(v));
     else
@@ -994,69 +916,6 @@ JSValue* toJS(ExecState* exec, CSSValue *v)
 
 // -------------------------------------------------------------------------
 
-const ClassInfo DOMCSSValueList::info = { "CSSValueList", 0, &DOMCSSValueListTable, 0 };
-
-/*
-@begin DOMCSSValueListTable 3
-  length                DOMCSSValueList::Length         DontDelete|ReadOnly
-  item                  DOMCSSValueList::Item           DontDelete|Function 1
-@end
-*/
-KJS_IMPLEMENT_PROTOFUNC(DOMCSSValueListFunc) // not really a proto, but doesn't matter
-
-DOMCSSValueList::DOMCSSValueList(ExecState* exec, CSSValueList *v)
-  : DOMCSSValue(exec, v) 
-{ 
-}
-
-JSValue* DOMCSSValueList::getValueProperty(ExecState* exec, int token) const
-{
-  assert(token == Length);
-  return jsNumber(static_cast<CSSValueList*>(impl())->length());
-}
-
-JSValue* DOMCSSValueList::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
-{
-  DOMCSSValueList *thisObj = static_cast<DOMCSSValueList*>(slot.slotBase());
-  return toJS(exec, static_cast<CSSValueList*>(thisObj->impl())->item(slot.index()));
-}
-
-bool DOMCSSValueList::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
-  CSSValueList &valueList = *static_cast<CSSValueList*>(impl());
-  const HashEntry* entry = Lookup::findEntry(&DOMCSSValueListTable, propertyName);
-  if (entry) {
-    if (entry->attr & Function)
-      slot.setStaticEntry(this, entry, staticFunctionGetter<DOMCSSValueListFunc>);
-    else
-      slot.setStaticEntry(this, entry, staticValueGetter<DOMCSSValueList>);
-  }
-
-  bool ok;
-  unsigned u = propertyName.toUInt32(&ok);
-  if (ok && u < valueList.length()) {
-    slot.setCustomIndex(this, u, indexGetter);
-    return true;
-  }
-
-  return DOMCSSValue::getOwnPropertySlot(exec, propertyName, slot);
-}
-
-JSValue* DOMCSSValueListFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
-{
-  if (!thisObj->inherits(&KJS::DOMCSSValue::info))
-    return throwError(exec, TypeError);
-  CSSValueList &valueList = *static_cast<CSSValueList*>(static_cast<DOMCSSValueList*>(thisObj)->impl());
-  switch (id) {
-    case DOMCSSValueList::Item:
-      return toJS(exec,valueList.item(args[0]->toInt32(exec)));
-    default:
-      return jsUndefined();
-  }
-}
-
-// -------------------------------------------------------------------------
-
 const ClassInfo DOMRGBColor::info = { "RGBColor", 0, &DOMRGBColorTable, 0 };
 
 /*
index e70ba73d93b95d32be48f6491499ad4b90cd7fcd..eca6ff340d1bda55b20d4d5c54b5021e4ca8b6b1 100644 (file)
@@ -148,25 +148,6 @@ namespace KJS {
     enum { OwnerRule, CssRules, Rules, InsertRule, DeleteRule, AddRule, RemoveRule };
   };
 
-  class DOMCSSRuleList : public DOMObject {
-  public:
-    DOMCSSRuleList(ExecState*, WebCore::CSSRuleList*);
-    virtual ~DOMCSSRuleList();
-    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
-    JSValue* getValueProperty(ExecState*, int token) const;
-    // no put - all read-only
-    virtual const ClassInfo* classInfo() const { return &info; }
-    static const ClassInfo info;
-    enum { Item, Length };
-    WebCore::CSSRuleList* impl() const { return m_impl.get(); }
-  private:
-    static JSValue* indexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
-
-    RefPtr<WebCore::CSSRuleList> m_impl;
-  };
-
-  JSValue* toJS(ExecState*, WebCore::CSSRuleList*);
-
   class DOMCSSRule : public DOMObject {
   public:
     DOMCSSRule(ExecState*, WebCore::CSSRule*);
@@ -211,19 +192,6 @@ namespace KJS {
 
   JSValue* toJS(ExecState*, WebCore::CSSValue*);
 
-  class DOMCSSValueList : public DOMCSSValue {
-  public:
-    DOMCSSValueList(ExecState*, WebCore::CSSValueList*);
-    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
-    JSValue* getValueProperty(ExecState*, int token) const;
-    // no put - all read-only
-    virtual const ClassInfo* classInfo() const { return &info; }
-    static const ClassInfo info;
-    enum { Length, Item };
-  private:
-    static JSValue* indexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
-  };
-
   class DOMRGBColor : public DOMObject {
   public:
     DOMRGBColor(unsigned color) : m_color(color) { }
index 8f7f931b365a5928d9bf925fea18facf77bf4eba..069d006bf20def5563d8bdf28b011d467e185418 100644 (file)
@@ -733,7 +733,7 @@ JSValue *DOMNodeList::indexGetter(ExecState *exec, JSObject *originalObject, con
 JSValue *DOMNodeList::nameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
   DOMNodeList *thisObj = static_cast<DOMNodeList*>(slot.slotBase());
-  return toJS(exec, thisObj->m_impl->itemById(propertyName));
+  return toJS(exec, thisObj->m_impl->itemWithName(propertyName));
 }
 
 bool DOMNodeList::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -748,15 +748,13 @@ bool DOMNodeList::getOwnPropertySlot(ExecState *exec, const Identifier& property
     return true;
   }
 
-  NodeList &list = *m_impl;
-
   // array index ?
   bool ok;
   unsigned idx = propertyName.toUInt32(&ok);
-  if (ok && idx < list.length()) {
+  if (ok && idx < m_impl->length()) {
     slot.setCustomIndex(this, idx, indexGetter);
     return true;
-  } else if (list.itemById(String(propertyName).impl())) {
+  } else if (m_impl->itemWithName(String(propertyName).impl())) {
     slot.setCustom(this, nameGetter);
     return true;
   }
@@ -871,7 +869,7 @@ bool DOMNamedNodeMap::getOwnPropertySlot(ExecState* exec, const Identifier& prop
       return true;
   } else {
     // Look in the prototype (for functions) before assuming it's an item's name
-    JSValue *proto = prototype();
+    JSValueproto = prototype();
     if (proto->isObject() && static_cast<JSObject*>(proto)->hasProperty(exec, propertyName))
       return false;
 
index 54c5ce676c7abef9043c49ed7e1bc7e6aeda72da..482f49035a40d20bf1104761b590cde69fae632f 100644 (file)
@@ -85,8 +85,8 @@ namespace KJS {
 
 class HTMLElementFunction : public InternalFunctionImp {
 public:
-  HTMLElementFunction(ExecState *exec, int i, int len, const Identifier& name);
-  virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List&args);
+  HTMLElementFunction(ExecStateexec, int i, int len, const Identifier& name);
+  virtual JSValue *callAsFunction(ExecState* exec, JSObject* thisObj, const List&args);
 private:
   int id;
 };
@@ -106,7 +106,7 @@ releaseEvents         JSHTMLDocument::ReleaseEvents     DontDelete|Function 0
 KJS_IMPLEMENT_PROTOFUNC(JSHTMLDocumentProtoFunc)
 KJS_IMPLEMENT_PROTOTYPE("HTMLDocument", JSHTMLDocumentProto, JSHTMLDocumentProtoFunc)
 
-JSValue *JSHTMLDocumentProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
+JSValue *JSHTMLDocumentProtoFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
 {
     if (!thisObj->inherits(&JSHTMLDocument::info))
         return throwError(exec, TypeError);
@@ -123,7 +123,7 @@ JSValue *JSHTMLDocumentProtoFunc::callAsFunction(ExecState *exec, JSObject *this
                 if (frame) {
                     Window *window = Window::retrieveWindow(frame);
                     if (window) {
-                        JSObject *functionObject = window->get(exec, "open")->getObject();
+                        JSObjectfunctionObject = window->get(exec, "open")->getObject();
                         if (!functionObject || !functionObject->implementsCall())
                             return throwError(exec, TypeError);
                         return functionObject->call(exec, window, args);
@@ -202,13 +202,13 @@ const ClassInfo JSHTMLDocument::info =
 @end
 */
 
-JSHTMLDocument::JSHTMLDocument(ExecState *exec, HTMLDocument *d)
+JSHTMLDocument::JSHTMLDocument(ExecStateexec, HTMLDocument *d)
   : JSDocument(exec, d)
 {
     setPrototype(JSHTMLDocumentProto::self(exec));
 }
 
-JSValue *JSHTMLDocument::namedItemGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *JSHTMLDocument::namedItemGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
   JSHTMLDocument *thisObj = static_cast<JSHTMLDocument*>(slot.slotBase());
   HTMLDocument &doc = *static_cast<HTMLDocument*>(thisObj->impl());
@@ -227,7 +227,7 @@ JSValue *JSHTMLDocument::namedItemGetter(ExecState *exec, JSObject *originalObje
   return getHTMLCollection(exec, collection.get());
 }
 
-JSValue *JSHTMLDocument::getValueProperty(ExecState *exec, int token) const
+JSValue *JSHTMLDocument::getValueProperty(ExecStateexec, int token) const
 {
   HTMLDocument& doc = *static_cast<HTMLDocument*>(impl());
 
@@ -312,7 +312,7 @@ JSValue *JSHTMLDocument::getValueProperty(ExecState *exec, int token) const
   }
 }
 
-bool JSHTMLDocument::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool JSHTMLDocument::getOwnPropertySlot(ExecStateexec, const Identifier& propertyName, PropertySlot& slot)
 {
   HTMLDocument &doc = *static_cast<HTMLDocument*>(impl());
 
@@ -333,17 +333,17 @@ bool JSHTMLDocument::getOwnPropertySlot(ExecState *exec, const Identifier& prope
   return JSDocument::getOwnPropertySlot(exec, propertyName, slot);
 }
 
-void JSHTMLDocument::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
+void JSHTMLDocument::put(ExecStateexec, const Identifier &propertyName, JSValue *value, int attr)
 {
     lookupPut<JSHTMLDocument, JSDocument>(exec, propertyName, value, attr, &HTMLDocumentTable, this);
 }
 
-void JSHTMLDocument::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
+void JSHTMLDocument::putValueProperty(ExecStateexec, int token, JSValue *value, int /*attr*/)
 {
   DOMExceptionTranslator exception(exec);
   HTMLDocument &doc = *static_cast<HTMLDocument*>(impl());
-  HTMLElement *body = doc.body();
-  HTMLBodyElement *bodyElement = (body && body->hasTagName(bodyTag)) ? static_cast<HTMLBodyElement*>(body) : 0;
+  HTMLElementbody = doc.body();
+  HTMLBodyElementbodyElement = (body && body->hasTagName(bodyTag)) ? static_cast<HTMLBodyElement*>(body) : 0;
 
   switch (token) {
   case Title:
@@ -443,7 +443,6 @@ void JSHTMLDocument::putValueProperty(ExecState *exec, int token, JSValue *value
 const ClassInfo JSHTMLElement::caption_info = { "HTMLTableCaptionElement", &JSHTMLElement::info, &HTMLTableCaptionElementTable, 0 };
 const ClassInfo JSHTMLElement::col_info = { "HTMLTableColElement", &JSHTMLElement::info, &HTMLTableColElementTable, 0 };
 const ClassInfo JSHTMLElement::embed_info = { "HTMLEmbedElement", &JSHTMLElement::info, &HTMLEmbedElementTable, 0 };
-const ClassInfo JSHTMLElement::form_info = { "HTMLFormElement", &JSHTMLElement::info, &HTMLFormElementTable, 0 };
 const ClassInfo JSHTMLElement::frameSet_info = { "HTMLFrameSetElement", &JSHTMLElement::info, &HTMLFrameSetElementTable, 0 };
 const ClassInfo JSHTMLElement::frame_info = { "HTMLFrameElement", &JSHTMLElement::info, &HTMLFrameElementTable, 0 };
 const ClassInfo JSHTMLElement::iFrame_info = { "HTMLIFrameElement", &JSHTMLElement::info, &HTMLIFrameElementTable, 0 };
@@ -464,7 +463,6 @@ const ClassInfo* JSHTMLElement::classInfo() const
         classInfoMap.set(colTag.localName().impl(), &col_info);
         classInfoMap.set(colgroupTag.localName().impl(), &col_info);
         classInfoMap.set(embedTag.localName().impl(), &embed_info);
-        classInfoMap.set(formTag.localName().impl(), &form_info);
         classInfoMap.set(frameTag.localName().impl(), &frame_info);
         classInfoMap.set(framesetTag.localName().impl(), &frameSet_info);
         classInfoMap.set(iframeTag.localName().impl(), &iFrame_info);
@@ -487,7 +485,6 @@ const ClassInfo* JSHTMLElement::classInfo() const
     return &info;
 }
 
-const JSHTMLElement::Accessors JSHTMLElement::form_accessors = { &JSHTMLElement::formGetter, &JSHTMLElement::formSetter };
 const JSHTMLElement::Accessors JSHTMLElement::select_accessors = { &JSHTMLElement::selectGetter, &JSHTMLElement::selectSetter };
 const JSHTMLElement::Accessors JSHTMLElement::object_accessors = { &JSHTMLElement::objectGetter, &JSHTMLElement::objectSetter };
 const JSHTMLElement::Accessors JSHTMLElement::embed_accessors = { &JSHTMLElement::embedGetter, &JSHTMLElement::embedSetter };
@@ -510,7 +507,6 @@ const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
         accessorMap.add(colTag.localName().impl(), &col_accessors);
         accessorMap.add(colgroupTag.localName().impl(), &col_accessors);
         accessorMap.add(embedTag.localName().impl(), &embed_accessors);
-        accessorMap.add(formTag.localName().impl(), &form_accessors);
         accessorMap.add(frameTag.localName().impl(), &frame_accessors);
         accessorMap.add(framesetTag.localName().impl(), &frameSet_accessors);
         accessorMap.add(iframeTag.localName().impl(), &iFrame_accessors);
@@ -551,19 +547,6 @@ const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
   contentEditable   KJS::JSHTMLElement::ElementContentEditable  DontDelete
   isContentEditable KJS::JSHTMLElement::ElementIsContentEditable  DontDelete|ReadOnly
 @end
-@begin HTMLFormElementTable 11
-# Also supported, by name/index
-  elements      KJS::JSHTMLElement::FormElements  DontDelete|ReadOnly
-  length        KJS::JSHTMLElement::FormLength    DontDelete|ReadOnly
-  name          KJS::JSHTMLElement::FormName      DontDelete
-  acceptCharset KJS::JSHTMLElement::FormAcceptCharset     DontDelete
-  action        KJS::JSHTMLElement::FormAction    DontDelete
-  enctype       KJS::JSHTMLElement::FormEncType   DontDelete
-  method        KJS::JSHTMLElement::FormMethod    DontDelete
-  target        KJS::JSHTMLElement::FormTarget    DontDelete
-  submit        KJS::JSHTMLElement::FormSubmit    DontDelete|Function 0
-  reset         KJS::JSHTMLElement::FormReset     DontDelete|Function 0
-@end
 @begin HTMLSelectElementTable 11
 # Also supported, by index
   type          KJS::JSHTMLElement::SelectType    DontDelete|ReadOnly
@@ -733,40 +716,24 @@ JSValue* JSHTMLElementProtoFunc::callAsFunction(ExecState*, JSObject*, const Lis
     return 0;
 }
 
-JSHTMLElement::JSHTMLElement(ExecState *exec, HTMLElement *e)
+JSHTMLElement::JSHTMLElement(ExecState* exec, HTMLElement* e)
     : WebCore::JSHTMLElement(exec, e)
 {
     setPrototype(JSHTMLElementProto::self(exec));
 }
 
-JSValue *JSHTMLElement::formIndexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
-{
-    JSHTMLElement *thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
-    HTMLFormElement *form = static_cast<HTMLFormElement*>(thisObj->impl());
-
-    return toJS(exec, form->elements()->item(slot.index()));
-}
-
-JSValue *JSHTMLElement::formNameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
-{
-    JSHTMLElement *thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
-    HTMLFormElement *form = static_cast<HTMLFormElement*>(thisObj->impl());
-    
-    return JSHTMLCollection(exec, form->elements().get()).getNamedItems(exec, propertyName);
-}
-
-JSValue *JSHTMLElement::selectIndexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *JSHTMLElement::selectIndexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
-    JSHTMLElement *thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
-    HTMLSelectElement *select = static_cast<HTMLSelectElement*>(thisObj->impl());
+    JSHTMLElementthisObj = static_cast<JSHTMLElement*>(slot.slotBase());
+    HTMLSelectElementselect = static_cast<HTMLSelectElement*>(thisObj->impl());
 
     return toJS(exec, select->options()->item(slot.index()));
 }
 
-JSValue *JSHTMLElement::framesetNameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *JSHTMLElement::framesetNameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
-    JSHTMLElement *thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
-    HTMLElement *element = static_cast<HTMLElement*>(thisObj->impl());
+    JSHTMLElementthisObj = static_cast<JSHTMLElement*>(slot.slotBase());
+    HTMLElementelement = static_cast<HTMLElement*>(thisObj->impl());
 
     WebCore::Node *frame = element->children()->namedItem(propertyName);
     if (Document* doc = static_cast<HTMLFrameElement*>(frame)->contentDocument())
@@ -776,46 +743,30 @@ JSValue *JSHTMLElement::framesetNameGetter(ExecState *exec, JSObject *originalOb
     return jsUndefined();
 }
 
-JSValue *JSHTMLElement::runtimeObjectGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *JSHTMLElement::runtimeObjectGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
-    JSHTMLElement *thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
-    HTMLElement *element = static_cast<HTMLElement*>(thisObj->impl());
+    JSHTMLElementthisObj = static_cast<JSHTMLElement*>(slot.slotBase());
+    HTMLElementelement = static_cast<HTMLElement*>(thisObj->impl());
 
     return getRuntimeObject(exec, element);
 }
 
-JSValue *JSHTMLElement::runtimeObjectPropertyGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *JSHTMLElement::runtimeObjectPropertyGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
-    JSHTMLElement *thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
-    HTMLElement *element = static_cast<HTMLElement*>(thisObj->impl());
+    JSHTMLElementthisObj = static_cast<JSHTMLElement*>(slot.slotBase());
+    HTMLElementelement = static_cast<HTMLElement*>(thisObj->impl());
 
     if (JSValue *runtimeObject = getRuntimeObject(exec, element))
         return static_cast<JSObject*>(runtimeObject)->get(exec, propertyName);
     return jsUndefined();
 }
 
-bool JSHTMLElement::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool JSHTMLElement::getOwnPropertySlot(ExecStateexec, const Identifier& propertyName, PropertySlot& slot)
 {
     HTMLElement &element = *static_cast<HTMLElement*>(impl());
 
     // First look at dynamic properties
-    if (element.hasLocalName(formTag)) {
-        HTMLFormElement &form = static_cast<HTMLFormElement &>(element);
-        // Check if we're retrieving an element (by index or by name)
-        bool ok;
-        unsigned u = propertyName.toUInt32(&ok);
-        if (ok) {
-            slot.setCustomIndex(this, u, formIndexGetter);
-            return true;
-        }
-
-        // FIXME: need faster way to check for a named item and/or a way to pass on the named items subcollection
-        JSValue *namedItems = JSHTMLCollection(exec, form.elements().get()).getNamedItems(exec, propertyName);
-        if (!namedItems->isUndefined()) {
-            slot.setCustom(this, formNameGetter);
-            return true;
-        }
-    } else if (element.hasLocalName(selectTag)) {
+    if (element.hasLocalName(selectTag)) {
         bool ok;
         unsigned u = propertyName.toUInt32(&ok);
         if (ok) {
@@ -836,7 +787,7 @@ bool JSHTMLElement::getOwnPropertySlot(ExecState *exec, const Identifier& proper
         }
         JSValue *runtimeObject = getRuntimeObject(exec,&element);
         if (runtimeObject) {
-            JSObject *imp = static_cast<JSObject*>(runtimeObject);
+            JSObjectimp = static_cast<JSObject*>(runtimeObject);
             if (imp->hasProperty(exec, propertyName)) {
                 slot.setCustom(this, runtimeObjectPropertyGetter);
                 return true;
@@ -860,20 +811,20 @@ bool JSHTMLElement::getOwnPropertySlot(ExecState *exec, const Identifier& proper
 
 bool JSHTMLElement::implementsCall() const
 {
-    HTMLElement *element = static_cast<HTMLElement*>(impl());
+    HTMLElementelement = static_cast<HTMLElement*>(impl());
     if (element->hasTagName(embedTag) || element->hasTagName(objectTag) || element->hasTagName(appletTag)) {
         Document* doc = element->document();
         KJSProxy *proxy = doc->frame()->jScript();
-        ExecState *exec = proxy->interpreter()->globalExec();
+        ExecStateexec = proxy->interpreter()->globalExec();
         if (JSValue *runtimeObject = getRuntimeObject(exec, element))
             return static_cast<JSObject*>(runtimeObject)->implementsCall();
     }
     return false;
 }
 
-JSValue *JSHTMLElement::callAsFunction(ExecState *exec, JSObject *thisObj, const List&args)
+JSValue *JSHTMLElement::callAsFunction(ExecState* exec, JSObject* thisObj, const List&args)
 {
-    HTMLElement *element = static_cast<HTMLElement*>(impl());
+    HTMLElementelement = static_cast<HTMLElement*>(impl());
     if (element->hasTagName(embedTag) || element->hasTagName(objectTag) || element->hasTagName(appletTag)) {
         if (JSValue *runtimeObject = getRuntimeObject(exec, element))
             return static_cast<JSObject*>(runtimeObject)->call(exec, thisObj, args);
@@ -881,22 +832,6 @@ JSValue *JSHTMLElement::callAsFunction(ExecState *exec, JSObject *thisObj, const
     return jsUndefined();
 }
 
-JSValue *JSHTMLElement::formGetter(ExecState* exec, int token) const
-{
-    HTMLFormElement& form = *static_cast<HTMLFormElement*>(impl());
-    switch (token) {
-        case FormElements:        return getHTMLCollection(exec, form.elements().get());
-        case FormLength:          return jsNumber(form.length());
-        case FormName:            return jsString(form.name());
-        case FormAcceptCharset:   return jsString(form.acceptCharset());
-        case FormAction:          return jsString(form.action());
-        case FormEncType:         return jsString(form.enctype());
-        case FormMethod:          return jsString(form.method());
-        case FormTarget:          return jsString(form.target());
-    }
-    return jsUndefined();
-}
-
 JSValue *JSHTMLElement::selectGetter(ExecState* exec, int token) const
 {
     HTMLSelectElement& select = *static_cast<HTMLSelectElement*>(impl());
@@ -1146,7 +1081,7 @@ JSValue *JSHTMLElement::marqueeGetter(ExecState* exec, int token) const
     return jsUndefined();
 }
 
-JSValue *JSHTMLElement::getValueProperty(ExecState *exec, int token) const
+JSValue *JSHTMLElement::getValueProperty(ExecStateexec, int token) const
 {
     // Check our set of generic properties first.
     HTMLElement &element = *static_cast<HTMLElement*>(impl());
@@ -1187,7 +1122,7 @@ JSValue *JSHTMLElement::getValueProperty(ExecState *exec, int token) const
     return jsUndefined();
 }
 
-UString JSHTMLElement::toString(ExecState *exec) const
+UString JSHTMLElement::toString(ExecStateexec) const
 {
     if (impl()->hasTagName(aTag))
         return UString(static_cast<const HTMLAnchorElement*>(impl())->href());
@@ -1195,7 +1130,7 @@ UString JSHTMLElement::toString(ExecState *exec) const
         return JSElement::toString(exec);
 }
 
-static HTMLFormElement *getForm(HTMLElement *element)
+static HTMLFormElement* getForm(HTMLElement* element)
 {
     if (element->isGenericFormElement())
         return static_cast<HTMLGenericFormElement*>(element)->form();
@@ -1207,9 +1142,9 @@ static HTMLFormElement *getForm(HTMLElement *element)
     return 0;
 }
 
-void JSHTMLElement::pushEventHandlerScope(ExecState *exec, ScopeChain &scope) const
+void JSHTMLElement::pushEventHandlerScope(ExecStateexec, ScopeChain &scope) const
 {
-  HTMLElement *element = static_cast<HTMLElement*>(impl());
+  HTMLElementelement = static_cast<HTMLElement*>(impl());
 
   // The document is put on first, fall back to searching it only after the element and form.
   scope.push(static_cast<JSObject*>(toJS(exec, element->ownerDocument())));
@@ -1219,7 +1154,7 @@ void JSHTMLElement::pushEventHandlerScope(ExecState *exec, ScopeChain &scope) co
   // First try to obtain the form from the element itself.  We do this to deal with
   // the malformed case where <form>s aren't in our parent chain (e.g., when they were inside 
   // <table> or <tbody>.
-  HTMLFormElement *form = getForm(element);
+  HTMLFormElementform = getForm(element);
   if (form)
     scope.push(static_cast<JSObject*>(toJS(exec, form)));
   else {
@@ -1235,32 +1170,21 @@ void JSHTMLElement::pushEventHandlerScope(ExecState *exec, ScopeChain &scope) co
   scope.push(static_cast<JSObject*>(toJS(exec, element)));
 }
 
-HTMLElementFunction::HTMLElementFunction(ExecState *exec, int i, int len, const Identifier& name)
+HTMLElementFunction::HTMLElementFunction(ExecStateexec, int i, int len, const Identifier& name)
   : InternalFunctionImp(static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype()), name)
   , id(i)
 {
   put(exec,lengthPropertyName,jsNumber(len),DontDelete|ReadOnly|DontEnum);
 }
 
-JSValue *HTMLElementFunction::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
+JSValue *HTMLElementFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
 {
     if (!thisObj->inherits(&JSHTMLElement::info))
         return throwError(exec, TypeError);
     DOMExceptionTranslator exception(exec);
     HTMLElement &element = *static_cast<HTMLElement*>(static_cast<JSHTMLElement*>(thisObj)->impl());
 
-    if (element.hasLocalName(formTag)) {
-        HTMLFormElement &form = static_cast<HTMLFormElement &>(element);
-        if (id == JSHTMLElement::FormSubmit) {
-            form.submit();
-            return jsUndefined();
-        }
-        else if (id == JSHTMLElement::FormReset) {
-            form.reset();
-            return jsUndefined();
-        }
-    }
-    else if (element.hasLocalName(selectTag)) {
+    if (element.hasLocalName(selectTag)) {
         HTMLSelectElement &select = static_cast<HTMLSelectElement &>(element);
         if (id == JSHTMLElement::SelectAdd) {
             select.add(toHTMLElement(args[0]), toHTMLElement(args[1]), exception);
@@ -1344,7 +1268,7 @@ JSValue *HTMLElementFunction::callAsFunction(ExecState *exec, JSObject *thisObj,
     return jsUndefined();
 }
 
-void JSHTMLElement::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
+void JSHTMLElement::put(ExecStateexec, const Identifier &propertyName, JSValue *value, int attr)
 {
     HTMLElement &element = *static_cast<HTMLElement*>(impl());
     // First look at dynamic properties
@@ -1353,14 +1277,14 @@ void JSHTMLElement::put(ExecState *exec, const Identifier &propertyName, JSValue
         bool ok;
         /*unsigned u =*/ propertyName.toUInt32(&ok);
         if (ok) {
-            JSObject *coll = static_cast<JSObject*>(getSelectHTMLCollection(exec, select.options().get(), &select));
+            JSObjectcoll = static_cast<JSObject*>(getSelectHTMLCollection(exec, select.options().get(), &select));
             coll->put(exec,propertyName,value);
             return;
         }
     }
     else if (element.hasLocalName(embedTag) || element.hasLocalName(objectTag) || element.hasLocalName(appletTag)) {
         if (JSValue *runtimeObject = getRuntimeObject(exec, &element)) {
-            JSObject *imp = static_cast<JSObject*>(runtimeObject);
+            JSObjectimp = static_cast<JSObject*>(runtimeObject);
             if (imp->canPut(exec, propertyName))
                 return imp->put(exec, propertyName, value);
         }
@@ -1381,22 +1305,7 @@ void JSHTMLElement::put(ExecState *exec, const Identifier &propertyName, JSValue
     lookupPut<JSHTMLElement, JSElement>(exec, propertyName, value, attr, &HTMLElementTable, this);
 }
 
-void JSHTMLElement::formSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
-{
-    HTMLFormElement& form = *static_cast<HTMLFormElement*>(impl());
-    switch (token) {
-        // read-only: elements
-        // read-only: length
-        case FormName:            { form.setName(str); return; }
-        case FormAcceptCharset:   { form.setAcceptCharset(str); return; }
-        case FormAction:          { form.setAction(str); return; }
-        case FormEncType:         { form.setEnctype(str); return; }
-        case FormMethod:          { form.setMethod(str); return; }
-        case FormTarget:          { form.setTarget(str); return; }
-    }
-}
-
-void JSHTMLElement::selectSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
+void JSHTMLElement::selectSetter(ExecState* exec, int token, JSValue *value, const WebCore::String& str)
 {
     HTMLSelectElement& select = *static_cast<HTMLSelectElement*>(impl());
     switch (token) {
@@ -1404,7 +1313,7 @@ void JSHTMLElement::selectSetter(ExecState *exec, int token, JSValue *value, con
         case SelectSelectedIndex:   { select.setSelectedIndex(value->toInt32(exec)); return; }
         case SelectValue:           { select.setValue(str); return; }
         case SelectLength:          { // read-only according to the NS spec, but webpages need it writeable
-                                        JSObject *coll = static_cast<JSObject*>(getSelectHTMLCollection(exec, select.options().get(), &select));
+                                        JSObjectcoll = static_cast<JSObject*>(getSelectHTMLCollection(exec, select.options().get(), &select));
                                         coll->put(exec,lengthPropertyName,value);
                                         return;
                                     }
@@ -1418,7 +1327,7 @@ void JSHTMLElement::selectSetter(ExecState *exec, int token, JSValue *value, con
     }
 }
 
-void JSHTMLElement::objectSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
+void JSHTMLElement::objectSetter(ExecStateexec, int token, JSValue *value, const WebCore::String& str)
 {
     HTMLObjectElement& object = *static_cast<HTMLObjectElement*>(impl());
     switch (token) {
@@ -1457,7 +1366,7 @@ void JSHTMLElement::embedSetter(ExecState*, int token, JSValue*, const WebCore::
     }
 }
 
-void JSHTMLElement::tableSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
+void JSHTMLElement::tableSetter(ExecStateexec, int token, JSValue *value, const WebCore::String& str)
 {
     HTMLTableElement& table = *static_cast<HTMLTableElement*>(impl());
     switch (token) {
@@ -1478,14 +1387,14 @@ void JSHTMLElement::tableSetter(ExecState *exec, int token, JSValue *value, cons
     }
 }
 
-void JSHTMLElement::tableCaptionSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
+void JSHTMLElement::tableCaptionSetter(ExecStateexec, int token, JSValue *value, const WebCore::String& str)
 {
     HTMLTableCaptionElement& tableCaption = *static_cast<HTMLTableCaptionElement*>(impl());
     if (token == TableCaptionAlign)
         tableCaption.setAlign(str);
 }
 
-void JSHTMLElement::tableColSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
+void JSHTMLElement::tableColSetter(ExecStateexec, int token, JSValue *value, const WebCore::String& str)
 {
     HTMLTableColElement& tableCol = *static_cast<HTMLTableColElement*>(impl());
     switch (token) {
@@ -1498,7 +1407,7 @@ void JSHTMLElement::tableColSetter(ExecState *exec, int token, JSValue *value, c
     }
 }
 
-void JSHTMLElement::tableSectionSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
+void JSHTMLElement::tableSectionSetter(ExecStateexec, int token, JSValue *value, const WebCore::String& str)
 {
     HTMLTableSectionElement& tableSection = *static_cast<HTMLTableSectionElement*>(impl());
     switch (token) {
@@ -1510,7 +1419,7 @@ void JSHTMLElement::tableSectionSetter(ExecState *exec, int token, JSValue *valu
     }
 }
 
-void JSHTMLElement::tableRowSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
+void JSHTMLElement::tableRowSetter(ExecStateexec, int token, JSValue *value, const WebCore::String& str)
 {
     HTMLTableRowElement& tableRow = *static_cast<HTMLTableRowElement*>(impl());
     switch (token) {
@@ -1525,7 +1434,7 @@ void JSHTMLElement::tableRowSetter(ExecState *exec, int token, JSValue *value, c
     }
 }
 
-void JSHTMLElement::tableCellSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
+void JSHTMLElement::tableCellSetter(ExecStateexec, int token, JSValue *value, const WebCore::String& str)
 {
     HTMLTableCellElement& tableCell = *static_cast<HTMLTableCellElement*>(impl());
     switch (token) {
@@ -1547,7 +1456,7 @@ void JSHTMLElement::tableCellSetter(ExecState *exec, int token, JSValue *value,
     }
 }
 
-void JSHTMLElement::frameSetSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
+void JSHTMLElement::frameSetSetter(ExecStateexec, int token, JSValue *value, const WebCore::String& str)
 {
     HTMLFrameSetElement& frameSet = *static_cast<HTMLFrameSetElement*>(impl());
     switch (token) {
@@ -1556,7 +1465,7 @@ void JSHTMLElement::frameSetSetter(ExecState *exec, int token, JSValue *value, c
     }
 }
 
-void JSHTMLElement::frameSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
+void JSHTMLElement::frameSetter(ExecStateexec, int token, JSValue *value, const WebCore::String& str)
 {
     HTMLFrameElement& frameElement = *static_cast<HTMLFrameElement*>(impl());
     switch (token) {
@@ -1573,7 +1482,7 @@ void JSHTMLElement::frameSetter(ExecState *exec, int token, JSValue *value, cons
     }
 }
 
-void JSHTMLElement::iFrameSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
+void JSHTMLElement::iFrameSetter(ExecStateexec, int token, JSValue *value, const WebCore::String& str)
 {
     HTMLIFrameElement& iFrame = *static_cast<HTMLIFrameElement*>(impl());
     switch (token) {
@@ -1591,12 +1500,12 @@ void JSHTMLElement::iFrameSetter(ExecState *exec, int token, JSValue *value, con
     }
 }
 
-void JSHTMLElement::marqueeSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
+void JSHTMLElement::marqueeSetter(ExecStateexec, int token, JSValue *value, const WebCore::String& str)
 {
     // FIXME: Find out what WinIE supports and implement it.
 }
 
-void JSHTMLElement::putValueProperty(ExecState *exec, int token, JSValue *value, int)
+void JSHTMLElement::putValueProperty(ExecStateexec, int token, JSValue *value, int)
 {
     DOMExceptionTranslator exception(exec);
     WebCore::String str = value->toString(exec);
@@ -1639,24 +1548,24 @@ void JSHTMLElement::putValueProperty(ExecState *exec, int token, JSValue *value,
         return (this->*(access->m_setter))(exec, token, value, str);  
 }
 
-HTMLElement *toHTMLElement(JSValue *val)
+HTMLElementtoHTMLElement(JSValue *val)
 {
     if (!val || !val->isObject(&JSHTMLElement::info))
         return 0;
     return static_cast<HTMLElement*>(static_cast<JSHTMLElement*>(val)->impl());
 }
 
-HTMLTableCaptionElement *toHTMLTableCaptionElement(JSValue *val)
+HTMLTableCaptionElementtoHTMLTableCaptionElement(JSValue *val)
 {
-    HTMLElement *e = toHTMLElement(val);
+    HTMLElemente = toHTMLElement(val);
     if (e && e->hasTagName(captionTag))
         return static_cast<HTMLTableCaptionElement*>(e);
     return 0;
 }
 
-HTMLTableSectionElement *toHTMLTableSectionElement(JSValue *val)
+HTMLTableSectionElementtoHTMLTableSectionElement(JSValue *val)
 {
-    HTMLElement *e = toHTMLElement(val);
+    HTMLElemente = toHTMLElement(val);
     if (e && (e->hasTagName(theadTag) || e->hasTagName(tbodyTag) || e->hasTagName(tfootTag)))
         return static_cast<HTMLTableSectionElement*>(e);
     return 0;
@@ -1676,7 +1585,7 @@ KJS_IMPLEMENT_PROTOTYPE("HTMLCollection",HTMLCollectionProto,HTMLCollectionProto
 
 const ClassInfo JSHTMLCollection::info = { "HTMLCollection", 0, 0, 0 };
 
-JSHTMLCollection::JSHTMLCollection(ExecState *exec, HTMLCollection *c)
+JSHTMLCollection::JSHTMLCollection(ExecStateexec, HTMLCollection *c)
   : m_impl(c) 
 {
   setPrototype(HTMLCollectionProto::self(exec));
@@ -1687,25 +1596,25 @@ JSHTMLCollection::~JSHTMLCollection()
   ScriptInterpreter::forgetDOMObject(m_impl.get());
 }
 
-JSValue *JSHTMLCollection::lengthGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *JSHTMLCollection::lengthGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
     JSHTMLCollection *thisObj = static_cast<JSHTMLCollection*>(slot.slotBase());
     return jsNumber(thisObj->m_impl->length());
 }
 
-JSValue *JSHTMLCollection::indexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *JSHTMLCollection::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
     JSHTMLCollection *thisObj = static_cast<JSHTMLCollection*>(slot.slotBase());
     return toJS(exec, thisObj->m_impl->item(slot.index()));
 }
 
-JSValue *JSHTMLCollection::nameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *JSHTMLCollection::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
     JSHTMLCollection *thisObj = static_cast<JSHTMLCollection*>(slot.slotBase());
     return thisObj->getNamedItems(exec, propertyName);
 }
 
-bool JSHTMLCollection::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool JSHTMLCollection::getOwnPropertySlot(ExecStateexec, const Identifier& propertyName, PropertySlot& slot)
 {
   if (propertyName == lengthPropertyName) {
       slot.setCustom(this, lengthGetter);
@@ -1735,7 +1644,7 @@ bool JSHTMLCollection::getOwnPropertySlot(ExecState *exec, const Identifier& pro
 
 // HTMLCollections are strange objects, they support both get and call,
 // so that document.forms.item(0) and document.forms(0) both work.
-JSValue *JSHTMLCollection::callAsFunction(ExecState *exec, JSObject *, const List &args)
+JSValue *JSHTMLCollection::callAsFunction(ExecState* exec, JSObject* , const List &args)
 {
   // Do not use thisObj here. It can be the JSHTMLDocument, in the document.forms(i) case.
   HTMLCollection &collection = *m_impl;
@@ -1772,7 +1681,7 @@ JSValue *JSHTMLCollection::callAsFunction(ExecState *exec, JSObject *, const Lis
   return jsUndefined();
 }
 
-JSValue *JSHTMLCollection::getNamedItems(ExecState *exec, const Identifier &propertyName) const
+JSValue *JSHTMLCollection::getNamedItems(ExecStateexec, const Identifier &propertyName) const
 {
     DeprecatedValueList< RefPtr<WebCore::Node> > namedItems = m_impl->namedItems(propertyName);
 
@@ -1785,7 +1694,7 @@ JSValue *JSHTMLCollection::getNamedItems(ExecState *exec, const Identifier &prop
     return new DOMNamedNodesCollection(exec, namedItems);
 }
 
-JSValue *HTMLCollectionProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
+JSValue *HTMLCollectionProtoFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
 {
   if (!thisObj->inherits(&JSHTMLCollection::info))
     return throwError(exec, TypeError);
@@ -1805,18 +1714,18 @@ JSValue *HTMLCollectionProtoFunc::callAsFunction(ExecState *exec, JSObject *this
 
 // -------------------------------------------------------------------------
 
-JSHTMLSelectCollection::JSHTMLSelectCollection(ExecState *exec, HTMLCollection *c, HTMLSelectElement *e)
+JSHTMLSelectCollection::JSHTMLSelectCollection(ExecState* exec, HTMLCollection *c, HTMLSelectElement* e)
   : JSHTMLCollection(exec, c), m_element(e)
 {
 }
 
-JSValue *JSHTMLSelectCollection::selectedIndexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *JSHTMLSelectCollection::selectedIndexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
     JSHTMLSelectCollection *thisObj = static_cast<JSHTMLSelectCollection*>(slot.slotBase());
     return jsNumber(thisObj->m_element->selectedIndex());
 }
 
-bool JSHTMLSelectCollection::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool JSHTMLSelectCollection::getOwnPropertySlot(ExecStateexec, const Identifier& propertyName, PropertySlot& slot)
 {
   if (propertyName == "selectedIndex") {
     slot.setCustom(this, selectedIndexGetter);
@@ -1827,7 +1736,7 @@ bool JSHTMLSelectCollection::getOwnPropertySlot(ExecState *exec, const Identifie
   return JSHTMLCollection::getOwnPropertySlot(exec, propertyName, slot);
 }
 
-void JSHTMLSelectCollection::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int)
+void JSHTMLSelectCollection::put(ExecStateexec, const Identifier &propertyName, JSValue *value, int)
 {
 #ifdef KJS_VERBOSE
   kdDebug(6070) << "JSHTMLSelectCollection::put " << propertyName.deprecatedString() << endl;
@@ -1884,7 +1793,7 @@ void JSHTMLSelectCollection::put(ExecState *exec, const Identifier &propertyName
 
   int exception = 0;
   int diff = int(u) - m_element->length();
-  HTMLElement *before = 0;
+  HTMLElementbefore = 0;
   // out of array bounds ? first insert empty dummies
   if (diff > 0) {
     while (diff--) {
@@ -1920,7 +1829,7 @@ bool ImageConstructorImp::implementsConstruct() const
   return true;
 }
 
-JSObject *ImageConstructorImp::construct(ExecState * exec, const List & list)
+JSObject* ImageConstructorImp::construct(ExecState*  exec, const List & list)
 {
     bool widthSet = false, heightSet = false;
     int width = 0, height = 0;
@@ -1935,7 +1844,7 @@ JSObject *ImageConstructorImp::construct(ExecState * exec, const List & list)
         height = h->toInt32(exec);
     }
         
-    HTMLImageElement *result = new HTMLImageElement(m_doc.get());
+    HTMLImageElementresult = new HTMLImageElement(m_doc.get());
     
     if (widthSet)
         result->setWidth(width);
@@ -1947,17 +1856,17 @@ JSObject *ImageConstructorImp::construct(ExecState * exec, const List & list)
 
 ////////////////////////////////////////////////////////////////
                      
-JSValue *getAllHTMLCollection(ExecState *exec, HTMLCollection *c)
+JSValue* getAllHTMLCollection(ExecState* exec, HTMLCollection* c)
 {
     return cacheDOMObject<HTMLCollection, HTMLAllCollection>(exec, c);
 }
 
-JSValue *getHTMLCollection(ExecState *exec, HTMLCollection *c)
+JSValue* getHTMLCollection(ExecState* exec, HTMLCollection* c)
 {
-  return cacheDOMObject<HTMLCollection, JSHTMLCollection>(exec, c);
+    return cacheDOMObject<HTMLCollection, JSHTMLCollection>(exec, c);
 }
 
-JSValue *getSelectHTMLCollection(ExecState *exec, HTMLCollection *c, HTMLSelectElement *e)
+JSValue *getSelectHTMLCollection(ExecState* exec, HTMLCollection *c, HTMLSelectElement* e)
 {
   DOMObject *ret;
   if (!c)
index 30b3535ca6606bc9d393fd12c4ab04f393f8453b..3cba35dc9d4dfc5d3c2ba8d79d8800750c3e0001 100644 (file)
@@ -78,7 +78,7 @@ namespace KJS {
     virtual const ClassInfo* classInfo() const;
     static const ClassInfo info;
 
-    static const ClassInfo form_info,
+    static const ClassInfo
       select_info, object_info, 
       embed_info, table_info, caption_info, col_info, tablesection_info, tr_info,
       tablecell_info, frameSet_info, frame_info, iFrame_info, marquee_info;
@@ -88,13 +88,11 @@ namespace KJS {
     typedef void (JSHTMLElement::*SetterFunction)(ExecState*, int token, JSValue*, const WebCore::String&);
     struct Accessors { GetterFunction m_getter; SetterFunction m_setter; };
     const Accessors* accessors() const;
-    static const Accessors form_accessors,
+    static const Accessors
       select_accessors, object_accessors, embed_accessors, table_accessors,
       caption_accessors, col_accessors, tablesection_accessors, tr_accessors,
       tablecell_accessors, frameSet_accessors, frame_accessors, iFrame_accessors, marquee_accessors;
 
-    JSValue* formGetter(ExecState* exec, int token) const;
-    void  formSetter(ExecState*, int token, JSValue*, const WebCore::String&);
     JSValue* selectGetter(ExecState* exec, int token) const;
     void  selectSetter(ExecState*, int token, JSValue*, const WebCore::String&);
     JSValue* objectGetter(ExecState* exec, int token) const;
@@ -123,8 +121,7 @@ namespace KJS {
     void  marqueeSetter(ExecState*, int token, JSValue*, const WebCore::String&);
 
     enum {
-           FormAction, FormEncType, FormElements, FormLength, FormAcceptCharset,
-           FormReset, FormTarget, FormName, FormMethod, FormSubmit, SelectAdd,
+           SelectAdd,
            SelectTabIndex, SelectValue, SelectSelectedIndex, SelectLength,
            SelectRemove, SelectForm, SelectBlur, SelectType, SelectOptions,
            SelectDisabled, SelectMultiple, SelectName, SelectSize, SelectFocus,
@@ -161,8 +158,6 @@ namespace KJS {
            ElementIsContentEditable, ElementOuterHTML, ElementOuterText
   };
   private:
-    static JSValue* formIndexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
-    static JSValue* formNameGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
     static JSValue* selectIndexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
     static JSValue* framesetNameGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
     static JSValue* frameWindowPropertyGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
index d2907c4c0803fb4d1fadd3f508cb45479f3583d1..f954650da61d3786150300565168179a3ca8e5b6 100644 (file)
@@ -34,8 +34,8 @@ my %implIncludes = ();
 # Default .h template
 my $headerTemplate = << "EOF";
 /*
-    This file is part of the KDE project.
-    This file has been generated by kdomidl.pl. DO NOT MODIFY!
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -57,22 +57,22 @@ EOF
 # Default constructor
 sub new
 {
-  my $object = shift;
-  my $reference = { };
-
-  $codeGenerator = shift;
-  $outputDir = shift;
-
-  bless($reference, $object);
-  return $reference;
+       my $object = shift;
+       my $reference = { };
+       
+       $codeGenerator = shift;
+       $outputDir = shift;
+       
+       bless($reference, $object);
+       return $reference;
 }
 
 sub finish
 {
-  my $object = shift;
-
-  # Commit changes!
-  $object->WriteData();
+       my $object = shift;
+       
+       # Commit changes!
+       $object->WriteData();
 }
 
 sub leftShift($$) {
@@ -83,329 +83,340 @@ sub leftShift($$) {
 # Params: 'domClass' struct
 sub GenerateInterface
 {
-  my $object = shift;
-  my $dataNode = shift;
-
-  # FIXME: Check dates to see if we need to re-generate anything
-  
-  # Start actual generation..
-  $object->GenerateHeader($dataNode);
-  $object->GenerateImplementation($dataNode);
-
-  my $name = $dataNode->name;
-  
-  # Open files for writing...
-  my $headerFileName = "$outputDir/JS$name.h";
-  my $implFileName = "$outputDir/JS$name.cpp";
-
-  open($IMPL, ">$implFileName") || die "Couldn't open file $implFileName";
-  open($HEADER, ">$headerFileName") || die "Couldn't open file $headerFileName";
+       my $object = shift;
+       my $dataNode = shift;
+       
+       # FIXME: Check dates to see if we need to re-generate anything
+       
+    # Start actual generation..
+    $object->GenerateHeader($dataNode);
+    $object->GenerateImplementation($dataNode);
+    
+    my $name = $dataNode->name;
+    
+    # Open files for writing...
+    my $headerFileName = "$outputDir/JS$name.h";
+    my $implFileName = "$outputDir/JS$name.cpp";
+    
+    open($IMPL, ">$implFileName") || die "Couldn't open file $implFileName";
+    open($HEADER, ">$headerFileName") || die "Couldn't open file $headerFileName";
 }
 
 # Params: 'idlDocument' struct
 sub GenerateModule
 {
-  my $object = shift;
-  my $dataNode = shift;  
-  
-  $module = $dataNode->module;
-
+    my $object = shift;
+    my $dataNode = shift;  
+    
+    $module = $dataNode->module;    
 }
 
 sub GetParentClassName
 {
-  my $dataNode = shift;
-  return $dataNode->extendedAttributes->{"LegacyParent"} if $dataNode->extendedAttributes->{"LegacyParent"};
-  return "KJS::DOMObject" if @{$dataNode->parents} eq 0;
-  return "JS" . $dataNode->parents(0);
+    my $dataNode = shift;
+    return $dataNode->extendedAttributes->{"LegacyParent"} if $dataNode->extendedAttributes->{"LegacyParent"};
+    return "KJS::DOMObject" if @{$dataNode->parents} eq 0;
+    return "JS" . $dataNode->parents(0);
 }
 
 sub GetLegacyHeaderIncludes
 {
-  my $legacyParent = shift;
-  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";
-  } elsif ($module eq "events") {
-    return "#include \"kjs_events.h\"\n\n";
-  } elsif ($module eq "core") {
-    return "#include \"kjs_dom.h\"\n\n";
-  } elsif ($module eq "css") {
-    return "#include \"kjs_css.h\"\n\n";
-  } elsif ($module eq "html") {
-    return "#include \"kjs_html.h\"\n\n";
-  } elsif ($module eq "traversal") {
-    return "#include \"kjs_traversal.h\"\n\n";
-  } else {
-    die ("Don't know what headers to include for module $module");
-  }
+    my $legacyParent = shift;
+    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";
+    } elsif ($module eq "events") {
+        return "#include \"kjs_events.h\"\n\n";
+    } elsif ($module eq "core") {
+        return "#include \"kjs_dom.h\"\n\n";
+    } elsif ($module eq "css") {
+        return "#include \"kjs_css.h\"\n\n";
+    } elsif ($module eq "html") {
+        return "#include \"kjs_html.h\"\n\n";
+    } elsif ($module eq "traversal") {
+        return "#include \"kjs_traversal.h\"\n\n";
+    } else {
+        die ("Don't know what headers to include for module $module");
+    }
 }
 
 sub AddIncludesForType
 {
-  my $type = shift;
-  
-  # When we're finished with the one-file-per-class 
-  # reorganization, we don't need these special cases.
-  
-  if ($type eq "MutationEvent" or
-           $type eq "KeyboardEvent" or
-           $type eq "MouseEvent" or
-           $type eq "Event" or
-           $type eq "UIEvent" or
-           $type eq "WheelEvent") {
-    $implIncludes{"dom2_eventsimpl.h"} = 1;
-  } elsif ($type eq "NodeIterator" or
+    my $type = shift;
+    
+    # When we're finished with the one-file-per-class 
+    # reorganization, we don't need these special cases.
+    
+    if ($type eq "MutationEvent" or
+      $type eq "KeyboardEvent" or
+      $type eq "MouseEvent" or
+      $type eq "Event" or
+      $type eq "UIEvent" or
+      $type eq "WheelEvent") {
+        $implIncludes{"dom2_eventsimpl.h"} = 1;
+    } elsif ($type eq "NodeIterator" or
            $type eq "NodeFilter" or
-          $type eq "TreeWalker") {
-    $implIncludes{"dom2_traversalimpl.h"} = 1;
-  } elsif ($type eq "CanvasRenderingContext2D") {
-    $implIncludes{"CanvasGradient.h"} = 1;
-    $implIncludes{"CanvasPattern.h"} = 1;
-    $implIncludes{"CanvasRenderingContext2D.h"} = 1;
-    $implIncludes{"CanvasStyle.h"} = 1;
-  } elsif ($type eq "CanvasGradient") {
-    $implIncludes{"CanvasGradient.h"} = 1;
-    $implIncludes{"PlatformString.h"} = 1;
-  } elsif ($codeGenerator->IsPrimitiveType($type) or
-           $type eq "DOMString" or $type eq "DOMObject" or $type eq "RGBColor" or $type eq "Rect") {
-  } else {
-    # default, include the same named file
-    $implIncludes{"${type}.h"} = 1;
-  }
+           $type eq "TreeWalker") {
+        $implIncludes{"dom2_traversalimpl.h"} = 1;
+    } elsif ($type eq "CanvasRenderingContext2D") {
+        $implIncludes{"CanvasGradient.h"} = 1;
+        $implIncludes{"CanvasPattern.h"} = 1;
+        $implIncludes{"CanvasRenderingContext2D.h"} = 1;
+        $implIncludes{"CanvasStyle.h"} = 1;
+    } elsif ($type eq "CanvasGradient") {
+        $implIncludes{"CanvasGradient.h"} = 1;
+        $implIncludes{"PlatformString.h"} = 1;
+    } elsif ($codeGenerator->IsPrimitiveType($type) or
+        $type eq "DOMString" or $type eq "DOMObject" or $type eq "RGBColor" or $type eq "Rect") {
+    } else {
+        # default, include the same named file
+        $implIncludes{"${type}.h"} = 1;
+    }
 }
 
 sub GenerateHeader
 {
-  my $object = shift;
-  my $dataNode = shift;
-
-  my $interfaceName = $dataNode->name;
-  my $className = "JS$interfaceName";
-  my $implClassName = $interfaceName;
-  
-  # FIXME: If we're sure that an interface can't have more than
-  # one parent we can do the check in the parser instead
-  if (@{$dataNode->parents} > 1) {
-    die "A class can't have more than one parent";
-  }
-  
-  my $hasLegacyParent = $dataNode->extendedAttributes->{"LegacyParent"};
-  my $hasRealParent = @{$dataNode->parents} > 0;
-  my $hasParent = $hasLegacyParent || $hasRealParent;
-  my $parentClassName = GetParentClassName($dataNode);
-  my $conditional = $dataNode->extendedAttributes->{"Conditional"};
-  
-  # - Add default header template
-  @headerContent = split("\r", $headerTemplate);
-
-  # - Add header protection
-  push(@headerContent, "\n#ifndef $className" . "_H");
-  push(@headerContent, "\n#define $className" . "_H\n\n");
-  
-  push(@headerContent, "#if ${conditional}_SUPPORT\n\n") if $conditional;
-  
-  if (exists $dataNode->extendedAttributes->{"LegacyParent"}) {
-    push(@headerContent, GetLegacyHeaderIncludes($dataNode->extendedAttributes->{"LegacyParent"}));
-  } else {
-    if ($hasParent) {
-      push(@headerContent, "#include \"$parentClassName.h\"\n");
+    my $object = shift;
+    my $dataNode = shift;
+    
+    my $interfaceName = $dataNode->name;
+    my $className = "JS$interfaceName";
+    my $implClassName = $interfaceName;
+    
+    # FIXME: For SVG we need to support more than one parent
+    # But no more than one parent can be "concrete"
+    if (@{$dataNode->parents} > 1) {
+        die "A class can't have more than one parent";
+    }
+    
+    my $hasLegacyParent = $dataNode->extendedAttributes->{"LegacyParent"};
+    my $hasRealParent = @{$dataNode->parents} > 0;
+    my $hasParent = $hasLegacyParent || $hasRealParent;
+    my $parentClassName = GetParentClassName($dataNode);
+    my $conditional = $dataNode->extendedAttributes->{"Conditional"};
+    
+    # - Add default header template
+    @headerContent = split("\r", $headerTemplate);
+    
+    # - Add header protection
+    push(@headerContent, "\n#ifndef $className" . "_H");
+    push(@headerContent, "\n#define $className" . "_H\n\n");
+    
+    push(@headerContent, "#if ${conditional}_SUPPORT\n\n") if $conditional;
+    
+    if (exists $dataNode->extendedAttributes->{"LegacyParent"}) {
+        push(@headerContent, GetLegacyHeaderIncludes($dataNode->extendedAttributes->{"LegacyParent"}));
     } else {
-      push(@headerContent, "#include \"kjs_binding.h\"\n");
+        if ($hasParent) {
+            push(@headerContent, "#include \"$parentClassName.h\"\n");
+        } else {
+            push(@headerContent, "#include \"kjs_binding.h\"\n");
+        }
     }
-  }
-  
-  my $numAttributes = @{$dataNode->attributes};
-  my $numFunctions = @{$dataNode->functions};
-  my $numConstants = @{$dataNode->constants};
-  
-  push(@headerContent, "\nnamespace WebCore {\n\n");
   
-  # Implementation class forward declaration
-  push(@headerContent, "class $implClassName;\n\n");
-
-  # Class declaration
-  push(@headerContent, "class $className : public $parentClassName {\n");
-  push(@headerContent, "public:\n");
-  
-  # Constructor
-  if ($dataNode->extendedAttributes->{"DoNotCache"}) {
-      push(@headerContent, "    $className($implClassName*);\n");
-  } else {
-      push(@headerContent, "    $className(KJS::ExecState*, $implClassName*);\n");
-  }
+    my $numAttributes = @{$dataNode->attributes};
+    my $numFunctions = @{$dataNode->functions};
+    my $numConstants = @{$dataNode->constants};
     
-  # Destructor
-  if (!$hasParent or $interfaceName eq "Document") {
-    push(@headerContent, "    virtual ~$className();\n");
-  }
-  
-  # Getters
-  if ($numAttributes > 0) {
-    push(@headerContent, "    virtual bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&);\n");
-    push(@headerContent, "    KJS::JSValue* getValueProperty(KJS::ExecState*, int token) const;\n");
-  }
-  
-  # Check if we have any writable properties
-  my $hasReadWriteProperties = 0;
-  foreach(@{$dataNode->attributes}) {
-    if($_->type !~ /^readonly\ attribute$/) {
-      $hasReadWriteProperties = 1;
+    push(@headerContent, "\nnamespace WebCore {\n\n");
+    
+    # Implementation class forward declaration
+    push(@headerContent, "class $implClassName;\n\n");
+    
+    # Class declaration
+    push(@headerContent, "class $className : public $parentClassName {\n");
+    push(@headerContent, "public:\n");
+    
+    # Constructor
+    if ($dataNode->extendedAttributes->{"DoNotCache"}) {
+        push(@headerContent, "    $className($implClassName*);\n");
+    } else {
+        push(@headerContent, "    $className(KJS::ExecState*, $implClassName*);\n");
+    }
+    
+    # Destructor
+    if (!$hasParent or $interfaceName eq "Document") {
+        push(@headerContent, "    virtual ~$className();\n");
     }
-  }
-  
-  if ($hasReadWriteProperties) {
-    push(@headerContent, "    virtual void put(KJS::ExecState*, const KJS::Identifier&, KJS::JSValue*, int attr = KJS::None);\n");
-    push(@headerContent, "    void putValueProperty(KJS::ExecState*, int, KJS::JSValue*, int attr);\n");
-  }
-  
-  # Class info
-  push(@headerContent, "    virtual const KJS::ClassInfo* classInfo() const { return &info; }\n");
-  push(@headerContent, "    static const KJS::ClassInfo info;\n");
-  
-  # Constructor object getter
-  if ($dataNode->extendedAttributes->{"GenerateConstructor"}) {
-    push(@headerContent, "    static KJS::JSValue* getConstructor(KJS::ExecState*);\n")
-  }
-
-  my $numCustomFunctions = 0;
-  my $numCustomAttributes = 0;
-  
-  # Attribute and function enums
-  if ($numAttributes + $numFunctions > 0) {
-    push(@headerContent, "    enum {\n")
-  }
   
-  if ($numAttributes > 0) {
-    push(@headerContent, "        // Attributes\n        ");
+    # Getters
+    if ($numAttributes > 0) {
+        push(@headerContent, "    virtual bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&);\n");
+        push(@headerContent, "    KJS::JSValue* getValueProperty(KJS::ExecState*, int token) const;\n");
+    }
     
-    my $i = -1;
+    # Check if we have any writable properties
+    my $hasReadWriteProperties = 0;
     foreach(@{$dataNode->attributes}) {
-      my $attribute = $_;
-
-      $numCustomAttributes++ if $attribute->signature->extendedAttributes->{"Custom"};
-
-      $i++;
-      if((($i % 4) eq 0) and ($i ne 0)) {
-        push(@headerContent, "\n        ");
-      }
-
-      my $value = $attribute->signature->type =~ /Constructor$/
-                  ? $attribute->signature->name . "ConstructorAttrNum" 
-                  : ucfirst($attribute->signature->name) . "AttrNum";
-      $value .= ", " if(($i < $numAttributes - 1));
-      $value .= ", " if(($i eq $numAttributes - 1) and ($numFunctions ne 0));
-      push(@headerContent, $value);
+        if($_->type !~ /^readonly\ attribute$/) {
+            $hasReadWriteProperties = 1;
+        }
+    }
+    
+    if ($hasReadWriteProperties) {
+        push(@headerContent, "    virtual void put(KJS::ExecState*, const KJS::Identifier&, KJS::JSValue*, int attr = KJS::None);\n");
+        push(@headerContent, "    void putValueProperty(KJS::ExecState*, int, KJS::JSValue*, int attr);\n");
+    }
+    
+    # Class info
+    push(@headerContent, "    virtual const KJS::ClassInfo* classInfo() const { return &info; }\n");
+    push(@headerContent, "    static const KJS::ClassInfo info;\n");
+    
+    # Constructor object getter
+    if ($dataNode->extendedAttributes->{"GenerateConstructor"}) {
+        push(@headerContent, "    static KJS::JSValue* getConstructor(KJS::ExecState*);\n")
+    }
+    
+    my $numCustomFunctions = 0;
+    my $numCustomAttributes = 0;
+    
+    # Attribute and function enums
+    if ($numAttributes + $numFunctions > 0) {
+        push(@headerContent, "    enum {\n")
     }
-  }
   
-  if ($numFunctions > 0) {
     if ($numAttributes > 0) {
-      push(@headerContent, "\n\n");
+        push(@headerContent, "        // Attributes\n        ");
+        
+        my $i = -1;
+        foreach(@{$dataNode->attributes}) {
+            my $attribute = $_;
+            
+            $numCustomAttributes++ if $attribute->signature->extendedAttributes->{"Custom"};
+            
+            $i++;
+            if((($i % 4) eq 0) and ($i ne 0)) {
+                push(@headerContent, "\n        ");
+            }
+            
+            my $value = $attribute->signature->type =~ /Constructor$/
+                      ? $attribute->signature->name . "ConstructorAttrNum" 
+                      : ucfirst($attribute->signature->name) . "AttrNum";
+            $value .= ", " if(($i < $numAttributes - 1));
+            $value .= ", " if(($i eq $numAttributes - 1) and ($numFunctions ne 0));
+            push(@headerContent, $value);
+        }
     }
-    push(@headerContent,"        // Functions\n        ");
-
-    $i = -1;
-    foreach(@{$dataNode->functions}) {
-      my $function = $_;
-
-      $i++;
-      if ((($i % 4) eq 0) and ($i ne 0)) {
-        push(@headerContent, "\n        ");
-      }
-
-      $numCustomFunctions++ if $function->signature->extendedAttributes->{"Custom"};
-      
-      my $value = ucfirst($function->signature->name) . "FuncNum";
-      $value .= ", " if ($i < $numFunctions - 1);
-      push(@headerContent, $value);
+    
+    if ($numFunctions > 0) {
+        if ($numAttributes > 0) {
+            push(@headerContent, "\n\n");
+        }
+        push(@headerContent,"        // Functions\n        ");
+        
+        $i = -1;
+        foreach(@{$dataNode->functions}) {
+            my $function = $_;
+            
+            $i++;
+            if ((($i % 4) eq 0) and ($i ne 0)) {
+                push(@headerContent, "\n        ");
+            }
+            
+            $numCustomFunctions++ if $function->signature->extendedAttributes->{"Custom"};
+            
+            my $value = ucfirst($function->signature->name) . "FuncNum";
+            $value .= ", " if ($i < $numFunctions - 1);
+            push(@headerContent, $value);
+        }
     }
-  }
   
-  if ($numAttributes + $numFunctions > 0) {
-    push(@headerContent, "\n    };\n");
-  }
+    if ($numAttributes + $numFunctions > 0) {
+        push(@headerContent, "\n    };\n");
+    }
 
-  if ($numCustomAttributes > 0) {
-    push(@headerContent, "\n    // Custom attributes\n");
-    
-    foreach(@{$dataNode->attributes}) {
-      my $attribute = $_;
-          
-      if ($attribute->signature->extendedAttributes->{"Custom"}) {
-        push(@headerContent, "    KJS::JSValue* " . $attribute->signature->name . "(KJS::ExecState*) const;\n");
-        if ($attribute->type !~ /^readonly/) {
-          push(@headerContent, "    void set" . ucfirst($attribute->signature->name) . "(KJS::ExecState*, KJS::JSValue*);\n");        
+    if ($numCustomAttributes > 0) {
+        push(@headerContent, "\n    // Custom attributes\n");
+        
+        foreach(@{$dataNode->attributes}) {
+            my $attribute = $_;
+              
+            if ($attribute->signature->extendedAttributes->{"Custom"}) {
+                push(@headerContent, "    KJS::JSValue* " . $attribute->signature->name . "(KJS::ExecState*) const;\n");
+                if ($attribute->type !~ /^readonly/) {
+                    push(@headerContent, "    void set" . ucfirst($attribute->signature->name) . "(KJS::ExecState*, KJS::JSValue*);\n");        
+                }
+            }
         }
-      }
     }
-  }
   
-  if ($numCustomFunctions > 0) {      
-    push(@headerContent, "\n    // Custom functions\n");
-    foreach(@{$dataNode->functions}) {
-      my $function = $_;
-          
-      if ($function->signature->extendedAttributes->{"Custom"}) {
-        push(@headerContent, "    KJS::JSValue* " . $function->signature->name . "(KJS::ExecState*, const KJS::List&);\n");
-      }
+    if ($numCustomFunctions > 0) {      
+        push(@headerContent, "\n    // Custom functions\n");
+        foreach(@{$dataNode->functions}) {
+            my $function = $_;
+              
+            if ($function->signature->extendedAttributes->{"Custom"}) {
+                push(@headerContent, "    KJS::JSValue* " . $function->signature->name . "(KJS::ExecState*, const KJS::List&);\n");
+            }
+        }
     }
-  }            
-  
-  if (!$hasParent) {
-    push(@headerContent, "    $implClassName* impl() const { return m_impl.get(); }\n");
-    push(@headerContent, "private:\n");
-    push(@headerContent, "    RefPtr<$implClassName> m_impl;\n");
-  }
-  
-  push(@headerContent, "};\n\n");
-  
-  if (!$hasParent) {
-    push(@headerContent, "KJS::JSValue* toJS(KJS::ExecState*, $implClassName*);\n");
-    push(@headerContent, "$implClassName* to${interfaceName}(KJS::JSValue*);\n\n");
-  }
-
-  # Add prototype declaration -- code adopted from the KJS_DEFINE_PROTOTYPE and KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macros
-  push(@headerContent, "class ${className}Proto : public KJS::JSObject {\n");
-  if (!$dataNode->extendedAttributes->{"DoNotCache"}) {
-      push(@headerContent, "    friend KJS::JSObject* KJS_GCC_ROOT_NS_HACK cacheGlobalObject<${className}Proto>(KJS::ExecState*, const KJS::Identifier& propertyName);\n");
-  }
-  push(@headerContent, "public:\n");
-  if ($dataNode->extendedAttributes->{"DoNotCache"}) {
-      push(@headerContent, "    static KJS::JSObject* self();\n");
-  } else {
-      push(@headerContent, "    static KJS::JSObject* self(KJS::ExecState* exec);\n");
-  }
-  push(@headerContent, "    virtual const KJS::ClassInfo* classInfo() const { return &info; }\n");
-  push(@headerContent, "    static const KJS::ClassInfo info;\n");
-  if ($numFunctions > 0 || $numConstants > 0) {
-      push(@headerContent, "    bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&);\n");
-  }
-  if ($numConstants ne 0) {
-      push(@headerContent, "    KJS::JSValue* getValueProperty(KJS::ExecState*, int token) const;\n");
-  }
-  push(@headerContent, "protected:\n");
-  if ($dataNode->extendedAttributes->{"DoNotCache"}) {
-      push(@headerContent, "    ${className}Proto() { }\n");
-  } else {
-      push(@headerContent, "    ${className}Proto(KJS::ExecState* exec)\n");
-      if ($hasParent && $parentClassName ne "KJS::DOMCSSRule" && $parentClassName ne "KJS::DOMNodeFilter") {
-          push(@headerContent, "        : KJS::JSObject(${parentClassName}Proto::self(exec)) { }\n");
-      } else {
-          push(@headerContent, "        : KJS::JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()) { }\n");
-      }
-  }
   
-  push(@headerContent, "};\n\n");
+    if (!$hasParent) {
+        push(@headerContent, "    $implClassName* impl() const { return m_impl.get(); }\n");
+        push(@headerContent, "private:\n");
+        push(@headerContent, "    RefPtr<$implClassName> m_impl;\n");
+    }
   
-  push(@headerContent, "}\n\n");
-
-  push(@headerContent, "#endif // ${conditional}_SUPPORT\n\n") if $conditional;
+    # Index getter
+    if ($dataNode->extendedAttributes->{"HasIndexGetter"}) {
+        push(@headerContent, "private:\n");
+        push(@headerContent, "    static KJS::JSValue* indexGetter(KJS::ExecState*, KJS::JSObject*, const KJS::Identifier&, const KJS::PropertySlot&);\n");
+    }
+    # Name getter
+    if ($dataNode->extendedAttributes->{"HasNameGetter"}) {
+        push(@headerContent, "private:\n");
+        push(@headerContent, "    static KJS::JSValue* nameGetter(KJS::ExecState*, KJS::JSObject*, const KJS::Identifier&, const KJS::PropertySlot&);\n");
+        push(@headerContent, "    static bool canGetItemsForName(KJS::ExecState*, $implClassName*, const AtomicString&);\n")
+    }
   
-  push(@headerContent, "#endif\n");
+    push(@headerContent, "};\n\n");
+    
+    if (!$hasParent) {
+        push(@headerContent, "KJS::JSValue* toJS(KJS::ExecState*, $implClassName*);\n");
+        push(@headerContent, "$implClassName* to${interfaceName}(KJS::JSValue*);\n\n");
+    }
+    
+    # Add prototype declaration -- code adopted from the KJS_DEFINE_PROTOTYPE and KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macros
+    push(@headerContent, "class ${className}Proto : public KJS::JSObject {\n");
+    if (!$dataNode->extendedAttributes->{"DoNotCache"}) {
+        push(@headerContent, "    friend KJS::JSObject* KJS_GCC_ROOT_NS_HACK cacheGlobalObject<${className}Proto>(KJS::ExecState*, const KJS::Identifier& propertyName);\n");
+    }
+    push(@headerContent, "public:\n");
+    if ($dataNode->extendedAttributes->{"DoNotCache"}) {
+        push(@headerContent, "    static KJS::JSObject* self();\n");
+    } else {
+        push(@headerContent, "    static KJS::JSObject* self(KJS::ExecState* exec);\n");
+    }
+    push(@headerContent, "    virtual const KJS::ClassInfo* classInfo() const { return &info; }\n");
+    push(@headerContent, "    static const KJS::ClassInfo info;\n");
+    if ($numFunctions > 0 || $numConstants > 0) {
+        push(@headerContent, "    bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&);\n");
+    }
+    if ($numConstants ne 0) {
+        push(@headerContent, "    KJS::JSValue* getValueProperty(KJS::ExecState*, int token) const;\n");
+    }
+    push(@headerContent, "protected:\n");
+    if ($dataNode->extendedAttributes->{"DoNotCache"}) {
+        push(@headerContent, "    ${className}Proto() { }\n");
+    } else {
+        push(@headerContent, "    ${className}Proto(KJS::ExecState* exec)\n");
+        if ($hasParent && $parentClassName ne "KJS::DOMCSSRule" && $parentClassName ne "KJS::DOMNodeFilter") {
+            push(@headerContent, "        : KJS::JSObject(${parentClassName}Proto::self(exec)) { }\n");
+        } else {
+            push(@headerContent, "        : KJS::JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()) { }\n");
+        }
+    }
+    
+    push(@headerContent, "};\n\n");
+    
+    push(@headerContent, "}\n\n");
+    
+    push(@headerContent, "#endif // ${conditional}_SUPPORT\n\n") if $conditional;
+    
+    push(@headerContent, "#endif\n");
 }
 
 sub GenerateImplementation
@@ -640,7 +651,43 @@ sub GenerateImplementation
         push(@implContent, "    if (getOverridePropertySlot(exec, propertyName, slot))\n");
         push(@implContent, "        return true;\n");
     }
-    push(@implContent, "    return getStaticValueSlot<$className, $parentClassName>(exec, &${className}Table, this, propertyName, slot);\n");
+    
+    my $requiresManualLookup = $dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasNameGetter"};
+    if ($requiresManualLookup) {
+        push(@implContent, "    const HashEntry* entry = Lookup::findEntry(&${className}Table, propertyName);\n");
+        push(@implContent, "    if (entry) {\n");
+        push(@implContent, "        slot.setStaticEntry(this, entry, staticValueGetter<$className>);\n");
+        push(@implContent, "        return true;\n");
+        push(@implContent, "    }\n");
+    }
+    
+    if ($dataNode->extendedAttributes->{"HasNameGetter"}) {
+        # if it has a prototype, we need to check that first too
+        push(@implContent, "    if (prototype()->isObject() && static_cast<JSObject*>(prototype())->hasProperty(exec, propertyName))\n");
+        push(@implContent, "        return false;\n");
+    }
+    
+    if ($dataNode->extendedAttributes->{"HasIndexGetter"}) {
+        push(@implContent, "    bool ok;\n");
+        push(@implContent, "    unsigned u = propertyName.toUInt32(&ok);\n");
+        push(@implContent, "    if (ok && u < static_cast<$implClassName*>(impl())->length()) {\n");
+        push(@implContent, "        slot.setCustomIndex(this, u, indexGetter);\n");
+        push(@implContent, "        return true;\n");
+        push(@implContent, "    }\n");
+    }
+    
+    if ($dataNode->extendedAttributes->{"HasNameGetter"}) {
+        push(@implContent, "    if (canGetItemsForName(exec, static_cast<$implClassName*>(impl()), propertyName)) {\n");
+        push(@implContent, "        slot.setCustom(this, nameGetter);\n");
+        push(@implContent, "        return true;\n");
+        push(@implContent, "    }\n");
+    }
+    
+    if ($requiresManualLookup) {
+        push(@implContent, "    return ${parentClassName}::getOwnPropertySlot(exec, propertyName, slot);\n");
+    } else {
+        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");
@@ -763,11 +810,11 @@ sub GenerateImplementation
         my $name = $parameter->name;
         push(@implContent, "        bool ${name}Ok;\n") if TypeCanFailConversion($parameter);
         push(@implContent, "        " . GetNativeType($parameter) . " $name = " . JSValueToNative($parameter, "args[$paramIndex]", TypeCanFailConversion($parameter) ? "${name}Ok" : undef) . ";\n");        
-       if (TypeCanFailConversion($parameter)) {
-           push(@implContent, "        if (!${name}Ok) {\n");
-           push(@implContent, "            setDOMException(exec, TYPE_MISMATCH_ERR);\n");
-           push(@implContent, "            return jsUndefined();\n        }\n");
-       }          
+    if (TypeCanFailConversion($parameter)) {
+        push(@implContent, "        if (!${name}Ok) {\n");
+        push(@implContent, "            setDOMException(exec, TYPE_MISMATCH_ERR);\n");
+        push(@implContent, "            return jsUndefined();\n        }\n");
+    }          
         
         # If a parameter is "an index", it should throw an INDEX_SIZE_ERR
         # exception        
@@ -808,6 +855,14 @@ sub GenerateImplementation
     push(@implContent, "}\n")
   }
   
+  if ($dataNode->extendedAttributes->{"HasIndexGetter"}) {
+    push(@implContent, "\nJSValue* ${className}::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)\n");
+    push(@implContent, "{\n");
+    push(@implContent, "    ${className}* thisObj = static_cast<$className*>(slot.slotBase());\n");
+    push(@implContent, "    return toJS(exec, static_cast<$implClassName*>(thisObj->impl())->item(slot.index()));\n");
+    push(@implContent, "}\n");
+  }
+    
   if (!$hasParent) {
     push(@implContent, toFunctionsFor($className, $implClassName, $interfaceName));
   }
@@ -913,9 +968,9 @@ sub JSValueToNative
   if ($type eq "boolean") {
     my $conv = $signature->extendedAttributes->{"ConvertUndefinedToTrue"};
     if (defined $conv) {
-       return "valueToBooleanTreatUndefinedAsTrue(exec, $value)";
+    return "valueToBooleanTreatUndefinedAsTrue(exec, $value)";
     } else {
-       return "$value->toBoolean(exec)";
+    return "$value->toBoolean(exec)";
     }
   } elsif ($type eq "unsigned long" or $type eq "long") {
     return "$value->toInt32(exec)";
@@ -966,312 +1021,309 @@ sub JSValueToNative
 
 sub NativeToJSValue
 {
-  my $signature = shift;
-  my $value = shift;
-  
-  my $type = $signature->type;
-  
-  if ($type eq "boolean") {
-    return "jsBoolean($value)";
-  } elsif ($type eq "long" or
-           $type eq "unsigned long" or 
-           $type eq "short" or 
-           $type eq "unsigned short" or
-           $type eq "float" or 
-           $type eq "double") {
-    return "jsNumber($value)";
-  } elsif ($type eq "DOMString") {
-    my $conv = $signature->extendedAttributes->{"ConvertNullStringTo"};
-    if (defined $conv) {
-      if ($conv eq "Null") {
-        return "jsStringOrNull($value)";
-      } elsif ($conv eq "Undefined") {
-        return "jsStringOrUndefined($value)";
-      } elsif ($conv eq "False") {
-        return "jsStringOrFalse($value)";
-      } else {
-        die "Unknown value for ConvertNullStringTo extended attribute";
-      }
+    my $signature = shift;
+    my $value = shift;
+    
+    my $type = $signature->type;
+    
+    if ($type eq "boolean") {
+        return "jsBoolean($value)";
+    } elsif ($type eq "long" or
+             $type eq "unsigned long" or 
+             $type eq "short" or 
+             $type eq "unsigned short" or
+             $type eq "float" or 
+             $type eq "double") {
+        return "jsNumber($value)";
+    } elsif ($type eq "DOMString") {
+        my $conv = $signature->extendedAttributes->{"ConvertNullStringTo"};
+        if (defined $conv) {
+            if ($conv eq "Null") {
+                return "jsStringOrNull($value)";
+            } elsif ($conv eq "Undefined") {
+                return "jsStringOrUndefined($value)";
+            } elsif ($conv eq "False") {
+                return "jsStringOrFalse($value)";
+            } else {
+                die "Unknown value for ConvertNullStringTo extended attribute";
+            }
+        } else {
+            return "jsString($value)";
+        }
+    } elsif ($type eq "DOMImplementation") {
+        $implIncludes{"kjs_dom.h"} = 1;
+        $implIncludes{"JSDOMImplementation.h"} = 1;
+        return "toJS(exec, $value)";
+    } elsif ($type eq "Attr" or
+             $type eq "CDATASection" or
+             $type eq "Comment" or
+             $type eq "Document" or
+             $type eq "DocumentFragment" or
+             $type eq "DocumentType" or
+             $type eq "Element" or
+             $type eq "EntityReference" or
+             $type eq "HTMLDocument" or
+             $type eq "Node" or
+             $type eq "ProcessingInstruction" or
+             $type eq "Text") {
+        $implIncludes{"kjs_dom.h"} = 1;
+        $implIncludes{"Comment.h"} = 1;
+        $implIncludes{"CDATASection.h"} = 1;
+        $implIncludes{"Node.h"} = 1;
+        $implIncludes{"Element.h"} = 1;
+        $implIncludes{"DocumentType.h"} = 1;
+        return "toJS(exec, $value)";
+    } elsif ($type eq "EventTarget") {
+        $implIncludes{"kjs_dom.h"} = 1;
+        $implIncludes{"EventTargetNode.h"} = 1;
+        return "toJS(exec, $value)";
+    } elsif ($type eq "Event") {
+        $implIncludes{"kjs_events.h"} = 1;
+        $implIncludes{"dom2_eventsimpl.h"} = 1;
+        return "toJS(exec, $value)";
+    } elsif ($type eq "NodeList" or $type eq "NamedNodeMap") {
+        $implIncludes{"kjs_dom.h"} = 1;
+        return "toJS(exec, $value)";
+    } elsif ($type eq "CSSStyleSheet" or $type eq "StyleSheet" or $type eq "MediaList") {
+        $implIncludes{"CSSStyleSheet.h"} = 1;
+        $implIncludes{"MediaList.h"} = 1;
+        $implIncludes{"kjs_css.h"} = 1;
+        return "toJS(exec, $value)";
+    } elsif ($type eq "StyleSheetList") {
+        $implIncludes{"StyleSheetList.h"} = 1;
+        $implIncludes{"kjs_css.h"} = 1;
+        return "toJS(exec, $value, impl)";
+    } elsif ($type eq "CSSStyleDeclaration" or $type eq "Rect") {
+        $implIncludes{"CSSStyleDeclaration.h"} = 1;
+        $implIncludes{"RectImpl.h"} = 1;
+        $implIncludes{"kjs_css.h"} = 1;
+        return "toJS(exec, $value)";
+    } elsif ($type eq "RGBColor") {
+        $implIncludes{"kjs_css.h"} = 1;
+        return "getDOMRGBColor(exec, $value)";
+    } elsif ($type eq "HTMLCanvasElement") {
+        $implIncludes{"kjs_dom.h"} = 1;
+        $implIncludes{"HTMLCanvasElement.h"} = 1;
+        return "toJS(exec, $value)";
+    } elsif ($type eq "NodeIterator" or
+             $type eq "TreeWalker") {
+        $implIncludes{"kjs_traversal.h"} = 1;
+        return "toJS(exec, $value)";
+    } elsif ($type eq "DOMWindow") {
+        $implIncludes{"kjs_window.h"} = 1;
+        return "toJS(exec, $value)";
+    } 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)";
+    } elsif ($type eq "HTMLCollection") {
+        $implIncludes{"kjs_html.h"} = 1;
+        $implIncludes{"HTMLCollection.h"} = 1;
+        return "getHTMLCollection(exec, $value.get())";
     } else {
-      return "jsString($value)";
+        $implIncludes{"JS$type.h"} = 1;
+        return "toJS(exec, $value)";
     }
-  } elsif ($type eq "DOMImplementation") {
-    $implIncludes{"kjs_dom.h"} = 1;
-    $implIncludes{"JSDOMImplementation.h"} = 1;
-    return "toJS(exec, $value)";
-  } elsif ($type eq "Attr" or
-           $type eq "CDATASection" or
-           $type eq "Comment" or
-           $type eq "Document" or
-           $type eq "DocumentFragment" or
-           $type eq "DocumentType" or
-           $type eq "Element" or
-           $type eq "EntityReference" or
-           $type eq "HTMLDocument" or
-           $type eq "Node" or
-           $type eq "ProcessingInstruction" or
-           $type eq "Text") {
-    $implIncludes{"kjs_dom.h"} = 1;
-    $implIncludes{"Comment.h"} = 1;
-    $implIncludes{"CDATASection.h"} = 1;
-    $implIncludes{"Node.h"} = 1;
-    $implIncludes{"Element.h"} = 1;
-    $implIncludes{"DocumentType.h"} = 1;
-    return "toJS(exec, $value)";
-  } elsif ($type eq "EventTarget") {
-    $implIncludes{"kjs_dom.h"} = 1;
-    $implIncludes{"EventTargetNode.h"} = 1;
-    return "toJS(exec, $value)";
-  } elsif ($type eq "Event") {
-    $implIncludes{"kjs_events.h"} = 1;
-    $implIncludes{"dom2_eventsimpl.h"} = 1;
-    return "toJS(exec, $value)";
-  } elsif ($type eq "NodeList" or $type eq "NamedNodeMap") {
-    $implIncludes{"kjs_dom.h"} = 1;
-    return "toJS(exec, $value)";
-  } elsif ($type eq "CSSStyleSheet" or $type eq "StyleSheet" or $type eq "MediaList") {
-    $implIncludes{"CSSStyleSheet.h"} = 1;
-    $implIncludes{"MediaList.h"} = 1;
-    $implIncludes{"kjs_css.h"} = 1;
-    return "toJS(exec, $value)";
-  } elsif ($type eq "StyleSheetList") {
-     $implIncludes{"StyleSheetList.h"} = 1;
-     $implIncludes{"kjs_css.h"} = 1;
-     return "toJS(exec, $value, impl)";
-  } elsif ($type eq "CSSRuleList") {
-     $implIncludes{"CSSRuleList.h"} = 1;
-     return "toJS(exec, $value)";  
-   } elsif ($type eq "CSSStyleDeclaration" or $type eq "Rect") {
-    $implIncludes{"CSSStyleDeclaration.h"} = 1;
-    $implIncludes{"RectImpl.h"} = 1;
-    $implIncludes{"kjs_css.h"} = 1;
-    return "toJS(exec, $value)";
-  } elsif ($type eq "RGBColor") {
-    $implIncludes{"kjs_css.h"} = 1;
-    return "getDOMRGBColor(exec, $value)";
-  } elsif ($type eq "HTMLCanvasElement") {
-    $implIncludes{"kjs_dom.h"} = 1;
-    $implIncludes{"HTMLCanvasElement.h"} = 1;
-    return "toJS(exec, $value)";
-  } elsif ($type eq "NodeIterator" or
-          $type eq "TreeWalker") {
-    $implIncludes{"kjs_traversal.h"} = 1;
-    return "toJS(exec, $value)";
-  } elsif ($type eq "DOMWindow") {
-    $implIncludes{"kjs_window.h"} = 1;
-    return "toJS(exec, $value)";
-  } 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)";
-  } elsif ($type eq "HTMLCollection") {
-      $implIncludes{"kjs_html.h"} = 1;
-      $implIncludes{"HTMLCollection.h"} = 1;
-      return "getHTMLCollection(exec, $value.get())";
-  } else {
-    $implIncludes{"JS$type.h"} = 1;
-    return "toJS(exec, $value)";
-  }
-  
-  die ("$value " . $signature->type);
+    
+    die ("$value " . $signature->type);
 }
 
 # Internal Helper
 sub GenerateHashTable
 {
-  my $object = shift;
-
-  my $name = shift;
-  my $size = shift;
-  my $keys = shift;
-  my $values = shift;
-  my $specials = shift;
-  my $parameters = shift;
-  
-  # Helpers
-  my @table = ();
-  my @links = ();
-
-  my $maxDepth = 0;
-  my $collisions = 0;
-  my $numEntries = $size;
-
-  # Collect hashtable information...
-  my $i = 0;
-  foreach(@{$keys}) {
-    my $depth = 0;
-    my $h = $object->GenerateHashValue($_) % $numEntries;
-
-    while(defined($table[$h])) {
-      if(defined($links[$h])) {
-        $h = $links[$h];
-        $depth++;
-      } else {
-        $collisions++;
-        $links[$h] = $size;
-        $h = $size;
-        $size++;
-      }
+    my $object = shift;
+    
+    my $name = shift;
+    my $size = shift;
+    my $keys = shift;
+    my $values = shift;
+    my $specials = shift;
+    my $parameters = shift;
+    
+    # Helpers
+    my @table = ();
+    my @links = ();
+    
+    my $maxDepth = 0;
+    my $collisions = 0;
+    my $numEntries = $size;
+    
+    # Collect hashtable information...
+    my $i = 0;
+    foreach(@{$keys}) {
+        my $depth = 0;
+        my $h = $object->GenerateHashValue($_) % $numEntries;
+        
+        while(defined($table[$h])) {
+            if (defined($links[$h])) {
+                $h = $links[$h];
+                $depth++;
+            } else {
+                $collisions++;
+                $links[$h] = $size;
+                $h = $size;
+                $size++;
+            }
+        }
+        
+        $table[$h] = $i;
+        
+        $i++;
+        $maxDepth = $depth if ($depth > $maxDepth);
     }
-  
-    $table[$h] = $i;
-
-    $i++;
-    $maxDepth = $depth if($depth > $maxDepth);
-  }
-
-  # Ensure table is big enough (in case of undef entries at the end)
-  if($#table + 1 < $size) {
-    $#table = $size - 1;
-  }
-
-  # Start outputing the hashtables...
-  my $nameEntries = "${name}Entries";
-  $nameEntries =~ s/:/_/g;
-
-  # first, build the string table
-  my %soffset = ();
-  if(($name =~ /Proto/) or ($name =~ /Constructor/)) {
-    my $type = $name;
-    my $implClass;
-
-    if($name =~ /Proto/) {
-      $type =~ s/Proto.*//;
-      $implClass = $type; $implClass =~ s/Wrapper$//;
-      push(@implContent, "/* Hash table for prototype */\n");
-    } else {
-      $type =~ s/Constructor.*//;
-      $implClass = $type; $implClass =~ s/Constructor$//;
-      push(@implContent, "/* Hash table for constructor */\n");
+    
+    # Ensure table is big enough (in case of undef entries at the end)
+    if ($#table + 1 < $size) {
+        $#table = $size - 1;
     }
-  } else {
-    push(@implContent, "/* Hash table */\n");
-  }
-
-  # Dump the hash table...
-  push(@implContent, "\nstatic const HashEntry $nameEntries\[\] =\n\{\n");
-
-  $i = 0;
-  foreach $entry (@table) {
-    if(defined($entry)) {
-      my $key = @$keys[$entry];
-
-      push(@implContent, "    \{ \"" . $key . "\"");
-      push(@implContent, ", " . @$values[$entry]);
-      push(@implContent, ", " . @$specials[$entry]);
-      push(@implContent, ", " . @$parameters[$entry]);
-      push(@implContent, ", ");
-
-      if(defined($links[$i])) {
-        push(@implContent, "&${nameEntries}[$links[$i]]" . " \}");
-      } else {
-        push(@implContent, "0 \}");
-      }
+    
+    # Start outputing the hashtables...
+    my $nameEntries = "${name}Entries";
+    $nameEntries =~ s/:/_/g;
+    
+    # first, build the string table
+    my %soffset = ();
+    if (($name =~ /Proto/) or ($name =~ /Constructor/)) {
+        my $type = $name;
+        my $implClass;
+        
+        if ($name =~ /Proto/) {
+            $type =~ s/Proto.*//;
+            $implClass = $type; $implClass =~ s/Wrapper$//;
+            push(@implContent, "/* Hash table for prototype */\n");
+        } else {
+            $type =~ s/Constructor.*//;
+            $implClass = $type; $implClass =~ s/Constructor$//;
+            push(@implContent, "/* Hash table for constructor */\n");
+        }
     } else {
-      push(@implContent, "    \{ 0, 0, 0, 0, 0 \}");
+        push(@implContent, "/* Hash table */\n");
     }
-
-    push(@implContent, ",") unless($i eq $size - 1);
-    push(@implContent, "\n");
-
-    $i++;
-  }
-
-  if ($size eq 0) {
-    # dummy bucket -- an empty table would crash Lookup::findEntry
-    push(@implContent, "    \{ 0, 0, 0, 0, 0 \}\n") ;
-    $numEntries = 1;
-    $size = 1;
-  }
-  push(@implContent, "};\n\n");
-  push(@implContent, "static const HashTable $name = \n");
-  push(@implContent, "{\n    2, $size, $nameEntries, $numEntries\n};\n\n");
+    
+    # Dump the hash table...
+    push(@implContent, "\nstatic const HashEntry $nameEntries\[\] =\n\{\n");
+    
+    $i = 0;
+    foreach $entry (@table) {
+        if (defined($entry)) {
+            my $key = @$keys[$entry];
+            
+            push(@implContent, "    \{ \"" . $key . "\"");
+            push(@implContent, ", " . @$values[$entry]);
+            push(@implContent, ", " . @$specials[$entry]);
+            push(@implContent, ", " . @$parameters[$entry]);
+            push(@implContent, ", ");
+            
+            if (defined($links[$i])) {
+                push(@implContent, "&${nameEntries}[$links[$i]]" . " \}");
+            } else {
+                push(@implContent, "0 \}");
+            }
+        } else {
+            push(@implContent, "    \{ 0, 0, 0, 0, 0 \}");
+        }
+        
+        push(@implContent, ",") unless($i eq $size - 1);
+        push(@implContent, "\n");
+        
+        $i++;
+    }
+    
+    if ($size eq 0) {
+        # dummy bucket -- an empty table would crash Lookup::findEntry
+        push(@implContent, "    \{ 0, 0, 0, 0, 0 \}\n") ;
+        $numEntries = 1;
+        $size = 1;
+    }
+    push(@implContent, "};\n\n");
+    push(@implContent, "static const HashTable $name = \n");
+    push(@implContent, "{\n    2, $size, $nameEntries, $numEntries\n};\n\n");
 }
 
 # Internal helper
 sub GenerateHashValue
 {
-  my $object = shift;
-
-  @chars = split(/ */, $_[0]);
-
-  # This hash is designed to work on 16-bit chunks at a time. But since the normal case
-  # (above) is to hash UTF-16 characters, we just treat the 8-bit chars as if they
-  # were 16-bit chunks, which should give matching results
-
-  my $EXP2_32 = 4294967296;
-
-  my $hash = 0x9e3779b9;
-  my $l    = scalar @chars; #I wish this was in Ruby --- Maks
-  my $rem  = $l & 1;
-  $l = $l >> 1;
-
-  my $s = 0;
-
-  # Main loop
-  for (; $l > 0; $l--) {
-    $hash   += ord($chars[$s]);
-    my $tmp = leftShift(ord($chars[$s+1]), 11) ^ $hash;
-    $hash   = (leftShift($hash, 16)% $EXP2_32) ^ $tmp;
-    $s += 2;
-    $hash += $hash >> 11;
-  }
-
-  # Handle end case
-  if ($rem !=0) {
-    $hash += ord($chars[$s]);
-    $hash ^= (leftShift($hash, 11)% $EXP2_32);
-    $hash += $hash >> 17;
-  }
-
-  # Force "avalanching" of final 127 bits
-  $hash ^= leftShift($hash, 3);
-  $hash += ($hash >> 5);
-  $hash = ($hash% $EXP2_32);
-  $hash ^= (leftShift($hash, 2)% $EXP2_32);
-  $hash += ($hash >> 15);
-  $hash = $hash% $EXP2_32;
-  $hash ^= (leftShift($hash, 10)% $EXP2_32);
-  
-  # this avoids ever returning a hash code of 0, since that is used to
-  # signal "hash not computed yet", using a value that is likely to be
-  # effectively the same as 0 when the low bits are masked
-  $hash = 0x80000000  if ($hash == 0);
-
-  return $hash;
+    my $object = shift;
+    
+    @chars = split(/ */, $_[0]);
+    
+    # This hash is designed to work on 16-bit chunks at a time. But since the normal case
+    # (above) is to hash UTF-16 characters, we just treat the 8-bit chars as if they
+    # were 16-bit chunks, which should give matching results
+    
+    my $EXP2_32 = 4294967296;
+    
+    my $hash = 0x9e3779b9;
+    my $l    = scalar @chars; #I wish this was in Ruby --- Maks
+    my $rem  = $l & 1;
+    $l = $l >> 1;
+    
+    my $s = 0;
+    
+    # Main loop
+    for (; $l > 0; $l--) {
+        $hash   += ord($chars[$s]);
+        my $tmp = leftShift(ord($chars[$s+1]), 11) ^ $hash;
+        $hash   = (leftShift($hash, 16)% $EXP2_32) ^ $tmp;
+        $s += 2;
+        $hash += $hash >> 11;
+    }
+    
+    # Handle end case
+    if ($rem !=0) {
+        $hash += ord($chars[$s]);
+        $hash ^= (leftShift($hash, 11)% $EXP2_32);
+        $hash += $hash >> 17;
+    }
+    
+    # Force "avalanching" of final 127 bits
+    $hash ^= leftShift($hash, 3);
+    $hash += ($hash >> 5);
+    $hash = ($hash% $EXP2_32);
+    $hash ^= (leftShift($hash, 2)% $EXP2_32);
+    $hash += ($hash >> 15);
+    $hash = $hash% $EXP2_32;
+    $hash ^= (leftShift($hash, 10)% $EXP2_32);
+    
+    # this avoids ever returning a hash code of 0, since that is used to
+    # signal "hash not computed yet", using a value that is likely to be
+    # effectively the same as 0 when the low bits are masked
+    $hash = 0x80000000  if ($hash == 0);
+    
+    return $hash;
 }
 
 # Internal helper
 sub WriteData
 {
-  if (defined($IMPL)) {
-    # Write content to file.
-    print $IMPL @implContentHeader;
-  
-    foreach my $implInclude (sort keys(%implIncludes)) {
-      print $IMPL "#include \"$implInclude\"\n";
+    if (defined($IMPL)) {
+        # Write content to file.
+        print $IMPL @implContentHeader;
+        
+        foreach my $implInclude (sort keys(%implIncludes)) {
+            print $IMPL "#include \"$implInclude\"\n";
+        }
+        
+        print $IMPL @implContent;
+        close($IMPL);
+        undef($IMPL);
+        
+        @implHeaderContent = "";
+        @implContent = "";    
+        %implIncludes = ();
+    }
+        
+    if (defined($HEADER)) {
+        # Write content to file.
+        print $HEADER @headerContent;
+        close($HEADER);
+        undef($HEADER);
+        
+        @headerContent = "";
     }
-
-    print $IMPL @implContent;
-    close($IMPL);
-    undef($IMPL);
-
-    @implHeaderContent = "";
-    @implContent = "";    
-    %implIncludes = ();
-  }
-
-  if (defined($HEADER)) {
-    # Write content to file.
-    print $HEADER @headerContent;
-    close($HEADER);
-    undef($HEADER);
-
-    @headerContent = "";
-  }
 }
 
 sub constructorFor
diff --git a/WebCore/css/CSSRuleList.idl b/WebCore/css/CSSRuleList.idl
new file mode 100644 (file)
index 0000000..554c1d7
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+module css {
+
+    // Introduced in DOM Level 2:
+    interface [HasIndexGetter] CSSRuleList {
+        readonly attribute unsigned long    length;
+        CSSRule           item(in unsigned long index);
+    };
+}
diff --git a/WebCore/css/CSSValueList.idl b/WebCore/css/CSSValueList.idl
new file mode 100644 (file)
index 0000000..517c0f3
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+module css {
+
+    // Introduced in DOM Level 2:
+    interface [HasIndexGetter] CSSValueList : CSSValue {
+        readonly attribute unsigned long    length;
+        CSSValue           item(in unsigned long index);
+    };
+}
diff --git a/WebCore/css/MediaList.idl b/WebCore/css/MediaList.idl
new file mode 100644 (file)
index 0000000..2557e60
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+module stylesheets {
+
+    // Introduced in DOM Level 2:
+    interface MediaList {
+                 attribute DOMString        mediaText
+                                            setter raises(DOMException);
+
+        readonly attribute unsigned long    length;
+        DOMString          item(in unsigned long index);
+        void               deleteMedium(in DOMString oldMedium)
+                                            raises(DOMException);
+        void               appendMedium(in DOMString newMedium)
+                                            raises(DOMException);
+    };
+}
index 75ee4420f960de829229101c386c52e990ad34ec..7ecc0de5b0359183cfbef716e67ef2f714a151c3 100644 (file)
@@ -59,7 +59,8 @@ PassRefPtr<Node> NamedAttrMap::getNamedItem(const String& name) const
 {
     String localName = inHTMLDocument(element) ? name.lower() : name;
     Attribute* a = getAttributeItem(localName);
-    if (!a) return 0;
+    if (!a)
+        return 0;
     
     return a->createAttrIfNeeded(element);
 }
@@ -89,7 +90,8 @@ PassRefPtr<Node> NamedAttrMap::removeNamedItemNS(const String& namespaceURI, con
 PassRefPtr<Node> NamedAttrMap::getNamedItem(const QualifiedName& name) const
 {
     Attribute* a = getAttributeItem(name);
-    if (!a) return 0;
+    if (!a)
+        return 0;
 
     return a->createAttrIfNeeded(element);
 }
index 02df62bf278f89c6777cf4932af6e79df3e3fa34..6ce9ca9e852e42f4414dfaca8010e81eeabb919d 100644 (file)
@@ -100,7 +100,7 @@ Node* NodeList::recursiveItem(unsigned offset, Node* start) const
     return 0; // no matching node in this subtree
 }
 
-Node* NodeList::itemById(const AtomicString& elementId) const
+Node* NodeList::itemWithName(const AtomicString& elementId) const
 {
     if (rootNode->isDocumentNode() || rootNode->inDocument()) {
         Node* node = rootNode->document()->getElementById(elementId);
index bca2905f329536cca23f48edf01f6ba0fedc86f9..6d2dd640cc08751512238e64f941a654f4ef7b5d 100644 (file)
@@ -43,7 +43,7 @@ public:
     // DOM methods & attributes for NodeList
     virtual unsigned length() const = 0;
     virtual Node* item(unsigned index) const = 0;
-    Node* itemById(const AtomicString&) const;
+    Node* itemWithName(const AtomicString&) const;
 
     // Other methods (not part of DOM)
     virtual void rootNodeChildrenChanged();
index a2822c1491bc443268ffc89161f2767f0dd1c108..51af134914b0babc609e6f9dbe9ce31f4585b119 100644 (file)
@@ -107,7 +107,7 @@ void HTMLFormElement::removedFromDocument()
     HTMLElement::removedFromDocument();
 }
 
-int HTMLFormElement::length() const
+unsigned HTMLFormElement::length() const
 {
     int len = 0;
     for (unsigned i = 0; i < formElements.size(); ++i)
@@ -117,6 +117,10 @@ int HTMLFormElement::length() const
     return len;
 }
 
+Node* HTMLFormElement::item(unsigned index)
+{
+    return elements()->item(index);
+}
 
 void HTMLFormElement::submitClick()
 {
@@ -516,9 +520,9 @@ void HTMLFormElement::removeImgElement(HTMLImageElement *e)
     removeFromVector(imgElements, e);
 }
 
-RefPtr<HTMLCollection> HTMLFormElement::elements()
+PassRefPtr<HTMLCollection> HTMLFormElement::elements()
 {
-    return RefPtr<HTMLCollection>(new HTMLFormCollection(this));
+    return new HTMLFormCollection(this);
 }
 
 String HTMLFormElement::name() const
index 1a06d9e97046a3a229bef18aa0f6f93f9dfe44d8..ba75b401a125472d1f0d01ef7f8608864d10a6ab 100644 (file)
@@ -42,7 +42,7 @@ class HTMLFormCollection;
 class HTMLFormElement : public HTMLElement
 {
 public:
-    HTMLFormElement(Document *doc);
+    HTMLFormElement(Document*);
     virtual ~HTMLFormElement();
 
     virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
@@ -52,23 +52,24 @@ public:
     virtual void insertedIntoDocument();
     virtual void removedFromDocument();
  
-    RefPtr<HTMLCollection> elements();
-    int length() const;
+    PassRefPtr<HTMLCollection> elements();
+    unsigned length() const;
+    Node* item(unsigned index);
 
     String enctype() const { return m_enctype; }
-    void setEnctype(const String &);
+    void setEnctype(const String&);
 
     String boundary() const { return m_boundary; }
-    void setBoundary(const String &);
+    void setBoundary(const String&);
 
     bool autoComplete() const { return m_autocomplete; }
 
     virtual void parseMappedAttribute(MappedAttribute *attr);
 
-    void registerFormElement(HTMLGenericFormElement *);
-    void removeFormElement(HTMLGenericFormElement *);
-    void registerImgElement(HTMLImageElement *);
-    void removeImgElement(HTMLImageElement *);
+    void registerFormElement(HTMLGenericFormElement*);
+    void removeFormElement(HTMLGenericFormElement*);
+    void registerImgElement(HTMLImageElement*);
+    void removeImgElement(HTMLImageElement*);
 
     bool prepareSubmit();
     void submit(bool activateSubmitButton = false);
@@ -86,25 +87,23 @@ public:
     bool formWouldHaveSecureSubmission(const String &url);
 
     String name() const;
-    void setName(const String &);
+    void setName(const String&);
 
     String acceptCharset() const;
-    void setAcceptCharset(const String &);
+    void setAcceptCharset(const String&);
 
     String action() const;
-    void setAction(const String &);
+    void setAction(const String&);
 
     String method() const;
-    void setMethod(const String &);
+    void setMethod(const String&);
 
     String target() const;
-    void setTarget(const String &);
-
-    static void i18nData();
+    void setTarget(const String&);
 
     friend class HTMLFormCollection;
 
-    HTMLCollection::CollectionInfo *collectionInfo;
+    HTMLCollection::CollectionInfocollectionInfo;
 
     Vector<HTMLGenericFormElement*> formElements;
     Vector<HTMLImageElement*> imgElements;
@@ -123,10 +122,10 @@ public:
     bool m_preserveAcrossRemove : 1;
 
 private:
-    void parseEnctype(const String &);
-    bool formData(WebCore::FormData &) const;
+    void parseEnctype(const String&);
+    bool formData(WebCore::FormData&) const;
 
-    unsigned formElementIndex(HTMLGenericFormElement *);
+    unsigned formElementIndex(HTMLGenericFormElement*);
 
     String oldNameAttr;
 };
diff --git a/WebCore/html/HTMLFormElement.idl b/WebCore/html/HTMLFormElement.idl
new file mode 100644 (file)
index 0000000..b996709
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * 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, HasIndexGetter, HasNameGetter] HTMLFormElement : HTMLElement {
+        readonly attribute HTMLCollection  elements;
+        readonly attribute long            length;
+                 attribute DOMString       name;
+                 attribute DOMString       acceptCharset;
+                 attribute DOMString       action;
+                 attribute DOMString       enctype;
+                 attribute DOMString       method;
+                 attribute DOMString       target;
+        
+        void               submit();
+        void               reset();
+    };
+}
index ca9b7bf26a26eb43da9dcede56441d5c97fdebd6..e98eecffa8f286c51bc03bebfcbae11e713d8819 100644 (file)
@@ -511,14 +511,14 @@ bool HTMLTableElement::isURLAttribute(Attribute *attr) const
     return attr->name() == backgroundAttr;
 }
 
-RefPtr<HTMLCollection> HTMLTableElement::rows()
+PassRefPtr<HTMLCollection> HTMLTableElement::rows()
 {
-    return RefPtr<HTMLCollection>(new HTMLCollection(this, HTMLCollection::TABLE_ROWS));
+    return new HTMLCollection(this, HTMLCollection::TABLE_ROWS);
 }
 
-RefPtr<HTMLCollection> HTMLTableElement::tBodies()
+PassRefPtr<HTMLCollection> HTMLTableElement::tBodies()
 {
-    return RefPtr<HTMLCollection>(new HTMLCollection(this, HTMLCollection::TABLE_TBODIES));
+    return new HTMLCollection(this, HTMLCollection::TABLE_TBODIES);
 }
 
 String HTMLTableElement::align() const
index b3a3b3318a3e9c9f612cc2921670f8ad8a7577d0..b68a203c75c93fb613a499a9261355b9d8cd58e6 100644 (file)
@@ -86,8 +86,8 @@ public:
     HTMLElement* insertRow(int index, ExceptionCode&);
     void deleteRow(int index, ExceptionCode&);
 
-    RefPtr<HTMLCollection> rows();
-    RefPtr<HTMLCollection> tBodies();
+    PassRefPtr<HTMLCollection> rows();
+    PassRefPtr<HTMLCollection> tBodies();
 
     String align() const;
     void setAlign(const String&);
index be14b76ff6aae3f259677ca324017e7fdd2bc050..d74592f7e40dcfd4353910393857c939b5c0c19f 100644 (file)
@@ -161,9 +161,9 @@ void HTMLTableRowElement::deleteCell( int index, ExceptionCode& ec)
         ec = INDEX_SIZE_ERR;
 }
 
-RefPtr<HTMLCollection> HTMLTableRowElement::cells()
+PassRefPtr<HTMLCollection> HTMLTableRowElement::cells()
 {
-    return RefPtr<HTMLCollection>(new HTMLCollection(this, HTMLCollection::TR_CELLS));
+    return new HTMLCollection(this, HTMLCollection::TR_CELLS);
 }
 
 void HTMLTableRowElement::setCells(HTMLCollection *, ExceptionCode& ec)
index e9c90fcdb7f63203f2b724f40950acb58473c234..a81df37fd477b0c9dc8b5266ee596f8d5e224e19 100644 (file)
@@ -52,7 +52,7 @@ public:
 
     void setSectionRowIndex(int);
 
-    RefPtr<HTMLCollection> cells();
+    PassRefPtr<HTMLCollection> cells();
     void setCells(HTMLCollection *, ExceptionCode&);
 
     String align() const;
index c97c6d4f5dcd2a4513c0edff9c2cf4102e93c7e5..f6ce4a43c34cfc529c4bee5de148942c3cdfe2b0 100644 (file)
@@ -153,9 +153,9 @@ void HTMLTableSectionElement::setVAlign(const String &value)
     setAttribute(valignAttr, value);
 }
 
-RefPtr<HTMLCollection> HTMLTableSectionElement::rows()
+PassRefPtr<HTMLCollection> HTMLTableSectionElement::rows()
 {
-    return RefPtr<HTMLCollection>(new HTMLCollection(this, HTMLCollection::TABLE_ROWS));
+    return new HTMLCollection(this, HTMLCollection::TABLE_ROWS);
 }
 
 }
index fae86fcd454f778c1301f9affede2a65e314042c..555b2efdf0e18010698bcd4745877c25c154fb24 100644 (file)
@@ -59,7 +59,7 @@ public:
     String vAlign() const;
     void setVAlign(const String&);
 
-    RefPtr<HTMLCollection> rows();
+    PassRefPtr<HTMLCollection> rows();
 };
 
 } //namespace