Changeset 21832 in webkit


Ignore:
Timestamp:
May 27, 2007 9:40:10 PM (17 years ago)
Author:
weinig
Message:

LayoutTests:

Reviewed by Hyatt.

Update results for http://bugs.webkit.org/show_bug.cgi?id=13893
Autogenerate the JS bindings for the HTMLObjectElement,
HTMLEmbedElement and HTMLAppletElement

  • account for the new JSHTMLObjectElement and JSHTMLEmbedElement that are being autogenerated and can now produce constructors.
  • fast/dom/Window/element-constructors-on-window-expected.txt:
  • fast/dom/Window/window-properties-expected.txt:

WebCore:

Reviewed by Hyatt.

Patch for http://bugs.webkit.org/show_bug.cgi?id=13893
Autogenerate the JS bindings for the HTMLObjectElement,
HTMLEmbedElement and HTMLAppletElement

  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSHTMLAppletElementCustom.cpp: Added. (WebCore::JSHTMLAppletElement::customGetOwnPropertySlot): (WebCore::JSHTMLAppletElement::customPut): (WebCore::JSHTMLAppletElement::implementsCall): (WebCore::JSHTMLAppletElement::callAsFunction): (WebCore::JSHTMLAppletElement::canGetItemsForName): (WebCore::JSHTMLAppletElement::nameGetter):
  • bindings/js/JSHTMLElementWrapperFactory.cpp:
  • bindings/js/JSHTMLEmbedElementCustom.cpp: Added. (WebCore::JSHTMLEmbedElement::customGetOwnPropertySlot): (WebCore::JSHTMLEmbedElement::customPut): (WebCore::JSHTMLEmbedElement::implementsCall): (WebCore::JSHTMLEmbedElement::callAsFunction): (WebCore::JSHTMLEmbedElement::canGetItemsForName): (WebCore::JSHTMLEmbedElement::nameGetter):
  • bindings/js/JSHTMLObjectElementCustom.cpp: Added. (WebCore::JSHTMLObjectElement::customGetOwnPropertySlot): (WebCore::JSHTMLObjectElement::customPut): (WebCore::JSHTMLObjectElement::implementsCall): (WebCore::JSHTMLObjectElement::callAsFunction): (WebCore::JSHTMLObjectElement::canGetItemsForName): (WebCore::JSHTMLObjectElement::nameGetter):
  • bindings/js/kjs_html.cpp: (KJS::): (KJS::JSHTMLElement::toString): (KJS::JSHTMLElement::pushEventHandlerScope): (KJS::runtimeObjectGetter): (KJS::runtimeObjectPropertyGetter): (KJS::runtimeObjectCustomGetOwnPropertySlot): (KJS::runtimeObjectCustomPut): (KJS::runtimeObjectImplementsCall): (KJS::runtimeObjectCallAsFunction):
  • bindings/js/kjs_html.h: (KJS::JSHTMLElement::classInfo):
  • bindings/scripts/CodeGeneratorJS.pm: Add support for CustomGetOwnPropertySlot, CustomPutFunction, CustomCall, and SVGCheckSecurityDocument properties.
  • html/HTMLAppletElement.idl:
  • html/HTMLEmbedElement.idl:
  • html/HTMLObjectElement.idl:
  • page/DOMWindow.idl: Uncomment constructors.
Location:
trunk
Files:
3 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r21807 r21832  
     12007-05-27  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Hyatt.
     4
     5        Update results for http://bugs.webkit.org/show_bug.cgi?id=13893
     6        Autogenerate the JS bindings for the HTMLObjectElement,
     7        HTMLEmbedElement and HTMLAppletElement
     8
     9        - account for the new JSHTMLObjectElement and JSHTMLEmbedElement that are
     10          being autogenerated and can now produce constructors.
     11
     12        * fast/dom/Window/element-constructors-on-window-expected.txt:
     13        * fast/dom/Window/window-properties-expected.txt:
     14
    1152007-05-26  Mitz Pettel  <mitz@webkit.org>
    216
  • trunk/LayoutTests/fast/dom/Window/element-constructors-on-window-expected.txt

    r21716 r21832  
    6767HTMLModElement: [object HTMLModElementConstructor]
    6868
    69 HTMLObjectElement: undefined
     69HTMLObjectElement: [object HTMLObjectElementConstructor]
    7070
    7171HTMLOListElement: [object HTMLOListElementConstructor]
     
    113113HTMLDelElement: undefined
    114114
    115 HTMLEmbedElement: undefined
     115HTMLEmbedElement: [object HTMLEmbedElementConstructor]
    116116
    117117HTMLMarqueeElement: [object HTMLMarqueeElementConstructor]
  • trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt

    r21716 r21832  
    523523window.HTMLElement [object HTMLElementConstructor]
    524524window.HTMLElement.prototype [printed above as window.Element.prototype]
     525window.HTMLEmbedElement [object HTMLEmbedElementConstructor]
     526window.HTMLEmbedElement.prototype [printed above as window.Element.prototype]
    525527window.HTMLFieldSetElement [object HTMLFieldSetElementConstructor]
    526528window.HTMLFieldSetElement.prototype [printed above as window.Element.prototype]
     
    569571window.HTMLOListElement [object HTMLOListElementConstructor]
    570572window.HTMLOListElement.prototype [printed above as window.Element.prototype]
     573window.HTMLObjectElement [object HTMLObjectElementConstructor]
     574window.HTMLObjectElement.prototype [printed above as window.Element.prototype]
    571575window.HTMLOptGroupElement [object HTMLOptGroupElementConstructor]
    572576window.HTMLOptGroupElement.prototype [printed above as window.Element.prototype]
  • trunk/WebCore/ChangeLog

    r21831 r21832  
     12007-05-27  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Hyatt.
     4
     5        Patch for http://bugs.webkit.org/show_bug.cgi?id=13893
     6        Autogenerate the JS bindings for the HTMLObjectElement,
     7        HTMLEmbedElement and HTMLAppletElement
     8
     9        * DerivedSources.make:
     10        * WebCore.xcodeproj/project.pbxproj:
     11        * bindings/js/JSHTMLAppletElementCustom.cpp: Added.
     12        (WebCore::JSHTMLAppletElement::customGetOwnPropertySlot):
     13        (WebCore::JSHTMLAppletElement::customPut):
     14        (WebCore::JSHTMLAppletElement::implementsCall):
     15        (WebCore::JSHTMLAppletElement::callAsFunction):
     16        (WebCore::JSHTMLAppletElement::canGetItemsForName):
     17        (WebCore::JSHTMLAppletElement::nameGetter):
     18        * bindings/js/JSHTMLElementWrapperFactory.cpp:
     19        * bindings/js/JSHTMLEmbedElementCustom.cpp: Added.
     20        (WebCore::JSHTMLEmbedElement::customGetOwnPropertySlot):
     21        (WebCore::JSHTMLEmbedElement::customPut):
     22        (WebCore::JSHTMLEmbedElement::implementsCall):
     23        (WebCore::JSHTMLEmbedElement::callAsFunction):
     24        (WebCore::JSHTMLEmbedElement::canGetItemsForName):
     25        (WebCore::JSHTMLEmbedElement::nameGetter):
     26        * bindings/js/JSHTMLObjectElementCustom.cpp: Added.
     27        (WebCore::JSHTMLObjectElement::customGetOwnPropertySlot):
     28        (WebCore::JSHTMLObjectElement::customPut):
     29        (WebCore::JSHTMLObjectElement::implementsCall):
     30        (WebCore::JSHTMLObjectElement::callAsFunction):
     31        (WebCore::JSHTMLObjectElement::canGetItemsForName):
     32        (WebCore::JSHTMLObjectElement::nameGetter):
     33        * bindings/js/kjs_html.cpp:
     34        (KJS::):
     35        (KJS::JSHTMLElement::toString):
     36        (KJS::JSHTMLElement::pushEventHandlerScope):
     37        (KJS::runtimeObjectGetter):
     38        (KJS::runtimeObjectPropertyGetter):
     39        (KJS::runtimeObjectCustomGetOwnPropertySlot):
     40        (KJS::runtimeObjectCustomPut):
     41        (KJS::runtimeObjectImplementsCall):
     42        (KJS::runtimeObjectCallAsFunction):
     43        * bindings/js/kjs_html.h:
     44        (KJS::JSHTMLElement::classInfo):
     45        * bindings/scripts/CodeGeneratorJS.pm: Add support for
     46        CustomGetOwnPropertySlot, CustomPutFunction, CustomCall,
     47        and SVGCheckSecurityDocument properties.
     48        * html/HTMLAppletElement.idl:
     49        * html/HTMLEmbedElement.idl:
     50        * html/HTMLObjectElement.idl:
     51        * page/DOMWindow.idl: Uncomment constructors.
     52
    1532007-05-27  Sam Weinig  <sam@webkit.org>
    254
  • trunk/WebCore/DerivedSources.make

    r21771 r21832  
    338338    JSHTMLDocument.h \
    339339    JSHTMLElement.h \
     340    JSHTMLEmbedElement.h \
    340341    JSHTMLFieldSetElement.h \
    341342    JSHTMLFontElement.h \
     
    363364    JSHTMLOListElement.h \
    364365    JSHTMLOptGroupElement.h \
     366    JSHTMLObjectElement.h \
    365367    JSHTMLOptionElement.h \
    366368    JSHTMLOptionsCollection.h \
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r21764 r21832  
    27622762                BC1A37BF097C715F0019F3D8 /* DOMUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC1A37A9097C715F0019F3D8 /* DOMUtility.mm */; };
    27632763                BC1A37C0097C715F0019F3D8 /* DOMViews.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A37AA097C715F0019F3D8 /* DOMViews.h */; settings = {ATTRIBUTES = (Private, ); }; };
     2764                BC305C790C076BB300CD20F0 /* JSHTMLObjectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC305C770C076BB300CD20F0 /* JSHTMLObjectElement.cpp */; };
     2765                BC305C7A0C076BB300CD20F0 /* JSHTMLObjectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC305C780C076BB300CD20F0 /* JSHTMLObjectElement.h */; };
     2766                BC305CA40C0781BB00CD20F0 /* JSHTMLObjectElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC305CA30C0781BB00CD20F0 /* JSHTMLObjectElementCustom.cpp */; };
    27642767                BC3FCAA90AC3DB5800BA54AD /* PlatformScrollBar.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */; settings = {ATTRIBUTES = (); }; };
    27652768                BC4918C60BFEA050009D6316 /* JSHTMLFrameElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4918C00BFEA050009D6316 /* JSHTMLFrameElement.cpp */; };
     
    27702773                BC491B780C023EFD009D6316 /* JSHTMLMarqueeElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC491B760C023EFD009D6316 /* JSHTMLMarqueeElement.cpp */; };
    27712774                BC491B790C023EFD009D6316 /* JSHTMLMarqueeElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC491B770C023EFD009D6316 /* JSHTMLMarqueeElement.h */; };
     2775                BC4EDEF40C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */; };
    27722776                BC5156E80C03B741008BB0EE /* DOMHTMLMarqueeElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = BC5156E50C03B741008BB0EE /* DOMHTMLMarqueeElement.h */; };
    27732777                BC5156E90C03B741008BB0EE /* DOMHTMLMarqueeElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC5156E60C03B741008BB0EE /* DOMHTMLMarqueeElement.mm */; };
     
    27792783                BC588AF00BFA6CF900EE679E /* HTMLParserErrorCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = BC588AEF0BFA6CF900EE679E /* HTMLParserErrorCodes.h */; };
    27802784                BC588B4B0BFA723C00EE679E /* HTMLParserErrorCodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC588B4A0BFA723C00EE679E /* HTMLParserErrorCodes.cpp */; };
     2785                BC6D44BE0C07EFB60072D2C9 /* JSHTMLEmbedElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6D44BD0C07EFB60072D2C9 /* JSHTMLEmbedElementCustom.cpp */; };
     2786                BC6D44EC0C07F2ED0072D2C9 /* JSHTMLEmbedElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6D44EA0C07F2ED0072D2C9 /* JSHTMLEmbedElement.cpp */; };
     2787                BC6D44ED0C07F2ED0072D2C9 /* JSHTMLEmbedElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6D44EB0C07F2ED0072D2C9 /* JSHTMLEmbedElement.h */; };
    27812788                BC6D6DD209AF906600F59759 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6D6DD009AF906600F59759 /* Font.cpp */; };
    27822789                BC6D6DD309AF906600F59759 /* Font.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6D6DD109AF906600F59759 /* Font.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    60076014                BC1A37A9097C715F0019F3D8 /* DOMUtility.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMUtility.mm; sourceTree = "<group>"; };
    60086015                BC1A37AA097C715F0019F3D8 /* DOMViews.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMViews.h; sourceTree = "<group>"; };
     6016                BC305C770C076BB300CD20F0 /* JSHTMLObjectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLObjectElement.cpp; sourceTree = "<group>"; };
     6017                BC305C780C076BB300CD20F0 /* JSHTMLObjectElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLObjectElement.h; sourceTree = "<group>"; };
     6018                BC305CA30C0781BB00CD20F0 /* JSHTMLObjectElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLObjectElementCustom.cpp; sourceTree = "<group>"; };
    60096019                BC3B364705C9D5E200E42902 /* AtomicStringList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AtomicStringList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
    60106020                BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PlatformScrollBar.h; sourceTree = "<group>"; };
     
    60166026                BC491B760C023EFD009D6316 /* JSHTMLMarqueeElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLMarqueeElement.cpp; sourceTree = "<group>"; };
    60176027                BC491B770C023EFD009D6316 /* JSHTMLMarqueeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLMarqueeElement.h; sourceTree = "<group>"; };
     6028                BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLAppletElementCustom.cpp; sourceTree = "<group>"; };
    60186029                BC5156E50C03B741008BB0EE /* DOMHTMLMarqueeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLMarqueeElement.h; sourceTree = "<group>"; };
    60196030                BC5156E60C03B741008BB0EE /* DOMHTMLMarqueeElement.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLMarqueeElement.mm; sourceTree = "<group>"; };
     
    60246035                BC588B4A0BFA723C00EE679E /* HTMLParserErrorCodes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLParserErrorCodes.cpp; sourceTree = "<group>"; };
    60256036                BC5EC1760A507E3E006007F5 /* view-source.css */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "view-source.css"; sourceTree = "<group>"; };
     6037                BC6D44BD0C07EFB60072D2C9 /* JSHTMLEmbedElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLEmbedElementCustom.cpp; sourceTree = "<group>"; };
     6038                BC6D44EA0C07F2ED0072D2C9 /* JSHTMLEmbedElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLEmbedElement.cpp; sourceTree = "<group>"; };
     6039                BC6D44EB0C07F2ED0072D2C9 /* JSHTMLEmbedElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLEmbedElement.h; sourceTree = "<group>"; };
    60266040                BC6D6DD009AF906600F59759 /* Font.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Font.cpp; sourceTree = "<group>"; };
    60276041                BC6D6DD109AF906600F59759 /* Font.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Font.h; sourceTree = "<group>"; };
     
    64536467                                1A494BF80A122F4400FDAFC1 /* JSHTMLElement.cpp */,
    64546468                                1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */,
     6469                                BC6D44EA0C07F2ED0072D2C9 /* JSHTMLEmbedElement.cpp */,
     6470                                BC6D44EB0C07F2ED0072D2C9 /* JSHTMLEmbedElement.h */,
    64556471                                1AE2AA120A1CDAB300B42B25 /* JSHTMLFieldSetElement.cpp */,
    64566472                                1AE2AA130A1CDAB300B42B25 /* JSHTMLFieldSetElement.h */,
     
    64976513                                1AE2AB1F0A1CE63B00B42B25 /* JSHTMLModElement.cpp */,
    64986514                                1AE2AB200A1CE63B00B42B25 /* JSHTMLModElement.h */,
     6515                                BC305C770C076BB300CD20F0 /* JSHTMLObjectElement.cpp */,
     6516                                BC305C780C076BB300CD20F0 /* JSHTMLObjectElement.h */,
    64996517                                1A85B1E40A1B240500D8C87C /* JSHTMLOListElement.cpp */,
    65006518                                1A85B1E50A1B240500D8C87C /* JSHTMLOListElement.h */,
     
    90779095                        children = (
    90789096                                14DFB33F0A7DF7630018F769 /* Derived Sources */,
     9097                                BC4EDEF70C08F414007EDD49 /* Custom */,
    90799098                                93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */,
    9080                                 1A9EF4560A1B957D00332B63 /* JSCanvasRenderingContext2DCustom.cpp */,
    90819099                                E10B93C20B73C291003ED890 /* JSCustomXPathNSResolver.cpp */,
    90829100                                E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */,
    9083                                 929264760B61FC7200B41D34 /* JSDocumentCustom.cpp */,
    9084                                 BCF411770BFCC76A00125622 /* JSHTMLAnchorElementCustom.cpp */,
    9085                                 BC51580A0C03D404008BB0EE /* JSHTMLDocumentCustom.cpp */,
    90869101                                938E65F609F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp */,
    90879102                                938E65F009F09840008A48EC /* JSHTMLElementWrapperFactory.h */,
    9088                                 A8D065AD0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp */,
    9089                                 BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */,
    90909103                                A80E7E640A1A82EC007FB8C5 /* JSHTMLInputElementBase.cpp */,
    90919104                                A80E7E630A1A82EC007FB8C5 /* JSHTMLInputElementBase.h */,
    90929105                                A826E8AD0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.cpp */,
    90939106                                A826E8AC0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h */,
    9094                                 448AD27A0A4813790023D179 /* JSHTMLOptionsCollectionCustom.cpp */,
    9095                                 BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */,
    9096                                 AB4CB4EA0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h */,
    9097                                 1A750DD30A90E729000FF215 /* JSNodeIteratorCustom.cpp */,
    90989107                                8574D1F10ADE6122004CBA11 /* JSSVGElementWrapperFactory.cpp */,
    90999108                                8574D1F20ADE6122004CBA11 /* JSSVGElementWrapperFactory.h */,
    9100                                 B25DFAAE0B2E2929000E6510 /* JSSVGMatrixCustom.cpp */,
    9101                                 B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */,
    9102                                 B297BC6F0B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp */,
    91039109                                B21127A50B3186770009BE53 /* JSSVGPODTypeWrapper.h */,
    9104                                 B2080A110B3CA3B600120852 /* JSSVGPointListCustom.cpp */,
    9105                                 1A750E330A90F89F000FF215 /* JSTreeWalkerCustom.cpp */,
    91069110                                93B70D4109EB0C7C009D8468 /* JSXMLHttpRequest.cpp */,
    91079111                                93B70D4209EB0C7C009D8468 /* JSXMLHttpRequest.h */,
     
    91719175                        );
    91729176                        path = objc;
     9177                        sourceTree = "<group>";
     9178                };
     9179                BC4EDEF70C08F414007EDD49 /* Custom */ = {
     9180                        isa = PBXGroup;
     9181                        children = (
     9182                                1A9EF4560A1B957D00332B63 /* JSCanvasRenderingContext2DCustom.cpp */,
     9183                                929264760B61FC7200B41D34 /* JSDocumentCustom.cpp */,
     9184                                BCF411770BFCC76A00125622 /* JSHTMLAnchorElementCustom.cpp */,
     9185                                BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */,
     9186                                BC51580A0C03D404008BB0EE /* JSHTMLDocumentCustom.cpp */,
     9187                                BC6D44BD0C07EFB60072D2C9 /* JSHTMLEmbedElementCustom.cpp */,
     9188                                A8D065AD0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp */,
     9189                                BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */,
     9190                                BC305CA30C0781BB00CD20F0 /* JSHTMLObjectElementCustom.cpp */,
     9191                                448AD27A0A4813790023D179 /* JSHTMLOptionsCollectionCustom.cpp */,
     9192                                BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */,
     9193                                AB4CB4EA0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h */,
     9194                                1A750DD30A90E729000FF215 /* JSNodeIteratorCustom.cpp */,
     9195                                B25DFAAE0B2E2929000E6510 /* JSSVGMatrixCustom.cpp */,
     9196                                B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */,
     9197                                B297BC6F0B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp */,
     9198                                B2080A110B3CA3B600120852 /* JSSVGPointListCustom.cpp */,
     9199                                1A750E330A90F89F000FF215 /* JSTreeWalkerCustom.cpp */,
     9200                        );
     9201                        name = Custom;
    91739202                        sourceTree = "<group>";
    91749203                };
     
    1139111420                                BC6E2B1A0C04B93600444EF8 /* DOMHTMLDocumentPrivate.h in Headers */,
    1139211421                                BC926F810C0552470082776B /* JSHTMLFrameSetElement.h in Headers */,
     11422                                BC305C7A0C076BB300CD20F0 /* JSHTMLObjectElement.h in Headers */,
     11423                                BC6D44ED0C07F2ED0072D2C9 /* JSHTMLEmbedElement.h in Headers */,
    1139311424                        );
    1139411425                        runOnlyForDeploymentPostprocessing = 0;
     
    1278412815                                BC926F800C0552470082776B /* JSHTMLFrameSetElement.cpp in Sources */,
    1278512816                                BCD41ABB0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp in Sources */,
     12817                                BC305C790C076BB300CD20F0 /* JSHTMLObjectElement.cpp in Sources */,
     12818                                BC305CA40C0781BB00CD20F0 /* JSHTMLObjectElementCustom.cpp in Sources */,
     12819                                BC6D44BE0C07EFB60072D2C9 /* JSHTMLEmbedElementCustom.cpp in Sources */,
     12820                                BC6D44EC0C07F2ED0072D2C9 /* JSHTMLEmbedElement.cpp in Sources */,
     12821                                BC4EDEF40C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp in Sources */,
    1278612822                        );
    1278712823                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/bindings/js/JSHTMLElementWrapperFactory.cpp

    r21714 r21832  
    3333#include "HTMLDirectoryElement.h"
    3434#include "HTMLDivElement.h"
     35#include "HTMLEmbedElement.h"
    3536#include "HTMLFieldSetElement.h"
    3637#include "HTMLFontElement.h"
     
    5657#include "HTMLModElement.h"
    5758#include "HTMLOListElement.h"
     59#include "HTMLObjectElement.h"
    5860#include "HTMLOptGroupElement.h"
    5961#include "HTMLOptionElement.h"
     
    9092#include "JSHTMLDirectoryElement.h"
    9193#include "JSHTMLDivElement.h"
     94#include "JSHTMLEmbedElement.h"
    9295#include "JSHTMLFieldSetElement.h"
    9396#include "JSHTMLFontElement.h"
     
    113116#include "JSHTMLModElement.h"
    114117#include "JSHTMLOListElement.h"
     118#include "JSHTMLObjectElement.h"
    115119#include "JSHTMLOptGroupElement.h"
    116120#include "JSHTMLOptionElement.h"
     
    161165    macro(div, Div) \
    162166    macro(dl, DList) \
     167    macro(embed, Embed) \
    163168    macro(fieldset, FieldSet) \
    164169    macro(font, Font) \
     
    179184    macro(link, Link) \
    180185    macro(map, Map) \
     186    macro(marquee, Marquee) \
    181187    macro(menu, Menu) \
    182188    macro(meta, Meta) \
    183     macro(marquee, Marquee) \
     189    macro(object, Object) \
    184190    macro(ol, OList) \
    185191    macro(optgroup, OptGroup) \
     
    237243}
    238244
    239 }
     245} // namespace WebCore
  • trunk/WebCore/bindings/js/kjs_html.cpp

    r21759 r21832  
    6363namespace KJS {
    6464
    65 class HTMLElementFunction : public InternalFunctionImp {
    66 public:
    67   HTMLElementFunction(ExecState* exec, int i, int len, const Identifier& name);
    68   virtual JSValue *callAsFunction(ExecState* exec, JSObject* thisObj, const List&args);
    69 private:
    70   int id;
    71 };
    72 
    73 const ClassInfo JSHTMLElement::info = { "HTMLElement", &JSElement::info, &HTMLElementTable, 0 };
    74 
    75 const ClassInfo JSHTMLElement::embed_info = { "HTMLEmbedElement", &JSHTMLElement::info, &HTMLEmbedElementTable, 0 };
    76 const ClassInfo JSHTMLElement::object_info = { "HTMLObjectElement", &JSHTMLElement::info, &HTMLObjectElementTable, 0 };
    77 
    78 const ClassInfo* JSHTMLElement::classInfo() const
    79 {
    80     static HashMap<AtomicStringImpl*, const ClassInfo*> classInfoMap;
    81     if (classInfoMap.isEmpty()) {
    82         classInfoMap.set(embedTag.localName().impl(), &embed_info);
    83         classInfoMap.set(objectTag.localName().impl(), &object_info);
    84     }
    85    
    86     HTMLElement* element = static_cast<HTMLElement*>(impl());
    87     const ClassInfo* result = classInfoMap.get(element->localName().impl());
    88     if (result)
    89         return result;
    90     return &info;
    91 }
    92 
    93 const JSHTMLElement::Accessors JSHTMLElement::object_accessors = { &JSHTMLElement::objectGetter, &JSHTMLElement::objectSetter };
    94 const JSHTMLElement::Accessors JSHTMLElement::embed_accessors = { &JSHTMLElement::embedGetter, &JSHTMLElement::embedSetter };
    95 
    96 const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
    97 {
    98     static HashMap<AtomicStringImpl*, const Accessors*> accessorMap;
    99     if (accessorMap.isEmpty()) {
    100         accessorMap.add(embedTag.localName().impl(), &embed_accessors);
    101         accessorMap.add(objectTag.localName().impl(), &object_accessors);
    102     }
    103    
    104     HTMLElement* element = static_cast<HTMLElement*>(impl());
    105     return accessorMap.get(element->localName().impl());
    106 }
    107 
    10865/*
    10966@begin JSHTMLElementPrototypeTable 0
    11067@end
    111 @begin HTMLElementTable 0
    112 @end
    113 @begin HTMLObjectElementTable 20
    114   form            KJS::JSHTMLElement::ObjectForm            DontDelete|ReadOnly
    115   code            KJS::JSHTMLElement::ObjectCode            DontDelete
    116   align           KJS::JSHTMLElement::ObjectAlign           DontDelete
    117   archive         KJS::JSHTMLElement::ObjectArchive         DontDelete
    118   border          KJS::JSHTMLElement::ObjectBorder          DontDelete
    119   codeBase        KJS::JSHTMLElement::ObjectCodeBase        DontDelete
    120   codeType        KJS::JSHTMLElement::ObjectCodeType        DontDelete
    121   contentDocument KJS::JSHTMLElement::ObjectContentDocument DontDelete|ReadOnly
    122   data            KJS::JSHTMLElement::ObjectData            DontDelete
    123   declare         KJS::JSHTMLElement::ObjectDeclare         DontDelete
    124   height          KJS::JSHTMLElement::ObjectHeight          DontDelete
    125   hspace          KJS::JSHTMLElement::ObjectHspace          DontDelete
    126   getSVGDocument  KJS::JSHTMLElement::ObjectGetSVGDocument  DontDelete|Function 0
    127   name            KJS::JSHTMLElement::ObjectName            DontDelete
    128   standby         KJS::JSHTMLElement::ObjectStandby         DontDelete
    129   tabIndex        KJS::JSHTMLElement::ObjectTabIndex        DontDelete
    130   type            KJS::JSHTMLElement::ObjectType            DontDelete
    131   useMap          KJS::JSHTMLElement::ObjectUseMap          DontDelete
    132   vspace          KJS::JSHTMLElement::ObjectVspace          DontDelete
    133   width           KJS::JSHTMLElement::ObjectWidth           DontDelete
    134 @end
    135 @begin HTMLEmbedElementTable 6
    136   align         KJS::JSHTMLElement::EmbedAlign           DontDelete
    137   height        KJS::JSHTMLElement::EmbedHeight          DontDelete
    138   getSVGDocument KJS::JSHTMLElement::EmbedGetSVGDocument DontDelete|Function 0
    139   name          KJS::JSHTMLElement::EmbedName            DontDelete
    140   src           KJS::JSHTMLElement::EmbedSrc             DontDelete
    141   type          KJS::JSHTMLElement::EmbedType            DontDelete
    142   width         KJS::JSHTMLElement::EmbedWidth           DontDelete
    143 @end
    14468*/
     69
     70const ClassInfo JSHTMLElement::info = { "HTMLElement", &JSElement::info, 0, 0 };
    14571
    14672KJS_IMPLEMENT_PROTOTYPE_FUNCTION(JSHTMLElementPrototypeFunction)
     
    15884}
    15985
    160 JSValue *JSHTMLElement::runtimeObjectGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
    161 {
    162     JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
    163     HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
    164 
    165     return getRuntimeObject(exec, element);
    166 }
    167 
    168 JSValue *JSHTMLElement::runtimeObjectPropertyGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
    169 {
    170     JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
    171     HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
    172 
    173     if (JSValue *runtimeObject = getRuntimeObject(exec, element))
    174         return static_cast<JSObject*>(runtimeObject)->get(exec, propertyName);
    175     return jsUndefined();
    176 }
    177 
    178 bool JSHTMLElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    179 {
    180     HTMLElement &element = *static_cast<HTMLElement*>(impl());
    181 
    182     // First look at dynamic properties
    183     if (element.hasLocalName(embedTag) || element.hasLocalName(objectTag) || element.hasLocalName(appletTag)) {
    184         if (propertyName == "__apple_runtime_object") {
    185             slot.setCustom(this, runtimeObjectGetter);
    186             return true;
    187         }
    188         JSValue *runtimeObject = getRuntimeObject(exec,&element);
    189         if (runtimeObject) {
    190             JSObject* imp = static_cast<JSObject*>(runtimeObject);
    191             if (imp->hasProperty(exec, propertyName)) {
    192                 slot.setCustom(this, runtimeObjectPropertyGetter);
    193                 return true;
    194             }
    195         }
    196     }
    197 
    198     const HashTable* table = classInfo()->propHashTable; // get the right hashtable
    199     if (table) {
    200         const HashEntry* entry = Lookup::findEntry(table, propertyName);
    201         if (entry) {
    202             if (entry->attr & Function)
    203                 slot.setStaticEntry(this, entry, staticFunctionGetter<HTMLElementFunction>);
    204             else
    205                 slot.setStaticEntry(this, entry, staticValueGetter<JSHTMLElement>);
    206             return true;
    207         }
    208     }
    209 
    210     // Base JSHTMLElement stuff or parent class forward, as usual
    211     return getStaticPropertySlot<HTMLElementFunction, JSHTMLElement, WebCore::JSHTMLElement>(exec, &HTMLElementTable, this, propertyName, slot);
    212 }
    213 
    214 bool JSHTMLElement::implementsCall() const
    215 {
    216     HTMLElement* element = static_cast<HTMLElement*>(impl());
    217     if (element->hasTagName(embedTag) || element->hasTagName(objectTag) || element->hasTagName(appletTag)) {
    218         Frame* frame = element->document()->frame();
    219         if (!frame)
    220             return false;
    221         KJSProxy *proxy = frame->scriptProxy();
    222         ExecState* exec = proxy->interpreter()->globalExec();
    223         if (JSValue *runtimeObject = getRuntimeObject(exec, element))
    224             return static_cast<JSObject*>(runtimeObject)->implementsCall();
    225     }
    226     return false;
    227 }
    228 
    229 JSValue *JSHTMLElement::callAsFunction(ExecState* exec, JSObject* thisObj, const List&args)
    230 {
    231     HTMLElement* element = static_cast<HTMLElement*>(impl());
    232     if (element->hasTagName(embedTag) || element->hasTagName(objectTag) || element->hasTagName(appletTag)) {
    233         if (JSValue *runtimeObject = getRuntimeObject(exec, element))
    234             return static_cast<JSObject*>(runtimeObject)->call(exec, thisObj, args);
    235     }
    236     return jsUndefined();
    237 }
    238 
    239 JSValue *JSHTMLElement::objectGetter(ExecState* exec, int token) const
    240 {
    241     HTMLObjectElement& object = *static_cast<HTMLObjectElement*>(impl());
    242     switch (token) {
    243         case ObjectForm:            return toJS(exec,object.form()); // type HTMLFormElement
    244         case ObjectCode:            return jsString(object.code());
    245         case ObjectAlign:           return jsString(object.align());
    246         case ObjectArchive:         return jsString(object.archive());
    247         case ObjectBorder:          return jsString(object.border());
    248         case ObjectCodeBase:        return jsString(object.codeBase());
    249         case ObjectCodeType:        return jsString(object.codeType());
    250         case ObjectContentDocument: return checkNodeSecurity(exec,object.contentDocument()) ?
    251                                            toJS(exec, object.contentDocument()) : jsUndefined();
    252         case ObjectData:            return jsString(object.data());
    253         case ObjectDeclare:         return jsBoolean(object.declare());
    254         case ObjectHeight:          return jsString(object.height());
    255         case ObjectHspace:          return jsNumber(object.hspace());
    256         case ObjectName:            return jsString(object.name());
    257         case ObjectStandby:         return jsString(object.standby());
    258         case ObjectTabIndex:        return jsNumber(object.tabIndex());
    259         case ObjectType:            return jsString(object.type());
    260         case ObjectUseMap:          return jsString(object.useMap());
    261         case ObjectVspace:          return jsNumber(object.vspace());
    262         case ObjectWidth:           return jsString(object.width());
    263     }
    264     return jsUndefined();
    265 }
    266 
    267 JSValue *JSHTMLElement::embedGetter(ExecState* exec, int token) const
    268 {
    269     HTMLEmbedElement& embed = *static_cast<HTMLEmbedElement*>(impl());
    270     switch (token) {
    271         case EmbedAlign:           return jsString(embed.align());
    272         case EmbedHeight:          return jsString(embed.height());
    273         case EmbedName:            return jsString(embed.name());
    274         case EmbedSrc:             return jsString(embed.src());
    275         case EmbedType:            return jsString(embed.type());
    276         case EmbedWidth:           return jsString(embed.width());
    277     }
    278     return jsUndefined();
    279 }
    280 
    281 JSValue *JSHTMLElement::getValueProperty(ExecState* exec, int token) const
    282 {
    283     // Check the properties specific to our element type.
    284     const Accessors* access = accessors();
    285     if (access && access->m_getter)
    286         return (this->*(access->m_getter))(exec, token);
    287     return jsUndefined();
    288 }
    289 
    29086UString JSHTMLElement::toString(ExecState* exec) const
    29187{
    29288    if (impl()->hasTagName(aTag))
    29389        return UString(static_cast<const HTMLAnchorElement*>(impl())->href());
    294     else
    295         return JSElement::toString(exec);
     90    return JSElement::toString(exec);
    29691}
    29792
     
    308103}
    309104
    310 void JSHTMLElement::pushEventHandlerScope(ExecState* exec, ScopeChain &scope) const
    311 {
    312   HTMLElement* element = static_cast<HTMLElement*>(impl());
    313 
    314   // The document is put on first, fall back to searching it only after the element and form.
    315   scope.push(static_cast<JSObject*>(toJS(exec, element->ownerDocument())));
    316 
    317   // The form is next, searched before the document, but after the element itself.
    318  
    319   // First try to obtain the form from the element itself.  We do this to deal with
    320   // the malformed case where <form>s aren't in our parent chain (e.g., when they were inside
    321   // <table> or <tbody>.
    322   HTMLFormElement* form = getForm(element);
    323   if (form)
    324     scope.push(static_cast<JSObject*>(toJS(exec, form)));
    325   else {
    326     WebCore::Node* form = element->parentNode();
    327     while (form && !form->hasTagName(formTag))
    328       form = form->parentNode();
    329    
     105void JSHTMLElement::pushEventHandlerScope(ExecState* exec, ScopeChain& scope) const
     106{
     107    HTMLElement* element = static_cast<HTMLElement*>(impl());
     108
     109    // The document is put on first, fall back to searching it only after the element and form.
     110    scope.push(static_cast<JSObject*>(toJS(exec, element->ownerDocument())));
     111
     112    // The form is next, searched before the document, but after the element itself.
     113
     114    // First try to obtain the form from the element itself.  We do this to deal with
     115    // the malformed case where <form>s aren't in our parent chain (e.g., when they were inside
     116    // <table> or <tbody>.
     117    HTMLFormElement* form = getForm(element);
    330118    if (form)
    331       scope.push(static_cast<JSObject*>(toJS(exec, form)));
    332   }
    333  
    334   // The element is on top, searched first.
    335   scope.push(static_cast<JSObject*>(toJS(exec, element)));
    336 }
    337 
    338 HTMLElementFunction::HTMLElementFunction(ExecState* exec, int i, int len, const Identifier& name)
    339   : InternalFunctionImp(static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype()), name)
    340   , id(i)
    341 {
    342   put(exec, exec->propertyNames().length, jsNumber(len), DontDelete | ReadOnly | DontEnum);
    343 }
    344 
    345 JSValue *HTMLElementFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
    346 {
    347     if (!thisObj->inherits(&JSHTMLElement::info))
    348         return throwError(exec, TypeError);
    349     DOMExceptionTranslator exception(exec);
    350 
    351 #if ENABLE(SVG)
    352     HTMLElement &element = *static_cast<HTMLElement*>(static_cast<JSHTMLElement*>(thisObj)->impl());
    353 
    354     if (element.hasLocalName(objectTag)) {
    355         HTMLObjectElement& object = static_cast<HTMLObjectElement&>(element);
    356         if (id == JSHTMLElement::ObjectGetSVGDocument)
    357             return checkNodeSecurity(exec, object.getSVGDocument(exception)) ? toJS(exec, object.getSVGDocument(exception)) : jsUndefined();
    358     } else if (element.hasLocalName(embedTag)) {
    359         HTMLEmbedElement& embed = static_cast<HTMLEmbedElement&>(element);
    360         if (id == JSHTMLElement::EmbedGetSVGDocument)
    361             return checkNodeSecurity(exec, embed.getSVGDocument(exception)) ? toJS(exec, embed.getSVGDocument(exception)) : jsUndefined();
    362     }
    363 #endif
    364 
    365     return jsUndefined();
    366 }
    367 
    368 void JSHTMLElement::put(ExecState* exec, const Identifier &propertyName, JSValue *value, int attr)
    369 {
    370     HTMLElement &element = *static_cast<HTMLElement*>(impl());
    371     // First look at dynamic properties
    372     if (element.hasLocalName(embedTag) || element.hasLocalName(objectTag) || element.hasLocalName(appletTag)) {
    373         if (JSValue *runtimeObject = getRuntimeObject(exec, &element)) {
    374             JSObject* imp = static_cast<JSObject*>(runtimeObject);
    375             if (imp->canPut(exec, propertyName))
    376                 return imp->put(exec, propertyName, value);
    377         }
    378     }
    379 
    380     const HashTable* table = classInfo()->propHashTable; // get the right hashtable
    381     if (table) {
    382         const HashEntry* entry = Lookup::findEntry(table, propertyName);
    383         if (entry) {
    384             if (entry->attr & Function) { // function: put as override property
    385                 JSObject::put(exec, propertyName, value, attr);
    386                 return;
    387             } else if (!(entry->attr & ReadOnly)) { // let lookupPut print the warning if read-only
    388                 putValueProperty(exec, entry->value, value, attr);
    389                 return;
    390             }
    391         }
    392     }
    393 
    394     lookupPut<JSHTMLElement, WebCore::JSHTMLElement>(exec, propertyName, value, attr, &HTMLElementTable, this);
    395 }
    396 
    397 void JSHTMLElement::objectSetter(ExecState* exec, int token, JSValue* value)
    398 {
    399     HTMLObjectElement& object = *static_cast<HTMLObjectElement*>(impl());
    400     switch (token) {
    401         // read-only: form
    402         case ObjectCode:            { object.setCode(valueToStringWithNullCheck(exec, value)); return; }
    403         case ObjectAlign:           { object.setAlign(valueToStringWithNullCheck(exec, value)); return; }
    404         case ObjectArchive:         { object.setArchive(valueToStringWithNullCheck(exec, value)); return; }
    405         case ObjectBorder:          { object.setBorder(valueToStringWithNullCheck(exec, value)); return; }
    406         case ObjectCodeBase:        { object.setCodeBase(valueToStringWithNullCheck(exec, value)); return; }
    407         case ObjectCodeType:        { object.setCodeType(valueToStringWithNullCheck(exec, value)); return; }
    408         // read-only: ObjectContentDocument
    409         case ObjectData:            { object.setData(valueToStringWithNullCheck(exec, value)); return; }
    410         case ObjectDeclare:         { object.setDeclare(value->toBoolean(exec)); return; }
    411         case ObjectHeight:          { object.setHeight(valueToStringWithNullCheck(exec, value)); return; }
    412         case ObjectHspace:          { object.setHspace(value->toInt32(exec)); return; }
    413         case ObjectName:            { object.setName(valueToStringWithNullCheck(exec, value)); return; }
    414         case ObjectStandby:         { object.setStandby(valueToStringWithNullCheck(exec, value)); return; }
    415         case ObjectTabIndex:        { object.setTabIndex(value->toInt32(exec)); return; }
    416         case ObjectType:            { object.setType(valueToStringWithNullCheck(exec, value)); return; }
    417         case ObjectUseMap:          { object.setUseMap(valueToStringWithNullCheck(exec, value)); return; }
    418         case ObjectVspace:          { object.setVspace(value->toInt32(exec)); return; }
    419         case ObjectWidth:           { object.setWidth(valueToStringWithNullCheck(exec, value)); return; }
    420     }
    421 }
    422 
    423 void JSHTMLElement::embedSetter(ExecState* exec, int token, JSValue* value)
    424 {
    425     HTMLEmbedElement& embed = *static_cast<HTMLEmbedElement*>(impl());
    426     switch (token) {
    427         case EmbedAlign:           { embed.setAlign(valueToStringWithNullCheck(exec, value)); return; }
    428         case EmbedHeight:          { embed.setHeight(value->toString(exec)); return; }
    429         case EmbedName:            { embed.setName(valueToStringWithNullCheck(exec, value)); return; }
    430         case EmbedSrc:             { embed.setSrc(valueToStringWithNullCheck(exec, value)); return; }
    431         case EmbedType:            { embed.setType(valueToStringWithNullCheck(exec, value)); return; }
    432         case EmbedWidth:           { embed.setWidth(value->toString(exec)); return; }
    433     }
    434 }
    435 
    436 void JSHTMLElement::putValueProperty(ExecState* exec, int token, JSValue *value, int)
    437 {
    438     // Check for properties that apply to a specific element type.
    439     const Accessors* access = accessors();
    440     if (access && access->m_setter)
    441         return (this->*(access->m_setter))(exec, token, value);
     119        scope.push(static_cast<JSObject*>(toJS(exec, form)));
     120    else {
     121        WebCore::Node* form = element->parentNode();
     122        while (form && !form->hasTagName(formTag))
     123            form = form->parentNode();
     124
     125        if (form)
     126            scope.push(static_cast<JSObject*>(toJS(exec, form)));
     127    }
     128
     129    // The element is on top, searched first.
     130    scope.push(static_cast<JSObject*>(toJS(exec, element)));
    442131}
    443132
     
    653342}
    654343
     344JSValue* runtimeObjectGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
     345{
     346    JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
     347    HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
     348
     349    return getRuntimeObject(exec, element);
     350}
     351
     352JSValue* runtimeObjectPropertyGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
     353{
     354    JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
     355    HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
     356
     357    if (JSValue* runtimeObject = getRuntimeObject(exec, element))
     358        return static_cast<JSObject*>(runtimeObject)->get(exec, propertyName);
     359    return jsUndefined();
     360}
     361
     362bool runtimeObjectCustomGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot, JSHTMLElement* originalObj, HTMLElement* thisImp)
     363{
     364    JSValue* runtimeObject = getRuntimeObject(exec, thisImp);
     365    if (runtimeObject) {
     366        JSObject* imp = static_cast<JSObject*>(runtimeObject);
     367        if (imp->hasProperty(exec, propertyName)) {
     368            slot.setCustom(originalObj, runtimeObjectPropertyGetter);
     369            return true;
     370        }
     371    }
     372
     373    return false;
     374}
     375
     376bool runtimeObjectCustomPut(ExecState* exec, const Identifier& propertyName, JSValue* value, int /*attr*/, HTMLElement* thisImp)
     377{
     378    if (JSValue* runtimeObject = getRuntimeObject(exec, thisImp)) {
     379        JSObject* imp = static_cast<JSObject*>(runtimeObject);
     380        if (imp->canPut(exec, propertyName)) {
     381            imp->put(exec, propertyName, value);
     382            return true;
     383        }
     384    }
     385
     386    return false;
     387}
     388
     389bool runtimeObjectImplementsCall(HTMLElement* thisImp)
     390{
     391    Frame* frame = thisImp->document()->frame();
     392    if (!frame)
     393        return false;
     394    KJSProxy* proxy = frame->scriptProxy();
     395    ExecState* exec = proxy->interpreter()->globalExec();
     396    if (JSValue* runtimeObject = getRuntimeObject(exec, thisImp))
     397        return static_cast<JSObject*>(runtimeObject)->implementsCall();
     398
     399    return false;
     400}
     401
     402JSValue* runtimeObjectCallAsFunction(ExecState* exec, JSObject* thisObj, const List& args, HTMLElement* thisImp)
     403{
     404    if (JSValue* runtimeObject = getRuntimeObject(exec, thisImp))
     405        return static_cast<JSObject*>(runtimeObject)->call(exec, thisObj, args);
     406    return jsUndefined();
     407}
     408
    655409} // namespace
  • trunk/WebCore/bindings/js/kjs_html.h

    r21714 r21832  
    4747  public:
    4848    JSHTMLElement(ExecState*, WebCore::HTMLElement*);
    49     virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    50     JSValue* getValueProperty(ExecState*, int token) const;
    51     virtual void put(ExecState*, const Identifier& propertyName, JSValue*, int attr = None);
    52     void putValueProperty(ExecState*, int token, JSValue*, int);
    53     virtual UString toString(ExecState*) const;
    54     virtual void pushEventHandlerScope(ExecState*, ScopeChain &scope) const;
    55     virtual JSValue* callAsFunction(ExecState*, JSObject* thisObj, const List& args);
    56     virtual bool implementsCall() const;
    57     virtual const ClassInfo* classInfo() const;
     49
     50    virtual const ClassInfo* classInfo() const { return &info; }
    5851    static const ClassInfo info;
    5952
    60     static const ClassInfo object_info, embed_info;
    61 
    62     // FIXME: Might make sense to combine this with ClassInfo some day.
    63     typedef JSValue* (JSHTMLElement::*GetterFunction)(ExecState*, int token) const;
    64     typedef void (JSHTMLElement::*SetterFunction)(ExecState*, int token, JSValue*);
    65     struct Accessors { GetterFunction m_getter; SetterFunction m_setter; };
    66     const Accessors* accessors() const;
    67     static const Accessors object_accessors, embed_accessors;
    68 
    69     JSValue* objectGetter(ExecState* exec, int token) const;
    70     void  objectSetter(ExecState*, int token, JSValue*);
    71     JSValue* embedGetter(ExecState*, int token) const;
    72     void  embedSetter(ExecState*, int token, JSValue*);
    73 
    74     enum {
    75            ObjectHspace, ObjectHeight, ObjectAlign,
    76            ObjectBorder, ObjectCode, ObjectType, ObjectVspace, ObjectArchive,
    77            ObjectDeclare, ObjectForm, ObjectCodeBase, ObjectCodeType, ObjectData,
    78            ObjectName, ObjectStandby, ObjectTabIndex, ObjectUseMap, ObjectWidth, ObjectContentDocument, ObjectGetSVGDocument,
    79            EmbedAlign, EmbedHeight, EmbedName, EmbedSrc, EmbedType, EmbedWidth, EmbedGetSVGDocument
    80     };
    81   private:
    82     static JSValue* runtimeObjectGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
    83     static JSValue* runtimeObjectPropertyGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
     53    virtual UString toString(ExecState*) const;
     54    virtual void pushEventHandlerScope(ExecState*, ScopeChain& scope) const;
    8455  };
    8556
     
    132103  JSValue* getAllHTMLCollection(ExecState*, WebCore::HTMLCollection*);
    133104
    134 } // namespace
     105  JSValue* runtimeObjectGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
     106  JSValue* runtimeObjectPropertyGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
     107  bool runtimeObjectCustomGetOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&, JSHTMLElement*, WebCore::HTMLElement*);
     108  bool runtimeObjectCustomPut(ExecState*, const Identifier&, JSValue*, int attr, WebCore::HTMLElement*);
     109  bool runtimeObjectImplementsCall(WebCore::HTMLElement*);
     110  JSValue* runtimeObjectCallAsFunction(ExecState*, JSObject*, const List&, WebCore::HTMLElement*);
    135111
    136 #endif
     112} // namespace KJS
     113
     114#endif // kjs_html_h
  • trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r21681 r21832  
    323323        push(@headerContent, "    virtual bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&);\n");
    324324        push(@headerContent, "    KJS::JSValue* getValueProperty(KJS::ExecState*, int token) const;\n");
     325        if ($dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"}) {
     326            push(@headerContent, "    bool customGetOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&);\n");
     327        }
    325328    }
    326329
     
    336339        push(@headerContent, "    virtual void put(KJS::ExecState*, const KJS::Identifier&, KJS::JSValue*, int attr = KJS::None);\n");
    337340        push(@headerContent, "    void putValueProperty(KJS::ExecState*, int, KJS::JSValue*, int attr);\n");
     341        if ($dataNode->extendedAttributes->{"CustomPutFunction"}) {
     342            push(@headerContent, "    bool customPut(KJS::ExecState*, const KJS::Identifier&, KJS::JSValue*, int attr);\n");
     343        }
    338344    }
    339345
    340346    # Class info
    341347    push(@headerContent, "    virtual const KJS::ClassInfo* classInfo() const { return &info; }\n");
    342     push(@headerContent, "    static const KJS::ClassInfo info;\n");
     348    push(@headerContent, "    static const KJS::ClassInfo info;\n\n");
    343349
    344350    # Custom mark function
    345351    if ($dataNode->extendedAttributes->{"CustomMarkFunction"}) {
    346         push(@headerContent, "\n    virtual void mark();\n\n");
     352        push(@headerContent, "    virtual void mark();\n\n");
     353    }
     354
     355    # Custom call functions
     356    if ($dataNode->extendedAttributes->{"CustomCall"}) {
     357        push(@headerContent, "    virtual KJS::JSValue* callAsFunction(KJS::ExecState*, KJS::JSObject*, const KJS::List& args);\n");
     358        push(@headerContent, "    virtual bool implementsCall() const;\n\n");
    347359    }
    348360
     
    802814        if ($dataNode->extendedAttributes->{"HasNameGetter"}) {
    803815            &$hasNameGetterGeneration();
     816        }
     817
     818        if ($dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"}) {
     819                push(@implContent, "    bool didGet = customGetOwnPropertySlot(exec, propertyName, slot);\n");
     820                push(@implContent, "    if (didGet)\n");
     821                push(@implContent, "        return true;\n");
    804822        }
    805823
     
    908926                push(@implContent, "    }\n");
    909927            }
     928            if ($dataNode->extendedAttributes->{"CustomPutFunction"}) {
     929                push(@implContent, "    bool didPut = customPut(exec, propertyName, value, attr);\n");
     930                push(@implContent, "    if (didPut)\n");
     931                push(@implContent, "        return;\n");
     932            }
     933
    910934            push(@implContent, "    lookupPut<$className, $parentClassName>(exec, propertyName, value, attr, &${className}Table, this);\n");
    911935            push(@implContent, "}\n\n");
     
    10191043            if (@{$function->raisesExceptions}) {
    10201044                push(@implContent, "        ExceptionCode ec = 0;\n");
     1045            }
     1046
     1047            if ($function->signature->extendedAttributes->{"SVGCheckSecurityDocument"}) {
     1048                push(@implContent, "        if (!checkNodeSecurity(exec, imp->getSVGDocument(" . (@{$function->raisesExceptions} ? "ec" : "") .")))\n");
     1049                push(@implContent, "            return jsUndefined();\n");
    10211050            }
    10221051
  • trunk/WebCore/html/HTMLAppletElement.idl

    r21470 r21832  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
    44 *
     
    2121module html {
    2222
    23     interface [LegacyParent=KJS::JSHTMLElement, GenerateConstructor] HTMLAppletElement : HTMLElement {
     23    interface [LegacyParent=KJS::JSHTMLElement, GenerateConstructor, CustomPutFunction, CustomGetOwnPropertySlot, CustomCall, HasOverridingNameGetter] HTMLAppletElement : HTMLElement {
    2424                 attribute [ConvertNullToNullString] DOMString align;
    2525                 attribute [ConvertNullToNullString] DOMString alt;
  • trunk/WebCore/html/HTMLEmbedElement.idl

    r21470 r21832  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
    44 *
     
    2121module html {
    2222
    23     interface HTMLEmbedElement : HTMLElement {
     23    interface [LegacyParent=KJS::JSHTMLElement, GenerateConstructor, CustomPutFunction, CustomGetOwnPropertySlot, CustomCall, HasOverridingNameGetter] HTMLEmbedElement : HTMLElement {
    2424                 attribute [ConvertNullToNullString] DOMString align;
     25#if defined(LANGUAGE_JAVASCRIPT)
     26                 attribute [ConvertNullToNullString] DOMString height;
     27#else
    2528                 attribute [ConvertFromString] long height;
     29#endif
    2630                 attribute [ConvertNullToNullString] DOMString name;
    2731                 attribute [ConvertNullToNullString] DOMString src;
    2832                 attribute [ConvertNullToNullString] DOMString type;
     33#if defined(LANGUAGE_JAVASCRIPT)
     34                 attribute [ConvertNullToNullString] DOMString width;
     35#else
    2936                 attribute [ConvertFromString] long width;
     37#endif
     38
     39#if ENABLE_SVG
     40        [SVGCheckSecurityDocument] SVGDocument getSVGDocument()
     41            raises(DOMException);
     42#endif
    3043    };
    3144
  • trunk/WebCore/html/HTMLObjectElement.idl

    r21470 r21832  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
    44 *
     
    2121module html {
    2222
    23     interface HTMLObjectElement : HTMLElement {
    24 
     23    interface [LegacyParent=KJS::JSHTMLElement, GenerateConstructor, CustomPutFunction, CustomGetOwnPropertySlot, CustomCall, HasOverridingNameGetter] HTMLObjectElement : HTMLElement {
    2524        readonly attribute HTMLFormElement form;
    2625                 attribute [ConvertNullToNullString] DOMString       code;
     
    4140                 attribute long            vspace;
    4241                 attribute [ConvertNullToNullString] DOMString       width;
     42
    4343        // Introduced in DOM Level 2:
    44         readonly attribute Document        contentDocument;
     44        readonly attribute [CheckFrameSecurity] Document        contentDocument;
     45
     46#if ENABLE_SVG
     47        [SVGCheckSecurityDocument] SVGDocument getSVGDocument()
     48            raises(DOMException);
     49#endif
    4550
    4651#if defined(LANGUAGE_OBJECTIVE_C)
  • trunk/WebCore/page/DOMWindow.idl

    r21716 r21832  
    8080        attribute ProcessingInstructionConstructor ProcessingInstruction;
    8181       
    82         // FIXME: Implement the commented-out global constructors for elements listed in DOM Level 2 HTML specification.
    8382        attribute HTMLElementConstructor HTMLElement;
    8483        attribute HTMLAnchorElementConstructor HTMLAnchorElement;
     
    114113        attribute HTMLMetaElementConstructor HTMLMetaElement;
    115114        attribute HTMLModElementConstructor HTMLModElement;
    116 //        attribute HTMLObjectElementConstructor HTMLObjectElement;
     115        attribute HTMLObjectElementConstructor HTMLObjectElement;
    117116        attribute HTMLOListElementConstructor HTMLOListElement;
    118117        attribute HTMLOptGroupElementConstructor HTMLOptGroupElement;
     
    136135        attribute HTMLCanvasElementConstructor HTMLCanvasElement;
    137136        attribute HTMLMarqueeElementConstructor HTMLMarqueeElement;
     137        attribute HTMLEmbedElementConstructor HTMLEmbedElement;
    138138
    139139        attribute HTMLDocumentConstructor HTMLDocument;
     140
    140141        attribute MutationEventConstructor MutationEvent;
    141142        attribute NodeFilterConstructor NodeFilter;
Note: See TracChangeset for help on using the changeset viewer.