WebCore:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2006 21:40:34 +0000 (21:40 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2006 21:40:34 +0000 (21:40 +0000)
        Reviewed by Tim H.

        Patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10903
        Yet Another Objective-C Bindings Patch

        - Whitespace cleanup for IDLParser.pm

        - Split DOMException, DOMRangeException, DOMXPathException, DOMEventsException
          and DOMAbstractView into their own files.

        - Remove private method [DOMRGBColor _color] from DOMPrivate.h as
          it is not used and a public method is available now.

        - Remove internal method [DOMDocument _ownerElement] from DOMInternal.h
          as it not used.

        - Auto-generate method isContentEditable for DOMNode.

        - General cleanup of bindings code including removing unneeded #imports
          and whitespace cleanup

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/objc/DOM.mm:
        (addElementClass):
        (elementClass):
        (-[DOMNode _initWithNode:WebCore::]):
        (+[DOMNode _nodeWith:WebCore::]):
        (-[DOMNode WebCore::]):
        (-[DOMNode KJS::Bindings::]):
        (-[DOMNode addEventListener:::]):
        (-[DOMNode removeEventListener:::]):
        (-[DOMNode dispatchEvent:]):
        (-[DOMElement image]):
        (-[DOMElement _font]):
        (-[DOMElement _imageTIFFRepresentation]):
        (-[DOMElement _getURLAttribute:]):
        (-[DOMElement _NPObject]):
        (-[DOMElement isFocused]):
        (-[DOMRange dealloc]):
        (-[DOMRange finalize]):
        (-[DOMRange description]):
        (-[DOMRange startContainer]):
        (-[DOMRange startOffset]):
        (-[DOMRange endContainer]):
        (-[DOMRange endOffset]):
        (-[DOMRange collapsed]):
        (-[DOMRange commonAncestorContainer]):
        (-[DOMRange setStart::]):
        (-[DOMRange setEnd::]):
        (-[DOMRange setStartBefore:]):
        (-[DOMRange setStartAfter:]):
        (-[DOMRange setEndBefore:]):
        (-[DOMRange setEndAfter:]):
        (-[DOMRange collapse:]):
        (-[DOMRange selectNode:]):
        (-[DOMRange selectNodeContents:]):
        (-[DOMRange compareBoundaryPoints::]):
        (-[DOMRange deleteContents]):
        (-[DOMRange extractContents]):
        (-[DOMRange cloneContents]):
        (-[DOMRange insertNode:]):
        (-[DOMRange surroundContents:]):
        (-[DOMRange cloneRange]):
        (-[DOMRange toString]):
        (-[DOMRange detach]):
        (-[DOMRange _initWithRange:WebCore::]):
        (+[DOMRange _rangeWith:WebCore::]):
        (-[DOMRange WebCore::]):
        (-[DOMNodeFilter _initWithNodeFilter:WebCore::]):
        (+[DOMNodeFilter _nodeFilterWith:WebCore::]):
        (-[DOMNodeFilter WebCore::]):
        (-[DOMNodeFilter dealloc]):
        (-[DOMNodeFilter finalize]):
        (-[DOMNodeIterator _initWithNodeIterator:WebCore::filter:]):
        (-[DOMNodeIterator WebCore::]):
        (+[DOMNodeIterator _nodeIteratorWith:WebCore::filter:]):
        (-[DOMTreeWalker _initWithTreeWalker:WebCore::filter:]):
        (-[DOMTreeWalker WebCore::]):
        (+[DOMTreeWalker _treeWalkerWith:WebCore::filter:]):
        (ObjCNodeFilterCondition::acceptNode):
        (-[DOMDocument createNodeIterator::::]):
        (-[DOMDocument createTreeWalker::::]):
        (ObjCEventListener::find):
        (ObjCEventListener::create):
        (ObjCEventListener::handleEvent):
        * bindings/objc/DOMAbstractView.h: Added.
        * bindings/objc/DOMAbstractView.mm: Added.
        (-[DOMAbstractView document]):
        (-[DOMAbstractView WebCore::]):
        (-[DOMAbstractView _initWithAbstractView:WebCore::]):
        (+[DOMAbstractView _abstractViewWith:WebCore::]):
        * bindings/objc/DOMCSS.mm:
        (-[DOMStyleSheet _initWithStyleSheet:WebCore::]):
        (+[DOMStyleSheet _styleSheetWith:WebCore::]):
        (+[DOMCSSStyleSheet _CSSStyleSheetWith:WebCore::]):
        (-[DOMCSSRule _initWithRule:WebCore::]):
        (+[DOMCSSRule _CSSRuleWith:WebCore::]):
        (-[DOMCSSValue _initWithValue:WebCore::]):
        (+[DOMCSSValue _CSSValueWith:WebCore::]):
        (+[DOMCSSPrimitiveValue _CSSPrimitiveValueWith:WebCore::]):
        (-[DOMDocument getComputedStyle::]):
        (-[DOMDocument getMatchedCSSRules::]):
        * bindings/objc/DOMCore.h:
        * bindings/objc/DOMEventException.h: Added.
        * bindings/objc/DOMEvents.h:
        * bindings/objc/DOMEvents.mm:
        * bindings/objc/DOMException.h: Added.
        * bindings/objc/DOMHTML.mm:
        (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:]):
        (viewForElement):
        (-[DOMHTMLInputElement _replaceCharactersInRange:withString:selectingFromIndex:]):
        (-[DOMHTMLInputElement _selectedRange]):
        (-[DOMHTMLInputElement _setAutofilled:]):
        * bindings/objc/DOMInternal.h:
        * bindings/objc/DOMObject.h:
        * bindings/objc/DOMPrivate.h:
        * bindings/objc/DOMRange.h:
        * bindings/objc/DOMRangeException.h: Added.
        * bindings/objc/DOMViews.h:
        * bindings/objc/DOMViews.mm: Removed.
        * bindings/objc/DOMXPath.h:
        * bindings/objc/DOMXPathException.h: Added.
        * bindings/scripts/IDLParser.pm:
        * dom/Node.idl:

WebKit:

        Reviewed by Tim H.

        Patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10903
        Yet Another Objective-C Bindings Patch

        * MigrateHeaders.make:

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

24 files changed:
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/objc/DOM.mm
WebCore/bindings/objc/DOMAbstractView.h [new file with mode: 0644]
WebCore/bindings/objc/DOMAbstractView.mm [moved from WebCore/bindings/objc/DOMViews.mm with 86% similarity]
WebCore/bindings/objc/DOMCSS.mm
WebCore/bindings/objc/DOMCore.h
WebCore/bindings/objc/DOMEventException.h [new file with mode: 0644]
WebCore/bindings/objc/DOMEvents.h
WebCore/bindings/objc/DOMEvents.mm
WebCore/bindings/objc/DOMException.h [new file with mode: 0644]
WebCore/bindings/objc/DOMHTML.mm
WebCore/bindings/objc/DOMInternal.h
WebCore/bindings/objc/DOMObject.h
WebCore/bindings/objc/DOMPrivate.h
WebCore/bindings/objc/DOMRange.h
WebCore/bindings/objc/DOMRangeException.h [new file with mode: 0644]
WebCore/bindings/objc/DOMViews.h
WebCore/bindings/objc/DOMXPath.h
WebCore/bindings/objc/DOMXPathException.h [new file with mode: 0644]
WebCore/bindings/scripts/IDLParser.pm
WebCore/dom/Node.idl
WebKit/ChangeLog
WebKit/MigrateHeaders.make

index 3d010710af33cbc7ec55636790dc6f209fcdabba..6fe5ee4179887c0f36004f9623673d5c46c68544 100644 (file)
@@ -1,3 +1,130 @@
+2006-09-18  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Tim H.
+
+        Patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10903
+        Yet Another Objective-C Bindings Patch
+
+        - Whitespace cleanup for IDLParser.pm
+
+        - Split DOMException, DOMRangeException, DOMXPathException, DOMEventsException
+          and DOMAbstractView into their own files.
+
+        - Remove private method [DOMRGBColor _color] from DOMPrivate.h as
+          it is not used and a public method is available now.
+
+        - Remove internal method [DOMDocument _ownerElement] from DOMInternal.h
+          as it not used.
+
+        - Auto-generate method isContentEditable for DOMNode.
+
+        - General cleanup of bindings code including removing unneeded #imports
+          and whitespace cleanup
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/objc/DOM.mm:
+        (addElementClass):
+        (elementClass):
+        (-[DOMNode _initWithNode:WebCore::]):
+        (+[DOMNode _nodeWith:WebCore::]):
+        (-[DOMNode WebCore::]):
+        (-[DOMNode KJS::Bindings::]):
+        (-[DOMNode addEventListener:::]):
+        (-[DOMNode removeEventListener:::]):
+        (-[DOMNode dispatchEvent:]):
+        (-[DOMElement image]):
+        (-[DOMElement _font]):
+        (-[DOMElement _imageTIFFRepresentation]):
+        (-[DOMElement _getURLAttribute:]):
+        (-[DOMElement _NPObject]):
+        (-[DOMElement isFocused]):
+        (-[DOMRange dealloc]):
+        (-[DOMRange finalize]):
+        (-[DOMRange description]):
+        (-[DOMRange startContainer]):
+        (-[DOMRange startOffset]):
+        (-[DOMRange endContainer]):
+        (-[DOMRange endOffset]):
+        (-[DOMRange collapsed]):
+        (-[DOMRange commonAncestorContainer]):
+        (-[DOMRange setStart::]):
+        (-[DOMRange setEnd::]):
+        (-[DOMRange setStartBefore:]):
+        (-[DOMRange setStartAfter:]):
+        (-[DOMRange setEndBefore:]):
+        (-[DOMRange setEndAfter:]):
+        (-[DOMRange collapse:]):
+        (-[DOMRange selectNode:]):
+        (-[DOMRange selectNodeContents:]):
+        (-[DOMRange compareBoundaryPoints::]):
+        (-[DOMRange deleteContents]):
+        (-[DOMRange extractContents]):
+        (-[DOMRange cloneContents]):
+        (-[DOMRange insertNode:]):
+        (-[DOMRange surroundContents:]):
+        (-[DOMRange cloneRange]):
+        (-[DOMRange toString]):
+        (-[DOMRange detach]):
+        (-[DOMRange _initWithRange:WebCore::]):
+        (+[DOMRange _rangeWith:WebCore::]):
+        (-[DOMRange WebCore::]):
+        (-[DOMNodeFilter _initWithNodeFilter:WebCore::]):
+        (+[DOMNodeFilter _nodeFilterWith:WebCore::]):
+        (-[DOMNodeFilter WebCore::]):
+        (-[DOMNodeFilter dealloc]):
+        (-[DOMNodeFilter finalize]):
+        (-[DOMNodeIterator _initWithNodeIterator:WebCore::filter:]):
+        (-[DOMNodeIterator WebCore::]):
+        (+[DOMNodeIterator _nodeIteratorWith:WebCore::filter:]):
+        (-[DOMTreeWalker _initWithTreeWalker:WebCore::filter:]):
+        (-[DOMTreeWalker WebCore::]):
+        (+[DOMTreeWalker _treeWalkerWith:WebCore::filter:]):
+        (ObjCNodeFilterCondition::acceptNode):
+        (-[DOMDocument createNodeIterator::::]):
+        (-[DOMDocument createTreeWalker::::]):
+        (ObjCEventListener::find):
+        (ObjCEventListener::create):
+        (ObjCEventListener::handleEvent):
+        * bindings/objc/DOMAbstractView.h: Added.
+        * bindings/objc/DOMAbstractView.mm: Added.
+        (-[DOMAbstractView document]):
+        (-[DOMAbstractView WebCore::]):
+        (-[DOMAbstractView _initWithAbstractView:WebCore::]):
+        (+[DOMAbstractView _abstractViewWith:WebCore::]):
+        * bindings/objc/DOMCSS.mm:
+        (-[DOMStyleSheet _initWithStyleSheet:WebCore::]):
+        (+[DOMStyleSheet _styleSheetWith:WebCore::]):
+        (+[DOMCSSStyleSheet _CSSStyleSheetWith:WebCore::]):
+        (-[DOMCSSRule _initWithRule:WebCore::]):
+        (+[DOMCSSRule _CSSRuleWith:WebCore::]):
+        (-[DOMCSSValue _initWithValue:WebCore::]):
+        (+[DOMCSSValue _CSSValueWith:WebCore::]):
+        (+[DOMCSSPrimitiveValue _CSSPrimitiveValueWith:WebCore::]):
+        (-[DOMDocument getComputedStyle::]):
+        (-[DOMDocument getMatchedCSSRules::]):
+        * bindings/objc/DOMCore.h:
+        * bindings/objc/DOMEventException.h: Added.
+        * bindings/objc/DOMEvents.h:
+        * bindings/objc/DOMEvents.mm:
+        * bindings/objc/DOMException.h: Added.
+        * bindings/objc/DOMHTML.mm:
+        (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:]):
+        (viewForElement):
+        (-[DOMHTMLInputElement _replaceCharactersInRange:withString:selectingFromIndex:]):
+        (-[DOMHTMLInputElement _selectedRange]):
+        (-[DOMHTMLInputElement _setAutofilled:]):
+        * bindings/objc/DOMInternal.h:
+        * bindings/objc/DOMObject.h:
+        * bindings/objc/DOMPrivate.h:
+        * bindings/objc/DOMRange.h:
+        * bindings/objc/DOMRangeException.h: Added.
+        * bindings/objc/DOMViews.h:
+        * bindings/objc/DOMViews.mm: Removed.
+        * bindings/objc/DOMXPath.h:
+        * bindings/objc/DOMXPathException.h: Added.
+        * bindings/scripts/IDLParser.pm:
+        * dom/Node.idl:
+
 2006-09-18  Brady Eidson  <beidson@apple.com>
 
         Windows build fix
index e41bd1899da75a06cba64a239165cfa93a286a63..e3e70b2e59383a21ca99cd112dbb54c4c484f61e 100644 (file)
                8518DCEA0A9CC80D0091B7A6 /* DOMDOMImplementation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8518DCE80A9CC80D0091B7A6 /* DOMDOMImplementation.mm */; };
                8518DD780A9CF31B0091B7A6 /* DOMNamedNodeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 8518DD760A9CF31B0091B7A6 /* DOMNamedNodeMap.h */; settings = {ATTRIBUTES = (); }; };
                8518DD790A9CF31B0091B7A6 /* DOMNamedNodeMap.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8518DD770A9CF31B0091B7A6 /* DOMNamedNodeMap.mm */; };
+               851EE80C0ABCA28F00A6AA33 /* DOMAbstractView.h in Headers */ = {isa = PBXBuildFile; fileRef = 851EE80A0ABCA28F00A6AA33 /* DOMAbstractView.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               851EE80D0ABCA28F00A6AA33 /* DOMAbstractView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 851EE80B0ABCA28F00A6AA33 /* DOMAbstractView.mm */; };
+               851EE8110ABCA39600A6AA33 /* DOMEventException.h in Headers */ = {isa = PBXBuildFile; fileRef = 851EE8100ABCA39600A6AA33 /* DOMEventException.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               851EE8210ABCA58100A6AA33 /* DOMRangeException.h in Headers */ = {isa = PBXBuildFile; fileRef = 851EE8200ABCA58100A6AA33 /* DOMRangeException.h */; settings = {ATTRIBUTES = (Private, ); }; };
                85217E020A5ECD4700DB8D00 /* XSLImportRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85217E000A5ECD4700DB8D00 /* XSLImportRule.cpp */; };
                85217E030A5ECD4700DB8D00 /* XSLImportRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 85217E010A5ECD4700DB8D00 /* XSLImportRule.h */; };
                852B9E870AA79C47002ADA6E /* DOMHTMLAppletElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 852B9E830AA79C47002ADA6E /* DOMHTMLAppletElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
                857E0B2C0AB043FC0036E447 /* DOMMouseEventPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 857E0B2B0AB043FC0036E447 /* DOMMouseEventPrivate.h */; };
                857E0B310AB044780036E447 /* DOMMouseEvent.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 857E0B230AB043460036E447 /* DOMMouseEvent.h */; };
                857E0B320AB044780036E447 /* DOMMouseEventPrivate.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 857E0B2B0AB043FC0036E447 /* DOMMouseEventPrivate.h */; };
+               858015CE0ABCA75D0080588D /* DOMXPathException.h in Headers */ = {isa = PBXBuildFile; fileRef = 858015CD0ABCA75D0080588D /* DOMXPathException.h */; settings = {ATTRIBUTES = (Private, ); }; };
                858C381C0AA8E29600B187A4 /* DOMCSSValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 858C381A0AA8E29600B187A4 /* DOMCSSValue.h */; };
                858C381D0AA8E29600B187A4 /* DOMCSSValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 858C381B0AA8E29600B187A4 /* DOMCSSValue.mm */; };
                858C382C0AA8E40500B187A4 /* DOMCSSPrimitiveValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 858C382A0AA8E40500B187A4 /* DOMCSSPrimitiveValue.h */; };
                85BA4D2E0AA6889F0088052D /* DOMHTMLUListElement.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 85BA4D090AA688680088052D /* DOMHTMLUListElement.h */; };
                85BCBC130ABBA87D00381160 /* DOMHTMLDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 85BCBC110ABBA87D00381160 /* DOMHTMLDocument.h */; };
                85BCBC140ABBA87D00381160 /* DOMHTMLDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85BCBC120ABBA87D00381160 /* DOMHTMLDocument.mm */; };
+               85C78A680ABDE1B40044FC16 /* DOMException.h in Headers */ = {isa = PBXBuildFile; fileRef = 85C78A670ABDE1B40044FC16 /* DOMException.h */; settings = {ATTRIBUTES = (Private, ); }; };
                85C7F3E60AAF5D5E004014DD /* DOMEvent.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 85AFA8200AAF528A00E84305 /* DOMEvent.h */; };
                85C7F4470AAF76DC004014DD /* DOMEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 85C7F4450AAF76DC004014DD /* DOMEventTarget.h */; settings = {ATTRIBUTES = (Private, ); }; };
                85C7F4910AAF79DC004014DD /* DOMUIEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85C7F48F0AAF79DC004014DD /* DOMUIEvent.h */; };
                BC1A37BE097C715F0019F3D8 /* DOMTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A37A8097C715F0019F3D8 /* DOMTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC1A37BF097C715F0019F3D8 /* DOMUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC1A37A9097C715F0019F3D8 /* DOMUtility.mm */; };
                BC1A37C0097C715F0019F3D8 /* DOMViews.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A37AA097C715F0019F3D8 /* DOMViews.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               BC1A37C1097C715F0019F3D8 /* DOMViews.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC1A37AB097C715F0019F3D8 /* DOMViews.mm */; };
                BC6B7BAF0993603C0052867B /* Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6B7BAE0993603C0052867B /* Image.cpp */; };
                BC6B7ECF0998AC7F0052867B /* ImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6B7ECE0998AC7F0052867B /* ImageSource.h */; };
                BC6D6DD209AF906600F59759 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6D6DD009AF906600F59759 /* Font.cpp */; };
                FAE04190097596C9000540BE /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE0418E097596C9000540BE /* SVGImageLoader.h */; };
 /* End PBXBuildFile section */
 
-/* Begin PBXBuildStyle section */
-               BCFAD45F0ABD3ABA00B7663D /* Development */ = {
-                       isa = PBXBuildStyle;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = NO;
-                       };
-                       name = Development;
-               };
-               BCFAD4600ABD3ABA00B7663D /* Deployment */ = {
-                       isa = PBXBuildStyle;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                       };
-                       name = Deployment;
-               };
-/* End PBXBuildStyle section */
-
 /* Begin PBXContainerItemProxy section */
                DD041FF009D9E3250010AF2A /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                8518DCE80A9CC80D0091B7A6 /* DOMDOMImplementation.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMDOMImplementation.mm; sourceTree = "<group>"; };
                8518DD760A9CF31B0091B7A6 /* DOMNamedNodeMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMNamedNodeMap.h; sourceTree = "<group>"; };
                8518DD770A9CF31B0091B7A6 /* DOMNamedNodeMap.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMNamedNodeMap.mm; sourceTree = "<group>"; };
+               851EE80A0ABCA28F00A6AA33 /* DOMAbstractView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMAbstractView.h; sourceTree = "<group>"; };
+               851EE80B0ABCA28F00A6AA33 /* DOMAbstractView.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMAbstractView.mm; sourceTree = "<group>"; };
+               851EE8100ABCA39600A6AA33 /* DOMEventException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMEventException.h; sourceTree = "<group>"; };
+               851EE8200ABCA58100A6AA33 /* DOMRangeException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMRangeException.h; sourceTree = "<group>"; };
                85217E000A5ECD4700DB8D00 /* XSLImportRule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = XSLImportRule.cpp; sourceTree = "<group>"; };
                85217E010A5ECD4700DB8D00 /* XSLImportRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = XSLImportRule.h; sourceTree = "<group>"; };
                852B9E830AA79C47002ADA6E /* DOMHTMLAppletElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLAppletElement.h; sourceTree = "<group>"; };
                857E0B230AB043460036E447 /* DOMMouseEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMouseEvent.h; sourceTree = "<group>"; };
                857E0B240AB043460036E447 /* DOMMouseEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMouseEvent.mm; sourceTree = "<group>"; };
                857E0B2B0AB043FC0036E447 /* DOMMouseEventPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMouseEventPrivate.h; sourceTree = "<group>"; };
+               858015CD0ABCA75D0080588D /* DOMXPathException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMXPathException.h; sourceTree = "<group>"; };
                858C381A0AA8E29600B187A4 /* DOMCSSValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMCSSValue.h; sourceTree = "<group>"; };
                858C381B0AA8E29600B187A4 /* DOMCSSValue.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMCSSValue.mm; sourceTree = "<group>"; };
                858C382A0AA8E40500B187A4 /* DOMCSSPrimitiveValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMCSSPrimitiveValue.h; sourceTree = "<group>"; };
                85C56CA90AA89E6600D95755 /* CSSImportRule.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSImportRule.idl; sourceTree = "<group>"; };
                85C56CAC0AA89F8E00D95755 /* CSSCharsetRule.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSCharsetRule.idl; sourceTree = "<group>"; };
                85C56CAD0AA89FE000D95755 /* CSSUnknownRule.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSUnknownRule.idl; sourceTree = "<group>"; };
+               85C78A670ABDE1B40044FC16 /* DOMException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMException.h; sourceTree = "<group>"; };
                85C7F4450AAF76DC004014DD /* DOMEventTarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMEventTarget.h; sourceTree = "<group>"; };
                85C7F48F0AAF79DC004014DD /* DOMUIEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMUIEvent.h; sourceTree = "<group>"; };
                85C7F4900AAF79DC004014DD /* DOMUIEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMUIEvent.mm; sourceTree = "<group>"; };
                BC1A37A8097C715F0019F3D8 /* DOMTraversal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMTraversal.h; sourceTree = "<group>"; };
                BC1A37A9097C715F0019F3D8 /* DOMUtility.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMUtility.mm; sourceTree = "<group>"; };
                BC1A37AA097C715F0019F3D8 /* DOMViews.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMViews.h; sourceTree = "<group>"; };
-               BC1A37AB097C715F0019F3D8 /* DOMViews.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMViews.mm; sourceTree = "<group>"; };
                BC3B364705C9D5E200E42902 /* AtomicStringList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AtomicStringList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BC5EC1760A507E3E006007F5 /* view-source.css */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "view-source.css"; sourceTree = "<group>"; };
                BC6B7BAE0993603C0052867B /* Image.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Image.cpp; sourceTree = "<group>"; };
                        name = StyleSheets;
                        sourceTree = "<group>";
                };
+               851EE8060ABCA25200A6AA33 /* Views */ = {
+                       isa = PBXGroup;
+                       children = (
+                               851EE80A0ABCA28F00A6AA33 /* DOMAbstractView.h */,
+                               851EE80B0ABCA28F00A6AA33 /* DOMAbstractView.mm */,
+                       );
+                       name = Views;
+                       sourceTree = "<group>";
+               };
+               851EE8230ABCA58A00A6AA33 /* Range */ = {
+                       isa = PBXGroup;
+                       children = (
+                               851EE8200ABCA58100A6AA33 /* DOMRangeException.h */,
+                       );
+                       name = Range;
+                       sourceTree = "<group>";
+               };
                854F12AC0A8EBC18000940B5 /* Core */ = {
                        isa = PBXGroup;
                        children = (
+                               85C78A670ABDE1B40044FC16 /* DOMException.h */,
                                856C8AE20A912649005C687B /* DOMObject.h */,
                                856C8AE30A912649005C687B /* DOMObject.mm */,
                        );
                        name = Traversal;
                        sourceTree = "<group>";
                };
+               858015CC0ABCA7410080588D /* XPath */ = {
+                       isa = PBXGroup;
+                       children = (
+                               858015CD0ABCA75D0080588D /* DOMXPathException.h */,
+                       );
+                       name = XPath;
+                       sourceTree = "<group>";
+               };
                858C39510AA9024C00B187A4 /* CSS */ = {
                        isa = PBXGroup;
                        children = (
                85C7F4430AAF7686004014DD /* Events */ = {
                        isa = PBXGroup;
                        children = (
+                               851EE8100ABCA39600A6AA33 /* DOMEventException.h */,
                                85C7F4450AAF76DC004014DD /* DOMEventTarget.h */,
                        );
                        name = Events;
                                858C39510AA9024C00B187A4 /* CSS */,
                                85C7F4430AAF7686004014DD /* Events */,
                                85992FC20AA5DD4600AC0785 /* HTML */,
+                               851EE8230ABCA58A00A6AA33 /* Range */,
                                859FA5F20AB0BEE2004FAEE9 /* Traversal */,
+                               851EE8060ABCA25200A6AA33 /* Views */,
+                               858015CC0ABCA7410080588D /* XPath */,
                                859B7FB90A8D288800A5F1EA /* CodeGeneratorObjC.pm */,
                                1CD0B6200AABDB5000D0A3FF /* PublicDOMInterfaces.h */,
                                BC1A3797097C715F0019F3D8 /* DOM.h */,
                                BC1A37A8097C715F0019F3D8 /* DOMTraversal.h */,
                                BC1A37A9097C715F0019F3D8 /* DOMUtility.mm */,
                                BC1A37AA097C715F0019F3D8 /* DOMViews.h */,
-                               BC1A37AB097C715F0019F3D8 /* DOMViews.mm */,
                                1A1D137E0A5325520064BF5F /* DOMXPath.h */,
                                1A1D137F0A5325520064BF5F /* DOMXPath.mm */,
                                1CAF347E0A6C405200ABE06E /* WebScriptObject.h */,
                                853BF4DB0ABB6B55008647BB /* DOMNode.h in Headers */,
                                853BF4EB0ABB6E97008647BB /* DOMNodePrivate.h in Headers */,
                                85BCBC130ABBA87D00381160 /* DOMHTMLDocument.h in Headers */,
+                               851EE80C0ABCA28F00A6AA33 /* DOMAbstractView.h in Headers */,
+                               851EE8110ABCA39600A6AA33 /* DOMEventException.h in Headers */,
+                               851EE8210ABCA58100A6AA33 /* DOMRangeException.h in Headers */,
+                               858015CE0ABCA75D0080588D /* DOMXPathException.h in Headers */,
+                               85C78A680ABDE1B40044FC16 /* DOMException.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
-                       buildSettings = {
-                       };
-                       buildStyles = (
-                               BCFAD45F0ABD3ABA00B7663D /* Development */,
-                               BCFAD4600ABD3ABA00B7663D /* Deployment */,
-                       );
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                                BC1A37B7097C715F0019F3D8 /* DOMHTML.mm in Sources */,
                                BC1A37BA097C715F0019F3D8 /* DOMInternal.mm in Sources */,
                                BC1A37BF097C715F0019F3D8 /* DOMUtility.mm in Sources */,
-                               BC1A37C1097C715F0019F3D8 /* DOMViews.mm in Sources */,
                                BCEA478F097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp in Sources */,
                                BCEA4798097CAAC80094C9E4 /* csshelper.cpp in Sources */,
                                BCEA479A097CAAC80094C9E4 /* cssparser.cpp in Sources */,
                                B20111070AB7740500DB0E68 /* JSSVGAElement.cpp in Sources */,
                                853BF4DC0ABB6B55008647BB /* DOMNode.mm in Sources */,
                                85BCBC140ABBA87D00381160 /* DOMHTMLDocument.mm in Sources */,
+                               851EE80D0ABCA28F00A6AA33 /* DOMAbstractView.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index a7130dc595dc12a94d7b70ed0f52b95cc3b694fa..4d9a75dd8c08896c3ada792ba02af86fd1b03d49 100644 (file)
@@ -63,8 +63,8 @@
 #import "csshelper.h"
 
 // From old DOMCore.h
-#import "DOMNode.h"
 #import "DOMObject.h"
+#import "DOMException.h"
 
 // Generated Objective-C Bindings
 #import "DOMAttr.h"
@@ -79,6 +79,7 @@
 #import "DOMEntity.h"
 #import "DOMEntityReference.h"
 #import "DOMNamedNodeMap.h"
+#import "DOMNode.h"
 #import "DOMNodeList.h"
 #import "DOMNotation.h"
 #import "DOMProcessingInstruction.h"
@@ -86,7 +87,6 @@
 
 // From old DOMHTML.h
 #import "DOMHTMLAppletElement.h"
-#import "DOMHTMLDocument.h"
 #import "DOMHTMLOptionElement.h"
 
 // Generated Objective-C Bindings
 #import "DOMHTMLDListElement.h"
 #import "DOMHTMLDirectoryElement.h"
 #import "DOMHTMLDivElement.h"
+#import "DOMHTMLDocument.h"
 #import "DOMHTMLElement.h"
 #import "DOMHTMLFieldSetElement.h"
 #import "DOMHTMLFontElement.h"
 
 #import <objc/objc-class.h>
 
-using WebCore::AtomicString;
-using WebCore::AtomicStringImpl;
-using WebCore::Attr;
-using WebCore::Document;
-using WebCore::DocumentFragment;
-using WebCore::DOMImplementationFront;
-using WebCore::Element;
-using WebCore::Event;
-using WebCore::EventListener;
-using WebCore::ExceptionCode;
-using WebCore::HTMLDocument;
-using WebCore::HTMLElement;
-using WebCore::FrameMac;
-using WebCore::KURL;
-using WebCore::NamedNodeMap;
-using WebCore::Node;
-using WebCore::NodeFilter;
-using WebCore::NodeFilterCondition;
-using WebCore::NodeIterator;
-using WebCore::NodeList;
-using WebCore::QualifiedName;
-using WebCore::Range;
-using WebCore::RenderImage;
-using WebCore::RenderObject;
-using WebCore::String;
-using WebCore::TreeWalker;
-
 using namespace WebCore::HTMLNames;
 
-class ObjCEventListener : public EventListener {
+class ObjCEventListener : public WebCore::EventListener {
 public:
-    static ObjCEventListener *find(id <DOMEventListener>);
-    static ObjCEventListener *create(id <DOMEventListener>);
+    static ObjCEventListenerfind(id <DOMEventListener>);
+    static ObjCEventListenercreate(id <DOMEventListener>);
 
 private:
     ObjCEventListener(id <DOMEventListener>);
     virtual ~ObjCEventListener();
 
-    virtual void handleEvent(Event *, bool isWindowEvent);
+    virtual void handleEvent(WebCore::Event*, bool isWindowEvent);
 
     id <DOMEventListener> m_listener;
 };
 
 typedef HashMap<id, ObjCEventListener*> ListenerMap;
-typedef HashMap<AtomicStringImpl*, Class> ObjCClassMap;
+typedef HashMap<WebCore::AtomicStringImpl*, Class> ObjCClassMap;
 
 static ObjCClassMap* elementClassMap;
 static ListenerMap* listenerMap;
@@ -199,7 +173,7 @@ static ListenerMap* listenerMap;
 //------------------------------------------------------------------------------------------
 // DOMNode
 
-static void addElementClass(const QualifiedName& tag, Class objCClass)
+static void addElementClass(const WebCore::QualifiedName& tag, Class objCClass)
 {
     elementClassMap->set(tag.localName().impl(), objCClass);
 }
@@ -275,7 +249,7 @@ static void createHTMLElementClassMap()
     // FIXME: Reflect marquee once the API has been determined.
 }
 
-static Class elementClass(const AtomicString& tagName)
+static Class elementClass(const WebCore::AtomicString& tagName)
 {
     if (!elementClassMap)
         createHTMLElementClassMap();
@@ -301,18 +275,18 @@ static Class elementClass(const AtomicString& tagName)
     return [NSString stringWithFormat:@"<%@ [%@]: %p>", [[self class] description], [self nodeName], _internal];
 }
 
-- (id)_initWithNode:(Node *)impl
+- (id)_initWithNode:(WebCore::Node *)impl
 {
     ASSERT(impl);
 
     [super _init];
-    _internal = DOM_cast<DOMObjectInternal *>(impl);
+    _internal = DOM_cast<DOMObjectInternal*>(impl);
     impl->ref();
     addDOMWrapper(self, impl);
     return self;
 }
 
-+ (DOMNode *)_nodeWith:(Node *)impl
++ (DOMNode *)_nodeWith:(WebCore::Node *)impl
 {
     if (!impl)
         return nil;
@@ -324,49 +298,49 @@ static Class elementClass(const AtomicString& tagName)
     
     Class wrapperClass = nil;
     switch (impl->nodeType()) {
-        case Node::ELEMENT_NODE:
+        case WebCore::Node::ELEMENT_NODE:
             if (impl->isHTMLElement())
-                wrapperClass = elementClass(static_cast<HTMLElement*>(impl)->localName());
+                wrapperClass = elementClass(static_cast<WebCore::HTMLElement*>(impl)->localName());
             else
                 wrapperClass = [DOMElement class];
             break;
-        case Node::ATTRIBUTE_NODE:
+        case WebCore::Node::ATTRIBUTE_NODE:
             wrapperClass = [DOMAttr class];
             break;
-        case Node::TEXT_NODE:
+        case WebCore::Node::TEXT_NODE:
             wrapperClass = [DOMText class];
             break;
-        case Node::CDATA_SECTION_NODE:
+        case WebCore::Node::CDATA_SECTION_NODE:
             wrapperClass = [DOMCDATASection class];
             break;
-        case Node::ENTITY_REFERENCE_NODE:
+        case WebCore::Node::ENTITY_REFERENCE_NODE:
             wrapperClass = [DOMEntityReference class];
             break;
-        case Node::ENTITY_NODE:
+        case WebCore::Node::ENTITY_NODE:
             wrapperClass = [DOMEntity class];
             break;
-        case Node::PROCESSING_INSTRUCTION_NODE:
+        case WebCore::Node::PROCESSING_INSTRUCTION_NODE:
             wrapperClass = [DOMProcessingInstruction class];
             break;
-        case Node::COMMENT_NODE:
+        case WebCore::Node::COMMENT_NODE:
             wrapperClass = [DOMComment class];
             break;
-        case Node::DOCUMENT_NODE:
-            if (static_cast<Document*>(impl)->isHTMLDocument())
+        case WebCore::Node::DOCUMENT_NODE:
+            if (static_cast<WebCore::Document*>(impl)->isHTMLDocument())
                 wrapperClass = [DOMHTMLDocument class];
             else
                 wrapperClass = [DOMDocument class];
             break;
-        case Node::DOCUMENT_TYPE_NODE:
+        case WebCore::Node::DOCUMENT_TYPE_NODE:
             wrapperClass = [DOMDocumentType class];
             break;
-        case Node::DOCUMENT_FRAGMENT_NODE:
+        case WebCore::Node::DOCUMENT_FRAGMENT_NODE:
             wrapperClass = [DOMDocumentFragment class];
             break;
-        case Node::NOTATION_NODE:
+        case WebCore::Node::NOTATION_NODE:
             wrapperClass = [DOMNotation class];
             break;
-        case Node::XPATH_NAMESPACE_NODE:
+        case WebCore::Node::XPATH_NAMESPACE_NODE:
             // FIXME: Create an XPath objective C wrapper
             // See http://bugzilla.opendarwin.org/show_bug.cgi?id=8755
             return nil;
@@ -374,15 +348,15 @@ static Class elementClass(const AtomicString& tagName)
     return [[[wrapperClass alloc] _initWithNode:impl] autorelease];
 }
 
-- (Node *)_node
+- (WebCore::Node *)_node
 {
-    return DOM_cast<Node *>(_internal);
+    return DOM_cast<WebCore::Node*>(_internal);
 }
 
 - (const KJS::Bindings::RootObject *)_executionContext
 {
-    if (Node *n = [self _node]) {
-        if (FrameMac *f = Mac(n->document()->frame()))
+    if (WebCore::Node *n = [self _node]) {
+        if (WebCore::FrameMac *f = Mac(n->document()->frame()))
             return f->executionContextForDOM();
     }
     return 0;
@@ -390,17 +364,9 @@ static Class elementClass(const AtomicString& tagName)
 
 @end
 
-@implementation DOMNode (WebPrivate)
-
-- (BOOL)isContentEditable
-{
-    return [self _node]->isContentEditable();
-}
-
-@end
-
 @implementation DOMNode (DOMNodeExtensions)
 
+// FIXME: this should be implemented in the implementation
 - (NSRect)boundingBox
 {
     WebCore::RenderObject *renderer = [self _node]->renderer();
@@ -409,6 +375,7 @@ static Class elementClass(const AtomicString& tagName)
     return NSZeroRect;
 }
 
+// FIXME: this should be implemented in the implementation
 - (NSArray *)lineBoxRects
 {
     WebCore::RenderObject *renderer = [self _node]->renderer();
@@ -434,7 +401,7 @@ static Class elementClass(const AtomicString& tagName)
     if (![self _node]->isEventTargetNode())
         raiseDOMException(DOM_NOT_SUPPORTED_ERR);
     
-    EventListener *wrapper = ObjCEventListener::create(listener);
+    WebCore::EventListener *wrapper = ObjCEventListener::create(listener);
     EventTargetNodeCast([self _node])->addEventListener(type, wrapper, useCapture);
     wrapper->deref();
 }
@@ -444,7 +411,7 @@ static Class elementClass(const AtomicString& tagName)
     if (![self _node]->isEventTargetNode())
         raiseDOMException(DOM_NOT_SUPPORTED_ERR);
 
-    if (EventListener *wrapper = ObjCEventListener::find(listener))
+    if (WebCore::EventListener *wrapper = ObjCEventListener::find(listener))
         EventTargetNodeCast([self _node])->removeEventListener(type, wrapper, useCapture);
 }
 
@@ -453,7 +420,7 @@ static Class elementClass(const AtomicString& tagName)
     if (![self _node]->isEventTargetNode())
         raiseDOMException(DOM_NOT_SUPPORTED_ERR);
 
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     BOOL result = EventTargetNodeCast([self _node])->dispatchEvent([event _event], ec);
     raiseOnDOMError(ec);
     return result;
@@ -461,31 +428,18 @@ static Class elementClass(const AtomicString& tagName)
 
 @end
 
-
-//------------------------------------------------------------------------------------------
-// DOMDocument
-
-@implementation DOMDocument (WebCoreInternalExtension)
-
-- (DOMElement *)_ownerElement
-{
-    return [DOMElement _elementWith:[self _document]->ownerElement()];
-}
-
-@end
-
-
 //------------------------------------------------------------------------------------------
 // DOMElement
 
 // FIXME: this should be auto-genenerate in DOMElement.mm
 @implementation DOMElement (DOMElementAppKitExtensions)
 
+// FIXME: this should be implemented in the implementation
 - (NSImage*)image
 {
-    RenderObject* renderer = [self _element]->renderer();
+    WebCore::RenderObject* renderer = [self _element]->renderer();
     if (renderer && renderer->isImage()) {
-        RenderImage* img = static_cast<RenderImage*>(renderer);
+        WebCore::RenderImage* img = static_cast<WebCore::RenderImage*>(renderer);
         if (img->cachedImage() && !img->cachedImage()->isErrorImage())
             return img->cachedImage()->image()->getNSImage();
     }
@@ -496,45 +450,49 @@ static Class elementClass(const AtomicString& tagName)
 
 @implementation DOMElement (WebPrivate)
 
+// FIXME: this should be implemented in the implementation
 - (NSFont *)_font
 {
-    RenderObject *renderer = [self _element]->renderer();
+    WebCore::RenderObject* renderer = [self _element]->renderer();
     if (renderer)
         return renderer->style()->font().primaryFont()->getNSFont();
     return nil;
 }
 
+// FIXME: this should be implemented in the implementation
 - (NSData*)_imageTIFFRepresentation
 {
-    RenderObject *renderer = [self _element]->renderer();
+    WebCore::RenderObject* renderer = [self _element]->renderer();
     if (renderer && renderer->isImage()) {
-        RenderImage* img = static_cast<RenderImage*>(renderer);
+        WebCore::RenderImage* img = static_cast<WebCore::RenderImage*>(renderer);
         if (img->cachedImage() && !img->cachedImage()->isErrorImage())
             return (NSData*)(img->cachedImage()->image()->getTIFFRepresentation());
     }
     return nil;
 }
 
+// FIXME: this should be implemented in the implementation
 - (NSURL *)_getURLAttribute:(NSString *)name
 {
     ASSERT(name);
-    Element *e = [self _element];
-    ASSERT(e);
-    return KURL(e->document()->completeURL(parseURL(e->getAttribute(name)).deprecatedString())).getNSURL();
+    WebCore::Element* element = [self _element];
+    ASSERT(element);
+    return WebCore::KURL(element->document()->completeURL(parseURL(element->getAttribute(name)).deprecatedString())).getNSURL();
 }
 
+// FIXME: this should be implemented in the implementation
 - (void *)_NPObject
 {
-    Element* element = [self _element];
+    WebCore::Element* element = [self _element];
     if (element->hasTagName(appletTag) || element->hasTagName(embedTag) || element->hasTagName(objectTag))
         return static_cast<WebCore::HTMLPlugInElement*>(element)->getNPObject();
-    else
-        return 0;
+    return 0;
 }
 
+// FIXME: this should be implemented in the implementation
 - (BOOL)isFocused
 {
-    Element* impl = [self _element];
+    WebCore::Element* impl = [self _element];
     if (impl->document()->focusNode() == impl)
         return YES;
     return NO;
@@ -550,17 +508,15 @@ static Class elementClass(const AtomicString& tagName)
 
 - (void)dealloc
 {
-    if (_internal) {
-        DOM_cast<Range *>(_internal)->deref();
-    }
+    if (_internal)
+        DOM_cast<WebCore::Range*>(_internal)->deref();
     [super dealloc];
 }
 
 - (void)finalize
 {
-    if (_internal) {
-        DOM_cast<Range *>(_internal)->deref();
-    }
+    if (_internal)
+        DOM_cast<WebCore::Range*>(_internal)->deref();
     [super finalize];
 }
 
@@ -569,13 +525,12 @@ static Class elementClass(const AtomicString& tagName)
     if (!_internal)
         return @"<DOMRange: null>";
     return [NSString stringWithFormat:@"<DOMRange: %@ %d %@ %d>",
-        [self startContainer], [self startOffset],
-        [self endContainer], [self endOffset]];
+               [self startContainer], [self startOffset], [self endContainer], [self endOffset]];
 }
 
 - (DOMNode *)startContainer
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     DOMNode *result = [DOMNode _nodeWith:[self _range]->startContainer(ec)];
     raiseOnDOMError(ec);
     return result;
@@ -583,7 +538,7 @@ static Class elementClass(const AtomicString& tagName)
 
 - (int)startOffset
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     int result = [self _range]->startOffset(ec);
     raiseOnDOMError(ec);
     return result;
@@ -591,7 +546,7 @@ static Class elementClass(const AtomicString& tagName)
 
 - (DOMNode *)endContainer
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     DOMNode *result = [DOMNode _nodeWith:[self _range]->endContainer(ec)];
     raiseOnDOMError(ec);
     return result;
@@ -599,7 +554,7 @@ static Class elementClass(const AtomicString& tagName)
 
 - (int)endOffset
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     int result = [self _range]->endOffset(ec);
     raiseOnDOMError(ec);
     return result;
@@ -607,7 +562,7 @@ static Class elementClass(const AtomicString& tagName)
 
 - (BOOL)collapsed
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     BOOL result = [self _range]->collapsed(ec);
     raiseOnDOMError(ec);
     return result;
@@ -615,7 +570,7 @@ static Class elementClass(const AtomicString& tagName)
 
 - (DOMNode *)commonAncestorContainer
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     DOMNode *result = [DOMNode _nodeWith:[self _range]->commonAncestorContainer(ec)];
     raiseOnDOMError(ec);
     return result;
@@ -623,85 +578,85 @@ static Class elementClass(const AtomicString& tagName)
 
 - (void)setStart:(DOMNode *)refNode :(int)offset
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->setStart([refNode _node], offset, ec);
     raiseOnDOMError(ec);
 }
 
 - (void)setEnd:(DOMNode *)refNode :(int)offset
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->setEnd([refNode _node], offset, ec);
     raiseOnDOMError(ec);
 }
 
 - (void)setStartBefore:(DOMNode *)refNode
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->setStartBefore([refNode _node], ec);
     raiseOnDOMError(ec);
 }
 
 - (void)setStartAfter:(DOMNode *)refNode
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->setStartAfter([refNode _node], ec);
     raiseOnDOMError(ec);
 }
 
 - (void)setEndBefore:(DOMNode *)refNode
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->setEndBefore([refNode _node], ec);
     raiseOnDOMError(ec);
 }
 
 - (void)setEndAfter:(DOMNode *)refNode
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->setEndAfter([refNode _node], ec);
     raiseOnDOMError(ec);
 }
 
 - (void)collapse:(BOOL)toStart
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->collapse(toStart, ec);
     raiseOnDOMError(ec);
 }
 
 - (void)selectNode:(DOMNode *)refNode
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->selectNode([refNode _node], ec);
     raiseOnDOMError(ec);
 }
 
 - (void)selectNodeContents:(DOMNode *)refNode
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->selectNodeContents([refNode _node], ec);
     raiseOnDOMError(ec);
 }
 
 - (short)compareBoundaryPoints:(unsigned short)how :(DOMRange *)sourceRange
 {
-    ExceptionCode ec = 0;
-    short result = [self _range]->compareBoundaryPoints(static_cast<Range::CompareHow>(how), [sourceRange _range], ec);
+    WebCore::ExceptionCode ec = 0;
+    short result = [self _range]->compareBoundaryPoints(static_cast<WebCore::Range::CompareHow>(how), [sourceRange _range], ec);
     raiseOnDOMError(ec);
     return result;
 }
 
 - (void)deleteContents
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->deleteContents(ec);
     raiseOnDOMError(ec);
 }
 
 - (DOMDocumentFragment *)extractContents
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     DOMDocumentFragment *result = [DOMDocumentFragment _documentFragmentWith:[self _range]->extractContents(ec).get()];
     raiseOnDOMError(ec);
     return result;
@@ -709,7 +664,7 @@ static Class elementClass(const AtomicString& tagName)
 
 - (DOMDocumentFragment *)cloneContents
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     DOMDocumentFragment *result = [DOMDocumentFragment _documentFragmentWith:[self _range]->cloneContents(ec).get()];
     raiseOnDOMError(ec);
     return result;
@@ -717,21 +672,21 @@ static Class elementClass(const AtomicString& tagName)
 
 - (void)insertNode:(DOMNode *)newNode
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->insertNode([newNode _node], ec);
     raiseOnDOMError(ec);
 }
 
 - (void)surroundContents:(DOMNode *)newParent
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->surroundContents([newParent _node], ec);
     raiseOnDOMError(ec);
 }
 
 - (DOMRange *)cloneRange
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     DOMRange *result = [DOMRange _rangeWith:[self _range]->cloneRange(ec).get()];
     raiseOnDOMError(ec);
     return result;
@@ -739,7 +694,7 @@ static Class elementClass(const AtomicString& tagName)
 
 - (NSString *)toString
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     NSString *result = [self _range]->toString(ec);
     raiseOnDOMError(ec);
     return result;
@@ -752,7 +707,7 @@ static Class elementClass(const AtomicString& tagName)
 
 - (void)detach
 {
-    ExceptionCode ec = 0;
+    WebCore::ExceptionCode ec = 0;
     [self _range]->detach(ec);
     raiseOnDOMError(ec);
 }
@@ -761,18 +716,18 @@ static Class elementClass(const AtomicString& tagName)
 
 @implementation DOMRange (WebCoreInternal)
 
-- (id)_initWithRange:(Range *)impl
+- (id)_initWithRange:(WebCore::Range *)impl
 {
     ASSERT(impl);
 
     [super _init];
-    _internal = DOM_cast<DOMObjectInternal *>(impl);
+    _internal = DOM_cast<DOMObjectInternal*>(impl);
     impl->ref();
     addDOMWrapper(self, impl);
     return self;
 }
 
-+ (DOMRange *)_rangeWith:(Range *)impl
++ (DOMRange *)_rangeWith:(WebCore::Range *)impl
 {
     if (!impl)
         return nil;
@@ -785,9 +740,9 @@ static Class elementClass(const AtomicString& tagName)
     return [[[self alloc] _initWithRange:impl] autorelease];
 }
 
-- (Range *)_range
+- (WebCore::Range *)_range
 {
-    return DOM_cast<Range *>(_internal);
+    return DOM_cast<WebCore::Range*>(_internal);
 }
 
 @end
@@ -807,18 +762,18 @@ static Class elementClass(const AtomicString& tagName)
 
 @implementation DOMNodeFilter
 
-- (id)_initWithNodeFilter:(NodeFilter *)impl
+- (id)_initWithNodeFilter:(WebCore::NodeFilter *)impl
 {
     ASSERT(impl);
 
     [super _init];
-    _internal = DOM_cast<DOMObjectInternal *>(impl);
+    _internal = DOM_cast<DOMObjectInternal*>(impl);
     impl->ref();
     addDOMWrapper(self, impl);
     return self;
 }
 
-+ (DOMNodeFilter *)_nodeFilterWith:(NodeFilter *)impl
++ (DOMNodeFilter *)_nodeFilterWith:(WebCore::NodeFilter *)impl
 {
     if (!impl)
         return nil;
@@ -831,22 +786,22 @@ static Class elementClass(const AtomicString& tagName)
     return [[[self alloc] _initWithNodeFilter:impl] autorelease];
 }
 
-- (NodeFilter *)_nodeFilter
+- (WebCore::NodeFilter *)_nodeFilter
 {
-    return DOM_cast<NodeFilter *>(_internal);
+    return DOM_cast<WebCore::NodeFilter*>(_internal);
 }
 
 - (void)dealloc
 {
     if (_internal)
-        DOM_cast<NodeFilter *>(_internal)->deref();
+        DOM_cast<WebCore::NodeFilter*>(_internal)->deref();
     [super dealloc];
 }
 
 - (void)finalize
 {
     if (_internal)
-        DOM_cast<NodeFilter *>(_internal)->deref();
+        DOM_cast<WebCore::NodeFilter*>(_internal)->deref();
     [super finalize];
 }
 
@@ -863,24 +818,24 @@ static Class elementClass(const AtomicString& tagName)
 
 @implementation DOMNodeIterator(WebCoreInternal)
 
-- (id)_initWithNodeIterator:(NodeIterator *)impl filter:(id <DOMNodeFilter>)filter
+- (id)_initWithNodeIterator:(WebCore::NodeIterator *)impl filter:(id <DOMNodeFilter>)filter
 {
     ASSERT(impl);
 
     [super _init];
-    _internal = DOM_cast<DOMObjectInternal *>(impl);
+    _internal = DOM_cast<DOMObjectInternal*>(impl);
     impl->ref();
     addDOMWrapper(self, impl);
     m_filter = [filter retain];
     return self;
 }
 
-- (NodeIterator *)_nodeIterator
+- (WebCore::NodeIterator *)_nodeIterator
 {
-    return DOM_cast<NodeIterator *>(_internal);
+    return DOM_cast<WebCore::NodeIterator*>(_internal);
 }
 
-+ (DOMNodeIterator *)_nodeIteratorWith:(NodeIterator *)impl filter:(id <DOMNodeFilter>)filter
++ (DOMNodeIterator *)_nodeIteratorWith:(WebCore::NodeIterator *)impl filter:(id <DOMNodeFilter>)filter
 {
     if (!impl)
         return nil;
@@ -901,24 +856,24 @@ static Class elementClass(const AtomicString& tagName)
 
 @implementation DOMTreeWalker (WebCoreInternal)
 
-- (id)_initWithTreeWalker:(TreeWalker *)impl filter:(id <DOMNodeFilter>)filter
+- (id)_initWithTreeWalker:(WebCore::TreeWalker *)impl filter:(id <DOMNodeFilter>)filter
 {
     ASSERT(impl);
 
     [super _init];
-    _internal = DOM_cast<DOMObjectInternal *>(impl);
+    _internal = DOM_cast<DOMObjectInternal*>(impl);
     impl->ref();
     addDOMWrapper(self, impl);
     m_filter = [filter retain];
     return self;
 }
 
-- (TreeWalker *)_treeWalker
+- (WebCore::TreeWalker *)_treeWalker
 {
-    return DOM_cast<TreeWalker *>(_internal);
+    return DOM_cast<WebCore::TreeWalker *>(_internal);
 }
 
-+ (DOMTreeWalker *)_treeWalkerWith:(TreeWalker *)impl filter:(id <DOMNodeFilter>)filter
++ (DOMTreeWalker *)_treeWalkerWith:(WebCore::TreeWalker *)impl filter:(id <DOMNodeFilter>)filter
 {
     if (!impl)
         return nil;
@@ -937,16 +892,15 @@ static Class elementClass(const AtomicString& tagName)
 //------------------------------------------------------------------------------------------
 // ObjCNodeFilterCondition
 
-class ObjCNodeFilterCondition : public NodeFilterCondition
-{
+class ObjCNodeFilterCondition : public WebCore::NodeFilterCondition {
 public:
     ObjCNodeFilterCondition(id <DOMNodeFilter>);
     virtual ~ObjCNodeFilterCondition();
-    virtual short acceptNode(Node*) const;
+    virtual short acceptNode(WebCore::Node*) const;
 
 private:
-    ObjCNodeFilterCondition(const ObjCNodeFilterCondition &);
-    ObjCNodeFilterCondition &operator=(const ObjCNodeFilterCondition &);
+    ObjCNodeFilterCondition(const ObjCNodeFilterCondition&);
+    ObjCNodeFilterCondition &operator=(const ObjCNodeFilterCondition&);
 
     id <DOMNodeFilter> m_filter;
 };
@@ -963,10 +917,10 @@ ObjCNodeFilterCondition::~ObjCNodeFilterCondition()
     CFRelease(m_filter);
 }
 
-short ObjCNodeFilterCondition::acceptNode(Node* node) const
+short ObjCNodeFilterCondition::acceptNode(WebCore::Node* node) const
 {
     if (!node)
-        return NodeFilter::FILTER_REJECT;
+        return WebCore::NodeFilter::FILTER_REJECT;
     return [m_filter acceptNode:[DOMNode _nodeWith:node]];
 }
 
@@ -979,22 +933,22 @@ short ObjCNodeFilterCondition::acceptNode(Node* node) const
 
 - (DOMNodeIterator *)createNodeIterator:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences
 {
-    RefPtr<NodeFilter> cppFilter;
+    RefPtr<WebCore::NodeFilter> cppFilter;
     if (filter)
-        cppFilter = new NodeFilter(new ObjCNodeFilterCondition(filter));
-    ExceptionCode ec = 0;
-    RefPtr<NodeIterator> impl = [self _document]->createNodeIterator([root _node], whatToShow, cppFilter, expandEntityReferences, ec);
+        cppFilter = new WebCore::NodeFilter(new ObjCNodeFilterCondition(filter));
+    WebCore::ExceptionCode ec = 0;
+    RefPtr<WebCore::NodeIterator> impl = [self _document]->createNodeIterator([root _node], whatToShow, cppFilter, expandEntityReferences, ec);
     raiseOnDOMError(ec);
     return [DOMNodeIterator _nodeIteratorWith:impl.get() filter:filter];
 }
 
 - (DOMTreeWalker *)createTreeWalker:(DOMNode *)root :(unsigned)whatToShow :(id <DOMNodeFilter>)filter :(BOOL)expandEntityReferences
 {
-    RefPtr<NodeFilter> cppFilter;
+    RefPtr<WebCore::NodeFilter> cppFilter;
     if (filter)
-        cppFilter = new NodeFilter(new ObjCNodeFilterCondition(filter));
-    ExceptionCode ec = 0;
-    RefPtr<TreeWalker> impl = [self _document]->createTreeWalker([root _node], whatToShow, cppFilter, expandEntityReferences, ec);
+        cppFilter = new WebCore::NodeFilter(new ObjCNodeFilterCondition(filter));
+    WebCore::ExceptionCode ec = 0;
+    RefPtr<WebCore::TreeWalker> impl = [self _document]->createTreeWalker([root _node], whatToShow, cppFilter, expandEntityReferences, ec);
     raiseOnDOMError(ec);
     return [DOMTreeWalker _treeWalkerWith:impl.get() filter:filter];
 }
@@ -1009,12 +963,12 @@ ObjCEventListener* ObjCEventListener::find(id <DOMEventListener> listener)
 {
     if (ListenerMap* map = listenerMap)
         return map->get(listener);
-    return NULL;
+    return 0;
 }
 
 ObjCEventListener *ObjCEventListener::create(id <DOMEventListener> listener)
 {
-    ObjCEventListener *wrapper = find(listener);
+    ObjCEventListenerwrapper = find(listener);
     if (!wrapper)
         wrapper = new ObjCEventListener(listener);
     wrapper->ref();
@@ -1038,7 +992,7 @@ ObjCEventListener::~ObjCEventListener()
     [m_listener release];
 }
 
-void ObjCEventListener::handleEvent(Event *event, bool)
+void ObjCEventListener::handleEvent(WebCore::Event* event, bool)
 {
     [m_listener handleEvent:[DOMEvent _eventWith:event]];
 }
diff --git a/WebCore/bindings/objc/DOMAbstractView.h b/WebCore/bindings/objc/DOMAbstractView.h
new file mode 100644 (file)
index 0000000..6ecf248
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import <WebCore/DOMObject.h>
+
+@class DOMDocument;
+
+@interface DOMAbstractView : DOMObject
+- (DOMDocument *)document;
+@end
similarity index 86%
rename from WebCore/bindings/objc/DOMViews.mm
rename to WebCore/bindings/objc/DOMAbstractView.mm
index 41d5d4ef5927426ddfc441ef8f6d29120bd19b9d..75059ea1efc0ffe491f85f0438a58ab8a2f5550b 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2004-2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  */
 
 #import "config.h"
-#import "DOMViews.h"
+#import "DOMAbstractView.h"
 
+#import <wtf/GetPtr.h>
+
+#import "DOMDocument.h"
 #import "DOMInternal.h"
-#import "Document.h"
 #import "DOMWindow.h"
+#import "Document.h"
 
 namespace WebCore {
     typedef DOMWindow AbstractView;
@@ -38,9 +42,11 @@ ALLOW_DOM_CAST(DOMWindow)
 
 @implementation DOMAbstractView
 
+#define IMPL reinterpret_cast<WebCore::DOMWindow*>(_internal)
+
 - (DOMDocument *)document
 {
-    return [DOMDocument _documentWith:[self _abstractView]->document()];
+    return [DOMDocument _documentWith:WTF::getPtr(IMPL->document())];
 }
 
 @end
@@ -49,7 +55,7 @@ ALLOW_DOM_CAST(DOMWindow)
 
 - (WebCore::AbstractView *)_abstractView
 {
-    return DOM_cast<WebCore::AbstractView *>(_internal);
+    return IMPL;
 }
 
 - (id)_initWithAbstractView:(WebCore::AbstractView *)impl
index 6204a48ee17321d27875952a112f4499c4c0b6cf..a78c24c64bcd9e8cc9d4f47e83a25cf13c2aa3c8 100644 (file)
 #import "config.h"
 #import "DOMCSS.h"
 
-#import "DOMPrivate.h"
 #import "CSSCharsetRule.h"
 #import "CSSFontFaceRule.h"
 #import "CSSImportRule.h"
 #import "CSSMediaRule.h"
 #import "CSSPageRule.h"
+#import "CSSPrimitiveValue.h"
 #import "CSSRule.h"
 #import "CSSRuleList.h"
+#import "CSSStyleDeclaration.h"
 #import "CSSStyleRule.h"
 #import "CSSStyleSheet.h"
 #import "CSSValueList.h"
-#import "Counter.h"
 #import "DOMInternal.h"
+#import "DOMPrivate.h"
 #import "DOMWindow.h"
 #import "Document.h"
-#import "FoundationExtras.h"
-#import "HTMLLinkElement.h"
-#import "HTMLStyleElement.h"
-#import "MediaList.h"
-#import "ProcessingInstruction.h"
-#import "RectImpl.h"
 #import "StyleSheet.h"
-#import "StyleSheetList.h"
 
-#import <wtf/GetPtr.h>
 #import <objc/objc-class.h>
+#import <wtf/GetPtr.h>
 
 namespace WebCore {
     typedef DOMWindow AbstractView;
 }
 
-using namespace WebCore;
-
 //------------------------------------------------------------------------------------------
 // DOMStyleSheet
 
 @implementation DOMStyleSheet (WebCoreInternal)
 
-- (id)_initWithStyleSheet:(StyleSheet *)impl
+- (id)_initWithStyleSheet:(WebCore::StyleSheet *)impl
 {
     [super _init];
     _internal = DOM_cast<DOMObjectInternal*>(impl);
@@ -75,7 +67,7 @@ using namespace WebCore;
     return self;
 }
 
-+ (DOMStyleSheet *)_styleSheetWith:(StyleSheet *)impl
++ (DOMStyleSheet *)_styleSheetWith:(WebCore::StyleSheet *)impl
 {
     if (!impl)
         return nil;
@@ -101,7 +93,7 @@ using namespace WebCore;
 
 @implementation DOMCSSStyleSheet (WebCoreInternal)
 
-+ (DOMCSSStyleSheet *)_CSSStyleSheetWith:(CSSStyleSheet *)impl
++ (DOMCSSStyleSheet *)_CSSStyleSheetWith:(WebCore::CSSStyleSheet *)impl
 {
     return static_cast<DOMCSSStyleSheet*>([DOMStyleSheet _styleSheetWith:impl]);
 }
@@ -114,7 +106,7 @@ using namespace WebCore;
 
 @implementation DOMCSSRule (WebCoreInternal)
 
-- (id)_initWithRule:(CSSRule *)impl
+- (id)_initWithRule:(WebCore::CSSRule *)impl
 {
     [super _init];
     _internal = DOM_cast<DOMObjectInternal*>(impl);
@@ -123,7 +115,7 @@ using namespace WebCore;
     return self;
 }
 
-+ (DOMCSSRule *)_CSSRuleWith:(CSSRule *)impl
++ (DOMCSSRule *)_CSSRuleWith:(WebCore::CSSRule *)impl
 {
     if (!impl)
         return nil;
@@ -168,7 +160,7 @@ using namespace WebCore;
 
 @implementation DOMCSSValue (WebCoreInternal)
 
-- (id)_initWithValue:(CSSValue *)impl
+- (id)_initWithValue:(WebCore::CSSValue *)impl
 {
     [super _init];
     _internal = DOM_cast<DOMObjectInternal*>(impl);
@@ -177,7 +169,7 @@ using namespace WebCore;
     return self;
 }
 
-+ (DOMCSSValue *)_CSSValueWith:(CSSValue *)impl
++ (DOMCSSValue *)_CSSValueWith:(WebCore::CSSValue *)impl
 {
     if (!impl)
         return nil;
@@ -218,7 +210,7 @@ using namespace WebCore;
     return static_cast<WebCore::CSSPrimitiveValue*>(reinterpret_cast<WebCore::CSSValue*>(_internal));
 }
 
-+ (DOMCSSPrimitiveValue *)_CSSPrimitiveValueWith:(CSSValue *)impl
++ (DOMCSSPrimitiveValue *)_CSSPrimitiveValueWith:(WebCore::CSSValue *)impl
 {
     return static_cast<DOMCSSPrimitiveValue*>([DOMCSSValue _CSSValueWith:impl]);
 }
@@ -226,19 +218,6 @@ using namespace WebCore;
 @end
 
 
-//------------------------------------------------------------------------------------------
-// DOMRGBColor
-
-@implementation DOMRGBColor (WebPrivate)
-
-- (NSColor *)_color
-{
-    return [self color];
-}
-
-@end
-
-
 //------------------------------------------------------------------------------------------
 
 @implementation DOMCSSStyleDeclaration (DOMCSS2Properties)
@@ -1483,7 +1462,7 @@ using namespace WebCore;
 
 - (DOMCSSStyleDeclaration *)getComputedStyle:(DOMElement *)elt :(NSString *)pseudoElt
 {
-    AbstractView* dv = [self _document]->defaultView();
+    WebCore::AbstractView* dv = [self _document]->defaultView();
 
     if (!dv)
         return nil;
@@ -1497,7 +1476,7 @@ using namespace WebCore;
 
 - (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)elt :(NSString *)pseudoElt
 {
-    AbstractView* dv = [self _document]->defaultView();
+    WebCore::AbstractView* dv = [self _document]->defaultView();
 
     if (!dv)
         return nil;
index 08f80c1583fac4d84d008194ee12da8d27a4d5c3..afac8ed174454228aa299f33097d50d6fb8b7479 100644 (file)
@@ -34,6 +34,7 @@
 #import <WebCore/DOMElement.h>
 #import <WebCore/DOMEntity.h>
 #import <WebCore/DOMEntityReference.h>
+#import <WebCore/DOMException.h>
 #import <WebCore/DOMDOMImplementation.h>
 #import <WebCore/DOMNamedNodeMap.h>
 #import <WebCore/DOMNode.h>
diff --git a/WebCore/bindings/objc/DOMEventException.h b/WebCore/bindings/objc/DOMEventException.h
new file mode 100644 (file)
index 0000000..2ac682f
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+extern NSString * const DOMEventException;
+
+enum DOMEventExceptionCode {
+    DOM_UNSPECIFIED_EVENT_TYPE_ERR = 0
+};
index 8c715611cfea38b6c8bf5d11c0923ee908ae8841..654af2ecdace94c820a79fe774dbf73d43292694 100644 (file)
@@ -30,6 +30,7 @@
 #import <WebCore/DOMViews.h>
 
 #import <WebCore/DOMEvent.h>
+#import <WebCore/DOMEventException.h>
 #import <WebCore/DOMEventListener.h>
 #import <WebCore/DOMEventTarget.h>
 #import <WebCore/DOMKeyboardEvent.h>
 #import <WebCore/DOMUIEvent.h>
 #import <WebCore/DOMWheelEvent.h>
 
-extern NSString * const DOMEventException;
-
-enum DOMEventExceptionCode {
-    DOM_UNSPECIFIED_EVENT_TYPE_ERR = 0
-};
-
 @interface DOMKeyboardEvent (NonStandardAdditions)
 - (BOOL)getModifierState:(NSString *)keyIdentifierArg;
 @end
index 3b009d32ec7c9cd66738ae1383c8d75f9ccdc7cf..a628804cf64984243eb5401682ed7a9b203dec70 100644 (file)
@@ -38,8 +38,6 @@
 #import "OverflowEvent.h"
 #import "UIEvent.h"
 
-ALLOW_DOM_CAST(Event)
-
 //------------------------------------------------------------------------------------------
 // DOMEvent
 
@@ -98,6 +96,7 @@ ALLOW_DOM_CAST(Event)
 
 @implementation DOMKeyboardEvent (NonStandardAdditions)
 
+// FIXME: this should be implemented in the implementation
 - (BOOL)getModifierState:(NSString *)keyIdentifierArg
 {
     if ([keyIdentifierArg isEqualToString:@"Control"] && [self ctrlKey])
diff --git a/WebCore/bindings/objc/DOMException.h b/WebCore/bindings/objc/DOMException.h
new file mode 100644 (file)
index 0000000..b35e060
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+extern NSString * const DOMException;
+
+// DOM exception codes
+enum {
+    DOM_INDEX_SIZE_ERR                = 1,
+    DOM_DOMSTRING_SIZE_ERR            = 2,
+    DOM_HIERARCHY_REQUEST_ERR         = 3,
+    DOM_WRONG_DOCUMENT_ERR            = 4,
+    DOM_INVALID_CHARACTER_ERR         = 5,
+    DOM_NO_DATA_ALLOWED_ERR           = 6,
+    DOM_NO_MODIFICATION_ALLOWED_ERR   = 7,
+    DOM_NOT_FOUND_ERR                 = 8,
+    DOM_NOT_SUPPORTED_ERR             = 9,
+    DOM_INUSE_ATTRIBUTE_ERR           = 10,
+    DOM_INVALID_STATE_ERR             = 11,
+    DOM_SYNTAX_ERR                    = 12,
+    DOM_INVALID_MODIFICATION_ERR      = 13,
+    DOM_NAMESPACE_ERR                 = 14,
+    DOM_INVALID_ACCESS_ERR            = 15
+};
index ff0d6bab5916fde497d850b0dec7c203a17b9a94..c8552a7bbc6829a663e908f5c99ec91e580f1838 100644 (file)
 #import "FoundationExtras.h"
 #import "FrameView.h"
 #import "HTMLDocument.h"
-#import "HTMLFormElement.h"
-#import "HTMLImageElement.h"
 #import "HTMLInputElement.h"
-#import "HTMLNames.h"
 #import "HTMLObjectElement.h"
-#import "HTMLOptionsCollection.h"
-#import "HTMLSelectElement.h"
-#import "HTMLTableCaptionElement.h"
-#import "HTMLTableCellElement.h"
-#import "HTMLTableElement.h"
-#import "HTMLTableSectionElement.h"
 #import "KURL.h"
-#import "NameNodeList.h"
 #import "Range.h"
 #import "RenderTextControl.h"
 #import "csshelper.h"
 #import "markup.h"
 
-using namespace WebCore;
-using namespace HTMLNames;
-
-
 //------------------------------------------------------------------------------------------
 // DOMHTMLDocument
 
@@ -78,7 +64,7 @@ using namespace HTMLNames;
 
 - (DOMDocumentFragment *)_createDocumentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString
 {
-    NSURL *baseURL = KURL([self _document]->completeURL(parseURL(baseURLString)).deprecatedString()).getNSURL();
+    NSURL *baseURL = WebCore::KURL([self _document]->completeURL(WebCore::parseURL(baseURLString)).deprecatedString()).getNSURL();
     return [self createDocumentFragmentWithMarkupString:markupString baseURL:baseURL];
 }
 
@@ -122,19 +108,17 @@ using namespace HTMLNames;
 
 #pragma mark DOM EXTENSIONS
 
-// These #imports and "usings" are used only by viewForElement and should be deleted 
+// This #import is used only by viewForElement and should be deleted 
 // when that function goes away.
 #import "RenderWidget.h"
-using WebCore::RenderObject;
-using WebCore::RenderWidget;
 
 // This function is used only by the two FormAutoFillTransition categories, and will go away
 // as soon as possible.
 static NSView *viewForElement(DOMElement *element)
 {
-    RenderObject *renderer = [element _element]->renderer();
+    WebCore::RenderObject *renderer = [element _element]->renderer();
     if (renderer && renderer->isWidget()) {
-        Widget *widget = static_cast<const RenderWidget*>(renderer)->widget();
+        WebCore::Widget *widget = static_cast<const WebCore::RenderWidget*>(renderer)->widget();
         if (widget) {
             widget->populate();
             return widget->getView();
@@ -188,9 +172,9 @@ static NSView *viewForElement(DOMElement *element)
 
 - (void)_replaceCharactersInRange:(NSRange)targetRange withString:(NSString *)replacementString selectingFromIndex:(int)index
 {
-    HTMLInputElement* inputElement = [self _HTMLInputElement];
+    WebCore::HTMLInputElement* inputElement = [self _HTMLInputElement];
     if (inputElement) {
-        String newValue = inputElement->value().replace(targetRange.location, targetRange.length, replacementString);
+        WebCore::String newValue = inputElement->value().replace(targetRange.location, targetRange.length, replacementString);
         inputElement->setValue(newValue);
         inputElement->setSelectionRange(index, newValue.length());
     }
@@ -198,7 +182,7 @@ static NSView *viewForElement(DOMElement *element)
 
 - (NSRange)_selectedRange
 {
-    HTMLInputElement* inputElement = [self _HTMLInputElement];
+    WebCore::HTMLInputElement* inputElement = [self _HTMLInputElement];
     if (inputElement) {
         int start = inputElement->selectionStart();
         int end = inputElement->selectionEnd();
@@ -212,7 +196,7 @@ static NSView *viewForElement(DOMElement *element)
     // This notifies the input element that the content has been autofilled
     // This allows WebKit to obey the -webkit-autofill pseudo style, which
     // changes the background color.
-    HTMLInputElement* inputElement = [self _HTMLInputElement];
+    WebCore::HTMLInputElement* inputElement = [self _HTMLInputElement];
     if (inputElement)
         inputElement->setAutofilled(filled);
 }
index 8a4e55cf4b286b3b7dd06fe1f3e5b372a1a465fc..b01a610f9451cafaa806f577dc20f9a31f0311f5 100644 (file)
@@ -78,6 +78,7 @@
 namespace WebCore {
     class Attr;
     class CDATASection;
+    class CSSPrimitiveValue;
     class CSSRule;
     class CSSRuleList;
     class CSSStyleDeclaration;
@@ -201,10 +202,6 @@ namespace WebCore {
 - (WebCore::Document *)_document;
 @end
 
-@interface DOMDocument (WebCoreInternalExtension)
-- (DOMElement *)_ownerElement;
-@end
-
 @interface DOMDocumentFragment (WebCoreInternal)
 + (DOMDocumentFragment *)_documentFragmentWith:(WebCore::DocumentFragment *)impl;
 - (WebCore::DocumentFragment *)_documentFragment;
@@ -293,6 +290,7 @@ namespace WebCore {
 @end
 
 @interface DOMCSSPrimitiveValue (WebCoreInternal)
+- (WebCore::CSSPrimitiveValue *)_CSSPrimitiveValue;
 + (DOMCSSPrimitiveValue *)_CSSPrimitiveValueWith:(WebCore::CSSValue *)impl;
 @end
 
@@ -423,19 +421,20 @@ inline void raiseOnDOMError(WebCore::ExceptionCode ec)
         { return reinterpret_cast<class WebCore::type*>(p); }
 
 // No class should appear in this list if its base class is already here.
-ALLOW_DOM_CAST(Counter)
 ALLOW_DOM_CAST(CSSRule)
 ALLOW_DOM_CAST(CSSRuleList)
 ALLOW_DOM_CAST(CSSStyleDeclaration)
 ALLOW_DOM_CAST(CSSStyleSheet)
 ALLOW_DOM_CAST(CSSValue)
+ALLOW_DOM_CAST(Counter)
 ALLOW_DOM_CAST(DOMImplementationFront)
+ALLOW_DOM_CAST(Event)
 ALLOW_DOM_CAST(HTMLCollection)
 ALLOW_DOM_CAST(HTMLOptionsCollection)
 ALLOW_DOM_CAST(MediaList)
 ALLOW_DOM_CAST(NamedNodeMap)
-ALLOW_DOM_CAST(NodeFilter)
 ALLOW_DOM_CAST(Node)
+ALLOW_DOM_CAST(NodeFilter)
 ALLOW_DOM_CAST(NodeIterator)
 ALLOW_DOM_CAST(NodeList)
 ALLOW_DOM_CAST(Range)
index 28ed701e176d985355ce4c5196cc820291c4b4ec..263ccd5fb160c403ee073bbcc5f7d51507f1bb2a 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
+#import <WebCore/DOMException.h>
 #import <WebCore/WebScriptObject.h>
 
 @class DOMStyleSheet;
 
 typedef unsigned long long DOMTimeStamp;
 
-extern NSString * const DOMException;
-
-// DOM exception codes
-enum {
-    DOM_INDEX_SIZE_ERR                = 1,
-    DOM_DOMSTRING_SIZE_ERR            = 2,
-    DOM_HIERARCHY_REQUEST_ERR         = 3,
-    DOM_WRONG_DOCUMENT_ERR            = 4,
-    DOM_INVALID_CHARACTER_ERR         = 5,
-    DOM_NO_DATA_ALLOWED_ERR           = 6,
-    DOM_NO_MODIFICATION_ALLOWED_ERR   = 7,
-    DOM_NOT_FOUND_ERR                 = 8,
-    DOM_NOT_SUPPORTED_ERR             = 9,
-    DOM_INUSE_ATTRIBUTE_ERR           = 10,
-    DOM_INVALID_STATE_ERR             = 11,
-    DOM_SYNTAX_ERR                    = 12,
-    DOM_INVALID_MODIFICATION_ERR      = 13,
-    DOM_NAMESPACE_ERR                 = 14,
-    DOM_INVALID_ACCESS_ERR            = 15
-};
-
-
 typedef struct DOMObjectInternal DOMObjectInternal;
 
 @interface DOMObject : WebScriptObject <NSCopying>
index 4372e3b2084885d942f569a6db6b8c43d8cf8f86..4092f5931639b668a5c377ee6ff8c4b60f94f0ba 100644 (file)
@@ -52,7 +52,9 @@
 #import <WebCore/DOMHTMLStyleElementPrivate.h>
 #import <WebCore/DOMHTMLTextAreaElementPrivate.h>
 #import <WebCore/DOMKeyboardEventPrivate.h>
+#import <WebCore/DOMMouseEventPrivate.h>
 #import <WebCore/DOMNodeIteratorPrivate.h>
+#import <WebCore/DOMNodePrivate.h>
 #import <WebCore/DOMProcessingInstructionPrivate.h>
 #import <WebCore/DOMUIEventPrivate.h>
 #import <WebCore/DOMWheelEventPrivate.h>
 - (NSString *)_text;
 @end
 
-@interface DOMRGBColor (WebPrivate)
-// fast and easy way of getting an NSColor for a DOMRGBColor
-- (NSColor *)_color;
-@end
-
-@interface DOMNode (WebPrivate)
-- (BOOL)isContentEditable;
-@end
-
 @interface DOMElement (WebPrivate)
 - (NSFont *)_font;
 - (NSData *)_imageTIFFRepresentation;
index 39623cbac48f95521ca6159246d45f84576eb1c9..2162d18e5bb9413bff0db9fea60161f77bfc57a8 100644 (file)
 #import <WebCore/DOMDocument.h>
 #import <WebCore/DOMObject.h>
 
-extern NSString * const DOMRangeException;
+#import <WebCore/DOMRangeException.h>
 
+// DOM Range comparison codes
 enum {
-    //
-    // DOM range exception codes
-    //
-    DOM_BAD_BOUNDARYPOINTS_ERR        = 1,
-    DOM_INVALID_NODE_TYPE_ERR         = 2
-};
-
-enum {
-    //
-    // DOM Range comparison codes
-    //
     DOM_START_TO_START                = 0,
     DOM_START_TO_END                  = 1,
     DOM_END_TO_END                    = 2,
diff --git a/WebCore/bindings/objc/DOMRangeException.h b/WebCore/bindings/objc/DOMRangeException.h
new file mode 100644 (file)
index 0000000..33514e6
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+extern NSString * const DOMRangeException;
+
+enum DOMRangeExceptionCode {
+    DOM_BAD_BOUNDARYPOINTS_ERR        = 1,
+    DOM_INVALID_NODE_TYPE_ERR         = 2
+};
index bcbc23dc06112b0d38f11987aef7cdd1e447220d..4b625c83126c13ec601bb5b644e0faabd66a602f 100644 (file)
@@ -28,6 +28,4 @@
 #import <WebCore/DOMDocument.h>
 #import <WebCore/DOMObject.h>
 
-@interface DOMAbstractView : DOMObject
-- (DOMDocument *)document;
-@end
+#import <WebCore/DOMAbstractView.h>
index b1d09dc6836ed20bb08c8609e2e2951396c4dc94..f5472c3210ba85fedf4719cad611e082bd20ea9b 100644 (file)
 #import <WebCore/DOMDocument.h>
 #import <WebCore/DOMObject.h>
 
+#import <WebCore/DOMXPathException.h>
 #import <WebCore/DOMXPathExpression.h>
 #import <WebCore/DOMXPathNSResolver.h>
 #import <WebCore/DOMXPathResult.h>
-
-extern NSString * const DOMXPathException;
-
-enum DOMXPathExceptionCode {
-    DOM_INVALID_EXPRESSION_ERR = 51,
-    DOM_TYPE_ERR = 52
-};
diff --git a/WebCore/bindings/objc/DOMXPathException.h b/WebCore/bindings/objc/DOMXPathException.h
new file mode 100644 (file)
index 0000000..f38f6f5
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+extern NSString * const DOMXPathException;
+
+enum DOMXPathExceptionCode {
+    DOM_INVALID_EXPRESSION_ERR      = 51,
+    DOM_TYPE_ERR                    = 52
+};
index e1d34b401de36fd34bef05e1a6d7399b8fd92dd4..3a8a9f4fe5df787086940e49ae76c8213c562161 100644 (file)
@@ -44,365 +44,363 @@ my $document = 0; # Will hold the resulting 'idlDocument'
 # Default Constructor
 sub new
 {
-  my $object = shift;
-  my $reference = { };
+    my $object = shift;
+    my $reference = { };
 
-  $document = 0;
-  $beQuiet = shift;
+    $document = 0;
+    $beQuiet = shift;
 
-  bless($reference, $object);
-  return $reference;
+    bless($reference, $object);
+    return $reference;
 }
 
 # Returns the parsed 'idlDocument'
 sub Parse
 {
-  my $object = shift;
-  my $fileName = shift;
-  my $defines = shift;
-  
-  print " | *** Starting to parse $fileName...\n |\n" if(!$beQuiet);
+    my $object = shift;
+    my $fileName = shift;
+    my $defines = shift;
 
-  open FILE, "-|", "/usr/bin/gcc", "-E", "-P", "-x", "c++", 
-      (map { "-D$_" } split(/ /, $defines)), $fileName or die "Could not open $fileName";
-  my @documentContent = <FILE>;
-  close FILE;
+    print " | *** Starting to parse $fileName...\n |\n" unless $beQuiet;
 
-  my $dataAvailable = 0;
+    open FILE, "-|", "/usr/bin/gcc", "-E", "-P", "-x", "c++", 
+        (map { "-D$_" } split(/ /, $defines)), $fileName or die "Could not open $fileName";
+    my @documentContent = <FILE>;
+    close FILE;
 
-  # Simple IDL Parser (tm)
-  foreach(@documentContent) {
-    my $newParseMode = $object->DetermineParseMode($_);
+    my $dataAvailable = 0;
 
-    if($newParseMode ne MODE_UNDEF) {
-      if($dataAvailable eq 0) {
-        $dataAvailable = 1; # Start node building...
-      } else {
-        $object->ProcessSection();
-      }
-    }
+    # Simple IDL Parser (tm)
+    foreach (@documentContent) {
+        my $newParseMode = $object->DetermineParseMode($_);
+
+        if ($newParseMode ne MODE_UNDEF) {
+            if ($dataAvailable eq 0) {
+                $dataAvailable = 1; # Start node building...
+            } else {
+                $object->ProcessSection();
+            }
+        }
 
-    # Update detected data stream mode...
-    if($newParseMode ne MODE_UNDEF) {
-      $parseMode = $newParseMode;
+        # Update detected data stream mode...
+        if ($newParseMode ne MODE_UNDEF) {
+            $parseMode = $newParseMode;
+        }
+
+        push(@temporaryContent, $_);
     }
 
-    push(@temporaryContent, $_);
-  }
+    # Check if there is anything remaining to parse...
+    if (($parseMode ne MODE_UNDEF) and ($#temporaryContent > 0)) {
+        $object->ProcessSection();
+    }
 
-  # Check if there is anything remaining to parse...
-  if(($parseMode ne MODE_UNDEF) and ($#temporaryContent > 0)) {
-    $object->ProcessSection();
-  }
+    print " | *** Finished parsing!\n" unless $beQuiet;
+    $document->fileName($fileName);
 
-  print " | *** Finished parsing!\n" if(!$beQuiet);
-  
-  $document->fileName($fileName);
-  
-  return $document;
+    return $document;
 }
 
 sub ParseModule
 {
-  my $object = shift;
-  my $dataNode = shift;
+    my $object = shift;
+    my $dataNode = shift;
 
-  print " |- Trying to parse module...\n" if(!$beQuiet);
+    print " |- Trying to parse module...\n" unless $beQuiet;
 
-  my $data = join("", @temporaryContent);
-  $data =~ /$IDLStructure::moduleSelector/;
+    my $data = join("", @temporaryContent);
+    $data =~ /$IDLStructure::moduleSelector/;
 
-  my $moduleName = (defined($1) ? $1 : die("Parsing error!\nSource:\n$data\n)"));
-  $dataNode->module($moduleName);
+    my $moduleName = (defined($1) ? $1 : die("Parsing error!\nSource:\n$data\n)"));
+    $dataNode->module($moduleName);
 
-  print "  |----> Module; NAME \"$moduleName\"\n |-\n |\n" if(!$beQuiet);
+    print "  |----> Module; NAME \"$moduleName\"\n |-\n |\n" unless $beQuiet;
 }
 
 sub dumpExtendedAttributes
 {
-  my $padStr = shift;
-  my $attrs = shift;
+    my $padStr = shift;
+    my $attrs = shift;
 
-  if (!%{$attrs}) {
-    return "";
-  }
+    if (!%{$attrs}) {
+        return "";
+    }
 
-  my @temp;
-  while (($name, $value) = each(%{$attrs})) {
-    push(@temp, "$name=$value");
-  }
-  
-  return $padStr . "[" . join(", ", @temp) . "]";
+    my @temp;
+    while (($name, $value) = each(%{$attrs})) {
+        push(@temp, "$name=$value");
+    }
+
+    return $padStr . "[" . join(", ", @temp) . "]";
 }
 
 sub parseExtendedAttributes
 {
-  my $str = shift;
-  $str =~ s/\[\s*(.*)\]/$1/g;
-  
-  my %attrs = ();
-  
-  foreach my $value (split(/\s*,\s*/, $str)) {
-    ($name,$value) = split(/\s*=\s*/,$value,2);
+    my $str = shift;
+    $str =~ s/\[\s*(.*)\]/$1/g;
 
-    # Attributes with no value are set to be true
-    $value = 1 unless defined $value;
-    $attrs{$name} = $value;
-  }
-  
-  return \%attrs;
+    my %attrs = ();
+
+    foreach my $value (split(/\s*,\s*/, $str)) {
+        ($name,$value) = split(/\s*=\s*/, $value, 2);
+
+        # Attributes with no value are set to be true
+        $value = 1 unless defined $value;
+        $attrs{$name} = $value;
+    }
+
+    return \%attrs;
 }
 
 sub ParseInterface
 {
-  my $object = shift;
-  my $dataNode = shift;
-  my $sectionName = shift;
+    my $object = shift;
+    my $dataNode = shift;
+    my $sectionName = shift;
 
-  my $data = join("", @temporaryContent);
+    my $data = join("", @temporaryContent);
 
-  # Look for end-of-interface mark
-  $data =~ /};/g;
-  $data = substr($data, index($data, $sectionName), pos($data) - length($data));
+    # Look for end-of-interface mark
+    $data =~ /};/g;
+    $data = substr($data, index($data, $sectionName), pos($data) - length($data));
 
-  $data =~ s/[\n\r]//g;
+    $data =~ s/[\n\r]//g;
 
-  # Beginning of the regexp parsing magic
-  if($sectionName eq "exception") {
-    print " |- Trying to parse exception...\n" if(!$beQuiet);
+    # Beginning of the regexp parsing magic
+    if ($sectionName eq "exception") {
+        print " |- Trying to parse exception...\n" unless $beQuiet;
 
-    my $exceptionName = ""; my $exceptionData = "";
-    my $exceptionDataName = ""; my $exceptionDataType = "";
-  
-    # Match identifier of the exception, and enclosed data...
-    $data =~ /$IDLStructure::exceptionSelector/;
-    $exceptionName = (defined($1) ? $1 : die("Parsing error!\nSource:\n$data\n)"));
-    $exceptionData = (defined($2) ? $2 : die("Parsing error!\nSource:\n$data\n)"));
+        my $exceptionName = "";
+        my $exceptionData = "";
+        my $exceptionDataName = "";
+        my $exceptionDataType = "";
 
-    ('' =~ /^/); # Reset variables needed for regexp matching
+        # Match identifier of the exception, and enclosed data...
+        $data =~ /$IDLStructure::exceptionSelector/;
+        $exceptionName = (defined($1) ? $1 : die("Parsing error!\nSource:\n$data\n)"));
+        $exceptionData = (defined($2) ? $2 : die("Parsing error!\nSource:\n$data\n)"));
 
-    # ... parse enclosed data (get. name & type)
-    $exceptionData =~ /$IDLStructure::exceptionSubSelector/;
-    $exceptionDataType = (defined($1) ? $1 : die("Parsing error!\nSource:\n$data\n)"));
-    $exceptionDataName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$data\n)"));
+        ('' =~ /^/); # Reset variables needed for regexp matching
 
-    # Fill in domClass datastructure
-    $dataNode->name($exceptionName);
+        # ... parse enclosed data (get. name & type)
+        $exceptionData =~ /$IDLStructure::exceptionSubSelector/;
+        $exceptionDataType = (defined($1) ? $1 : die("Parsing error!\nSource:\n$data\n)"));
+        $exceptionDataName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$data\n)"));
 
-    my $newDataNode = new domAttribute();
-    $newDataNode->type("readonly attribute");
-    $newDataNode->signature(new domSignature());
+        # Fill in domClass datastructure
+        $dataNode->name($exceptionName);
 
-    $newDataNode->signature->name($exceptionDataName);
-    $newDataNode->signature->type($exceptionDataType);
-    $newDataNode->signature->hasPtrFlag(0);
+        my $newDataNode = new domAttribute();
+        $newDataNode->type("readonly attribute");
+        $newDataNode->signature(new domSignature());
 
-    my $arrayRef = $dataNode->attributes;
-    push(@$arrayRef, $newDataNode);
+        $newDataNode->signature->name($exceptionDataName);
+        $newDataNode->signature->type($exceptionDataType);
 
-    print "  |----> Exception; NAME \"$exceptionName\" DATA TYPE \"$exceptionDataType\" DATA NAME \"$exceptionDataName\"\n |-\n |\n" if(!$beQuiet);
-  } elsif($sectionName eq "interface") {
-    print " |- Trying to parse interface...\n" if(!$beQuiet);
+        my $arrayRef = $dataNode->attributes;
+        push(@$arrayRef, $newDataNode);
 
-    my $interfaceName = "";
-    my $interfaceData = "";
-    
-    # Match identifier of the interface, and enclosed data...
-    $data =~ /$IDLStructure::interfaceSelector/;
-    
-    $interfaceExtendedAttributes = (defined($1) ? $1 : " "); chop($interfaceExtendedAttributes);
-    $interfaceName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$data\n)"));
-    $interfaceBase = (defined($3) ? $3 : "");
-    $interfaceData = (defined($4) ? $4 : die("Parsing error!\nSource:\n$data\n)"));
-
-    # Fill in known parts of the domClass datastructure now...
-    $dataNode->name($interfaceName);
-    $dataNode->extendedAttributes(parseExtendedAttributes($interfaceExtendedAttributes));
-
-    # Inheritance detection
-    my @interfaceParents = split(/,/, $interfaceBase);
-    foreach(@interfaceParents) {
-      my $line = $_;
-      $line =~ s/\s*//g;
-
-      my $arrayRef = $dataNode->parents;
-      push(@$arrayRef, $line);
-    }
+        print "  |----> Exception; NAME \"$exceptionName\" DATA TYPE \"$exceptionDataType\" DATA NAME \"$exceptionDataName\"\n |-\n |\n" unless $beQuiet;
+    } elsif ($sectionName eq "interface") {
+        print " |- Trying to parse interface...\n" unless $beQuiet;
 
-    $interfaceData =~ s/[\n\r]//g;
-    my @interfaceMethods = split(/;/, $interfaceData);
+        my $interfaceName = "";
+        my $interfaceData = "";
 
-    foreach(@interfaceMethods) {
-      my $line = $_;
+        # Match identifier of the interface, and enclosed data...
+        $data =~ /$IDLStructure::interfaceSelector/;
 
-      if($line =~ /attribute/) {
-        $line =~ /$IDLStructure::interfaceAttributeSelector/;
+        $interfaceExtendedAttributes = (defined($1) ? $1 : " "); chop($interfaceExtendedAttributes);
+        $interfaceName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$data\n)"));
+        $interfaceBase = (defined($3) ? $3 : "");
+        $interfaceData = (defined($4) ? $4 : die("Parsing error!\nSource:\n$data\n)"));
 
-        my $attributeType = (defined($1) ? $1 : die("Parsing error!\nSource:\n$line\n)"));
-        my $attributeExtendedAttributes = (defined($2) ? $2 : " "); chop($attributeExtendedAttributes);
-        
-        my $attributeDataType = (defined($3) ? $3 : die("Parsing error!\nSource:\n$line\n)"));
-        my $attributeDataName = (defined($4) ? $4 : die("Parsing error!\nSource:\n$line\n)"));
-          
-        ('' =~ /^/); # Reset variables needed for regexp matching
-        
-        $line =~ /$IDLStructure::getterRaisesSelector/;
-        my $getterException = (defined($1) ? $1 : "");
-      
-        $line =~ /$IDLStructure::setterRaisesSelector/;
-        my $setterException = (defined($1) ? $1 : "");
-      
-        my $newDataNode = new domAttribute();
-        $newDataNode->type($attributeType);
-        $newDataNode->signature(new domSignature());
+        # Fill in known parts of the domClass datastructure now...
+        $dataNode->name($interfaceName);
+        $dataNode->extendedAttributes(parseExtendedAttributes($interfaceExtendedAttributes));
 
-        $newDataNode->signature->name($attributeDataName);
-        $newDataNode->signature->type($attributeDataType);
-        $newDataNode->signature->extendedAttributes(parseExtendedAttributes($attributeExtendedAttributes));
+        # Inheritance detection
+        my @interfaceParents = split(/,/, $interfaceBase);
+        foreach(@interfaceParents) {
+            my $line = $_;
+            $line =~ s/\s*//g;
 
-        my $arrayRef = $dataNode->attributes;
-        push(@$arrayRef, $newDataNode);
+            my $arrayRef = $dataNode->parents;
+            push(@$arrayRef, $line);
+        }
 
-        print "  |  |>  Attribute; TYPE \"$attributeType\" DATA NAME \"$attributeDataName\" DATA TYPE \"$attributeDataType\" GET EXCEPTION? \"$getterException\" SET EXCEPTION? \"$setterException\"" .
-              dumpExtendedAttributes("\n  |                 ", $newDataNode->signature->extendedAttributes) . "\n" if(!$beQuiet);
-
-        $getterException =~ s/\s+//g;
-        $setterException =~ s/\s+//g;
-        @{$newDataNode->getterExceptions} = split(/,/, $getterException);
-        @{$newDataNode->setterExceptions} = split(/,/, $setterException);
-      } elsif(($line !~ s/^\s*$//g) and ($line !~ /^\s+const/)) {
-        $line =~ /$IDLStructure::interfaceMethodSelector/ or die "Parsing error!\nSource:\n$line\n)";
-
-        my $methodExtendedAttributes = (defined($1) ? $1 : " "); chop($methodExtendedAttributes);
-        my $methodType = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));
-        my $methodName = (defined($3) ? $3 : die("Parsing error!\nSource:\n$line\n)"));
-        my $methodSignature = (defined($4) ? $4 : die("Parsing error!\nSource:\n$line\n)"));
-        
-        ('' =~ /^/); # Reset variables needed for regexp matching
-        
-        $line =~ /$IDLStructure::raisesSelector/;
-        my $methodException = (defined($1) ? $1 : "");
+        $interfaceData =~ s/[\n\r]//g;
+        my @interfaceMethods = split(/;/, $interfaceData);
 
-        my $newDataNode = new domFunction();
+        foreach my $line (@interfaceMethods) {
+            if ($line =~ /attribute/) {
+                $line =~ /$IDLStructure::interfaceAttributeSelector/;
 
-        $newDataNode->signature(new domSignature());
-        $newDataNode->signature->name($methodName);
-        $newDataNode->signature->type($methodType);
-        $newDataNode->signature->extendedAttributes(parseExtendedAttributes($methodExtendedAttributes));
+                my $attributeType = (defined($1) ? $1 : die("Parsing error!\nSource:\n$line\n)"));
+                my $attributeExtendedAttributes = (defined($2) ? $2 : " "); chop($attributeExtendedAttributes);
 
-        print "  |  |-  Method; TYPE \"$methodType\" NAME \"$methodName\" EXCEPTION? \"$methodException\"" .
-          dumpExtendedAttributes("\n  |              ", $newDataNode->signature->extendedAttributes) . "\n" if(!$beQuiet);
+                my $attributeDataType = (defined($3) ? $3 : die("Parsing error!\nSource:\n$line\n)"));
+                my $attributeDataName = (defined($4) ? $4 : die("Parsing error!\nSource:\n$line\n)"));
+  
+                ('' =~ /^/); # Reset variables needed for regexp matching
 
-        $methodException =~ s/\s+//g;
-        @{$newDataNode->raisesExceptions} = split(/,/, $methodException);
+                $line =~ /$IDLStructure::getterRaisesSelector/;
+                my $getterException = (defined($1) ? $1 : "");
 
-        my @params = split(/,/, $methodSignature);
-        foreach(@params) {
-          my $line = $_;
+                $line =~ /$IDLStructure::setterRaisesSelector/;
+                my $setterException = (defined($1) ? $1 : "");
 
-          $line =~ /$IDLStructure::interfaceParameterSelector/;
-          my $paramExtendedAttributes = (defined($1) ? $1 : " "); chop($paramExtendedAttributes);
-          my $paramType = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));
-          my $paramName = (defined($3) ? $3 : die("Parsing error!\nSource:\n$line\n)"));
+                my $newDataNode = new domAttribute();
+                $newDataNode->type($attributeType);
+                $newDataNode->signature(new domSignature());
 
-          my $paramDataNode = new domSignature();
-          $paramDataNode->name($paramName);
-          $paramDataNode->type($paramType);
-          $paramDataNode->extendedAttributes(parseExtendedAttributes($paramExtendedAttributes));
+                $newDataNode->signature->name($attributeDataName);
+                $newDataNode->signature->type($attributeDataType);
+                $newDataNode->signature->extendedAttributes(parseExtendedAttributes($attributeExtendedAttributes));
 
-          my $arrayRef = $newDataNode->parameters;
-          push(@$arrayRef, $paramDataNode);
+                my $arrayRef = $dataNode->attributes;
+                push(@$arrayRef, $newDataNode);
 
-          print "  |   |>  Param; TYPE \"$paramType\" NAME \"$paramName\"" . 
-            dumpExtendedAttributes("\n  |              ", $paramDataNode->extendedAttributes) . "\n" if(!$beQuiet);          
-        }
+                print "  |  |>  Attribute; TYPE \"$attributeType\" DATA NAME \"$attributeDataName\" DATA TYPE \"$attributeDataType\" GET EXCEPTION? \"$getterException\" SET EXCEPTION? \"$setterException\"" .
+                    dumpExtendedAttributes("\n  |                 ", $newDataNode->signature->extendedAttributes) . "\n" unless $beQuiet;
 
-        my $arrayRef = $dataNode->functions;
-        push(@$arrayRef, $newDataNode);
-      } elsif($line =~ /^\s+const/) {
-        $line =~ /$IDLStructure::constantSelector/;
-        my $constType = (defined($1) ? $1 : die("Parsing error!\nSource:\n$line\n)"));
-        my $constName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));
-        my $constValue = (defined($3) ? $3 : die("Parsing error!\nSource:\n$line\n)"));
-
-        my $newDataNode = new domConstant();
-        $newDataNode->name($constName);
-        $newDataNode->type($constType);
-        $newDataNode->value($constValue);
-
-        my $arrayRef = $dataNode->constants;
-        push(@$arrayRef, $newDataNode);
+                $getterException =~ s/\s+//g;
+                $setterException =~ s/\s+//g;
+                @{$newDataNode->getterExceptions} = split(/,/, $getterException);
+                @{$newDataNode->setterExceptions} = split(/,/, $setterException);
+            } elsif (($line !~ s/^\s*$//g) and ($line !~ /^\s+const/)) {
+                $line =~ /$IDLStructure::interfaceMethodSelector/ or die "Parsing error!\nSource:\n$line\n)";
 
-        print "  |   |>  Constant; TYPE \"$constType\" NAME \"$constName\" VALUE \"$constValue\"\n" if(!$beQuiet);
-      }
-    }
+                my $methodExtendedAttributes = (defined($1) ? $1 : " "); chop($methodExtendedAttributes);
+                my $methodType = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));
+                my $methodName = (defined($3) ? $3 : die("Parsing error!\nSource:\n$line\n)"));
+                my $methodSignature = (defined($4) ? $4 : die("Parsing error!\nSource:\n$line\n)"));
+
+                ('' =~ /^/); # Reset variables needed for regexp matching
+
+                $line =~ /$IDLStructure::raisesSelector/;
+                my $methodException = (defined($1) ? $1 : "");
+
+                my $newDataNode = new domFunction();
+
+                $newDataNode->signature(new domSignature());
+                $newDataNode->signature->name($methodName);
+                $newDataNode->signature->type($methodType);
+                $newDataNode->signature->extendedAttributes(parseExtendedAttributes($methodExtendedAttributes));
+
+                print "  |  |-  Method; TYPE \"$methodType\" NAME \"$methodName\" EXCEPTION? \"$methodException\"" .
+                    dumpExtendedAttributes("\n  |              ", $newDataNode->signature->extendedAttributes) . "\n" unless $beQuiet;
 
-    print "  |----> Interface; NAME \"$interfaceName\"" .
-          dumpExtendedAttributes("\n  |                 ", $dataNode->extendedAttributes) . "\n |-\n |\n" if(!$beQuiet);
-  }
+                $methodException =~ s/\s+//g;
+                @{$newDataNode->raisesExceptions} = split(/,/, $methodException);
+
+                my @params = split(/,/, $methodSignature);
+                foreach(@params) {
+                    my $line = $_;
+
+                    $line =~ /$IDLStructure::interfaceParameterSelector/;
+                    my $paramExtendedAttributes = (defined($1) ? $1 : " "); chop($paramExtendedAttributes);
+                    my $paramType = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));
+                    my $paramName = (defined($3) ? $3 : die("Parsing error!\nSource:\n$line\n)"));
+
+                    my $paramDataNode = new domSignature();
+                    $paramDataNode->name($paramName);
+                    $paramDataNode->type($paramType);
+                    $paramDataNode->extendedAttributes(parseExtendedAttributes($paramExtendedAttributes));
+
+                    my $arrayRef = $newDataNode->parameters;
+                    push(@$arrayRef, $paramDataNode);
+
+                    print "  |   |>  Param; TYPE \"$paramType\" NAME \"$paramName\"" . 
+                        dumpExtendedAttributes("\n  |              ", $paramDataNode->extendedAttributes) . "\n" unless $beQuiet;          
+                }
+
+                my $arrayRef = $dataNode->functions;
+                push(@$arrayRef, $newDataNode);
+            } elsif ($line =~ /^\s+const/) {
+                $line =~ /$IDLStructure::constantSelector/;
+                my $constType = (defined($1) ? $1 : die("Parsing error!\nSource:\n$line\n)"));
+                my $constName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));
+                my $constValue = (defined($3) ? $3 : die("Parsing error!\nSource:\n$line\n)"));
+
+                my $newDataNode = new domConstant();
+                $newDataNode->name($constName);
+                $newDataNode->type($constType);
+                $newDataNode->value($constValue);
+
+                my $arrayRef = $dataNode->constants;
+                push(@$arrayRef, $newDataNode);
+
+                print "  |   |>  Constant; TYPE \"$constType\" NAME \"$constName\" VALUE \"$constValue\"\n" unless $beQuiet;
+            }
+        }
+
+        print "  |----> Interface; NAME \"$interfaceName\"" .
+            dumpExtendedAttributes("\n  |                 ", $dataNode->extendedAttributes) . "\n |-\n |\n" unless $beQuiet;
+    }
 }
 
 # Internal helper
 sub DetermineParseMode
 {
-  my $object = shift;  
-  my $line = shift;
-
-  my $mode = MODE_UNDEF;
-  if($_ =~ /module/) {
-    $mode = MODE_MODULE;
-  } elsif($_ =~ /interface/) {
-    $mode = MODE_INTERFACE;
-  } elsif($_ =~ /exception/) {
-    $mode = MODE_EXCEPTION;
-  } elsif($_ =~ /alias/) {
-    $mode = MODE_ALIAS;
-  }
-
-  return $mode;
+    my $object = shift;  
+    my $line = shift;
+
+    my $mode = MODE_UNDEF;
+    if ($_ =~ /module/) {
+        $mode = MODE_MODULE;
+    } elsif ($_ =~ /interface/) {
+        $mode = MODE_INTERFACE;
+    } elsif ($_ =~ /exception/) {
+        $mode = MODE_EXCEPTION;
+    } elsif ($_ =~ /alias/) {
+        $mode = MODE_ALIAS;
+    }
+
+    return $mode;
 }
 
 # Internal helper
 sub ProcessSection
 {
-  my $object = shift;
+    my $object = shift;
   
-  if($parseMode eq MODE_MODULE) {
-    die ("Two modules in one file! Fatal error!\n") if($document ne 0);
-    $document = new idlDocument();
-    $object->ParseModule($document);
-  } elsif($parseMode eq MODE_INTERFACE) {
-    my $node = new domClass();
-    $object->ParseInterface($node, "interface");
+    if ($parseMode eq MODE_MODULE) {
+        die ("Two modules in one file! Fatal error!\n") if ($document ne 0);
+        $document = new idlDocument();
+        $object->ParseModule($document);
+    } elsif ($parseMode eq MODE_INTERFACE) {
+        my $node = new domClass();
+        $object->ParseInterface($node, "interface");
     
-    die ("No module specified! Fatal Error!\n") if($document eq 0);
-    my $arrayRef = $document->classes;
-    push(@$arrayRef, $node);
-  } elsif($parseMode eq MODE_EXCEPTION) {
-    my $node = new domClass();
-    $object->ParseInterface($node, "exception");
-
-    die ("No module specified! Fatal Error!\n") if($document eq 0);
-    my $arrayRef = $document->classes;
-    push(@$arrayRef, $node);
-  } elsif($parseMode eq MODE_ALIAS) {
-    print " |- Trying to parse alias...\n" if(!$beQuiet);
+        die ("No module specified! Fatal Error!\n") if ($document eq 0);
+        my $arrayRef = $document->classes;
+        push(@$arrayRef, $node);
+    } elsif($parseMode eq MODE_EXCEPTION) {
+        my $node = new domClass();
+        $object->ParseInterface($node, "exception");
+
+        die ("No module specified! Fatal Error!\n") if ($document eq 0);
+        my $arrayRef = $document->classes;
+        push(@$arrayRef, $node);
+    } elsif($parseMode eq MODE_ALIAS) {
+        print " |- Trying to parse alias...\n" unless $beQuiet;
     
-    my $line = join("", @temporaryContent);
-    $line =~ /$IDLStructure::aliasSelector/;
+        my $line = join("", @temporaryContent);
+        $line =~ /$IDLStructure::aliasSelector/;
 
-    my $interfaceName = (defined($1) ? $1 : die("Parsing error!\nSource:\n$line\n)"));
-    my $wrapperName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));
+        my $interfaceName = (defined($1) ? $1 : die("Parsing error!\nSource:\n$line\n)"));
+        my $wrapperName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));
     
-    print "  |----> Alias; INTERFACE \"$interfaceName\" WRAPPER \"$wrapperName\"\n |-\n |\n" if(!$beQuiet);
+        print "  |----> Alias; INTERFACE \"$interfaceName\" WRAPPER \"$wrapperName\"\n |-\n |\n" unless $beQuiet;
 
-    # FIXME: Check if alias is already in aliases
-    my $aliases = $document->aliases;
-    $aliases->{$interfaceName} = $wrapperName;
-  }
+        # FIXME: Check if alias is already in aliases
+        my $aliases = $document->aliases;
+        $aliases->{$interfaceName} = $wrapperName;
+    }
 
-  @temporaryContent = "";
+    @temporaryContent = "";
 }
 
 1;
-
index 028d1b9b48380a8f6e6e7670fc3855920a0077ba..59929c53ab34eddf77cfb149e8e1209cdf1e125e 100644 (file)
@@ -110,6 +110,11 @@ module core {
         DOMUserData        getUserData(in DOMString key);
 #endif /* !defined(LANGUAGE_OBJECTIVE_C) */
 #endif /* !defined(LANGUAGE_JAVASCRIPT) */
+
+#if defined(LANGUAGE_OBJECTIVE_C)
+        // Objective-C extensions
+        readonly attribute boolean         isContentEditable;
+#endif /* defined(LANGUAGE_OBJECTIVE_C) */
     };
 
 }
index 534f0e9675ecef7f94522a0c01720e7e1f1b7022..b6aa3357096feddb4840fa58333fb2446613f556 100644 (file)
@@ -1,3 +1,12 @@
+2006-09-18  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Tim H.
+
+        Patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10903
+        Yet Another Objective-C Bindings Patch
+
+        * MigrateHeaders.make:
+
 2006-09-17  David Harrison  <harrison@apple.com>
 
         Reviewed by John Sullivan.
index 1911da3d7d61f07de1f66dd7d5a66f77f89ccc3f..80805ed9595384198bff6b16b8348e7fe00c96f5 100644 (file)
@@ -33,6 +33,7 @@ PRIVATE_HEADERS_DIR = $(TARGET_BUILD_DIR)/$(PRIVATE_HEADERS_FOLDER_PATH)
 .PHONY : all
 all : \
     $(PUBLIC_HEADERS_DIR)/DOM.h \
+    $(PUBLIC_HEADERS_DIR)/DOMAbstractView.h \
     $(PUBLIC_HEADERS_DIR)/DOMAttr.h \
     $(PUBLIC_HEADERS_DIR)/DOMCDATASection.h \
     $(PUBLIC_HEADERS_DIR)/DOMCSS.h \
@@ -64,9 +65,11 @@ all : \
     $(PUBLIC_HEADERS_DIR)/DOMEntity.h \
     $(PUBLIC_HEADERS_DIR)/DOMEntityReference.h \
     $(PUBLIC_HEADERS_DIR)/DOMEvent.h \
+    $(PUBLIC_HEADERS_DIR)/DOMEventException.h \
     $(PUBLIC_HEADERS_DIR)/DOMEventListener.h \
     $(PUBLIC_HEADERS_DIR)/DOMEventTarget.h \
     $(PUBLIC_HEADERS_DIR)/DOMEvents.h \
+    $(PUBLIC_HEADERS_DIR)/DOMException.h \
     $(PUBLIC_HEADERS_DIR)/DOMExtensions.h \
     $(PUBLIC_HEADERS_DIR)/DOMHTML.h \
     $(PUBLIC_HEADERS_DIR)/DOMHTMLAnchorElement.h \
@@ -160,6 +163,7 @@ all : \
     $(PRIVATE_HEADERS_DIR)/DOMProcessingInstructionPrivate.h \
     $(PUBLIC_HEADERS_DIR)/DOMRGBColor.h \
     $(PUBLIC_HEADERS_DIR)/DOMRange.h \
+    $(PUBLIC_HEADERS_DIR)/DOMRangeException.h \
     $(PUBLIC_HEADERS_DIR)/DOMRect.h \
     $(PUBLIC_HEADERS_DIR)/DOMStyleSheet.h \
     $(PUBLIC_HEADERS_DIR)/DOMStyleSheetList.h \
@@ -173,6 +177,7 @@ all : \
     $(PUBLIC_HEADERS_DIR)/DOMWheelEvent.h \
     $(PRIVATE_HEADERS_DIR)/DOMWheelEventPrivate.h \
     $(PUBLIC_HEADERS_DIR)/DOMXPath.h \
+    $(PUBLIC_HEADERS_DIR)/DOMXPathException.h \
     $(PUBLIC_HEADERS_DIR)/DOMXPathExpression.h \
     $(PUBLIC_HEADERS_DIR)/DOMXPathNSResolver.h \
     $(PUBLIC_HEADERS_DIR)/DOMXPathResult.h \