Changeset 22039 in webkit


Ignore:
Timestamp:
Jun 6, 2007 9:28:36 PM (17 years ago)
Author:
weinig
Message:

LayoutTests:

Reviewed by Hyatt.

Update tests for http://bugs.webkit.org/show_bug.cgi?id=13973
Autogenerate most of the rest of kjs_dom.h/cpp

  • fast/dom/Window/window-properties-expected.txt:
  • fast/dom/prototype-chain-expected.txt:

WebCore:

Reviewed by Hyatt.

Patch for http://bugs.webkit.org/show_bug.cgi?id=13973
Autogenerate most of the rest of kjs_dom.h/cpp

  • Autogenerate JSNodeList and JSNamedNodeMap.
  • Move JSEventTargetNode, JSNamedNodesCollection, and JSDOMExceptionConstructor into their own files.
  • Rename KJS::DOMEventTargeNode to WebCore::JSEventTargetNode to adhere to convention and allow easier code generation.
  • Add JS constructors for JSNodeList and JSNamedNodeMap.
  • Moved more toJS methods into the correct (corresponding) header files.
  • Cleaned up code in order for changes to work.
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMExceptionConstructor.cpp: Added. (WebCore::): (WebCore::JSDOMExceptionConstructor::JSDOMExceptionConstructor): (WebCore::JSDOMExceptionConstructor::getOwnPropertySlot): (WebCore::JSDOMExceptionConstructor::getValueProperty): (WebCore::getDOMExceptionConstructor):
  • bindings/js/JSDOMExceptionConstructor.h: Added. (WebCore::JSDOMExceptionConstructor::classInfo):
  • bindings/js/JSDOMWindowCustom.cpp: Added. (WebCore::JSDOMWindow::customGetOwnPropertySlot):
  • bindings/js/JSDocumentCustom.cpp: (WebCore::JSDocument::mark): (WebCore::toJS):
  • bindings/js/JSEventTargetNode.cpp: Added. (WebCore::JSEventTargetNode::JSEventTargetNode): (WebCore::JSEventTargetNode::getOwnPropertySlot): (WebCore::JSEventTargetNode::getValueProperty): (WebCore::JSEventTargetNode::put): (WebCore::JSEventTargetNode::putValueProperty): (WebCore::JSEventTargetNode::setListener): (WebCore::JSEventTargetNode::getListener): (WebCore::JSEventTargetNode::pushEventHandlerScope): (WebCore::JSEventTargetNodePrototypeFunction::callAsFunction): (WebCore::toEventTargetNode):
  • bindings/js/JSEventTargetNode.h: Added. (WebCore::JSEventTargetNode::):
  • bindings/js/JSHTMLElementCustom.cpp:
  • bindings/js/JSHTMLFormElementCustom.cpp: (WebCore::JSHTMLFormElement::nameGetter):
  • bindings/js/JSHTMLOptionElementConstructor.cpp:
  • bindings/js/JSNamedNodeMapCustom.cpp: Added. (WebCore::JSNamedNodeMap::canGetItemsForName): (WebCore::JSNamedNodeMap::nameGetter):
  • bindings/js/JSNamedNodesCollection.cpp: Added. (WebCore::): (WebCore::JSNamedNodesCollection::JSNamedNodesCollection): (WebCore::JSNamedNodesCollection::lengthGetter): (WebCore::JSNamedNodesCollection::indexGetter): (WebCore::JSNamedNodesCollection::getOwnPropertySlot):
  • bindings/js/JSNamedNodesCollection.h: Added. (WebCore::JSNamedNodesCollection::classInfo):
  • bindings/js/JSNodeCustom.cpp: Added. (WebCore::toJS):
  • bindings/js/JSNodeListCustom.cpp: Added. (WebCore::JSNodeList::callAsFunction): (WebCore::JSNodeList::implementsCall): (WebCore::JSNodeList::canGetItemsForName): (WebCore::JSNodeList::nameGetter):
  • bindings/js/kjs_dom.cpp:
  • bindings/js/kjs_dom.h:
  • bindings/js/kjs_domnode.h:
  • bindings/js/kjs_events.cpp: (KJS::JSLazyEventListener::parseCode):
  • bindings/js/kjs_html.cpp: (KJS::JSHTMLCollection::getNamedItems):
  • bindings/js/kjs_html.h:
  • bindings/js/kjs_window.cpp: (WebCore::toJS):
  • bindings/js/kjs_window.h:
  • bindings/objc/DOMInternal.mm: (-[WebScriptObject _initializeScriptDOMNodeImp]):
  • bindings/objc/DOMUtility.mm: (KJS::createDOMWrapper):
  • bindings/scripts/CodeGeneratorJS.pm:
  • bridge/mac/WebCoreAXObject.mm:
  • dom/Attr.idl:
  • dom/CharacterData.idl:
  • dom/Document.idl:
  • dom/DocumentFragment.idl:
  • dom/DocumentType.idl:
  • dom/Element.idl:
  • dom/NamedNodeMap.idl:
  • dom/Node.idl:
  • dom/NodeList.idl:
  • page/DOMWindow.idl:
Location:
trunk
Files:
10 added
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r22038 r22039  
     12007-06-06  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Hyatt.
     4
     5        Update tests for http://bugs.webkit.org/show_bug.cgi?id=13973
     6        Autogenerate most of the rest of kjs_dom.h/cpp
     7
     8        * fast/dom/Window/window-properties-expected.txt:
     9        * fast/dom/prototype-chain-expected.txt:
     10
    1112007-06-06  Justin Garcia  <justin.garcia@apple.com>
    212
  • trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt

    r22035 r22039  
    679679window.MutationEvent.REMOVAL [number]
    680680window.MutationEvent.prototype [printed above as window.Event.prototype]
     681window.NamedNodeMap [object NamedNodeMapConstructor]
     682window.NamedNodeMap.prototype [object NamedNodeMapPrototype]
     683window.NamedNodeMap.prototype.getNamedItem [function]
     684window.NamedNodeMap.prototype.getNamedItemNS [function]
     685window.NamedNodeMap.prototype.item [function]
     686window.NamedNodeMap.prototype.removeNamedItem [function]
     687window.NamedNodeMap.prototype.removeNamedItemNS [function]
     688window.NamedNodeMap.prototype.setNamedItem [function]
     689window.NamedNodeMap.prototype.setNamedItemNS [function]
    681690window.Node [object NodeConstructor]
    682691window.Node.ATTRIBUTE_NODE [number]
     
    754763window.NodeFilter.prototype.SHOW_TEXT [number]
    755764window.NodeFilter.prototype.acceptNode [function]
     765window.NodeList [object NodeListConstructor]
     766window.NodeList.prototype [object NodeListPrototype]
     767window.NodeList.prototype.item [function]
    756768window.Notation [object NotationConstructor]
    757769window.Notation.prototype [printed above as window.Node.prototype]
  • trunk/LayoutTests/fast/dom/prototype-chain-expected.txt

    r21842 r22039  
    1111[object NodePrototype]
    1212
    13 [object DOMEventTargetNodePrototype]
     13[object EventTargetNodePrototype]
    1414
    1515[object DocumentPrototype]
     
    2525[object NodePrototype]
    2626
    27 [object DOMEventTargetNodePrototype]
     27[object EventTargetNodePrototype]
    2828
    2929[object ElementPrototype]
     
    4141[object NodePrototype]
    4242
    43 [object DOMEventTargetNodePrototype]
     43[object EventTargetNodePrototype]
    4444
    4545[object ElementPrototype]
  • trunk/WebCore/ChangeLog

    r22038 r22039  
     12007-06-06  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Hyatt.
     4
     5        Patch for http://bugs.webkit.org/show_bug.cgi?id=13973
     6        Autogenerate most of the rest of kjs_dom.h/cpp
     7
     8        - Autogenerate JSNodeList and JSNamedNodeMap.
     9        - Move JSEventTargetNode, JSNamedNodesCollection, and JSDOMExceptionConstructor
     10          into their own files.
     11        - Rename KJS::DOMEventTargeNode to WebCore::JSEventTargetNode to adhere
     12          to convention and allow easier code generation.
     13        - Add JS constructors for JSNodeList and JSNamedNodeMap.
     14        - Moved more toJS methods into the correct (corresponding) header files.
     15        - Cleaned up code in order for changes to work.
     16
     17        * DerivedSources.make:
     18        * WebCore.xcodeproj/project.pbxproj:
     19        * bindings/js/JSDOMExceptionConstructor.cpp: Added.
     20        (WebCore::):
     21        (WebCore::JSDOMExceptionConstructor::JSDOMExceptionConstructor):
     22        (WebCore::JSDOMExceptionConstructor::getOwnPropertySlot):
     23        (WebCore::JSDOMExceptionConstructor::getValueProperty):
     24        (WebCore::getDOMExceptionConstructor):
     25        * bindings/js/JSDOMExceptionConstructor.h: Added.
     26        (WebCore::JSDOMExceptionConstructor::classInfo):
     27        * bindings/js/JSDOMWindowCustom.cpp: Added.
     28        (WebCore::JSDOMWindow::customGetOwnPropertySlot):
     29        * bindings/js/JSDocumentCustom.cpp:
     30        (WebCore::JSDocument::mark):
     31        (WebCore::toJS):
     32        * bindings/js/JSEventTargetNode.cpp: Added.
     33        (WebCore::JSEventTargetNode::JSEventTargetNode):
     34        (WebCore::JSEventTargetNode::getOwnPropertySlot):
     35        (WebCore::JSEventTargetNode::getValueProperty):
     36        (WebCore::JSEventTargetNode::put):
     37        (WebCore::JSEventTargetNode::putValueProperty):
     38        (WebCore::JSEventTargetNode::setListener):
     39        (WebCore::JSEventTargetNode::getListener):
     40        (WebCore::JSEventTargetNode::pushEventHandlerScope):
     41        (WebCore::JSEventTargetNodePrototypeFunction::callAsFunction):
     42        (WebCore::toEventTargetNode):
     43        * bindings/js/JSEventTargetNode.h: Added.
     44        (WebCore::JSEventTargetNode::):
     45        * bindings/js/JSHTMLElementCustom.cpp:
     46        * bindings/js/JSHTMLFormElementCustom.cpp:
     47        (WebCore::JSHTMLFormElement::nameGetter):
     48        * bindings/js/JSHTMLOptionElementConstructor.cpp:
     49        * bindings/js/JSNamedNodeMapCustom.cpp: Added.
     50        (WebCore::JSNamedNodeMap::canGetItemsForName):
     51        (WebCore::JSNamedNodeMap::nameGetter):
     52        * bindings/js/JSNamedNodesCollection.cpp: Added.
     53        (WebCore::):
     54        (WebCore::JSNamedNodesCollection::JSNamedNodesCollection):
     55        (WebCore::JSNamedNodesCollection::lengthGetter):
     56        (WebCore::JSNamedNodesCollection::indexGetter):
     57        (WebCore::JSNamedNodesCollection::getOwnPropertySlot):
     58        * bindings/js/JSNamedNodesCollection.h: Added.
     59        (WebCore::JSNamedNodesCollection::classInfo):
     60        * bindings/js/JSNodeCustom.cpp: Added.
     61        (WebCore::toJS):
     62        * bindings/js/JSNodeListCustom.cpp: Added.
     63        (WebCore::JSNodeList::callAsFunction):
     64        (WebCore::JSNodeList::implementsCall):
     65        (WebCore::JSNodeList::canGetItemsForName):
     66        (WebCore::JSNodeList::nameGetter):
     67        * bindings/js/kjs_dom.cpp:
     68        * bindings/js/kjs_dom.h:
     69        * bindings/js/kjs_domnode.h:
     70        * bindings/js/kjs_events.cpp:
     71        (KJS::JSLazyEventListener::parseCode):
     72        * bindings/js/kjs_html.cpp:
     73        (KJS::JSHTMLCollection::getNamedItems):
     74        * bindings/js/kjs_html.h:
     75        * bindings/js/kjs_window.cpp:
     76        (WebCore::toJS):
     77        * bindings/js/kjs_window.h:
     78        * bindings/objc/DOMInternal.mm:
     79        (-[WebScriptObject _initializeScriptDOMNodeImp]):
     80        * bindings/objc/DOMUtility.mm:
     81        (KJS::createDOMWrapper):
     82        * bindings/scripts/CodeGeneratorJS.pm:
     83        * bridge/mac/WebCoreAXObject.mm:
     84        * dom/Attr.idl:
     85        * dom/CharacterData.idl:
     86        * dom/Document.idl:
     87        * dom/DocumentFragment.idl:
     88        * dom/DocumentType.idl:
     89        * dom/Element.idl:
     90        * dom/NamedNodeMap.idl:
     91        * dom/Node.idl:
     92        * dom/NodeList.idl:
     93        * page/DOMWindow.idl:
     94
    1952007-06-06  Justin Garcia  <justin.garcia@apple.com>
    296
  • trunk/WebCore/DerivedSources.make

    r22035 r22039  
    320320    JSCounter.h \
    321321    JSCSSStyleDeclaration.h \
     322    JSDOMExceptionConstructor.lut.h \
    322323    JSDOMImplementation.h \
    323324    JSDOMParser.h \
     
    327328    JSDocumentType.h \
    328329    JSElement.h \
    329     JSEvent.h \
    330330    JSEntity.h \
    331331    JSEntityReference.h \
     332    JSEvent.h \
     333    JSEventTargetNode.lut.h \
    332334    JSHTMLAppletElement.h \
    333335    JSHTMLAnchorElement.h \
     
    394396    JSMouseEvent.h \
    395397    JSMutationEvent.h \
     398    JSNamedNodeMap.h \
    396399    JSNode.h \
    397400    JSNodeFilter.h \
    398401    JSNodeIterator.h \
     402    JSNodeList.h \
    399403    JSNotation.h \
    400404    JSOverflowEvent.h \
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r22035 r22039  
    377377                656581F409D1508D000E61D7 /* kjs_html.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DD09D1508D000E61D7 /* kjs_html.lut.h */; };
    378378                656581F509D1508D000E61D7 /* kjs_navigator.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */; };
    379                 656581F609D1508D000E61D7 /* kjs_traversal.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DF09D1508D000E61D7 /* kjs_traversal.lut.h */; };
    380379                656581F809D1508D000E61D7 /* kjs_window.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581E109D1508D000E61D7 /* kjs_window.lut.h */; };
    381380                656581FB09D1508D000E61D7 /* ksvgcssproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581E409D1508D000E61D7 /* ksvgcssproperties.h */; };
     
    28622861                BCCFBAE80B5152ED0001F1D7 /* Tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCFBAE70B5152ED0001F1D7 /* Tokenizer.h */; };
    28632862                BCD41ABB0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */; };
     2863                BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */; };
     2864                BCD9C2630C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */; };
     2865                BCD9C2640C17AA67005C90A2 /* JSNodeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2600C17AA67005C90A2 /* JSNodeCustom.cpp */; };
     2866                BCD9C2650C17AA67005C90A2 /* JSNodeListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2610C17AA67005C90A2 /* JSNodeListCustom.cpp */; };
     2867                BCD9C26E0C17AA81005C90A2 /* JSDOMExceptionConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2680C17AA81005C90A2 /* JSDOMExceptionConstructor.cpp */; };
     2868                BCD9C26F0C17AA81005C90A2 /* JSDOMExceptionConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2690C17AA81005C90A2 /* JSDOMExceptionConstructor.h */; };
     2869                BCD9C2700C17AA81005C90A2 /* JSEventTargetNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C26A0C17AA81005C90A2 /* JSEventTargetNode.cpp */; };
     2870                BCD9C2710C17AA81005C90A2 /* JSEventTargetNode.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C26B0C17AA81005C90A2 /* JSEventTargetNode.h */; };
     2871                BCD9C2720C17AA81005C90A2 /* JSNamedNodesCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C26C0C17AA81005C90A2 /* JSNamedNodesCollection.cpp */; };
     2872                BCD9C2730C17AA81005C90A2 /* JSNamedNodesCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C26D0C17AA81005C90A2 /* JSNamedNodesCollection.h */; };
     2873                BCD9C2C00C17B69E005C90A2 /* JSNamedNodeMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2BC0C17B69E005C90A2 /* JSNamedNodeMap.cpp */; };
     2874                BCD9C2C10C17B69E005C90A2 /* JSNamedNodeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2BD0C17B69E005C90A2 /* JSNamedNodeMap.h */; };
     2875                BCD9C2C20C17B69E005C90A2 /* JSNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2BE0C17B69E005C90A2 /* JSNodeList.cpp */; };
     2876                BCD9C2C30C17B69E005C90A2 /* JSNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */; };
     2877                BCD9C2C60C17B6EC005C90A2 /* JSDOMExceptionConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2C40C17B6EC005C90A2 /* JSDOMExceptionConstructor.lut.h */; };
     2878                BCD9C2C70C17B6EC005C90A2 /* JSEventTargetNode.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2C50C17B6EC005C90A2 /* JSEventTargetNode.lut.h */; };
    28642879                BCE0139A0C0BEF180043860A /* JSStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE013980C0BEF180043860A /* JSStyleSheet.cpp */; };
    28652880                BCE0139B0C0BEF180043860A /* JSStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE013990C0BEF180043860A /* JSStyleSheet.h */; };
     
    35873602                656581DD09D1508D000E61D7 /* kjs_html.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_html.lut.h; sourceTree = "<group>"; };
    35883603                656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_navigator.lut.h; sourceTree = "<group>"; };
    3589                 656581DF09D1508D000E61D7 /* kjs_traversal.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_traversal.lut.h; sourceTree = "<group>"; };
    35903604                656581E109D1508D000E61D7 /* kjs_window.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_window.lut.h; sourceTree = "<group>"; };
    35913605                656581E209D1508D000E61D7 /* ksvgcssproperties.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ksvgcssproperties.c; sourceTree = "<group>"; };
     
    61396153                BCCFBAE70B5152ED0001F1D7 /* Tokenizer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Tokenizer.h; sourceTree = "<group>"; };
    61406154                BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFrameSetElementCustom.cpp; sourceTree = "<group>"; };
     6155                BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMWindowCustom.cpp; sourceTree = "<group>"; };
     6156                BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNamedNodeMapCustom.cpp; sourceTree = "<group>"; };
     6157                BCD9C2600C17AA67005C90A2 /* JSNodeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeCustom.cpp; sourceTree = "<group>"; };
     6158                BCD9C2610C17AA67005C90A2 /* JSNodeListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeListCustom.cpp; sourceTree = "<group>"; };
     6159                BCD9C2680C17AA81005C90A2 /* JSDOMExceptionConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMExceptionConstructor.cpp; sourceTree = "<group>"; };
     6160                BCD9C2690C17AA81005C90A2 /* JSDOMExceptionConstructor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMExceptionConstructor.h; sourceTree = "<group>"; };
     6161                BCD9C26A0C17AA81005C90A2 /* JSEventTargetNode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventTargetNode.cpp; sourceTree = "<group>"; };
     6162                BCD9C26B0C17AA81005C90A2 /* JSEventTargetNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSEventTargetNode.h; sourceTree = "<group>"; };
     6163                BCD9C26C0C17AA81005C90A2 /* JSNamedNodesCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNamedNodesCollection.cpp; sourceTree = "<group>"; };
     6164                BCD9C26D0C17AA81005C90A2 /* JSNamedNodesCollection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNamedNodesCollection.h; sourceTree = "<group>"; };
     6165                BCD9C2BC0C17B69E005C90A2 /* JSNamedNodeMap.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNamedNodeMap.cpp; sourceTree = "<group>"; };
     6166                BCD9C2BD0C17B69E005C90A2 /* JSNamedNodeMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNamedNodeMap.h; sourceTree = "<group>"; };
     6167                BCD9C2BE0C17B69E005C90A2 /* JSNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeList.cpp; sourceTree = "<group>"; };
     6168                BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNodeList.h; sourceTree = "<group>"; };
     6169                BCD9C2C40C17B6EC005C90A2 /* JSDOMExceptionConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMExceptionConstructor.lut.h; sourceTree = "<group>"; };
     6170                BCD9C2C50C17B6EC005C90A2 /* JSEventTargetNode.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSEventTargetNode.lut.h; sourceTree = "<group>"; };
    61416171                BCE013980C0BEF180043860A /* JSStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleSheet.cpp; sourceTree = "<group>"; };
    61426172                BCE013990C0BEF180043860A /* JSStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSStyleSheet.h; sourceTree = "<group>"; };
     
    66236653                                65DF31E709D1CC60000BE325 /* JSMutationEvent.cpp */,
    66246654                                65DF31E809D1CC60000BE325 /* JSMutationEvent.h */,
     6655                                BCD9C2BC0C17B69E005C90A2 /* JSNamedNodeMap.cpp */,
     6656                                BCD9C2BD0C17B69E005C90A2 /* JSNamedNodeMap.h */,
    66256657                                14DC0D3509FED073007B0235 /* JSNode.cpp */,
    66266658                                14DC0D3609FED073007B0235 /* JSNode.h */,
     
    66296661                                1A750D8B0A90E521000FF215 /* JSNodeIterator.cpp */,
    66306662                                1A750D8C0A90E521000FF215 /* JSNodeIterator.h */,
     6663                                BCD9C2BE0C17B69E005C90A2 /* JSNodeList.cpp */,
     6664                                BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */,
    66316665                                65DF31E909D1CC60000BE325 /* JSNotation.cpp */,
    66326666                                65DF31EA09D1CC60000BE325 /* JSNotation.h */,
     
    69967030                                A8D06B380A265DCD005E7203 /* HTMLNames.cpp */,
    69977031                                A8D06B370A265DCD005E7203 /* HTMLNames.h */,
     7032                                BCD9C2C40C17B6EC005C90A2 /* JSDOMExceptionConstructor.lut.h */,
     7033                                BCD9C2C50C17B6EC005C90A2 /* JSEventTargetNode.lut.h */,
    69987034                                656581DA09D1508D000E61D7 /* kjs_css.lut.h */,
    69997035                                656581DB09D1508D000E61D7 /* kjs_dom.lut.h */,
     
    70017037                                656581DD09D1508D000E61D7 /* kjs_html.lut.h */,
    70027038                                656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */,
    7003                                 656581DF09D1508D000E61D7 /* kjs_traversal.lut.h */,
    70047039                                656581E109D1508D000E61D7 /* kjs_window.lut.h */,
    70057040                                656581E209D1508D000E61D7 /* ksvgcssproperties.c */,
     
    91639198                                E10B93C20B73C291003ED890 /* JSCustomXPathNSResolver.cpp */,
    91649199                                E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */,
     9200                                BCD9C2680C17AA81005C90A2 /* JSDOMExceptionConstructor.cpp */,
     9201                                BCD9C2690C17AA81005C90A2 /* JSDOMExceptionConstructor.h */,
     9202                                BCD9C26A0C17AA81005C90A2 /* JSEventTargetNode.cpp */,
     9203                                BCD9C26B0C17AA81005C90A2 /* JSEventTargetNode.h */,
    91659204                                938E65F609F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp */,
    91669205                                938E65F009F09840008A48EC /* JSHTMLElementWrapperFactory.h */,
     
    91699208                                A826E8AD0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.cpp */,
    91709209                                A826E8AC0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h */,
     9210                                BCD9C26C0C17AA81005C90A2 /* JSNamedNodesCollection.cpp */,
     9211                                BCD9C26D0C17AA81005C90A2 /* JSNamedNodesCollection.h */,
     9212                                BCB7735E0C17853D00132BA4 /* JSNodeFilterCondition.cpp */,
     9213                                BCB7735F0C17853D00132BA4 /* JSNodeFilterCondition.h */,
    91719214                                8574D1F10ADE6122004CBA11 /* JSSVGElementWrapperFactory.cpp */,
    91729215                                8574D1F20ADE6122004CBA11 /* JSSVGElementWrapperFactory.h */,
     
    92479290                                BC20FB7E0C0E8E6C00D1447F /* JSCSSValueCustom.cpp */,
    92489291                                929264760B61FC7200B41D34 /* JSDocumentCustom.cpp */,
     9292                                BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */,
    92499293                                BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */,
    92509294                                BC51580A0C03D404008BB0EE /* JSHTMLDocumentCustom.cpp */,
     
    92579301                                BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */,
    92589302                                AB4CB4EA0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h */,
    9259                                 BCB7735E0C17853D00132BA4 /* JSNodeFilterCondition.cpp */,
    9260                                 BCB7735F0C17853D00132BA4 /* JSNodeFilterCondition.h */,
     9303                                BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */,
     9304                                BCD9C2600C17AA67005C90A2 /* JSNodeCustom.cpp */,
    92619305                                BCB773600C17853D00132BA4 /* JSNodeFilterCustom.cpp */,
    92629306                                1A750DD30A90E729000FF215 /* JSNodeIteratorCustom.cpp */,
     9307                                BCD9C2610C17AA67005C90A2 /* JSNodeListCustom.cpp */,
    92639308                                BC98A27C0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp */,
    92649309                                B25DFAAE0B2E2929000E6510 /* JSSVGMatrixCustom.cpp */,
     
    1035610401                                656581F409D1508D000E61D7 /* kjs_html.lut.h in Headers */,
    1035710402                                656581F509D1508D000E61D7 /* kjs_navigator.lut.h in Headers */,
    10358                                 656581F609D1508D000E61D7 /* kjs_traversal.lut.h in Headers */,
    1035910403                                656581F809D1508D000E61D7 /* kjs_window.lut.h in Headers */,
    1036010404                                656581FB09D1508D000E61D7 /* ksvgcssproperties.h in Headers */,
     
    1150011544                                BCC5BE010C0E93110011C2DB /* JSCSSStyleSheet.h in Headers */,
    1150111545                                BCB773620C17853D00132BA4 /* JSNodeFilterCondition.h in Headers */,
     11546                                BCD9C26F0C17AA81005C90A2 /* JSDOMExceptionConstructor.h in Headers */,
     11547                                BCD9C2710C17AA81005C90A2 /* JSEventTargetNode.h in Headers */,
     11548                                BCD9C2730C17AA81005C90A2 /* JSNamedNodesCollection.h in Headers */,
     11549                                BCD9C2C10C17B69E005C90A2 /* JSNamedNodeMap.h in Headers */,
     11550                                BCD9C2C30C17B69E005C90A2 /* JSNodeList.h in Headers */,
     11551                                BCD9C2C60C17B6EC005C90A2 /* JSDOMExceptionConstructor.lut.h in Headers */,
     11552                                BCD9C2C70C17B6EC005C90A2 /* JSEventTargetNode.lut.h in Headers */,
    1150211553                        );
    1150311554                        runOnlyForDeploymentPostprocessing = 0;
     
    1291212963                                BCB773610C17853D00132BA4 /* JSNodeFilterCondition.cpp in Sources */,
    1291312964                                BCB773630C17853D00132BA4 /* JSNodeFilterCustom.cpp in Sources */,
     12965                                BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */,
     12966                                BCD9C2630C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp in Sources */,
     12967                                BCD9C2640C17AA67005C90A2 /* JSNodeCustom.cpp in Sources */,
     12968                                BCD9C2650C17AA67005C90A2 /* JSNodeListCustom.cpp in Sources */,
     12969                                BCD9C26E0C17AA81005C90A2 /* JSDOMExceptionConstructor.cpp in Sources */,
     12970                                BCD9C2700C17AA81005C90A2 /* JSEventTargetNode.cpp in Sources */,
     12971                                BCD9C2720C17AA81005C90A2 /* JSNamedNodesCollection.cpp in Sources */,
     12972                                BCD9C2C00C17B69E005C90A2 /* JSNamedNodeMap.cpp in Sources */,
     12973                                BCD9C2C20C17B69E005C90A2 /* JSNodeList.cpp in Sources */,
    1291412974                        );
    1291512975                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/bindings/js/JSDocumentCustom.cpp

    r19105 r22039  
    11/*
    2  * Copyright (C) 2007 Apple, Inc.
     2 * Copyright (C) 2007 Apple, Inc. All rights reserved.
    33 *
    44 * This library is free software; you can redistribute it and/or
     
    2121#include "JSDocument.h"
    2222
     23#include "Document.h"
     24#include "HTMLDocument.h"
     25#include "JSHTMLDocument.h"
    2326#include "kjs_binding.h"
    24 #include "Document.h"
     27#include "kjs_window.h"
     28
     29#if ENABLE(SVG)
     30#include "JSSVGDocument.h"
     31#include "SVGDocument.h"
     32#endif
    2533
    2634namespace WebCore {
     35
     36using namespace KJS;
    2737
    2838void JSDocument::mark()
    2939{
    3040    DOMObject::mark();
    31     KJS::ScriptInterpreter::markDOMNodesForDocument(static_cast<Document*>(impl()));
    32 }
    33    
     41    ScriptInterpreter::markDOMNodesForDocument(static_cast<Document*>(impl()));
    3442}
    3543
     44JSValue* toJS(ExecState* exec, Document* doc)
     45{
     46    if (!doc)
     47        return jsNull();
     48
     49    ScriptInterpreter* interp = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter());
     50    JSDocument* ret =  static_cast<JSDocument*>(interp->getDOMObject(doc));
     51    if (ret)
     52        return ret;
     53
     54    if (doc->isHTMLDocument())
     55        ret = new JSHTMLDocument(exec, static_cast<HTMLDocument*>(doc));
     56#if ENABLE(SVG)
     57    else if (doc->isSVGDocument())
     58        ret = new JSSVGDocument(exec, static_cast<SVGDocument*>(doc));
     59#endif
     60    else
     61        ret = new JSDocument(exec, doc);
     62
     63    // Make sure the document is kept around by the window object, and works right with the
     64    // back/forward cache.
     65    if (doc->frame())
     66        Window::retrieveWindow(doc->frame())->putDirect("document", ret, DontDelete|ReadOnly);
     67
     68    interp->putDOMObject(doc, ret);
     69
     70    return ret;
     71}
     72
     73} // namespace WebCore
  • trunk/WebCore/bindings/js/JSHTMLElementCustom.cpp

    r21856 r22039  
    2929#include "Document.h"
    3030#include "HTMLFormElement.h"
     31#include "kjs_dom.h"
    3132
    3233namespace WebCore {
  • trunk/WebCore/bindings/js/JSHTMLFormElementCustom.cpp

    r21979 r22039  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
     2 * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2727#include "JSHTMLFormElement.h"
    2828
     29#include "HTMLCollection.h"
    2930#include "HTMLFormElement.h"
    30 #include "HTMLCollection.h"
     31#include "JSNamedNodesCollection.h"
     32#include "kjs_dom.h"
    3133
    3234using namespace KJS;
     
    5153        return toJS(exec, namedItems[0].get());
    5254    if (namedItems.size() > 1)
    53         return new DOMNamedNodesCollection(exec, namedItems);
     55        return new JSNamedNodesCollection(exec, namedItems);
    5456    return jsUndefined();
    5557}
  • trunk/WebCore/bindings/js/JSHTMLOptionElementConstructor.cpp

    r20310 r22039  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 *
    44 * This library is free software; you can redistribute it and/or
     
    2525#include "JSHTMLOptionElement.h"
    2626#include "Text.h"
     27#include "kjs_dom.h"
     28
     29namespace WebCore {
    2730
    2831using namespace KJS;
    29 
    30 namespace WebCore {
    3132
    3233JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor(ExecState* exec, Document* d)
     
    6667}
    6768
    68 }
     69} // namespace WebCore
  • trunk/WebCore/bindings/js/JSNodeFilterCondition.cpp

    r22035 r22039  
    2323#include "Document.h"
    2424#include "Frame.h"
     25#include "JSNode.h"
    2526#include "JSNodeFilter.h"
    2627#include "NodeFilter.h"
     
    4849        KJS::ExecState* exec = proxy->interpreter()->globalExec();
    4950        KJS::List args;
    50         args.append(KJS::toJS(exec, node));
     51        args.append(toJS(exec, node));
    5152        KJS::JSObject* obj = m_filter;
    5253        KJS::JSValue* result = obj->call(exec, obj, args);
  • trunk/WebCore/bindings/js/kjs_dom.cpp

    r22035 r22039  
    4949#include "JSHTMLDocument.h"
    5050#include "JSHTMLElementWrapperFactory.h"
     51#include "JSNamedNodeMap.h"
    5152#include "JSNode.h"
     53#include "JSNodeList.h"
    5254#include "JSNotation.h"
    5355#include "JSProcessingInstruction.h"
     
    5557#include "JSText.h"
    5658#include "NamedNodeMap.h"
     59#include "NodeList.h"
    5760#include "Notation.h"
    5861#include "ProcessingInstruction.h"
     
    169172  // Double check that we actually ended up marked. This assert caught problems in the past.
    170173  ASSERT(marked());
    171 }
    172 
    173 bool DOMNode::toBoolean(ExecState* ) const
    174 {
    175     return m_impl;
    176174}
    177175
     
    318316}
    319317
    320 EventTargetNode *toEventTargetNode(JSValue* val)
    321 {
    322     if (!val || !val->isObject(&DOMEventTargetNode::info))
    323         return 0;
    324     return static_cast<EventTargetNode*>(static_cast<DOMEventTargetNode*>(val)->impl());
    325 }
    326 
    327 Node* toNode(JSValue* val)
    328 {
    329     if (!val || !val->isObject(&DOMNode::info))
    330         return 0;
    331     return static_cast<DOMNode*>(val)->impl();
    332 }
    333 
    334 // -------------------------------------------------------------------------
    335 
    336 /* Source for DOMEventTargetNodeTable
    337 @begin DOMEventTargetNodeTable 50
    338 onabort       DOMEventTargetNode::OnAbort                DontDelete
    339 onblur        DOMEventTargetNode::OnBlur                 DontDelete
    340 onchange      DOMEventTargetNode::OnChange               DontDelete
    341 onclick       DOMEventTargetNode::OnClick                DontDelete
    342 oncontextmenu DOMEventTargetNode::OnContextMenu          DontDelete
    343 ondblclick    DOMEventTargetNode::OnDblClick             DontDelete
    344 onbeforecut   DOMEventTargetNode::OnBeforeCut            DontDelete
    345 oncut         DOMEventTargetNode::OnCut                  DontDelete
    346 onbeforecopy  DOMEventTargetNode::OnBeforeCopy           DontDelete
    347 oncopy        DOMEventTargetNode::OnCopy                 DontDelete
    348 onbeforepaste DOMEventTargetNode::OnBeforePaste          DontDelete
    349 onpaste       DOMEventTargetNode::OnPaste                DontDelete
    350 ondrag        DOMEventTargetNode::OnDrag                 DontDelete
    351 ondragend     DOMEventTargetNode::OnDragEnd              DontDelete
    352 ondragenter   DOMEventTargetNode::OnDragEnter            DontDelete
    353 ondragleave   DOMEventTargetNode::OnDragLeave            DontDelete
    354 ondragover    DOMEventTargetNode::OnDragOver             DontDelete
    355 ondragstart   DOMEventTargetNode::OnDragStart            DontDelete
    356 ondrop        DOMEventTargetNode::OnDrop                 DontDelete
    357 onerror       DOMEventTargetNode::OnError                DontDelete
    358 onfocus       DOMEventTargetNode::OnFocus                DontDelete
    359 oninput       DOMEventTargetNode::OnInput                DontDelete
    360 onkeydown     DOMEventTargetNode::OnKeyDown              DontDelete
    361 onkeypress    DOMEventTargetNode::OnKeyPress             DontDelete
    362 onkeyup       DOMEventTargetNode::OnKeyUp                DontDelete
    363 onload        DOMEventTargetNode::OnLoad                 DontDelete
    364 onmousedown   DOMEventTargetNode::OnMouseDown            DontDelete
    365 onmousemove   DOMEventTargetNode::OnMouseMove            DontDelete
    366 onmouseout    DOMEventTargetNode::OnMouseOut             DontDelete
    367 onmouseover   DOMEventTargetNode::OnMouseOver            DontDelete
    368 onmouseup     DOMEventTargetNode::OnMouseUp              DontDelete
    369 onmousewheel  DOMEventTargetNode::OnMouseWheel           DontDelete
    370 onreset       DOMEventTargetNode::OnReset                DontDelete
    371 onresize      DOMEventTargetNode::OnResize               DontDelete
    372 onscroll      DOMEventTargetNode::OnScroll               DontDelete
    373 onsearch      DOMEventTargetNode::OnSearch               DontDelete
    374 onselect      DOMEventTargetNode::OnSelect               DontDelete
    375 onselectstart DOMEventTargetNode::OnSelectStart          DontDelete
    376 onsubmit      DOMEventTargetNode::OnSubmit               DontDelete
    377 onunload      DOMEventTargetNode::OnUnload               DontDelete
    378 @end
    379 */
    380 
    381 DOMEventTargetNode::DOMEventTargetNode(ExecState* exec, Node* n)
    382     : JSNode(exec, n)
    383 {
    384     setPrototype(DOMEventTargetNodePrototype::self(exec));
    385 }
    386 
    387 bool DOMEventTargetNode::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    388 {
    389     return getStaticValueSlot<DOMEventTargetNode, DOMNode>(exec, &DOMEventTargetNodeTable, this, propertyName, slot);
    390 }
    391 
    392 JSValue* DOMEventTargetNode::getValueProperty(ExecState* exec, int token) const
    393 {
    394     switch (token) {
    395         case OnAbort:
    396             return getListener(abortEvent);
    397         case OnBlur:
    398             return getListener(blurEvent);
    399         case OnChange:
    400             return getListener(changeEvent);
    401         case OnClick:
    402             return getListener(clickEvent);
    403         case OnContextMenu:
    404             return getListener(contextmenuEvent);
    405         case OnDblClick:
    406             return getListener(dblclickEvent);
    407         case OnError:
    408             return getListener(errorEvent);
    409         case OnFocus:
    410             return getListener(focusEvent);
    411         case OnInput:
    412             return getListener(inputEvent);
    413         case OnKeyDown:
    414             return getListener(keydownEvent);
    415         case OnKeyPress:
    416             return getListener(keypressEvent);
    417         case OnKeyUp:
    418             return getListener(keyupEvent);
    419         case OnLoad:
    420             return getListener(loadEvent);
    421         case OnMouseDown:
    422             return getListener(mousedownEvent);
    423         case OnMouseMove:
    424             return getListener(mousemoveEvent);
    425         case OnMouseOut:
    426             return getListener(mouseoutEvent);
    427         case OnMouseOver:
    428             return getListener(mouseoverEvent);
    429         case OnMouseUp:
    430             return getListener(mouseupEvent);     
    431         case OnMouseWheel:
    432             return getListener(mousewheelEvent);     
    433         case OnBeforeCut:
    434             return getListener(beforecutEvent);
    435         case OnCut:
    436             return getListener(cutEvent);
    437         case OnBeforeCopy:
    438             return getListener(beforecopyEvent);
    439         case OnCopy:
    440             return getListener(copyEvent);
    441         case OnBeforePaste:
    442             return getListener(beforepasteEvent);
    443         case OnPaste:
    444             return getListener(pasteEvent);
    445         case OnDragEnter:
    446             return getListener(dragenterEvent);
    447         case OnDragOver:
    448             return getListener(dragoverEvent);
    449         case OnDragLeave:
    450             return getListener(dragleaveEvent);
    451         case OnDrop:
    452             return getListener(dropEvent);
    453         case OnDragStart:
    454             return getListener(dragstartEvent);
    455         case OnDrag:
    456             return getListener(dragEvent);
    457         case OnDragEnd:
    458             return getListener(dragendEvent);
    459         case OnReset:
    460             return getListener(resetEvent);
    461         case OnResize:
    462             return getListener(resizeEvent);
    463         case OnScroll:
    464             return getListener(scrollEvent);
    465         case OnSearch:
    466             return getListener(searchEvent);
    467         case OnSelect:
    468             return getListener(selectEvent);
    469         case OnSelectStart:
    470             return getListener(selectstartEvent);
    471         case OnSubmit:
    472             return getListener(submitEvent);
    473         case OnUnload:
    474             return getListener(unloadEvent);
    475     }
    476    
    477     return jsUndefined();
    478 }
    479 
    480 void DOMEventTargetNode::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
    481 {
    482     lookupPut<DOMEventTargetNode, DOMNode>(exec, propertyName, value, attr, &DOMEventTargetNodeTable, this);
    483 }
    484 
    485 void DOMEventTargetNode::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
    486 {
    487     switch (token) {
    488         case OnAbort:
    489             setListener(exec, abortEvent, value);
    490             break;
    491         case OnBlur:
    492             setListener(exec, blurEvent, value);
    493             break;
    494         case OnChange:
    495             setListener(exec, changeEvent, value);
    496             break;
    497         case OnClick:
    498             setListener(exec, clickEvent, value);
    499             break;
    500         case OnContextMenu:
    501             setListener(exec, contextmenuEvent, value);
    502             break;
    503         case OnDblClick:
    504             setListener(exec, dblclickEvent, value);
    505             break;
    506         case OnError:
    507             setListener(exec, errorEvent, value);
    508             break;
    509         case OnFocus:
    510             setListener(exec, focusEvent, value);
    511             break;
    512         case OnInput:
    513             setListener(exec, inputEvent, value);
    514             break;
    515         case OnKeyDown:
    516             setListener(exec, keydownEvent, value);
    517             break;
    518         case OnKeyPress:
    519             setListener(exec, keypressEvent, value);
    520             break;
    521         case OnKeyUp:
    522             setListener(exec, keyupEvent, value);
    523             break;
    524         case OnLoad:
    525             setListener(exec, loadEvent, value);
    526             break;
    527         case OnMouseDown:
    528             setListener(exec, mousedownEvent, value);
    529             break;
    530         case OnMouseMove:
    531             setListener(exec, mousemoveEvent, value);
    532             break;
    533         case OnMouseOut:
    534             setListener(exec, mouseoutEvent, value);
    535             break;
    536         case OnMouseOver:
    537             setListener(exec, mouseoverEvent, value);
    538             break;
    539         case OnMouseUp:
    540             setListener(exec, mouseupEvent, value);
    541             break;
    542         case OnMouseWheel:
    543             setListener(exec, mousewheelEvent, value);
    544             break;
    545         case OnBeforeCut:
    546             setListener(exec, beforecutEvent, value);
    547             break;
    548         case OnCut:
    549             setListener(exec, cutEvent, value);
    550             break;
    551         case OnBeforeCopy:
    552             setListener(exec, beforecopyEvent, value);
    553             break;
    554         case OnCopy:
    555             setListener(exec, copyEvent, value);
    556             break;
    557         case OnBeforePaste:
    558             setListener(exec, beforepasteEvent, value);
    559             break;
    560         case OnPaste:
    561             setListener(exec, pasteEvent, value);
    562             break;
    563         case OnDragEnter:
    564             setListener(exec, dragenterEvent, value);
    565             break;
    566         case OnDragOver:
    567             setListener(exec, dragoverEvent, value);
    568             break;
    569         case OnDragLeave:
    570             setListener(exec, dragleaveEvent, value);
    571             break;
    572         case OnDrop:
    573             setListener(exec, dropEvent, value);
    574             break;
    575         case OnDragStart:
    576             setListener(exec, dragstartEvent, value);
    577             break;
    578         case OnDrag:
    579             setListener(exec, dragEvent, value);
    580             break;
    581         case OnDragEnd:
    582             setListener(exec, dragendEvent, value);
    583             break;
    584         case OnReset:
    585             setListener(exec, resetEvent, value);
    586             break;
    587         case OnResize:
    588             setListener(exec, resizeEvent, value);
    589             break;
    590         case OnScroll:
    591             setListener(exec, scrollEvent, value);
    592             break;
    593         case OnSearch:
    594             setListener(exec, searchEvent, value);
    595             break;
    596         case OnSelect:
    597             setListener(exec, selectEvent, value);
    598             break;
    599         case OnSelectStart:
    600             setListener(exec, selectstartEvent, value);
    601             break;
    602         case OnSubmit:
    603             setListener(exec, submitEvent, value);
    604             break;
    605         case OnUnload:
    606             setListener(exec, unloadEvent, value);
    607             break;
    608     }
    609 }
    610 
    611 void DOMEventTargetNode::setListener(ExecState* exec, const AtomicString &eventType, JSValue* func) const
    612 {
    613     EventTargetNodeCast(impl())->setHTMLEventListener(eventType, Window::retrieveActive(exec)->findOrCreateJSEventListener(func, true));
    614 }
    615 
    616 JSValue* DOMEventTargetNode::getListener(const AtomicString &eventType) const
    617 {
    618     EventListener *listener = EventTargetNodeCast(impl())->getHTMLEventListener(eventType);
    619     JSEventListener *jsListener = static_cast<JSEventListener*>(listener);
    620     if (jsListener && jsListener->listenerObj())
    621         return jsListener->listenerObj();
    622     else
    623         return jsNull();
    624 }
    625 
    626 void DOMEventTargetNode::pushEventHandlerScope(ExecState*, ScopeChain &) const
    627 {
    628 }
    629 
    630 /*
    631 @begin DOMEventTargetNodePrototypeTable 5
    632 # from the EventTarget interface
    633 addEventListener        DOMEventTargetNode::AddEventListener   DontDelete|Function 3
    634 removeEventListener     DOMEventTargetNode::RemoveEventListener    DontDelete|Function 3
    635 dispatchEvent           DOMEventTargetNode::DispatchEvent  DontDelete|Function 1
    636 @end
    637 */
    638 
    639 KJS_IMPLEMENT_PROTOTYPE_FUNCTION(DOMEventTargetNodePrototypeFunction)
    640 KJS_IMPLEMENT_PROTOTYPE("DOMEventTargetNode", DOMEventTargetNodePrototype, DOMEventTargetNodePrototypeFunction)
    641 
    642 JSValue* DOMEventTargetNodePrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
    643 {
    644     if (!thisObj->inherits(&DOMEventTargetNode::info))
    645         return throwError(exec, TypeError);
    646     DOMExceptionTranslator exception(exec);
    647     DOMEventTargetNode* DOMNode = static_cast<DOMEventTargetNode*>(thisObj);
    648     EventTargetNode* node = static_cast<EventTargetNode*>(DOMNode->impl());
    649     switch (id) {
    650         case DOMEventTargetNode::AddEventListener: {
    651             JSEventListener *listener = Window::retrieveActive(exec)->findOrCreateJSEventListener(args[1]);
    652             if (listener)
    653                 node->addEventListener(args[0]->toString(exec), listener,args[2]->toBoolean(exec));
    654             return jsUndefined();
    655         }
    656         case DOMEventTargetNode::RemoveEventListener: {
    657             JSEventListener *listener = Window::retrieveActive(exec)->findJSEventListener(args[1]);
    658             if (listener)
    659                 node->removeEventListener(args[0]->toString(exec), listener,args[2]->toBoolean(exec));
    660             return jsUndefined();
    661         }
    662         case DOMEventTargetNode::DispatchEvent:
    663             return jsBoolean(node->dispatchEvent(toEvent(args[0]), exception));
    664     }
    665    
    666     return jsUndefined();
    667 }
    668 
    669 // -------------------------------------------------------------------------
    670 
    671 /*
    672 @begin DOMNodeListTable 2
    673   length        DOMNodeList::Length     DontDelete|ReadOnly
    674   item          DOMNodeList::Item               DontDelete|Function 1
    675 @end
    676 */
    677 
    678 KJS_IMPLEMENT_PROTOTYPE_FUNCTION(DOMNodeListFunc)
    679 
    680 const ClassInfo DOMNodeList::info = { "NodeList", 0, &DOMNodeListTable, 0 };
    681 
    682 DOMNodeList::DOMNodeList(ExecState* exec, NodeList *l)
    683 : m_impl(l)
    684 {
    685     setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
    686 }
    687 
    688 DOMNodeList::~DOMNodeList()
    689 {
    690   ScriptInterpreter::forgetDOMObject(m_impl.get());
    691 }
    692 
    693 JSValue* DOMNodeList::getValueProperty(ExecState* exec, int token) const
    694 {
    695   ASSERT(token == Length);
    696   return jsNumber(m_impl->length());
    697 }
    698 
    699 JSValue* DOMNodeList::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
    700 {
    701   DOMNodeList *thisObj = static_cast<DOMNodeList*>(slot.slotBase());
    702   return toJS(exec, thisObj->m_impl->item(slot.index()));
    703 }
    704 
    705 JSValue* DOMNodeList::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
    706 {
    707   DOMNodeList *thisObj = static_cast<DOMNodeList*>(slot.slotBase());
    708   return toJS(exec, thisObj->m_impl->itemWithName(propertyName));
    709 }
    710 
    711 bool DOMNodeList::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    712 {
    713   const HashEntry* entry = Lookup::findEntry(&DOMNodeListTable, propertyName);
    714 
    715   if (entry) {
    716     if (entry->attr & Function)
    717       slot.setStaticEntry(this, entry, staticFunctionGetter<DOMNodeListFunc>);
    718     else
    719       slot.setStaticEntry(this, entry, staticValueGetter<DOMNodeList>);
    720     return true;
    721   }
    722 
    723   // array index ?
    724   bool ok;
    725   unsigned idx = propertyName.toUInt32(&ok);
    726   if (ok && idx < m_impl->length()) {
    727     slot.setCustomIndex(this, idx, indexGetter);
    728     return true;
    729   } else if (m_impl->itemWithName(propertyName)) {
    730     slot.setCustom(this, nameGetter);
    731     return true;
    732   }
    733 
    734   return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
    735 }
    736 
    737 // Need to support both get and call, so that list[0] and list(0) work.
    738 JSValue* DOMNodeList::callAsFunction(ExecState* exec, JSObject*, const List &args)
    739 {
    740     // Do not use thisObj here. See JSHTMLCollection.
    741     UString s = args[0]->toString(exec);
    742     bool ok;
    743     unsigned int u = s.toUInt32(&ok);
    744     if (ok)
    745         return toJS(exec, m_impl->item(u));
    746 
    747     return jsUndefined();
    748 }
    749 
    750 // Not a prototype class currently, but should probably be converted to one
    751 JSValue* DOMNodeListFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
    752 {
    753   if (!thisObj->inherits(&KJS::DOMNodeList::info))
    754     return throwError(exec, TypeError);
    755   NodeList &list = *static_cast<DOMNodeList*>(thisObj)->impl();
    756 
    757   if (id == DOMNodeList::Item)
    758     return toJS(exec, list.item(args[0]->toInt32(exec)));
    759 
    760   return jsUndefined();
    761 }
    762 
    763318Attr* toAttr(JSValue* val, bool& ok)
    764319{
     
    772327}
    773328
    774 Element* toElement(JSValue* val)
    775 {
    776     if (!val || !val->isObject(&JSElement::info))
    777         return 0;
    778     return static_cast<Element*>(static_cast<JSElement*>(val)->impl());
    779 }
    780 
    781 DocumentType* toDocumentType(JSValue* val)
    782 {
    783     if (!val || !val->isObject(&JSDocumentType::info))
    784         return 0;
    785     return static_cast<DocumentType*>(static_cast<DOMNode*>(val)->impl());
    786 }
    787 
    788329// -------------------------------------------------------------------------
    789 
    790 /* Source for DOMNamedNodeMapPrototypeTable. Use "make hashtables" to regenerate.
    791 @begin DOMNamedNodeMapPrototypeTable 10
    792   getNamedItem          DOMNamedNodeMap::GetNamedItem           DontDelete|Function 1
    793   setNamedItem          DOMNamedNodeMap::SetNamedItem           DontDelete|Function 1
    794   removeNamedItem       DOMNamedNodeMap::RemoveNamedItem        DontDelete|Function 1
    795   item                  DOMNamedNodeMap::Item                   DontDelete|Function 1
    796 # DOM2
    797   getNamedItemNS        DOMNamedNodeMap::GetNamedItemNS         DontDelete|Function 2
    798   setNamedItemNS        DOMNamedNodeMap::SetNamedItemNS         DontDelete|Function 1
    799   removeNamedItemNS     DOMNamedNodeMap::RemoveNamedItemNS      DontDelete|Function 2
    800 @end
    801 */
    802 KJS_DEFINE_PROTOTYPE(DOMNamedNodeMapPrototype)
    803 KJS_IMPLEMENT_PROTOTYPE_FUNCTION(DOMNamedNodeMapPrototypeFunction)
    804 KJS_IMPLEMENT_PROTOTYPE("NamedNodeMap", DOMNamedNodeMapPrototype, DOMNamedNodeMapPrototypeFunction)
    805 
    806 const ClassInfo DOMNamedNodeMap::info = { "NamedNodeMap", 0, 0, 0 };
    807 
    808 DOMNamedNodeMap::DOMNamedNodeMap(ExecState* exec, NamedNodeMap* m)
    809     : m_impl(m)
    810 {
    811     setPrototype(DOMNamedNodeMapPrototype::self(exec));
    812 }
    813 
    814 DOMNamedNodeMap::~DOMNamedNodeMap()
    815 {
    816     ScriptInterpreter::forgetDOMObject(m_impl.get());
    817 }
    818 
    819 JSValue* DOMNamedNodeMap::lengthGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
    820 {
    821   DOMNamedNodeMap* thisObj = static_cast<DOMNamedNodeMap*>(slot.slotBase());
    822   return jsNumber(thisObj->m_impl->length());
    823 }
    824 
    825 JSValue* DOMNamedNodeMap::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
    826 {
    827   DOMNamedNodeMap* thisObj = static_cast<DOMNamedNodeMap*>(slot.slotBase());
    828   return toJS(exec, thisObj->m_impl->item(slot.index()));
    829 }
    830 
    831 JSValue* DOMNamedNodeMap::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
    832 {
    833   DOMNamedNodeMap* thisObj = static_cast<DOMNamedNodeMap*>(slot.slotBase());
    834   return toJS(exec, thisObj->m_impl->getNamedItem(propertyName));
    835 }
    836 
    837 bool DOMNamedNodeMap::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    838 {
    839   if (propertyName == exec->propertyNames().length) {
    840       slot.setCustom(this, lengthGetter);
    841       return true;
    842   } else {
    843     // Look in the prototype (for functions) before assuming it's an item's name
    844     JSValue* proto = prototype();
    845     if (proto->isObject() && static_cast<JSObject*>(proto)->hasProperty(exec, propertyName))
    846       return false;
    847 
    848     // name or index ?
    849     bool ok;
    850     unsigned idx = propertyName.toUInt32(&ok);
    851     if (ok && idx < m_impl->length()) {
    852       slot.setCustomIndex(this, idx, indexGetter);
    853       return true;
    854     }
    855 
    856     if (m_impl->getNamedItem(propertyName)) {
    857       slot.setCustom(this, nameGetter);
    858       return true;
    859     }
    860   }
    861 
    862   return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
    863 }
    864 
    865 JSValue* DOMNamedNodeMapPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
    866 {
    867   if (!thisObj->inherits(&KJS::DOMNamedNodeMap::info))
    868     return throwError(exec, TypeError);
    869   DOMExceptionTranslator exception(exec);
    870   NamedNodeMap &map = *static_cast<DOMNamedNodeMap*>(thisObj)->impl();
    871   switch (id) {
    872     case DOMNamedNodeMap::GetNamedItem:
    873       return toJS(exec, map.getNamedItem(args[0]->toString(exec)));
    874     case DOMNamedNodeMap::SetNamedItem:
    875       return toJS(exec, map.setNamedItem(toNode(args[0]), exception).get());
    876     case DOMNamedNodeMap::RemoveNamedItem:
    877       return toJS(exec, map.removeNamedItem(args[0]->toString(exec), exception).get());
    878     case DOMNamedNodeMap::Item:
    879       return toJS(exec, map.item(args[0]->toInt32(exec)));
    880     case DOMNamedNodeMap::GetNamedItemNS: // DOM2
    881       return toJS(exec, map.getNamedItemNS(valueToStringWithNullCheck(exec, args[0]), args[1]->toString(exec)));
    882     case DOMNamedNodeMap::SetNamedItemNS: // DOM2
    883       return toJS(exec, map.setNamedItemNS(toNode(args[0]), exception).get());
    884     case DOMNamedNodeMap::RemoveNamedItemNS: // DOM2
    885       return toJS(exec, map.removeNamedItemNS(valueToStringWithNullCheck(exec, args[0]), args[1]->toString(exec), exception).get());
    886   }
    887   return jsUndefined();
    888 }
    889 
    890 // -------------------------------------------------------------------------
    891 
    892 JSValue* toJS(ExecState* exec, Document *n)
    893 {
    894   if (!n)
    895     return jsNull();
    896 
    897   JSDocument* ret = 0;
    898   ScriptInterpreter* interp = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter());
    899 
    900   if ((ret = static_cast<JSDocument*>(interp->getDOMObject(n))))
    901     return ret;
    902 
    903   if (n->isHTMLDocument())
    904     ret = new WebCore::JSHTMLDocument(exec, static_cast<HTMLDocument*>(n));
    905 #if ENABLE(SVG)
    906   else if (n->isSVGDocument())
    907     ret = new WebCore::JSSVGDocument(exec, static_cast<SVGDocument*>(n));
    908 #endif
    909   else
    910     ret = new JSDocument(exec, n);
    911 
    912   // Make sure the document is kept around by the window object, and works right with the
    913   // back/forward cache.
    914   if (n->frame())
    915     Window::retrieveWindow(n->frame())->putDirect("document", ret, DontDelete|ReadOnly);
    916 
    917   interp->putDOMObject(n, ret);
    918 
    919   return ret;
    920 }
    921330
    922331bool checkNodeSecurity(ExecState* exec, Node* n)
     
    928337  Window* win = Window::retrieveWindow(n->document()->frame());
    929338  return win && win->isSafeScript(exec);
    930 }
    931 
    932 JSValue* toJS(ExecState* exec, PassRefPtr<Node> node)
    933 {
    934   Node* n = node.get();
    935   DOMNode* ret = 0;
    936   if (!n)
    937     return jsNull();
    938   ScriptInterpreter* interp = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter());
    939   Document* doc = n->document();
    940 
    941   if ((ret = interp->getDOMNodeForDocument(doc, n)))
    942     return ret;
    943 
    944   switch (n->nodeType()) {
    945     case Node::ELEMENT_NODE:
    946       if (n->isHTMLElement())
    947         ret = createJSHTMLWrapper(exec, static_pointer_cast<HTMLElement>(node));
    948 #if ENABLE(SVG)
    949       else if (n->isSVGElement())
    950         ret = createJSSVGWrapper(exec, static_pointer_cast<SVGElement>(node));
    951 #endif
    952       else
    953         ret = new JSElement(exec, static_cast<Element*>(n));
    954       break;
    955     case Node::ATTRIBUTE_NODE:
    956       ret = new JSAttr(exec, static_cast<Attr*>(n));
    957       break;
    958     case Node::TEXT_NODE:
    959       ret = new JSText(exec, static_cast<Text*>(n));
    960       break;
    961     case Node::CDATA_SECTION_NODE:
    962       ret = new JSCDATASection(exec, static_cast<CDATASection*>(n));
    963       break;
    964     case Node::ENTITY_NODE:
    965       ret = new JSEntity(exec, static_cast<Entity*>(n));
    966       break;
    967     case Node::PROCESSING_INSTRUCTION_NODE:
    968       ret = new JSProcessingInstruction(exec, static_cast<ProcessingInstruction*>(n));
    969       break;
    970     case Node::COMMENT_NODE:
    971       ret = new JSComment(exec, static_cast<WebCore::Comment*>(n));
    972       break;
    973     case Node::DOCUMENT_NODE:
    974       // we don't want to cache the document itself in the per-document dictionary
    975       return toJS(exec, static_cast<Document*>(n));
    976     case Node::DOCUMENT_TYPE_NODE:
    977       ret = new JSDocumentType(exec, static_cast<DocumentType*>(n));
    978       break;
    979     case Node::NOTATION_NODE:
    980       ret = new JSNotation(exec, static_cast<Notation*>(n));
    981       break;
    982     case Node::DOCUMENT_FRAGMENT_NODE:
    983       ret = new JSDocumentFragment(exec, static_cast<DocumentFragment*>(n));
    984       break;
    985     case Node::ENTITY_REFERENCE_NODE:
    986       ret = new JSEntityReference(exec, static_cast<EntityReference*>(n));
    987       break;
    988     default:
    989       ret = new JSNode(exec, n);
    990   }
    991 
    992   interp->putDOMNodeForDocument(doc, n, ret);
    993 
    994   return ret;
    995 }
    996 
    997 JSValue* toJS(ExecState* exec, NamedNodeMap* m)
    998 {
    999     return cacheDOMObject<NamedNodeMap, DOMNamedNodeMap>(exec, m);
    1000339}
    1001340
     
    1047386}
    1048387
    1049 JSValue* toJS(ExecState* exec, NodeList* l)
    1050 {
    1051     return cacheDOMObject<NodeList, DOMNodeList>(exec, l);
    1052 }
    1053 
    1054 // -------------------------------------------------------------------------
    1055 
    1056 const ClassInfo DOMExceptionConstructor::info = { "DOMExceptionConstructor", 0, 0, 0 };
    1057 
    1058 /* Source for DOMExceptionConstructorTable. Use "make hashtables" to regenerate.
    1059 @begin DOMExceptionConstructorTable 15
    1060   INDEX_SIZE_ERR                WebCore::INDEX_SIZE_ERR               DontDelete|ReadOnly
    1061   DOMSTRING_SIZE_ERR            WebCore::DOMSTRING_SIZE_ERR   DontDelete|ReadOnly
    1062   HIERARCHY_REQUEST_ERR         WebCore::HIERARCHY_REQUEST_ERR        DontDelete|ReadOnly
    1063   WRONG_DOCUMENT_ERR            WebCore::WRONG_DOCUMENT_ERR   DontDelete|ReadOnly
    1064   INVALID_CHARACTER_ERR         WebCore::INVALID_CHARACTER_ERR        DontDelete|ReadOnly
    1065   NO_DATA_ALLOWED_ERR           WebCore::NO_DATA_ALLOWED_ERR  DontDelete|ReadOnly
    1066   NO_MODIFICATION_ALLOWED_ERR   WebCore::NO_MODIFICATION_ALLOWED_ERR  DontDelete|ReadOnly
    1067   NOT_FOUND_ERR                 WebCore::NOT_FOUND_ERR                DontDelete|ReadOnly
    1068   NOT_SUPPORTED_ERR             WebCore::NOT_SUPPORTED_ERR    DontDelete|ReadOnly
    1069   INUSE_ATTRIBUTE_ERR           WebCore::INUSE_ATTRIBUTE_ERR  DontDelete|ReadOnly
    1070   INVALID_STATE_ERR             WebCore::INVALID_STATE_ERR    DontDelete|ReadOnly
    1071   SYNTAX_ERR                    WebCore::SYNTAX_ERR           DontDelete|ReadOnly
    1072   INVALID_MODIFICATION_ERR      WebCore::INVALID_MODIFICATION_ERR     DontDelete|ReadOnly
    1073   NAMESPACE_ERR                 WebCore::NAMESPACE_ERR                DontDelete|ReadOnly
    1074   INVALID_ACCESS_ERR            WebCore::INVALID_ACCESS_ERR   DontDelete|ReadOnly
    1075 @end
    1076 */
    1077 
    1078 DOMExceptionConstructor::DOMExceptionConstructor(ExecState* exec)
    1079 {
    1080     setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
    1081 }
    1082 
    1083 bool DOMExceptionConstructor::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
    1084 {
    1085   return getStaticValueSlot<DOMExceptionConstructor, DOMObject>(exec, &DOMExceptionConstructorTable, this, propertyName, slot);
    1086 }
    1087 
    1088 JSValue* DOMExceptionConstructor::getValueProperty(ExecState*, int token) const
    1089 {
    1090   // We use the token as the value to return directly
    1091   return jsNumber(token);
    1092 }
    1093 
    1094 JSObject* getDOMExceptionConstructor(ExecState* exec)
    1095 {
    1096   return cacheGlobalObject<DOMExceptionConstructor>(exec, "[[DOMException.constructor]]");
    1097 }
    1098 
    1099 // -------------------------------------------------------------------------
    1100 
    1101 const ClassInfo DOMNamedNodesCollection::info = { "Collection", 0, 0, 0 };
    1102 
    1103 // Such a collection is usually very short-lived, it only exists
    1104 // for constructs like document.forms.<name>[1],
    1105 // so it shouldn't be a problem that it's storing all the nodes (with the same name). (David)
    1106 DOMNamedNodesCollection::DOMNamedNodesCollection(ExecState* exec, const Vector<RefPtr<Node> >& nodes)
    1107   : m_nodes(nodes)
    1108 {
    1109     setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
    1110 }
    1111 
    1112 JSValue* DOMNamedNodesCollection::lengthGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
    1113 {
    1114   DOMNamedNodesCollection *thisObj = static_cast<DOMNamedNodesCollection*>(slot.slotBase());
    1115   return jsNumber(thisObj->m_nodes.size());
    1116 }
    1117 
    1118 JSValue* DOMNamedNodesCollection::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
    1119 {
    1120   DOMNamedNodesCollection *thisObj = static_cast<DOMNamedNodesCollection*>(slot.slotBase());
    1121   return toJS(exec, thisObj->m_nodes[slot.index()].get());
    1122 }
    1123 
    1124 bool DOMNamedNodesCollection::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    1125 {
    1126   if (propertyName == exec->propertyNames().length) {
    1127     slot.setCustom(this, lengthGetter);
    1128     return true;
    1129   }
    1130 
    1131   // array index ?
    1132   bool ok;
    1133   unsigned idx = propertyName.toUInt32(&ok);
    1134   if (ok && idx < m_nodes.size()) {
    1135     slot.setCustomIndex(this, idx, indexGetter);
    1136     return true;
    1137   }
    1138 
    1139   // For IE compatibility, we need to be able to look up elements in a
    1140   // document.formName.name result by id as well as be index.
    1141 
    1142   AtomicString atomicPropertyName = propertyName;
    1143   for (unsigned i = 0; i < m_nodes.size(); i++) {
    1144     Node* node = m_nodes[i].get();
    1145     if (node->hasAttributes() && node->attributes()->id() == atomicPropertyName) {
    1146       slot.setCustomIndex(this, i, indexGetter);
    1147       return true;
    1148     }
    1149   }
    1150 
    1151   return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
    1152 }
    1153 
    1154 } // namespace
     388} // namespace KJS
  • trunk/WebCore/bindings/js/kjs_dom.h

    r21927 r22039  
    2222
    2323#include "JSNode.h"
    24 #include "NodeList.h"
     24#include "Node.h"
    2525#include "kjs_binding.h"
    26 
    2726#include <wtf/Vector.h>
    2827
    2928namespace WebCore {
    30     class AtomicString;
    3129    class Attr;
    32     class CharacterData;
    33     class DocumentType;
    34     class DOMImplementation;
    35     class Element;
    36     class Entity;
    3730    class EventTarget;
    38     class EventTargetNode;
    39     class NamedNodeMap;
    40     class Notation;
    41     class ProcessingInstruction;
    42     class Text;
    4331}
    4432
    4533namespace KJS {
    4634
    47   KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(DOMEventTargetNodePrototype, WebCore::JSNodePrototype)
    48 
    49   class DOMEventTargetNode : public WebCore::JSNode {
    50   public:
    51       DOMEventTargetNode(ExecState *exec, WebCore::Node *n);
    52 
    53       void setListener(ExecState* exec, const WebCore::AtomicString &eventType, JSValue* func) const;
    54       JSValue* getListener(const WebCore::AtomicString &eventType) const;
    55       virtual void pushEventHandlerScope(ExecState* exec, ScopeChain &scope) const;
    56      
    57       bool getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot);
    58       JSValue* getValueProperty(ExecState* exec, int token) const;
    59       virtual void put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr);
    60       void putValueProperty(ExecState* exec, int token, JSValue* value, int);
    61 
    62       enum { 
    63           AddEventListener, RemoveEventListener, DispatchEvent,
    64           OnAbort, OnBlur, OnChange, OnClick, OnContextMenu, OnDblClick, OnError,
    65           OnDragEnter, OnDragOver, OnDragLeave, OnDrop, OnDragStart, OnDrag, OnDragEnd,
    66           OnBeforeCut, OnCut, OnBeforeCopy, OnCopy, OnBeforePaste, OnPaste, OnSelectStart,
    67           OnFocus, OnInput, OnKeyDown, OnKeyPress, OnKeyUp, OnLoad, OnMouseDown,
    68           OnMouseMove, OnMouseOut, OnMouseOver, OnMouseUp, OnMouseWheel, OnReset,
    69           OnResize, OnScroll, OnSearch, OnSelect, OnSubmit, OnUnload
    70       };
    71   };
    72 
    73   WebCore::EventTargetNode* toEventTargetNode(JSValue*); // returns 0 if passed-in value is not a EventTargetNode object
    74   WebCore::Node* toNode(JSValue*); // returns 0 if passed-in value is not a DOMNode object
    75 
    76   class DOMNodeList : public DOMObject {
    77   public:
    78     DOMNodeList(ExecState *, WebCore::NodeList *l);
    79     ~DOMNodeList();
    80     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
    81     JSValue *getValueProperty(ExecState *exec, int token) const;
    82     virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List&args);
    83     virtual bool implementsCall() const { return true; }
    84     // no put - all read-only
    85     virtual const ClassInfo* classInfo() const { return &info; }
    86     virtual bool toBoolean(ExecState *) const { return true; }
    87     static const ClassInfo info;
    88     enum { Length, Item };
    89     WebCore::NodeList *impl() const { return m_impl.get(); }
    90 
    91   private:
    92     static JSValue *indexGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
    93     static JSValue *nameGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
    94 
    95     RefPtr<WebCore::NodeList> m_impl;
    96   };
    97 
    9835  WebCore::Attr* toAttr(JSValue*, bool& ok);
    9936
    100   WebCore::Element *toElement(JSValue *); // returns 0 if passed-in value is not a DOMElement object
    101 
    102   WebCore::DocumentType *toDocumentType(JSValue *); // returns 0 if passed-in value is not a DOMDocumentType object
    103 
    104   class DOMNamedNodeMap : public DOMObject {
    105   public:
    106     DOMNamedNodeMap(ExecState *, WebCore::NamedNodeMap *m);
    107     ~DOMNamedNodeMap();
    108     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
    109     // no put - all read-only
    110     virtual const ClassInfo* classInfo() const { return &info; }
    111     virtual bool toBoolean(ExecState *) const { return true; }
    112     static const ClassInfo info;
    113     enum { GetNamedItem, SetNamedItem, RemoveNamedItem, Item,
    114            GetNamedItemNS, SetNamedItemNS, RemoveNamedItemNS };
    115     WebCore::NamedNodeMap *impl() const { return m_impl.get(); }
    116   private:
    117     static JSValue *lengthGetter(ExecState* exec, JSObject *, const Identifier&, const PropertySlot& slot);
    118     static JSValue *indexGetter(ExecState* exec, JSObject *, const Identifier&, const PropertySlot& slot);
    119     static JSValue *nameGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
    120 
    121     RefPtr<WebCore::NamedNodeMap> m_impl;
    122   };
    123 
    124   // Constructor for DOMException - constructor stuff not implemented yet
    125   class DOMExceptionConstructor : public DOMObject {
    126   public:
    127     DOMExceptionConstructor(ExecState*);
    128     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
    129     JSValue *getValueProperty(ExecState *exec, int token) const;
    130     // no put - all read-only
    131     virtual const ClassInfo* classInfo() const { return &info; }
    132     static const ClassInfo info;
    133   };
    134 
    135   JSValue* toJS(ExecState*, WebCore::Document*);
    13637  bool checkNodeSecurity(ExecState*, WebCore::Node*);
    13738  JSValue* getRuntimeObject(ExecState*, WebCore::Node*);
    138   JSValue* toJS(ExecState*, PassRefPtr<WebCore::Node>);
    139   JSValue* toJS(ExecState*, WebCore::NamedNodeMap*);
    140   JSValue* toJS(ExecState*, WebCore::NodeList*);
    14139  JSValue* toJS(ExecState*, WebCore::EventTarget*);
    14240  JSObject* getNodeConstructor(ExecState*);
    143   JSObject* getDOMExceptionConstructor(ExecState*);
    144 
    145   // Internal class, used for the collection return by e.g. document.forms.myinput
    146   // when multiple nodes have the same name.
    147   class DOMNamedNodesCollection : public DOMObject {
    148   public:
    149     DOMNamedNodesCollection(ExecState *exec, const Vector<RefPtr<WebCore::Node> >& nodes);
    150     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
    151     virtual const ClassInfo* classInfo() const { return &info; }
    152     static const ClassInfo info;
    153 private:
    154     static JSValue *lengthGetter(ExecState* exec, JSObject *, const Identifier&, const PropertySlot& slot);
    155     static JSValue *indexGetter(ExecState* exec, JSObject *, const Identifier&, const PropertySlot& slot);
    156 
    157     Vector<RefPtr<WebCore::Node> > m_nodes;
    158   };
    15941
    16042} // namespace
  • trunk/WebCore/bindings/js/kjs_domnode.h

    r21927 r22039  
    3636public:
    3737    virtual ~DOMNode();
    38     virtual bool toBoolean(ExecState*) const;
     38
    3939    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    4040    JSValue *getValueProperty(ExecState*, int token) const;
  • trunk/WebCore/bindings/js/kjs_events.cpp

    r21706 r22039  
    2222#include "kjs_events.h"
    2323
     24#include "CString.h"
    2425#include "Chrome.h"
    25 #include "CString.h"
    2626#include "Clipboard.h"
    2727#include "ClipboardEvent.h"
     
    3434#include "HTMLNames.h"
    3535#include "JSEvent.h"
     36#include "JSEventTargetNode.h"
    3637#include "JSKeyboardEvent.h"
    3738#include "JSMouseEvent.h"
     
    335336            JSValue* thisObj = toJS(exec, originalNode);
    336337            if (thisObj->isObject()) {
    337                 static_cast<DOMEventTargetNode*>(thisObj)->pushEventHandlerScope(exec, scope);
     338                static_cast<JSEventTargetNode*>(thisObj)->pushEventHandlerScope(exec, scope);
    338339                listenerAsFunction->setScope(scope);
    339340            }
  • trunk/WebCore/bindings/js/kjs_html.cpp

    r21842 r22039  
    3434#include "HTMLOptionsCollection.h"
    3535#include "JSHTMLOptionsCollection.h"
     36#include "JSNamedNodesCollection.h"
     37#include "JSNodeList.h"
    3638#include "NameNodeList.h"
    3739#include "RenderLayer.h"
     
    175177        return toJS(exec, namedItems[0].get());
    176178
    177     return new DOMNamedNodesCollection(exec, namedItems);
     179    return new JSNamedNodesCollection(exec, namedItems);
    178180}
    179181
  • trunk/WebCore/bindings/js/kjs_html.h

    r21842 r22039  
    2626#include "JSElement.h"
    2727#include "JSHTMLElement.h"
     28#include "kjs_dom.h"
    2829
    2930namespace WebCore {
  • trunk/WebCore/bindings/js/kjs_window.cpp

    r22035 r22039  
    4141#include "JSCSSRule.h"
    4242#include "JSCSSValue.h"
     43#include "JSDOMExceptionConstructor.h"
    4344#include "JSDOMWindow.h"
    4445#include "JSEvent.h"
     
    26092610    return Window::retrieve(frame);
    26102611}
    2611 
    2612 DOMWindow* toDOMWindow(JSValue* val)
    2613 {
    2614     return val->isObject(&JSDOMWindow::info) ? static_cast<JSDOMWindow*>(val)->impl() : 0;
    2615 }
    26162612   
    26172613} // namespace WebCore
  • trunk/WebCore/bindings/js/kjs_window.h

    r21927 r22039  
    277277namespace WebCore {
    278278    KJS::JSValue* toJS(KJS::ExecState*, DOMWindow*);
    279     DOMWindow* toDOMWindow(KJS::JSValue*);
    280279} // namespace WebCore
    281280
  • trunk/WebCore/bindings/objc/DOMInternal.mm

    r21324 r22039  
    11/*
    2  * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
     2 * Copyright (C) 2004, 2006, 2007 Apple Inc.  All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3030#import "Event.h"
    3131#import "Frame.h"
     32#import "JSNode.h"
    3233#import "Node.h"
    3334#import "PlatformString.h"
     
    3738#import "WebScriptObjectPrivate.h"
    3839#import "XPathEvaluator.h"
    39 #import "kjs_dom.h"
    4040#import "kjs_proxy.h"
    4141
     
    118118   
    119119    // Get (or create) a cached JS object for the DOM node.
    120     KJS::JSObject *scriptImp = static_cast<KJS::JSObject*>(KJS::toJS(exec, nodeImpl));
     120    KJS::JSObject *scriptImp = static_cast<KJS::JSObject*>(WebCore::toJS(exec, nodeImpl));
    121121
    122122    KJS::Bindings::RootObject* rootObject = frame->bindingRootObject();
  • trunk/WebCore/bindings/objc/DOMUtility.mm

    r21910 r22039  
    3838#import "JSHTMLOptionsCollection.h"
    3939#import "JSMediaList.h"
     40#import "JSNamedNodeMap.h"
    4041#import "JSNodeIterator.h"
     42#import "JSNodeList.h"
    4143#import "JSRange.h"
    4244#import "JSStyleSheet.h"
     
    7779    WRAP(HTMLOptionsCollection)
    7880    WRAP(MediaList)
     81    WRAP(NamedNodeMap)
     82    WRAP(NodeList)
    7983    WRAP(Range)
    8084    WRAP(StyleSheet)
     
    8993
    9094    WRAP(Event)
    91     WRAP(NamedNodeMap)
    9295    WRAP(Node)
    93     WRAP(NodeList)
    9496    WRAP(RGBColor)
    9597    WRAP(Rect)
  • trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r22035 r22039  
    162162    my $type = shift;
    163163
    164     return 1 if $type eq "SVGPathSeg" or $type eq "StyleSheet" or $type eq "CSSRule" or $type eq "CSSValue";
     164    return 1 if $type eq "Node" or $type eq "Document" or $type eq "SVGPathSeg" or $type eq "StyleSheet" or $type eq "CSSRule" or $type eq "CSSValue";
    165165    return 0;
    166166}
     
    367367    # Custom call functions
    368368    if ($dataNode->extendedAttributes->{"CustomCall"}) {
    369         push(@headerContent, "    virtual KJS::JSValue* callAsFunction(KJS::ExecState*, KJS::JSObject*, const KJS::List& args);\n");
     369        push(@headerContent, "    virtual KJS::JSValue* callAsFunction(KJS::ExecState*, KJS::JSObject*, const KJS::List&);\n");
    370370        push(@headerContent, "    virtual bool implementsCall() const;\n\n");
    371371    }
     
    476476    if ($dataNode->extendedAttributes->{"HasNameGetter"} || $dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
    477477        push(@headerContent, "private:\n");
     478        push(@headerContent, "    static bool canGetItemsForName(KJS::ExecState*, $implClassName*, const KJS::Identifier&);\n");
    478479        push(@headerContent, "    static KJS::JSValue* nameGetter(KJS::ExecState*, KJS::JSObject*, const KJS::Identifier&, const KJS::PropertySlot&);\n");
    479         push(@headerContent, "    static bool canGetItemsForName(KJS::ExecState*, $implClassName*, const KJS::Identifier&);\n")
    480480    }
    481481
    482482    push(@headerContent, "};\n\n");
    483483
    484     if (!$hasParent) {
     484    if (!$hasParent || $dataNode->extendedAttributes->{"GenerateToJS"}) {
    485485        if ($podType) {
    486486            push(@headerContent, "KJS::JSValue* toJS(KJS::ExecState*, JSSVGPODTypeWrapper<$podType>*);\n");
     487        } elsif ($interfaceName eq "Node") {
     488            push(@headerContent, "KJS::JSValue* toJS(KJS::ExecState*, PassRefPtr<Node>);\n");
    487489        } else {
    488490            push(@headerContent, "KJS::JSValue* toJS(KJS::ExecState*, $passType);\n");
     
    789791        push(@implContent, "bool ${className}::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)\n");
    790792        push(@implContent, "{\n");
    791         # FIXME: We need to provide scalable hooks/attributes for this kind of extension
    792         if ($interfaceName eq "DOMWindow") {
    793             push(@implContent, "    if (getOverridePropertySlot(exec, propertyName, slot))\n");
    794             push(@implContent, "        return true;\n");
     793
     794        if ($interfaceName eq "NamedNodeMap") {
     795            push(@implContent, "    JSValue* proto = prototype();\n");
     796            push(@implContent, "    if (proto->isObject() && static_cast<JSObject*>(proto)->hasProperty(exec, propertyName))\n");
     797            push(@implContent, "        return false;\n");
    795798        }
    796799
     
    830833
    831834        if ($dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"}) {
    832                 push(@implContent, "    bool didGet = customGetOwnPropertySlot(exec, propertyName, slot);\n");
    833                 push(@implContent, "    if (didGet)\n");
     835                push(@implContent, "    if (customGetOwnPropertySlot(exec, propertyName, slot))\n");
    834836                push(@implContent, "        return true;\n");
    835837        }
     
    867869                push(@implContent, "        return checkNodeSecurity(exec, imp->contentDocument()) ? " . NativeToJSValue($attribute->signature,  $implClassNameForValueConversion, "imp->$name()") . " : jsUndefined();\n");
    868870                $implIncludes{"Document.h"} = 1;
     871                $implIncludes{"kjs_dom.h"} = 1;
    869872            } elsif ($attribute->signature->type =~ /Constructor$/) {
    870873                my $constructorType = $codeGenerator->StripModule($attribute->signature->type);
     
    10651068                push(@implContent, "        if (!checkNodeSecurity(exec, imp->getSVGDocument(" . (@{$function->raisesExceptions} ? "ec" : "") .")))\n");
    10661069                push(@implContent, "            return jsUndefined();\n");
     1070                $implIncludes{"kjs_dom.h"} = 1;
    10671071            }
    10681072
     
    11451149    }
    11461150
    1147     if (!$hasParent and !UsesManualToJSImplementation($implClassName)) {
     1151    if ((!$hasParent or $dataNode->extendedAttributes->{"GenerateToJS"}) and !UsesManualToJSImplementation($implClassName)) {
    11481152        if ($podType) {
    11491153            push(@implContent, "KJS::JSValue* toJS(KJS::ExecState* exec, JSSVGPODTypeWrapper<$podType>* obj)\n");
     
    13291333    }
    13301334
    1331     if ($type eq "Node") {
    1332         $implIncludes{"kjs_dom.h"} = 1;
    1333         return "toNode($value)";
    1334     }
    1335 
    13361335    if ($type eq "EventTarget") {
    1337         $implIncludes{"kjs_dom.h"} = 1;
     1336        $implIncludes{"JSEventTargetNode.h"} = 1;
    13381337        return "toEventTargetNode($value)";
    13391338    }
     
    13421341        $implIncludes{"kjs_dom.h"} = 1;
    13431342        return "toAttr($value${maybeOkParam})";
    1344     }
    1345 
    1346     if ($type eq "DocumentType") {
    1347         $implIncludes{"kjs_dom.h"} = 1;
    1348         return "toDocumentType($value)";
    1349     }
    1350 
    1351     if ($type eq "Element") {
    1352         $implIncludes{"kjs_dom.h"} = 1;
    1353         return "toElement($value)";
    1354     }
    1355 
    1356     if ($type eq "DOMWindow") {
    1357         $implIncludes{"kjs_window.h"} = 1;
    1358         return "toDOMWindow($value)";
    13591343    }
    13601344
     
    14451429    }
    14461430
    1447     if ($type eq "DOMImplementation") {
     1431    if ($type eq "EventTarget") {
     1432        $implIncludes{"EventTargetNode.h"} = 1;
     1433        $implIncludes{"JSEventTargetNode.h"} = 1;
    14481434        $implIncludes{"kjs_dom.h"} = 1;
    1449         $implIncludes{"JSDOMImplementation.h"} = 1;
    1450     } elsif ($type eq "Attr" or
    1451              $type eq "CDATASection" or
    1452              $type eq "Comment" or
    1453              $type eq "Document" or
    1454              $type eq "DocumentFragment" or
    1455              $type eq "DocumentType" or
    1456              $type eq "Element" or
    1457              $type eq "EntityReference" or
    1458              $type eq "HTMLDocument" or
    1459              $type eq "Node" or
    1460              $type eq "ProcessingInstruction" or
    1461              $type eq "Text") {
    1462         $implIncludes{"kjs_dom.h"} = 1;
    1463         $implIncludes{"Comment.h"} = 1;
    1464         $implIncludes{"CDATASection.h"} = 1;
    1465         $implIncludes{"Node.h"} = 1;
    1466         $implIncludes{"Element.h"} = 1;
    1467         $implIncludes{"DocumentType.h"} = 1;
    1468     } elsif ($type eq "EventTarget") {
    1469         $implIncludes{"kjs_dom.h"} = 1;
    1470         $implIncludes{"EventTargetNode.h"} = 1;
    14711435    } elsif ($type eq "Event") {
    14721436        $implIncludes{"kjs_events.h"} = 1;
    14731437        $implIncludes{"Event.h"} = 1;
    14741438    } elsif ($type eq "NodeList") {
    1475         $implIncludes{"kjs_dom.h"} = 1;
    1476         $implIncludes{"NodeList.h"} = 1;
     1439        $implIncludes{"JS$type.h"} = 1;
     1440        $implIncludes{"$type.h"} = 1;
    14771441        $implIncludes{"NameNodeList.h"} = 1;
    1478     } elsif ($type eq "NamedNodeMap") {
    1479         $implIncludes{"kjs_dom.h"} = 1;
    1480         $implIncludes{"NamedNodeMap.h"} = 1;
    14811442    } elsif ($type eq "Rect") {
    14821443        $implIncludes{"RectImpl.h"} = 1;
     
    14891450    } elsif ($type eq "DOMObject") {
    14901451        $implIncludes{"JSCanvasRenderingContext2D.h"} = 1;
    1491     } elsif ($type eq "HTMLFormElement") {
    1492         $implIncludes{"kjs_html.h"} = 1;
    1493         $implIncludes{"HTMLFormElement.h"} = 1;
    14941452    } elsif ($type =~ /SVGPathSeg/) {
    14951453        $implIncludes{"JS$type.h"} = 1;
     
    17691727        put(exec, exec->propertyNames().length, jsNumber(len), DontDelete|ReadOnly|DontEnum);
    17701728    }
    1771     virtual JSValue* callAsFunction(ExecState* exec, JSObject* thisObj, const List& args);
     1729    virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&);
    17721730private:
    17731731    int id;
  • trunk/WebCore/bridge/mac/WebCoreAXObject.mm

    r21917 r22039  
    3232#import "FocusController.h"
    3333#import "FontData.h"
     34#import "Frame.h"
    3435#import "FrameLoader.h"
    35 #import "Frame.h"
    3636#import "FrameView.h"
    3737#import "HTMLAreaElement.h"
     
    4747#import "HitTestResult.h"
    4848#import "LocalizedStrings.h"
     49#import "NodeList.h"
    4950#import "Page.h"
    5051#import "RenderImage.h"
  • trunk/WebCore/dom/Attr.idl

    r21489 r22039  
    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 core {
    2222
    23     interface [LegacyParent=KJS::DOMEventTargetNode, GenerateConstructor] Attr : EventTargetNode {
     23    interface [GenerateConstructor] Attr : EventTargetNode {
    2424
    2525        // DOM Level 1
  • trunk/WebCore/dom/CharacterData.idl

    r21489 r22039  
    11/*
    2  * Copyright (C) 2006, 2007 Apple Inc.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 *
    44 * This library is free software; you can redistribute it and/or
     
    2020module core {
    2121
    22     interface [LegacyParent=KJS::DOMEventTargetNode, GenerateConstructor] CharacterData : EventTargetNode {
     22    interface [GenerateConstructor] CharacterData : EventTargetNode {
    2323
    2424        attribute [ConvertNullToNullString] DOMString data
  • trunk/WebCore/dom/Document.idl

    r21470 r22039  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 * Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
    44 *
     
    2121module core {
    2222
    23     interface [LegacyParent=KJS::DOMEventTargetNode, GenerateConstructor, CustomMarkFunction] Document : EventTargetNode {
     23    interface [GenerateConstructor, GenerateToJS, CustomMarkFunction] Document : EventTargetNode {
    2424
    2525        // DOM Level 1 Core
  • trunk/WebCore/dom/DocumentFragment.idl

    r14298 r22039  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 *
    44 * This library is free software; you can redistribute it and/or
     
    2020module core {
    2121
    22     interface [LegacyParent=KJS::DOMEventTargetNode, GenerateConstructor] DocumentFragment : EventTargetNode {
     22    interface [GenerateConstructor] DocumentFragment : EventTargetNode {
    2323    };
    2424
  • trunk/WebCore/dom/DocumentType.idl

    r21308 r22039  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 *
    44 * This library is free software; you can redistribute it and/or
     
    2020module core {
    2121
    22     interface [GenerateConstructor] DocumentType : Node {
     22    interface [GenerateConstructor, GenerateNativeConverter] DocumentType : Node {
    2323
    2424        // DOM Level 1
  • trunk/WebCore/dom/Element.idl

    r18134 r22039  
    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 core {
    2222
    23     interface [LegacyParent=KJS::DOMEventTargetNode, GenerateConstructor] Element : EventTargetNode {
     23    interface [GenerateConstructor, GenerateNativeConverter] Element : EventTargetNode {
    2424
    2525        // DOM Level 1 Core
  • trunk/WebCore/dom/NamedNodeMap.idl

    r16299 r22039  
    11/*
    22 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
     3 * Copyright (C) 2007 Apple Inc. All rights reserved.
    34 *
    45 * This library is free software; you can redistribute it and/or
     
    2021module core {
    2122
    22     interface NamedNodeMap {
     23    interface [GenerateConstructor, HasIndexGetter, HasNameGetter] NamedNodeMap {
    2324
    2425        Node getNamedItem(in DOMString name);
     
    3738        // Introduced in DOM Level 2:
    3839
    39         [OldStyleObjC] Node getNamedItemNS(in DOMString namespaceURI,
     40        [OldStyleObjC] Node getNamedItemNS(in [ConvertNullToNullString] DOMString namespaceURI,
    4041                                           in DOMString localName)
    4142            // FIXME: the implementation does take an exceptioncode parameter.
     
    4546            raises(DOMException);
    4647
    47         [OldStyleObjC] Node removeNamedItemNS(in DOMString namespaceURI,
     48        [OldStyleObjC] Node removeNamedItemNS(in [ConvertNullToNullString] DOMString namespaceURI,
    4849                                              in DOMString localName)
    4950            raises(DOMException);
  • trunk/WebCore/dom/Node.idl

    r21470 r22039  
    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 core {
    2222
    23     interface [LegacyParent=KJS::DOMNode, GenerateConstructor, ObjCCustomInternalImpl] Node {       
     23    interface [LegacyParent=KJS::DOMNode, GenerateConstructor, GenerateNativeConverter, GenerateToJS, ObjCCustomInternalImpl] Node {       
    2424        // NodeType
    2525        const unsigned short      ELEMENT_NODE                   = 1;
  • trunk/WebCore/dom/NodeList.idl

    r16068 r22039  
    11/*
    22 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
     3 * Copyright (C) 2007 Apple Inc. All rights reserved.
    34 *
    45 * This library is free software; you can redistribute it and/or
     
    2021module core {
    2122
    22     interface NodeList {
     23    interface [GenerateConstructor, HasIndexGetter, HasNameGetter, CustomCall] NodeList {
    2324
    2425        Node item(in [IsIndex] unsigned long index);
  • trunk/WebCore/page/DOMWindow.idl

    r21911 r22039  
    2828    // You can't cache the Window object in the global object because it *is* the global object.
    2929    // For the same reason, there's no need to.
    30     interface [LegacyParent=KJS::Window, DoNotCache] DOMWindow {
     30    interface [LegacyParent=KJS::Window, DoNotCache, GenerateNativeConverter, CustomGetOwnPropertySlot] DOMWindow {
    3131        // DOM Level 2 AbstractView Interface
    3232        readonly attribute Document document;
     
    7373        attribute DocumentConstructor Document;
    7474        attribute NodeConstructor Node;
    75 //        attribute NodeListConstructor NodeList;
    76 //        attribute NamedNodeMapConstructor NamedNodeMap;
     75        attribute NodeListConstructor NodeList;
     76        attribute NamedNodeMapConstructor NamedNodeMap;
    7777        attribute CharacterDataConstructor CharacterData;
    7878        attribute AttrConstructor Attr;
Note: See TracChangeset for help on using the changeset viewer.