Changeset 21832 in webkit
- Timestamp:
- May 27, 2007 9:40:10 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r21807 r21832 1 2007-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 1 15 2007-05-26 Mitz Pettel <mitz@webkit.org> 2 16 -
trunk/LayoutTests/fast/dom/Window/element-constructors-on-window-expected.txt
r21716 r21832 67 67 HTMLModElement: [object HTMLModElementConstructor] 68 68 69 HTMLObjectElement: undefined69 HTMLObjectElement: [object HTMLObjectElementConstructor] 70 70 71 71 HTMLOListElement: [object HTMLOListElementConstructor] … … 113 113 HTMLDelElement: undefined 114 114 115 HTMLEmbedElement: undefined115 HTMLEmbedElement: [object HTMLEmbedElementConstructor] 116 116 117 117 HTMLMarqueeElement: [object HTMLMarqueeElementConstructor] -
trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt
r21716 r21832 523 523 window.HTMLElement [object HTMLElementConstructor] 524 524 window.HTMLElement.prototype [printed above as window.Element.prototype] 525 window.HTMLEmbedElement [object HTMLEmbedElementConstructor] 526 window.HTMLEmbedElement.prototype [printed above as window.Element.prototype] 525 527 window.HTMLFieldSetElement [object HTMLFieldSetElementConstructor] 526 528 window.HTMLFieldSetElement.prototype [printed above as window.Element.prototype] … … 569 571 window.HTMLOListElement [object HTMLOListElementConstructor] 570 572 window.HTMLOListElement.prototype [printed above as window.Element.prototype] 573 window.HTMLObjectElement [object HTMLObjectElementConstructor] 574 window.HTMLObjectElement.prototype [printed above as window.Element.prototype] 571 575 window.HTMLOptGroupElement [object HTMLOptGroupElementConstructor] 572 576 window.HTMLOptGroupElement.prototype [printed above as window.Element.prototype] -
trunk/WebCore/ChangeLog
r21831 r21832 1 2007-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 1 53 2007-05-27 Sam Weinig <sam@webkit.org> 2 54 -
trunk/WebCore/DerivedSources.make
r21771 r21832 338 338 JSHTMLDocument.h \ 339 339 JSHTMLElement.h \ 340 JSHTMLEmbedElement.h \ 340 341 JSHTMLFieldSetElement.h \ 341 342 JSHTMLFontElement.h \ … … 363 364 JSHTMLOListElement.h \ 364 365 JSHTMLOptGroupElement.h \ 366 JSHTMLObjectElement.h \ 365 367 JSHTMLOptionElement.h \ 366 368 JSHTMLOptionsCollection.h \ -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r21764 r21832 2762 2762 BC1A37BF097C715F0019F3D8 /* DOMUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC1A37A9097C715F0019F3D8 /* DOMUtility.mm */; }; 2763 2763 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 */; }; 2764 2767 BC3FCAA90AC3DB5800BA54AD /* PlatformScrollBar.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */; settings = {ATTRIBUTES = (); }; }; 2765 2768 BC4918C60BFEA050009D6316 /* JSHTMLFrameElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4918C00BFEA050009D6316 /* JSHTMLFrameElement.cpp */; }; … … 2770 2773 BC491B780C023EFD009D6316 /* JSHTMLMarqueeElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC491B760C023EFD009D6316 /* JSHTMLMarqueeElement.cpp */; }; 2771 2774 BC491B790C023EFD009D6316 /* JSHTMLMarqueeElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC491B770C023EFD009D6316 /* JSHTMLMarqueeElement.h */; }; 2775 BC4EDEF40C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */; }; 2772 2776 BC5156E80C03B741008BB0EE /* DOMHTMLMarqueeElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = BC5156E50C03B741008BB0EE /* DOMHTMLMarqueeElement.h */; }; 2773 2777 BC5156E90C03B741008BB0EE /* DOMHTMLMarqueeElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC5156E60C03B741008BB0EE /* DOMHTMLMarqueeElement.mm */; }; … … 2779 2783 BC588AF00BFA6CF900EE679E /* HTMLParserErrorCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = BC588AEF0BFA6CF900EE679E /* HTMLParserErrorCodes.h */; }; 2780 2784 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 */; }; 2781 2788 BC6D6DD209AF906600F59759 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6D6DD009AF906600F59759 /* Font.cpp */; }; 2782 2789 BC6D6DD309AF906600F59759 /* Font.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6D6DD109AF906600F59759 /* Font.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 6007 6014 BC1A37A9097C715F0019F3D8 /* DOMUtility.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMUtility.mm; sourceTree = "<group>"; }; 6008 6015 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>"; }; 6009 6019 BC3B364705C9D5E200E42902 /* AtomicStringList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AtomicStringList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 6010 6020 BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PlatformScrollBar.h; sourceTree = "<group>"; }; … … 6016 6026 BC491B760C023EFD009D6316 /* JSHTMLMarqueeElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLMarqueeElement.cpp; sourceTree = "<group>"; }; 6017 6027 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>"; }; 6018 6029 BC5156E50C03B741008BB0EE /* DOMHTMLMarqueeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLMarqueeElement.h; sourceTree = "<group>"; }; 6019 6030 BC5156E60C03B741008BB0EE /* DOMHTMLMarqueeElement.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLMarqueeElement.mm; sourceTree = "<group>"; }; … … 6024 6035 BC588B4A0BFA723C00EE679E /* HTMLParserErrorCodes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLParserErrorCodes.cpp; sourceTree = "<group>"; }; 6025 6036 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>"; }; 6026 6040 BC6D6DD009AF906600F59759 /* Font.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Font.cpp; sourceTree = "<group>"; }; 6027 6041 BC6D6DD109AF906600F59759 /* Font.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Font.h; sourceTree = "<group>"; }; … … 6453 6467 1A494BF80A122F4400FDAFC1 /* JSHTMLElement.cpp */, 6454 6468 1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */, 6469 BC6D44EA0C07F2ED0072D2C9 /* JSHTMLEmbedElement.cpp */, 6470 BC6D44EB0C07F2ED0072D2C9 /* JSHTMLEmbedElement.h */, 6455 6471 1AE2AA120A1CDAB300B42B25 /* JSHTMLFieldSetElement.cpp */, 6456 6472 1AE2AA130A1CDAB300B42B25 /* JSHTMLFieldSetElement.h */, … … 6497 6513 1AE2AB1F0A1CE63B00B42B25 /* JSHTMLModElement.cpp */, 6498 6514 1AE2AB200A1CE63B00B42B25 /* JSHTMLModElement.h */, 6515 BC305C770C076BB300CD20F0 /* JSHTMLObjectElement.cpp */, 6516 BC305C780C076BB300CD20F0 /* JSHTMLObjectElement.h */, 6499 6517 1A85B1E40A1B240500D8C87C /* JSHTMLOListElement.cpp */, 6500 6518 1A85B1E50A1B240500D8C87C /* JSHTMLOListElement.h */, … … 9077 9095 children = ( 9078 9096 14DFB33F0A7DF7630018F769 /* Derived Sources */, 9097 BC4EDEF70C08F414007EDD49 /* Custom */, 9079 9098 93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */, 9080 1A9EF4560A1B957D00332B63 /* JSCanvasRenderingContext2DCustom.cpp */,9081 9099 E10B93C20B73C291003ED890 /* JSCustomXPathNSResolver.cpp */, 9082 9100 E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */, 9083 929264760B61FC7200B41D34 /* JSDocumentCustom.cpp */,9084 BCF411770BFCC76A00125622 /* JSHTMLAnchorElementCustom.cpp */,9085 BC51580A0C03D404008BB0EE /* JSHTMLDocumentCustom.cpp */,9086 9101 938E65F609F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp */, 9087 9102 938E65F009F09840008A48EC /* JSHTMLElementWrapperFactory.h */, 9088 A8D065AD0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp */,9089 BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */,9090 9103 A80E7E640A1A82EC007FB8C5 /* JSHTMLInputElementBase.cpp */, 9091 9104 A80E7E630A1A82EC007FB8C5 /* JSHTMLInputElementBase.h */, 9092 9105 A826E8AD0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.cpp */, 9093 9106 A826E8AC0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h */, 9094 448AD27A0A4813790023D179 /* JSHTMLOptionsCollectionCustom.cpp */,9095 BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */,9096 AB4CB4EA0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h */,9097 1A750DD30A90E729000FF215 /* JSNodeIteratorCustom.cpp */,9098 9107 8574D1F10ADE6122004CBA11 /* JSSVGElementWrapperFactory.cpp */, 9099 9108 8574D1F20ADE6122004CBA11 /* JSSVGElementWrapperFactory.h */, 9100 B25DFAAE0B2E2929000E6510 /* JSSVGMatrixCustom.cpp */,9101 B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */,9102 B297BC6F0B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp */,9103 9109 B21127A50B3186770009BE53 /* JSSVGPODTypeWrapper.h */, 9104 B2080A110B3CA3B600120852 /* JSSVGPointListCustom.cpp */,9105 1A750E330A90F89F000FF215 /* JSTreeWalkerCustom.cpp */,9106 9110 93B70D4109EB0C7C009D8468 /* JSXMLHttpRequest.cpp */, 9107 9111 93B70D4209EB0C7C009D8468 /* JSXMLHttpRequest.h */, … … 9171 9175 ); 9172 9176 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; 9173 9202 sourceTree = "<group>"; 9174 9203 }; … … 11391 11420 BC6E2B1A0C04B93600444EF8 /* DOMHTMLDocumentPrivate.h in Headers */, 11392 11421 BC926F810C0552470082776B /* JSHTMLFrameSetElement.h in Headers */, 11422 BC305C7A0C076BB300CD20F0 /* JSHTMLObjectElement.h in Headers */, 11423 BC6D44ED0C07F2ED0072D2C9 /* JSHTMLEmbedElement.h in Headers */, 11393 11424 ); 11394 11425 runOnlyForDeploymentPostprocessing = 0; … … 12784 12815 BC926F800C0552470082776B /* JSHTMLFrameSetElement.cpp in Sources */, 12785 12816 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 */, 12786 12822 ); 12787 12823 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/bindings/js/JSHTMLElementWrapperFactory.cpp
r21714 r21832 33 33 #include "HTMLDirectoryElement.h" 34 34 #include "HTMLDivElement.h" 35 #include "HTMLEmbedElement.h" 35 36 #include "HTMLFieldSetElement.h" 36 37 #include "HTMLFontElement.h" … … 56 57 #include "HTMLModElement.h" 57 58 #include "HTMLOListElement.h" 59 #include "HTMLObjectElement.h" 58 60 #include "HTMLOptGroupElement.h" 59 61 #include "HTMLOptionElement.h" … … 90 92 #include "JSHTMLDirectoryElement.h" 91 93 #include "JSHTMLDivElement.h" 94 #include "JSHTMLEmbedElement.h" 92 95 #include "JSHTMLFieldSetElement.h" 93 96 #include "JSHTMLFontElement.h" … … 113 116 #include "JSHTMLModElement.h" 114 117 #include "JSHTMLOListElement.h" 118 #include "JSHTMLObjectElement.h" 115 119 #include "JSHTMLOptGroupElement.h" 116 120 #include "JSHTMLOptionElement.h" … … 161 165 macro(div, Div) \ 162 166 macro(dl, DList) \ 167 macro(embed, Embed) \ 163 168 macro(fieldset, FieldSet) \ 164 169 macro(font, Font) \ … … 179 184 macro(link, Link) \ 180 185 macro(map, Map) \ 186 macro(marquee, Marquee) \ 181 187 macro(menu, Menu) \ 182 188 macro(meta, Meta) \ 183 macro( marquee, Marquee) \189 macro(object, Object) \ 184 190 macro(ol, OList) \ 185 191 macro(optgroup, OptGroup) \ … … 237 243 } 238 244 239 } 245 } // namespace WebCore -
trunk/WebCore/bindings/js/kjs_html.cpp
r21759 r21832 63 63 namespace KJS { 64 64 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() const79 {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() const97 {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 108 65 /* 109 66 @begin JSHTMLElementPrototypeTable 0 110 67 @end 111 @begin HTMLElementTable 0112 @end113 @begin HTMLObjectElementTable 20114 form KJS::JSHTMLElement::ObjectForm DontDelete|ReadOnly115 code KJS::JSHTMLElement::ObjectCode DontDelete116 align KJS::JSHTMLElement::ObjectAlign DontDelete117 archive KJS::JSHTMLElement::ObjectArchive DontDelete118 border KJS::JSHTMLElement::ObjectBorder DontDelete119 codeBase KJS::JSHTMLElement::ObjectCodeBase DontDelete120 codeType KJS::JSHTMLElement::ObjectCodeType DontDelete121 contentDocument KJS::JSHTMLElement::ObjectContentDocument DontDelete|ReadOnly122 data KJS::JSHTMLElement::ObjectData DontDelete123 declare KJS::JSHTMLElement::ObjectDeclare DontDelete124 height KJS::JSHTMLElement::ObjectHeight DontDelete125 hspace KJS::JSHTMLElement::ObjectHspace DontDelete126 getSVGDocument KJS::JSHTMLElement::ObjectGetSVGDocument DontDelete|Function 0127 name KJS::JSHTMLElement::ObjectName DontDelete128 standby KJS::JSHTMLElement::ObjectStandby DontDelete129 tabIndex KJS::JSHTMLElement::ObjectTabIndex DontDelete130 type KJS::JSHTMLElement::ObjectType DontDelete131 useMap KJS::JSHTMLElement::ObjectUseMap DontDelete132 vspace KJS::JSHTMLElement::ObjectVspace DontDelete133 width KJS::JSHTMLElement::ObjectWidth DontDelete134 @end135 @begin HTMLEmbedElementTable 6136 align KJS::JSHTMLElement::EmbedAlign DontDelete137 height KJS::JSHTMLElement::EmbedHeight DontDelete138 getSVGDocument KJS::JSHTMLElement::EmbedGetSVGDocument DontDelete|Function 0139 name KJS::JSHTMLElement::EmbedName DontDelete140 src KJS::JSHTMLElement::EmbedSrc DontDelete141 type KJS::JSHTMLElement::EmbedType DontDelete142 width KJS::JSHTMLElement::EmbedWidth DontDelete143 @end144 68 */ 69 70 const ClassInfo JSHTMLElement::info = { "HTMLElement", &JSElement::info, 0, 0 }; 145 71 146 72 KJS_IMPLEMENT_PROTOTYPE_FUNCTION(JSHTMLElementPrototypeFunction) … … 158 84 } 159 85 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 properties183 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 hashtable199 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 else205 slot.setStaticEntry(this, entry, staticValueGetter<JSHTMLElement>);206 return true;207 }208 }209 210 // Base JSHTMLElement stuff or parent class forward, as usual211 return getStaticPropertySlot<HTMLElementFunction, JSHTMLElement, WebCore::JSHTMLElement>(exec, &HTMLElementTable, this, propertyName, slot);212 }213 214 bool JSHTMLElement::implementsCall() const215 {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) const240 {241 HTMLObjectElement& object = *static_cast<HTMLObjectElement*>(impl());242 switch (token) {243 case ObjectForm: return toJS(exec,object.form()); // type HTMLFormElement244 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) const268 {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) const282 {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 290 86 UString JSHTMLElement::toString(ExecState* exec) const 291 87 { 292 88 if (impl()->hasTagName(aTag)) 293 89 return UString(static_cast<const HTMLAnchorElement*>(impl())->href()); 294 else 295 return JSElement::toString(exec); 90 return JSElement::toString(exec); 296 91 } 297 92 … … 308 103 } 309 104 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 105 void 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); 330 118 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))); 442 131 } 443 132 … … 653 342 } 654 343 344 JSValue* 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 352 JSValue* 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 362 bool 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 376 bool 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 389 bool 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 402 JSValue* 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 655 409 } // namespace -
trunk/WebCore/bindings/js/kjs_html.h
r21714 r21832 47 47 public: 48 48 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; } 58 51 static const ClassInfo info; 59 52 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; 84 55 }; 85 56 … … 132 103 JSValue* getAllHTMLCollection(ExecState*, WebCore::HTMLCollection*); 133 104 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*); 135 111 136 #endif 112 } // namespace KJS 113 114 #endif // kjs_html_h -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r21681 r21832 323 323 push(@headerContent, " virtual bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&);\n"); 324 324 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 } 325 328 } 326 329 … … 336 339 push(@headerContent, " virtual void put(KJS::ExecState*, const KJS::Identifier&, KJS::JSValue*, int attr = KJS::None);\n"); 337 340 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 } 338 344 } 339 345 340 346 # Class info 341 347 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"); 343 349 344 350 # Custom mark function 345 351 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"); 347 359 } 348 360 … … 802 814 if ($dataNode->extendedAttributes->{"HasNameGetter"}) { 803 815 &$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"); 804 822 } 805 823 … … 908 926 push(@implContent, " }\n"); 909 927 } 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 910 934 push(@implContent, " lookupPut<$className, $parentClassName>(exec, propertyName, value, attr, &${className}Table, this);\n"); 911 935 push(@implContent, "}\n\n"); … … 1019 1043 if (@{$function->raisesExceptions}) { 1020 1044 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"); 1021 1050 } 1022 1051 -
trunk/WebCore/html/HTMLAppletElement.idl
r21470 r21832 1 1 /* 2 * Copyright (C) 2006 Apple Computer, Inc.2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 4 4 * … … 21 21 module html { 22 22 23 interface [LegacyParent=KJS::JSHTMLElement, GenerateConstructor ] HTMLAppletElement : HTMLElement {23 interface [LegacyParent=KJS::JSHTMLElement, GenerateConstructor, CustomPutFunction, CustomGetOwnPropertySlot, CustomCall, HasOverridingNameGetter] HTMLAppletElement : HTMLElement { 24 24 attribute [ConvertNullToNullString] DOMString align; 25 25 attribute [ConvertNullToNullString] DOMString alt; -
trunk/WebCore/html/HTMLEmbedElement.idl
r21470 r21832 1 1 /* 2 * Copyright (C) 2006 Apple Computer, Inc.2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 4 4 * … … 21 21 module html { 22 22 23 interface HTMLEmbedElement : HTMLElement {23 interface [LegacyParent=KJS::JSHTMLElement, GenerateConstructor, CustomPutFunction, CustomGetOwnPropertySlot, CustomCall, HasOverridingNameGetter] HTMLEmbedElement : HTMLElement { 24 24 attribute [ConvertNullToNullString] DOMString align; 25 #if defined(LANGUAGE_JAVASCRIPT) 26 attribute [ConvertNullToNullString] DOMString height; 27 #else 25 28 attribute [ConvertFromString] long height; 29 #endif 26 30 attribute [ConvertNullToNullString] DOMString name; 27 31 attribute [ConvertNullToNullString] DOMString src; 28 32 attribute [ConvertNullToNullString] DOMString type; 33 #if defined(LANGUAGE_JAVASCRIPT) 34 attribute [ConvertNullToNullString] DOMString width; 35 #else 29 36 attribute [ConvertFromString] long width; 37 #endif 38 39 #if ENABLE_SVG 40 [SVGCheckSecurityDocument] SVGDocument getSVGDocument() 41 raises(DOMException); 42 #endif 30 43 }; 31 44 -
trunk/WebCore/html/HTMLObjectElement.idl
r21470 r21832 1 1 /* 2 * Copyright (C) 2006 Apple Computer, Inc.2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 4 4 * … … 21 21 module html { 22 22 23 interface HTMLObjectElement : HTMLElement { 24 23 interface [LegacyParent=KJS::JSHTMLElement, GenerateConstructor, CustomPutFunction, CustomGetOwnPropertySlot, CustomCall, HasOverridingNameGetter] HTMLObjectElement : HTMLElement { 25 24 readonly attribute HTMLFormElement form; 26 25 attribute [ConvertNullToNullString] DOMString code; … … 41 40 attribute long vspace; 42 41 attribute [ConvertNullToNullString] DOMString width; 42 43 43 // 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 45 50 46 51 #if defined(LANGUAGE_OBJECTIVE_C) -
trunk/WebCore/page/DOMWindow.idl
r21716 r21832 80 80 attribute ProcessingInstructionConstructor ProcessingInstruction; 81 81 82 // FIXME: Implement the commented-out global constructors for elements listed in DOM Level 2 HTML specification.83 82 attribute HTMLElementConstructor HTMLElement; 84 83 attribute HTMLAnchorElementConstructor HTMLAnchorElement; … … 114 113 attribute HTMLMetaElementConstructor HTMLMetaElement; 115 114 attribute HTMLModElementConstructor HTMLModElement; 116 //attribute HTMLObjectElementConstructor HTMLObjectElement;115 attribute HTMLObjectElementConstructor HTMLObjectElement; 117 116 attribute HTMLOListElementConstructor HTMLOListElement; 118 117 attribute HTMLOptGroupElementConstructor HTMLOptGroupElement; … … 136 135 attribute HTMLCanvasElementConstructor HTMLCanvasElement; 137 136 attribute HTMLMarqueeElementConstructor HTMLMarqueeElement; 137 attribute HTMLEmbedElementConstructor HTMLEmbedElement; 138 138 139 139 attribute HTMLDocumentConstructor HTMLDocument; 140 140 141 attribute MutationEventConstructor MutationEvent; 141 142 attribute NodeFilterConstructor NodeFilter;
Note: See TracChangeset
for help on using the changeset viewer.