[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:27:37 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 03a86c79c1cf4a3caa53c1d3779295ef568648c1
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 26 19:16:09 2004 +0000

    WebCore:
    
            Reviewed by Chris
    
            * WebCore.pbproj/project.pbxproj:
            * khtml/xml/dom2_rangeimpl.h: Now includes createInstance glue function as do the other
            khtml DOM objects that we reflect into ObjC.
            * kwq/DOM-compat.h: Added. Compatibility declarations for DOM SPI. Note that this file
            is copied into WebKit by the build system as needed.
            * kwq/DOM.h: Added. New home for DOM SPI. Note that this file is copied into WebKit by the build
            system as needed.
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::recordFormValue): Updated usage to new DOM SPI.
            * kwq/WebCoreBridge.h: Updated usage to new DOM SPI.
            * kwq/WebCoreBridge.mm: Updated usage to new DOM SPI. Needed to add DOM range impl include since
            includes jiggered around and this needed header was no longer included indirectly.
            (-[WebCoreBridge elementForView:]): Ditto.
            (inputElementFromDOMElement): Ditto.
            (formElementFromDOMElement): Ditto.
            (-[WebCoreBridge elementWithName:inForm:]): Ditto.
            (-[WebCoreBridge elementDoesAutoComplete:]): Ditto.
            (-[WebCoreBridge elementIsPassword:]): Ditto.
            (-[WebCoreBridge currentForm]): Ditto.
            (-[WebCoreBridge controlsInForm:]): Ditto.
            (-[WebCoreBridge searchForLabels:beforeElement:]): Ditto.
            (-[WebCoreBridge matchLabels:againstElement:]): Ditto.
            (-[WebCoreBridge elementAtPoint:]): Ditto.
            (-[WebCoreBridge DOMDocument]): Ditto.
            (-[WebCoreBridge setSelectionFrom:startOffset:to:endOffset:]): Ditto.
            (-[WebCoreBridge attributedStringFrom:startOffset:to:endOffset:]): Ditto.
            (-[WebCoreBridge selectionStart]): Ditto.
            (-[WebCoreBridge selectionEnd]): Ditto.
            * kwq/WebCoreDOM.h: New home for all private declarations needed for reflecting DOM into ObjC.
            * kwq/WebCoreDOM.mm: Added. New home for all implementations needed for reflecting DOM into ObjC.
            * kwq/WebCoreDOMDocument.mm: Removed. All ObjC DOM implementation now in WebCoreDOM.mm.
            * kwq/WebCoreDOMNode.mm: Removed. All ObjC DOM implementation now in WebCoreDOM.mm.
            * kwq/WebCoreDOMPrivate.h: Removed.
            * kwq/WebDOMDocument.h: Removed.
            * kwq/WebDOMElement.h: Removed.
            * kwq/WebDOMNode.h: Removed.
    
    WebKit:
    
            Reviewed by Chris
    
            Updated usage of DOM SPI to use new names and conventions.
    
            Unless indicated otherwise, the changes were to update protocol names for, which
            changed from using a "WebDOM" prefix to a "DOM" prefix, and changing now need
            only include the DOM.h header from WebKit to get everything.
    
            * DOM.subproj/DOM-compat.h: Added. This header contains some compatibility declarations
            to work with older clients of our DOM SPI. Though this file is checked into WebKit,
            it really lives and should be updated in WebCore. It is copied into WebKit by the build
            system as needed.
            * DOM.subproj/DOM.h: Added. This file includes the new "guts" of the DOM SPI. As above,
            this file is checked into WebKit, it really lives and should be updated in WebCore.
            It is copied into WebKit by the build system as needed.
            * DOM.subproj/WebDOMDocument.h: Removed declarations. Now just includes DOM.h and DOM-compat.h
            * DOM.subproj/WebDOMDocument.m: Removed.
            * DOM.subproj/WebDOMElement.h: Removed declarations. Now just includes DOM.h and DOM-compat.h
            * DOM.subproj/WebDOMElement.m: Removed.
            * DOM.subproj/WebDOMNode.h: Removed declarations. Now just includes DOM.h and DOM-compat.h
            * DOM.subproj/WebDOMNode.m: Removed.
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge loadURL:referrer:reload:onLoadEvent:target:triggeringEvent:form:formValues:])
            (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:])
            * WebKit.pbproj/project.pbxproj:
            * WebView.subproj/WebDefaultContextMenuDelegate.m:
            * WebView.subproj/WebFormDelegate.h:
            * WebView.subproj/WebFormDelegate.m:
            (-[WebFormDelegate frame:sourceFrame:willSubmitForm:withValues:submissionListener:])
            * WebView.subproj/WebFrame.h: Unrelated change. Removed -undoManager accessor from public header. Moved to private header.
            * WebView.subproj/WebFrame.m:
            (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:])
            (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:])
            (-[WebFrame undoManager]): Moved -undoManager accessor to private category implementation.
            (-[WebFormState initWithForm:values:sourceFrame:])
            (-[WebFormState form])
            (-[WebFrame childFrames])
            * WebView.subproj/WebFramePrivate.h: Moved in -undoManager accessor.
            * WebView.subproj/WebHTMLRepresentation.h:
            * WebView.subproj/WebHTMLRepresentation.m:
            (-[WebHTMLRepresentation DOMDocument])
            (-[WebHTMLRepresentation setSelectionFrom:startOffset:to:endOffset:])
            (-[WebHTMLRepresentation attributedStringFrom:startOffset:to:endOffset:])
            (-[WebHTMLRepresentation elementWithName:inForm:])
            (-[WebHTMLRepresentation elementForView:])
            (-[WebHTMLRepresentation elementDoesAutoComplete:])
            (-[WebHTMLRepresentation elementIsPassword:])
            (-[WebHTMLRepresentation formForElement:])
            (-[WebHTMLRepresentation controlsInForm:])
            (-[WebHTMLRepresentation searchForLabels:beforeElement:])
            (-[WebHTMLRepresentation matchLabels:againstElement:])
            * WebView.subproj/WebHTMLView.m:
            * copy-webcore-files-to-webkit: Added. Copies DOM.h and DOM-compat.h from WebCore when they
            have been updated there.
    
    WebBrowser:
    
            Reviewed by Chris
    
            Updated usage of DOM SPI to use new names and conventions.
    
            In each case, protocol names for DOM objects were changed from using a
            "WebDOM" prefix to a "DOM" prefix, and clients now need only include the
            DOM.h header from WebKit to get everything.
    
            * BrowserWebController.m:
            (-[FormDelegate frame:sourceFrame:willSubmitForm:withValues:submissionListener:])
            * Debug/SnippetController.m:
            (lastNode)
            (-[SnippetController loadComplete])
            * FormCompletionController.h:
            * FormCompletionController.m:
            (+[FormCompletionController loginInfoForForm:inFrame:])
            (+[FormCompletionController _frame:sourceFrame:willSubmitLoginForm:withValues:formInfo:submissionListener:])
            (+[FormCompletionController _frame:sourceFrame:willSubmitRegularForm:withValues:])
            (+[FormCompletionController frame:sourceFrame:willSubmitForm:withValues:submissionListener:])
            (+[FormCompletionController currentFormInFrame:])
            (+[FormCompletionController currentFrameAndForm:inWebView:])
            (+[FormCompletionController autoFillInWebView:])
            (+[FormCompletionController autoFillPasswordInFrame:])
            (-[FormCompletionController initWithSourceField:frame:])
            (-[FormCompletionController maxStringLength])
            (+[AutoFillController autoFillerForFrame:form:create:])
            (+[AutoFillController abMatchInFrame:form:fieldName:])
            (+[AutoFillController recordABMatch:inFrame:form:fieldName:])
            (+[AutoFillController clearAutoFilledView:inFrame:form:])
            (-[AutoFillController _fieldNameForAutoFillOfView:rep:])
            (-[FormToABBinder abPointerForFieldName:view:rep:foundByPageScan:])
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6117 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 172a503..e0771ed 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,44 @@
+2004-02-26  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Chris
+
+        * WebCore.pbproj/project.pbxproj:
+        * khtml/xml/dom2_rangeimpl.h: Now includes createInstance glue function as do the other
+        khtml DOM objects that we reflect into ObjC.
+        * kwq/DOM-compat.h: Added. Compatibility declarations for DOM SPI. Note that this file 
+        is copied into WebKit by the build system as needed.
+        * kwq/DOM.h: Added. New home for DOM SPI. Note that this file is copied into WebKit by the build 
+        system as needed.
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::recordFormValue): Updated usage to new DOM SPI.
+        * kwq/WebCoreBridge.h: Updated usage to new DOM SPI.
+        * kwq/WebCoreBridge.mm: Updated usage to new DOM SPI. Needed to add DOM range impl include since
+        includes jiggered around and this needed header was no longer included indirectly.
+        (-[WebCoreBridge elementForView:]): Ditto.
+        (inputElementFromDOMElement): Ditto.
+        (formElementFromDOMElement): Ditto.
+        (-[WebCoreBridge elementWithName:inForm:]): Ditto.
+        (-[WebCoreBridge elementDoesAutoComplete:]): Ditto.
+        (-[WebCoreBridge elementIsPassword:]): Ditto.
+        (-[WebCoreBridge currentForm]): Ditto.
+        (-[WebCoreBridge controlsInForm:]): Ditto.
+        (-[WebCoreBridge searchForLabels:beforeElement:]): Ditto.
+        (-[WebCoreBridge matchLabels:againstElement:]): Ditto.
+        (-[WebCoreBridge elementAtPoint:]): Ditto.
+        (-[WebCoreBridge DOMDocument]): Ditto.
+        (-[WebCoreBridge setSelectionFrom:startOffset:to:endOffset:]): Ditto.
+        (-[WebCoreBridge attributedStringFrom:startOffset:to:endOffset:]): Ditto.
+        (-[WebCoreBridge selectionStart]): Ditto.
+        (-[WebCoreBridge selectionEnd]): Ditto.
+        * kwq/WebCoreDOM.h: New home for all private declarations needed for reflecting DOM into ObjC.
+        * kwq/WebCoreDOM.mm: Added. New home for all implementations needed for reflecting DOM into ObjC.
+        * kwq/WebCoreDOMDocument.mm: Removed. All ObjC DOM implementation now in WebCoreDOM.mm.
+        * kwq/WebCoreDOMNode.mm: Removed. All ObjC DOM implementation now in WebCoreDOM.mm.
+        * kwq/WebCoreDOMPrivate.h: Removed.
+        * kwq/WebDOMDocument.h: Removed.
+        * kwq/WebDOMElement.h: Removed.
+        * kwq/WebDOMNode.h: Removed.
+
 2004-02-25  John Sullivan  <sullivan at apple.com>
 
         WebCore part of fix for <rdar://problem/3546370>: add a way to tab to menus, 
diff --git a/WebCore/ForwardingHeaders/editing/htmlediting.h b/WebCore/ForwardingHeaders/editing/htmlediting.h
new file mode 100644
index 0000000..a3a7ec0
--- /dev/null
+++ b/WebCore/ForwardingHeaders/editing/htmlediting.h
@@ -0,0 +1 @@
+#include <htmlediting.h>
diff --git a/WebCore/ForwardingHeaders/editing/htmlediting_impl.h b/WebCore/ForwardingHeaders/editing/htmlediting_impl.h
new file mode 100644
index 0000000..71efa50
--- /dev/null
+++ b/WebCore/ForwardingHeaders/editing/htmlediting_impl.h
@@ -0,0 +1 @@
+#include <htmlediting_impl.h>
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index e8f5807..4f7ea59 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -468,7 +468,6 @@
 				F5B2A4FE02E2220F018635CB,
 				F58785DB02DE375901EA4122,
 				F565A2740352509B01A80180,
-				F565A27D035284E301A80180,
 				F56234E103026D7301629B47,
 				F58785DE02DE375901EA4122,
 				F5517DC4031AB56301A80180,
@@ -482,9 +481,6 @@
 				F58785E402DE375901EA4122,
 				517FA6B30370BD6100CA2D3A,
 				F58785E602DE375901EA4122,
-				F5EDAAF7035345D901A80180,
-				F5EDAAF8035345D901A80180,
-				F5EDAAFA035345D901A80180,
 				F587861502DE382001EA4122,
 				F58786DF02DE3B8601EA4122,
 				F58786EC02DE3B8601EA4122,
@@ -512,14 +508,16 @@
 				BC745A1D05955F390058C893,
 				BCBDB03A0597B36E00B83B92,
 				BCBDB096059A28B100B83B92,
-				BEB1DD2805C197F800DD1F43,
 				BEB1DD3205C1980700DD1F43,
 				BEB1DD3E05C1982000DD1F43,
 				BC7FDE3405C1D9AB0070A902,
 				BC7E782205C5EB700088A50F,
 				BC3B364905C9D5E200E42902,
 				BC3B364A05C9D5E200E42902,
-				BE9580F905DA973B00EC5B54,
+				BE16801905EDB91A00B87935,
+				BE16801A05EDB91A00B87935,
+				BE9185E105EE59B80081354D,
+				BE9185E205EE59B80081354D,
 			);
 			isa = PBXHeadersBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -750,8 +748,6 @@
 				9377FB58032C235C008635CE,
 				93861DE2032C2E52008635CE,
 				93CCF7D7033BD43C008635CE,
-				F565A2780352643A01A80180,
-				F565A27B0352675C01A80180,
 				93386B93037045B3008635CE,
 				517FA6B70370C7ED00CA2D3A,
 				931C8A190380288B008635CE,
@@ -789,13 +785,14 @@
 				BC745A1C05955F390058C893,
 				BCBDB0390597B36E00B83B92,
 				BCBDB095059A28B100B83B92,
-				BEB1DD2705C197F800DD1F43,
 				BEB1DD3105C1980700DD1F43,
 				BEB1DD3D05C1982000DD1F43,
 				BC7FDE3305C1D9AB0070A902,
 				BC3B364805C9D5E200E42902,
 				BC433AD005D3046F003A5A14,
-				BE9580F805DA973B00EC5B54,
+				BE16801C05EDBAC000B87935,
+				BE9185E305EE59B80081354D,
+				BE9185E405EE59B80081354D,
 			);
 			isa = PBXSourcesBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -2508,6 +2505,48 @@
 //BE2
 //BE3
 //BE4
+		BE16801705EDB91A00B87935 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.c.h;
+			path = DOM.h;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		BE16801805EDB91A00B87935 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.c.h;
+			path = "DOM-compat.h";
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		BE16801905EDB91A00B87935 = {
+			fileRef = BE16801705EDB91A00B87935;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		BE16801A05EDB91A00B87935 = {
+			fileRef = BE16801805EDB91A00B87935;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		BE16801B05EDBAC000B87935 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.cpp.objcpp;
+			path = WebCoreDOM.mm;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		BE16801C05EDBAC000B87935 = {
+			fileRef = BE16801B05EDBAC000B87935;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 		BE26F15305517DE000BFA0C3 = {
 			fileEncoding = 30;
 			isa = PBXFileReference;
@@ -2539,16 +2578,16 @@
 			settings = {
 			};
 		};
-		BE9580F605DA973B00EC5B54 = {
+		BE9185DD05EE59B80081354D = {
 			fileEncoding = 30;
 			isa = PBXFileReference;
-			lastKnownFileType = sourcecode.cpp.cpp;
-			name = htmlediting_impl.cpp;
-			path = editing/htmlediting_impl.cpp;
+			lastKnownFileType = sourcecode.c.h;
+			name = htmlediting.h;
+			path = editing/htmlediting.h;
 			refType = 4;
 			sourceTree = "<group>";
 		};
-		BE9580F705DA973B00EC5B54 = {
+		BE9185DE05EE59B80081354D = {
 			fileEncoding = 30;
 			isa = PBXFileReference;
 			lastKnownFileType = sourcecode.c.h;
@@ -2557,14 +2596,44 @@
 			refType = 4;
 			sourceTree = "<group>";
 		};
-		BE9580F805DA973B00EC5B54 = {
-			fileRef = BE9580F605DA973B00EC5B54;
+		BE9185DF05EE59B80081354D = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.cpp.cpp;
+			name = htmlediting_impl.cpp;
+			path = editing/htmlediting_impl.cpp;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		BE9185E005EE59B80081354D = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.cpp.cpp;
+			name = htmlediting.cpp;
+			path = editing/htmlediting.cpp;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		BE9185E105EE59B80081354D = {
+			fileRef = BE9185DD05EE59B80081354D;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		BE9185E205EE59B80081354D = {
+			fileRef = BE9185DE05EE59B80081354D;
 			isa = PBXBuildFile;
 			settings = {
 			};
 		};
-		BE9580F905DA973B00EC5B54 = {
-			fileRef = BE9580F705DA973B00EC5B54;
+		BE9185E305EE59B80081354D = {
+			fileRef = BE9185DF05EE59B80081354D;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		BE9185E405EE59B80081354D = {
+			fileRef = BE9185E005EE59B80081354D;
 			isa = PBXBuildFile;
 			settings = {
 			};
@@ -2588,46 +2657,16 @@
 		};
 		BEB1DD0805C197DF00DD1F43 = {
 			children = (
-				BEB1DD2605C197F800DD1F43,
-				BEB1DD2505C197F800DD1F43,
-				BE9580F605DA973B00EC5B54,
-				BE9580F705DA973B00EC5B54,
+				BE9185E005EE59B80081354D,
+				BE9185DD05EE59B80081354D,
+				BE9185DE05EE59B80081354D,
+				BE9185DF05EE59B80081354D,
 			);
 			isa = PBXGroup;
 			name = editing;
 			refType = 4;
 			sourceTree = "<group>";
 		};
-		BEB1DD2505C197F800DD1F43 = {
-			fileEncoding = 30;
-			isa = PBXFileReference;
-			lastKnownFileType = sourcecode.cpp.cpp;
-			name = htmlediting.cpp;
-			path = editing/htmlediting.cpp;
-			refType = 4;
-			sourceTree = "<group>";
-		};
-		BEB1DD2605C197F800DD1F43 = {
-			fileEncoding = 30;
-			isa = PBXFileReference;
-			lastKnownFileType = sourcecode.c.h;
-			name = htmlediting.h;
-			path = editing/htmlediting.h;
-			refType = 4;
-			sourceTree = "<group>";
-		};
-		BEB1DD2705C197F800DD1F43 = {
-			fileRef = BEB1DD2505C197F800DD1F43;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
-		BEB1DD2805C197F800DD1F43 = {
-			fileRef = BEB1DD2605C197F800DD1F43;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
 		BEB1DD2F05C1980700DD1F43 = {
 			fileEncoding = 30;
 			isa = PBXFileReference;
@@ -6168,13 +6207,10 @@
 		};
 		F565A2700352410501A80180 = {
 			children = (
+				BE16801705EDB91A00B87935,
+				BE16801805EDB91A00B87935,
 				F565A2730352509B01A80180,
-				F565A2770352643A01A80180,
-				F565A27A0352675C01A80180,
-				F565A27C035284E301A80180,
-				F5EDAAF3035345D901A80180,
-				F5EDAAF4035345D901A80180,
-				F5EDAAF6035345D901A80180,
+				BE16801B05EDBAC000B87935,
 			);
 			isa = PBXGroup;
 			name = DOM;
@@ -6198,49 +6234,6 @@
 				);
 			};
 		};
-		F565A2770352643A01A80180 = {
-			fileEncoding = 4;
-			isa = PBXFileReference;
-			lastKnownFileType = sourcecode.cpp.objcpp;
-			name = WebCoreDOMDocument.mm;
-			path = kwq/WebCoreDOMDocument.mm;
-			refType = 2;
-			sourceTree = SOURCE_ROOT;
-		};
-		F565A2780352643A01A80180 = {
-			fileRef = F565A2770352643A01A80180;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
-		F565A27A0352675C01A80180 = {
-			fileEncoding = 4;
-			isa = PBXFileReference;
-			lastKnownFileType = sourcecode.cpp.objcpp;
-			path = WebCoreDOMNode.mm;
-			refType = 4;
-			sourceTree = "<group>";
-		};
-		F565A27B0352675C01A80180 = {
-			fileRef = F565A27A0352675C01A80180;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
-		F565A27C035284E301A80180 = {
-			fileEncoding = 4;
-			isa = PBXFileReference;
-			lastKnownFileType = sourcecode.c.h;
-			path = WebCoreDOMPrivate.h;
-			refType = 4;
-			sourceTree = "<group>";
-		};
-		F565A27D035284E301A80180 = {
-			fileRef = F565A27C035284E301A80180;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
 		F565AE8502ECA583018635CA = {
 			fileEncoding = 30;
 			isa = PBXFileReference;
@@ -10128,51 +10121,6 @@
 			settings = {
 			};
 		};
-		F5EDAAF3035345D901A80180 = {
-			fileEncoding = 4;
-			isa = PBXFileReference;
-			lastKnownFileType = sourcecode.c.h;
-			name = WebDOMDocument.h;
-			path = kwq/WebDOMDocument.h;
-			refType = 2;
-			sourceTree = SOURCE_ROOT;
-		};
-		F5EDAAF4035345D901A80180 = {
-			fileEncoding = 4;
-			isa = PBXFileReference;
-			lastKnownFileType = sourcecode.c.h;
-			name = WebDOMElement.h;
-			path = kwq/WebDOMElement.h;
-			refType = 2;
-			sourceTree = SOURCE_ROOT;
-		};
-		F5EDAAF6035345D901A80180 = {
-			fileEncoding = 4;
-			isa = PBXFileReference;
-			lastKnownFileType = sourcecode.c.h;
-			name = WebDOMNode.h;
-			path = kwq/WebDOMNode.h;
-			refType = 2;
-			sourceTree = SOURCE_ROOT;
-		};
-		F5EDAAF7035345D901A80180 = {
-			fileRef = F5EDAAF3035345D901A80180;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
-		F5EDAAF8035345D901A80180 = {
-			fileRef = F5EDAAF4035345D901A80180;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
-		F5EDAAFA035345D901A80180 = {
-			fileRef = F5EDAAF6035345D901A80180;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
 //F50
 //F51
 //F52
diff --git a/WebCore/khtml/xml/dom2_rangeimpl.h b/WebCore/khtml/xml/dom2_rangeimpl.h
index a197574..01a520b 100644
--- a/WebCore/khtml/xml/dom2_rangeimpl.h
+++ b/WebCore/khtml/xml/dom2_rangeimpl.h
@@ -88,6 +88,10 @@ public:
 
     bool readOnly() { return false; }
 
+#if APPLE_CHANGES
+    static Range createInstance (RangeImpl *impl);
+#endif
+
 protected:
     DocumentPtr *m_ownerDocument;
     NodeImpl *m_startContainer;
diff --git a/WebCore/kwq/DOM-compat.h b/WebCore/kwq/DOM-compat.h
new file mode 100644
index 0000000..beb7f71
--- /dev/null
+++ b/WebCore/kwq/DOM-compat.h
@@ -0,0 +1,80 @@
+/*	
+    DOM-compat.h
+    Copyright 2004, Apple, Inc. All rights reserved.
+*/
+
+ at protocol DOMNode;
+ at protocol DOMNamedNodeMap;
+ at protocol DOMNodeList;
+ at protocol DOMImplementation;
+ at protocol DOMDocumentFragment;
+ at protocol DOMDocument;
+ at protocol DOMCharacterData;
+ at protocol DOMAttr;
+ at protocol DOMElement;
+ at protocol DOMText;
+ at protocol DOMComment;
+ at protocol DOMCDATASection;
+ at protocol DOMDocumentType;
+ at protocol DOMNotation;
+ at protocol DOMEntity;
+ at protocol DOMEntityReference;
+ at protocol DOMProcessingInstruction;
+
+ at protocol WebDOMNode <DOMNode>
+ at end
+
+ at protocol WebDOMNamedNodeMap <DOMNamedNodeMap>
+ at end
+
+ at protocol WebDOMNodeList <DOMNodeList>
+ at end
+
+ at protocol WebDOMDocumentType <DOMDocumentType>
+ at end
+
+ at protocol WebDOMDocumentFragment <DOMDocumentFragment>
+ at end
+
+ at protocol WebDOMImplementation <DOMImplementation>
+ at end
+
+ at protocol WebDOMDocument <DOMDocument>
+ at end
+
+ at protocol WebDOMAttr <DOMAttr>
+ at end
+
+ at protocol WebDOMCharacterData <DOMCharacterData>
+ at end
+
+ at protocol WebDOMComment <DOMComment>
+ at end
+
+ at protocol WebDOMText <DOMText>
+ at end
+
+ at protocol WebDOMCDATASection <DOMCDATASection>
+ at end
+
+ at protocol WebDOMProcessingInstruction <DOMProcessingInstruction>
+ at end
+
+ at protocol WebDOMEntityReference <DOMEntityReference>
+ at end
+
+ at protocol WebDOMElement <DOMElement>
+ at end
+
+#define WebNodeType DOMNodeType
+#define WebDOMAttr DOMAttr
+#define WebDOMComment DOMComment
+#define WebDOMCDATASection DOMCDATASection
+#define WebDOMDocument DOMDocument
+#define WebDOMElement DOMElement
+#define WebDOMEntityReference DOMEntityReference
+#define WebDOMNamedNodeMap DOMNamedNodeMap
+#define WebDOMNode DOMNode
+#define WebDOMNodeList DOMNodeList
+#define WebDOMProcessingInstruction DOMProcessingInstruction
+#define WebDOMText DOMText
diff --git a/WebCore/kwq/DOM.h b/WebCore/kwq/DOM.h
new file mode 100644
index 0000000..3d8d75b
--- /dev/null
+++ b/WebCore/kwq/DOM.h
@@ -0,0 +1,351 @@
+/*
+ * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+//=========================================================================
+//=========================================================================
+//=========================================================================
+
+// Important Note:
+// Though this file appears as an exported header from WebKit, the
+// version you should edit is in WebCore. The WebKit version is copied
+// to WebKit during the build process.
+
+//=========================================================================
+//=========================================================================
+//=========================================================================
+
+enum DOMNodeType {
+    ELEMENT_NODE                   = 1,
+    ATTRIBUTE_NODE                 = 2,
+    TEXT_NODE                      = 3,
+    CDATA_SECTION_NODE             = 4,
+    ENTITY_REFERENCE_NODE          = 5,
+    ENTITY_NODE                    = 6,
+    PROCESSING_INSTRUCTION_NODE    = 7,
+    COMMENT_NODE                   = 8,
+    DOCUMENT_NODE                  = 9,
+    DOCUMENT_TYPE_NODE             = 10,
+    DOCUMENT_FRAGMENT_NODE         = 11,
+    NOTATION_NODE                  = 12,
+};
+
+enum DOMExceptionCode {
+    INDEX_SIZE_ERR                 = 1,
+    DOMSTRING_SIZE_ERR             = 2,
+    HIERARCHY_REQUEST_ERR          = 3,
+    WRONG_DOCUMENT_ERR             = 4,
+    INVALID_CHARACTER_ERR          = 5,
+    NO_DATA_ALLOWED_ERR            = 6,
+    NO_MODIFICATION_ALLOWED_ERR    = 7,
+    NOT_FOUND_ERR                  = 8,
+    NOT_SUPPORTED_ERR              = 9,
+    INUSE_ATTRIBUTE_ERR            = 10,
+    INVALID_STATE_ERR              = 11,
+    SYNTAX_ERR                     = 12,
+    INVALID_MODIFICATION_ERR       = 13,
+    NAMESPACE_ERR                  = 14,
+    INVALID_ACCESS_ERR             = 15,
+};
+
+extern NSString * const DOMErrorDomain;
+
+ at class NSError;
+ at class NSString;
+
+ at protocol NSObject;
+ at protocol DOMNode;
+ at protocol DOMNamedNodeMap;
+ at protocol DOMNodeList;
+ at protocol DOMImplementation;
+ at protocol DOMDocumentFragment;
+ at protocol DOMDocument;
+ at protocol DOMCharacterData;
+ at protocol DOMAttr;
+ at protocol DOMElement;
+ at protocol DOMText;
+ at protocol DOMComment;
+ at protocol DOMCDATASection;
+ at protocol DOMDocumentType;
+ at protocol DOMNotation;
+ at protocol DOMEntity;
+ at protocol DOMEntityReference;
+ at protocol DOMProcessingInstruction;
+ at protocol DOMRange;
+
+ at protocol DOMNode <NSObject>
+- (NSString *)nodeName;
+- (NSString *)nodeValue;
+- (void)setNodeValue:(NSString *)string error:(NSError **)error;
+- (unsigned short)nodeType;
+- (id <DOMNode>)parentNode;
+- (id <DOMNodeList>)childNodes;
+- (id <DOMNode>)firstChild;
+- (id <DOMNode>)lastChild;
+- (id <DOMNode>)previousSibling;
+- (id <DOMNode>)nextSibling;
+- (id <DOMNamedNodeMap>)attributes;
+- (id <DOMDocument>)ownerDocument;
+- (id <DOMNode>)insertBefore:(id <DOMNode>)newChild :(id <DOMNode>)refChild error:(NSError **)error;
+- (id <DOMNode>)replaceChild:(id <DOMNode>)newChild :(id <DOMNode>)oldChild error:(NSError **)error;
+- (id <DOMNode>)removeChild:(id <DOMNode>)oldChild error:(NSError **)error;
+- (id <DOMNode>)appendChild:(id <DOMNode>)newChild error:(NSError **)error;
+- (BOOL)hasChildNodes;
+- (id <DOMNode>)cloneNode:(BOOL)deep;
+- (void)normalize;
+- (BOOL)isSupported:(NSString *)feature :(NSString *)version;
+- (NSString *)namespaceURI;
+- (NSString *)prefix;
+- (void)setPrefix:(NSString *)prefix error:(NSError **)error;
+- (NSString *)localName;
+- (BOOL)hasAttributes;
+- (NSString *)HTMLString;
+// begin deprecated methods
+- (void)setNodeValue:(NSString *)string;
+- (id<DOMNode>)insert:(id<DOMNode>)newChild before:(id<DOMNode>)refChild;
+- (id<DOMNode>)replace:(id<DOMNode>)newChild child:(id<DOMNode>)oldChild;
+- (id<DOMNode>)removeChild:(id<DOMNode>)oldChild;
+- (id<DOMNode>)appendChild:(id<DOMNode>)newChild;
+- (void)setPrefix:(NSString *)prefix;
+// end deprecated methods
+ at end
+
+ at protocol DOMNamedNodeMap <NSObject>
+- (id <DOMNode>)getNamedItem:(NSString *)name;
+- (id <DOMNode>)setNamedItem:(id <DOMNode>)arg error:(NSError **)error;
+- (id <DOMNode>)removeNamedItem:(NSString *)name error:(NSError **)error;
+- (id <DOMNode>)item:(unsigned long)index;
+- (unsigned long)length;
+- (id <DOMNode>)getNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
+- (id <DOMNode>)setNamedItemNS:(id <DOMNode>)arg error:(NSError **)error;
+- (id <DOMNode>)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName error:(NSError **)error;
+// begin deprecated methods
+- (id<DOMNode>)setNamedItem:(id<DOMNode>)arg;
+- (id<DOMNode>)removeNamedItem:(NSString *)name;
+- (id<DOMNode>)setNamedItemNS:(id<DOMNode>)arg;
+- (id<DOMNode>)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMNodeList <NSObject>
+- (id <DOMNode>)item:(unsigned long)index;
+- (unsigned long)length;
+ at end
+
+
+ at protocol DOMImplementation <NSObject>
+- (BOOL)hasFeature:(NSString *)feature :(NSString *)version;
+- (id <DOMDocumentType>)createDocumentType:(NSString *)qualifiedName :(NSString *)publicId :(NSString *)systemId error:(NSError **)error;
+- (id <DOMDocument>)createDocument:(NSString *)namespaceURI :(NSString *)qualifiedName :(id <DOMDocumentType>)doctype error:(NSError **)error;
+// begin deprecated methods
+- (id<DOMDocumentType>)createDocumentType:(NSString *)qualifiedName :(NSString *)publicId :(NSString *)systemId :(int *)exceptionCode;
+- (id<DOMDocument>)createDocument:(NSString *)namespaceURI :(NSString *)qualifiedName :(id<DOMDocumentType>)doctype;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMDocumentFragment <DOMNode>
+ at end
+
+
+ at protocol DOMDocument <DOMNode>
+- (id <DOMDocumentType>)doctype;
+- (id <DOMImplementation>)implementation;
+- (id <DOMElement>)documentElement;
+- (id <DOMElement>)createElement:(NSString *)tagName error:(NSError **)error;
+- (id <DOMDocumentFragment>)createDocumentFragment;
+- (id <DOMText>)createTextNode:(NSString *)data;
+- (id <DOMComment>)createComment:(NSString *)data;
+- (id <DOMCDATASection>)createCDATASection:(NSString *)data error:(NSError **)error;
+- (id <DOMProcessingInstruction>)createProcessingInstruction:(NSString *)target :(NSString *)data error:(NSError **)error;
+- (id <DOMAttr>)createAttribute:(NSString *)name error:(NSError **)error;
+- (id <DOMEntityReference>)createEntityReference:(NSString *)name error:(NSError **)error;
+- (id <DOMNodeList>)getElementsByTagName:(NSString *)tagname;
+- (id <DOMNode>)importNode:(id <DOMNode>)importedNode :(BOOL)deep error:(NSError **)error;
+- (id <DOMElement>)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName error:(NSError **)error;
+- (id <DOMAttr>)createAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName error:(NSError **)error;
+- (id <DOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
+- (id <DOMElement>)getElementById:(NSString *)elementId;
+// begin deprecated methods
+- (id<DOMElement>)createElement:(NSString *)tagName;
+- (id<DOMElement>)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName;
+- (id<DOMCDATASection>)createCDATASection:(NSString *)data;
+- (id<DOMProcessingInstruction>)createProcessingInstruction:(NSString *)target :(NSString *)data;
+- (id<DOMAttr>)createAttribute:(NSString *)name;
+- (id<DOMEntityReference>)createEntityReference:(NSString *)name;
+- (id<DOMNode>)importNode:(id<DOMNode>)importedNode :(BOOL)deep;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMCharacterData <DOMNode>
+- (NSString *)data;
+- (void)setData:(NSString *)data error:(NSError **)error;
+- (unsigned long)length;
+- (NSString *)substringData:(unsigned long)offset :(unsigned long)count error:(NSError **)error;
+- (void)appendData:(NSString *)arg error:(NSError **)error;
+- (void)insertData:(unsigned long)offset :(NSString *)arg error:(NSError **)error;
+- (void)deleteData:(unsigned long)offset :(unsigned long) count error:(NSError **)error;
+- (void)replaceData:(unsigned long)offset :(unsigned long)count :(NSString *)arg error:(NSError **)error;
+// begin deprecated methods
+- (void)setData: (NSString *)data;
+- (NSString *)substringData: (unsigned long)offset :(unsigned long)count;
+- (void)appendData:(NSString *)arg;
+- (void)insertData:(unsigned long)offset :(NSString *)arg;
+- (void)deleteData:(unsigned long)offset :(unsigned long)count;
+- (void)replaceData:(unsigned long)offset :(unsigned long)count :(NSString *)arg;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMAttr <DOMNode>
+- (NSString *)name;
+- (BOOL)specified;
+- (NSString *)value;
+- (void)setValue:(NSString *)value error:(NSError **)error;
+- (id <DOMElement>)ownerElement;
+// begin deprecated methods
+- (void)setValue:(NSString *)value;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMElement <DOMNode>
+- (NSString *)tagName;
+- (NSString *)getAttribute:(NSString *)name;
+- (void)setAttribute:(NSString *)name :(NSString *)value error:(NSError **)error;
+- (void)removeAttribute:(NSString *)name error:(NSError **)error;
+- (id <DOMAttr>)getAttributeNode:(NSString *)name;
+- (id <DOMAttr>)setAttributeNode:(id <DOMAttr>)newAttr error:(NSError **)error;
+- (id <DOMAttr>)removeAttributeNode:(id <DOMAttr>)oldAttr error:(NSError **)error;
+- (id <DOMNodeList>)getElementsByTagName:(NSString *)name;
+- (NSString *)getAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
+- (void)setAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName :(NSString *)value error:(NSError **)error;
+- (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName error:(NSError **)error;
+- (id <DOMAttr>)getAttributeNodeNS:(NSString *)namespaceURI :(NSString *)localName;
+- (id <DOMAttr>)setAttributeNodeNS:(id <DOMAttr>)newAttr error:(NSError **)error;
+- (id <DOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
+- (BOOL)hasAttribute:(NSString *)name;
+- (BOOL)hasAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
+// begin deprecated methods
+- (void)setAttribute:(NSString *)name :(NSString *)value;
+- (void)removeAttribute:(NSString *)name;
+- (id<DOMAttr>)setAttributeNode:(id<DOMAttr>)newAttr;
+- (id<DOMAttr>)removeAttributeNode:(id<DOMAttr>)oldAttr;
+- (void)setAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName :(NSString *)value;
+- (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
+- (id<DOMAttr>)setAttributeNodeNS:(id<DOMAttr>)newAttr;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMText <DOMCharacterData>
+- (id <DOMText>)splitText:(unsigned long)offset error:(NSError **)error;
+// begin deprecated methods
+- (id<DOMText>)splitText:(unsigned long)offset;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMComment <DOMCharacterData>
+ at end
+
+
+ at protocol DOMCDATASection <DOMText>
+ at end
+
+
+ at protocol DOMDocumentType <DOMNode>
+- (NSString *)name;
+- (id <DOMNamedNodeMap>)entities;
+- (id <DOMNamedNodeMap>)notations;
+- (NSString *)publicId;
+- (NSString *)systemId;
+- (NSString *)internalSubset;
+ at end
+
+
+ at protocol DOMNotation <DOMNode>
+- (NSString *)publicId;
+- (NSString *)systemId;
+ at end
+
+
+ at protocol DOMEntity <DOMNode>
+- (NSString *)publicId;
+- (NSString *)systemId;
+- (NSString *)notationName;
+ at end
+
+
+ at protocol DOMEntityReference <DOMNode>
+ at end
+
+
+ at protocol DOMProcessingInstruction <DOMNode>
+- (NSString *)target;
+- (NSString *)data;
+- (void)setData:(NSString *)data error:(NSError **)error;
+// begin deprecated methods
+- (void)setData:(NSString *)data;
+// end deprecated methods
+ at end
+
+
+enum DOMCompareHow
+{
+    START_TO_START = 0,
+    START_TO_END   = 1,
+    END_TO_END     = 2,
+    END_TO_START   = 3,
+};
+
+ at protocol DOMRange <NSObject>
+- (id <DOMNode>)startContainer:(NSError **)error;
+- (long)startOffset:(NSError **)error;
+- (id <DOMNode>)endContainer:(NSError **)error;
+- (long)endOffset:(NSError **)error;
+- (BOOL)collapsed:(NSError **)error;
+- (id <DOMNode>)commonAncestorContainer:(NSError **)error;
+- (void)setStart:(id <DOMNode>)refNode :(long)offset error:(NSError **)error;
+- (void)setEnd:(id <DOMNode>)refNode :(long)offset error:(NSError **)error;
+- (void)setStartBefore:(id <DOMNode>)refNode error:(NSError **)error;
+- (void)setStartAfter:(id <DOMNode>)refNode error:(NSError **)error;
+- (void)setEndBefore:(id <DOMNode>)refNode error:(NSError **)error;
+- (void)setEndAfter:(id <DOMNode>)refNode error:(NSError **)error;
+- (void)collapse:(BOOL)toStart error:(NSError **)error;
+- (void)selectNode:(id <DOMNode>)refNode error:(NSError **)error;
+- (void)selectNodeContents:(id <DOMNode>)refNode error:(NSError **)error;
+- (short)compareBoundaryPoints:(unsigned short)how :(id <DOMRange>)sourceRange error:(NSError **)error;
+- (void)deleteContents:(NSError **)error;
+- (id <DOMDocumentFragment>)extractContents:(NSError **)error;
+- (id <DOMDocumentFragment>)cloneContents:(NSError **)error;
+- (void)insertNode:(id <DOMNode>)newNode error:(NSError **)error;
+- (void)surroundContents:(id <DOMNode>)newParent error:(NSError **)error;
+- (id <DOMRange>)cloneRange:(NSError **)error;
+- (NSString *)toString:(NSError **)error;
+- (void)detach:(NSError **)error;
+ at end
+
diff --git a/WebCore/kwq/DOM.mm b/WebCore/kwq/DOM.mm
new file mode 100644
index 0000000..5f111fd
--- /dev/null
+++ b/WebCore/kwq/DOM.mm
@@ -0,0 +1,1794 @@
+/*
+ * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import "WebCoreDOM.h"
+
+#import <Foundation/Foundation.h>
+
+#import <dom/dom_doc.h>
+#import <dom/dom_element.h>
+#import <dom/dom_exception.h>
+#import <dom/dom_node.h>
+#import <dom/dom_string.h>
+#import <dom/dom_text.h>
+#import <dom/dom_xml.h>
+#import <dom/dom2_range.h>
+#import <xml/dom_docimpl.h>
+#import <xml/dom_elementimpl.h>
+#import <xml/dom_nodeimpl.h>
+#import <xml/dom_stringimpl.h>
+#import <xml/dom_textimpl.h>
+#import <xml/dom_xmlimpl.h>
+#import <xml/dom2_rangeimpl.h>
+
+#import "KWQAssertions.h"
+#import "KWQLogging.h"
+
+using DOM::Attr;
+using DOM::AttrImpl;
+using DOM::CDATASectionImpl;
+using DOM::CharacterData;
+using DOM::CharacterDataImpl;
+using DOM::CommentImpl;
+using DOM::DocumentFragmentImpl;
+using DOM::DocumentType;
+using DOM::DocumentTypeImpl;
+using DOM::Document;
+using DOM::DocumentImpl;
+using DOM::DOMException;
+using DOM::DOMImplementation;
+using DOM::DOMImplementationImpl;
+using DOM::DOMString;
+using DOM::DOMStringImpl;
+using DOM::Element;
+using DOM::ElementImpl;
+using DOM::EntityImpl;
+using DOM::EntityReferenceImpl;
+using DOM::NamedNodeMap;
+using DOM::NamedNodeMapImpl;
+using DOM::Node;
+using DOM::NodeImpl;
+using DOM::NodeListImpl;
+using DOM::NotationImpl;
+using DOM::ProcessingInstruction;
+using DOM::ProcessingInstructionImpl;
+using DOM::Range;
+using DOM::RangeImpl;
+using DOM::TextImpl;
+
+//------------------------------------------------------------------------------------------
+// Static functions and data
+#pragma mark Static functions and data 
+
+NSString * const DOMErrorDomain = @"DOMErrorDomain";
+
+static CFMutableDictionaryRef wrapperCache(void)
+{
+    static CFMutableDictionaryRef wrapperCache = NULL;
+    if (!wrapperCache) {
+        // No need to retain/free either impl key, or id value.  Items will be removed
+        // from the cache in WebCoreDOMNode's dealloc method.
+        wrapperCache = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
+    }
+    return wrapperCache;
+}
+
+static id wrapperForImpl(const void *impl)
+{
+    return (id)CFDictionaryGetValue(wrapperCache(), impl);
+}
+
+static void setWrapperForImpl(id wrapper, const void *impl)
+{
+    CFDictionarySetValue(wrapperCache(), impl, wrapper);
+}
+
+static void removeWrapperForImpl(const void *impl)
+{
+    CFDictionaryRemoveValue(wrapperCache(), impl);
+}
+
+static NSString *domStringToNSString(const DOMString &aString)
+{
+    return [NSString stringWithCharacters:(unichar *)aString.unicode() length:aString.length()];
+}
+
+static DOMString NSStringToDOMString(NSString *aString)
+{
+    QChar *chars = (QChar *)malloc([aString length] * sizeof(QChar));
+    [aString getCharacters:(unichar *)chars];
+    DOMString ret(chars, [aString length]);
+    free(chars);
+    return ret;
+}
+
+static void fillInError(NSError **error, int code)
+{
+    if (!error || !code)
+        return;
+        
+    *error = [NSError errorWithDomain:DOMErrorDomain code:code userInfo:nil];
+}
+    
+//------------------------------------------------------------------------------------------
+// Macros
+
+#define WEB_CORE_INTERNAL_METHODS(ObjCClass,CPlusPlusClass) \
++ (ObjCClass *)objectWithImpl:(CPlusPlusClass *)impl \
+{ \
+    if (!impl) \
+        return nil; \
+    id cachedInstance; \
+    cachedInstance = wrapperForImpl(impl); \
+    if (cachedInstance) \
+        return [[cachedInstance retain] autorelease]; \
+    ObjCClass *instance = [ObjCClass alloc]; \
+    return [[instance initWith##CPlusPlusClass:impl] autorelease]; \
+} \
+- (id)initWith##CPlusPlusClass:(CPlusPlusClass *)impl \
+{ \
+    if (!impl) { \
+        [self release]; \
+        return nil; \
+    } \
+    self = [super initWithDetails:impl]; \
+    if (self) \
+        static_cast<CPlusPlusClass *>(details)->ref(); \
+    return self; \
+} \
+- (CPlusPlusClass *)impl \
+{ \
+    ASSERT(details); \
+    return static_cast<CPlusPlusClass *>(details); \
+}
+    
+//------------------------------------------------------------------------------------------
+// Factory methods
+
+DOM::NodeList DOM::NodeListImpl::createInstance(DOM::NodeListImpl *impl)
+{
+    return DOM::NodeList(impl);
+}
+
+DOM::NamedNodeMap DOM::NamedNodeMapImpl::createInstance(DOM::NamedNodeMapImpl *impl)
+{
+    return DOM::NamedNodeMap(impl);
+}
+
+DOM::Attr DOM::AttrImpl::createInstance(DOM::AttrImpl *impl)
+{
+    return DOM::Attr(impl);
+}
+
+DOM::Element DOM::ElementImpl::createInstance(DOM::ElementImpl *impl)
+{
+    return DOM::Element(impl);
+}
+
+DOM::CharacterData DOM::CharacterDataImpl::createInstance(DOM::CharacterDataImpl *impl)
+{
+    return DOM::CharacterData(impl);
+}
+
+DOM::Text DOM::TextImpl::createInstance(DOM::TextImpl *impl)
+{
+    return DOM::Text(impl);
+}
+
+DOM::ProcessingInstruction DOM::ProcessingInstructionImpl::createInstance(ProcessingInstructionImpl *impl)
+{
+    return DOM::ProcessingInstruction(impl);
+}
+
+DOM::DOMImplementation DOM::DOMImplementationImpl::createInstance(DOM::DOMImplementationImpl *impl)
+{
+    return DOM::DOMImplementation(impl);
+}
+
+DOM::DocumentType DOM::DocumentTypeImpl::createInstance(DOM::DocumentTypeImpl *impl)
+{
+    return DOM::DocumentType(impl);
+}
+
+DOM::Document DOM::DocumentImpl::createInstance(DOM::DocumentImpl *impl)
+{
+    return DOM::Document(impl);
+}
+
+DOM::Range DOM::RangeImpl::createInstance(DOM::RangeImpl *impl)
+{
+    return DOM::Range(impl);
+}
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMObject
+
+ at implementation WebCoreDOMObject
+
+- (id)initWithDetails:(void *)d
+{
+    if (!d) {
+        [self release];
+        return nil;
+    }
+
+    id cachedInstance;
+    cachedInstance = wrapperForImpl(d);
+    if (cachedInstance) {
+        [self release];
+        return [cachedInstance retain];
+    }
+
+    [super init];
+    details = d;
+    setWrapperForImpl(self, details);
+    return self;
+}
+
+- (void)dealloc
+{
+    if (details)
+        removeWrapperForImpl(details);
+    [super dealloc];
+}
+
+- (unsigned)hash
+{
+    return (unsigned)details;
+}
+
+- (BOOL)isEqual:(id)other
+{
+    if (self == other)
+        return YES;
+        
+    if ([other isKindOfClass:[WebCoreDOMObject class]] && ((WebCoreDOMObject *)other)->details == details)
+        return YES;
+        
+    return NO;
+}
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMNode
+
+ at implementation WebCoreDOMNode
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMNode, NodeImpl)
+
+// Note: only objects that derive directly from WebDOMObject need their own dealloc method.
+// This is due to the fact that some of the details impl objects derive from
+// khtml::Shared, others from khtml::TreeShared (which do not share a base type), and we 
+// have to cast to the right type in order to call the deref() function.
+- (void)dealloc
+{
+    NodeImpl *instance = static_cast<NodeImpl *>(details);
+    if (instance)
+        instance->deref();
+    [super dealloc];
+}
+
+- (NSString *)nodeName
+{
+    return domStringToNSString([self impl]->nodeName());
+}
+
+- (NSString *)nodeValue
+{
+    // Documentation says we can raise a DOMSTRING_SIZE_ERR.
+    // However, the lower layer does not report that error up to us.
+    return domStringToNSString([self impl]->nodeValue());
+}
+
+- (void)setNodeValue:(NSString *)string error:(NSError **)error
+{
+    ASSERT(string);
+    
+    int code;
+    [self impl]->setNodeValue(NSStringToDOMString(string), code);
+    fillInError(error, code);
+}
+
+- (unsigned short)nodeType
+{
+    return [self impl]->nodeType();
+}
+
+- (id <DOMNode>)parentNode
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->parentNode()];
+}
+
+- (id <DOMNodeList>)childNodes
+{
+    return [WebCoreDOMNodeList objectWithImpl:[self impl]->childNodes()];
+}
+
+- (id <DOMNode>)firstChild
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->firstChild()];
+}
+
+- (id <DOMNode>)lastChild
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->lastChild()];
+}
+
+- (id <DOMNode>)previousSibling
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->previousSibling()];
+}
+
+- (id <DOMNode>)nextSibling
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->nextSibling()];
+}
+
+- (id <DOMNamedNodeMap>)attributes
+{
+    // DOM level 2 core specification says: 
+    // A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
+    return nil;
+}
+
+- (id <DOMDocument>)ownerDocument
+{
+    return [WebCoreDOMDocument objectWithImpl:[self impl]->getDocument()];
+}
+
+- (id <DOMNode>)insertBefore:(id <DOMNode>)newChild :(id <DOMNode>)refChild error:(NSError **)error
+{
+    if (!newChild || !refChild) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    int code;
+    WebCoreDOMNode *result = [WebCoreDOMNode objectWithImpl:[self impl]->insertBefore(nodeImpl(newChild), nodeImpl(refChild), code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMNode>)replaceChild:(id <DOMNode>)newChild :(id <DOMNode>)oldChild error:(NSError **)error
+{
+    if (!newChild || !oldChild) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    int code;
+    WebCoreDOMNode *result = [WebCoreDOMNode objectWithImpl:[self impl]->replaceChild(nodeImpl(newChild), nodeImpl(oldChild), code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMNode>)removeChild:(id <DOMNode>)oldChild error:(NSError **)error
+{
+    if (!oldChild) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    int code;
+    WebCoreDOMNode *result = [WebCoreDOMNode objectWithImpl:[self impl]->removeChild(nodeImpl(oldChild), code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMNode>)appendChild:(id <DOMNode>)newChild error:(NSError **)error
+{
+    if (!newChild) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    int code;
+    WebCoreDOMNode *result = [WebCoreDOMNode objectWithImpl:[self impl]->appendChild(nodeImpl(newChild), code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (BOOL)hasChildNodes
+{
+    return [self impl]->hasChildNodes();
+}
+
+- (id <DOMNode>)cloneNode:(BOOL)deep
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->cloneNode(deep)];
+}
+
+- (void)normalize
+{
+    [self impl]->normalize();
+}
+
+- (BOOL)isSupported:(NSString *)feature :(NSString *)version
+{
+    ASSERT(feature);
+    ASSERT(version);
+
+    // Method not reflected in DOM::NodeImpl interface
+    Node node([self impl]);
+    return node.isSupported(NSStringToDOMString(feature), NSStringToDOMString(version));
+}
+
+- (NSString *)namespaceURI
+{
+    // Method not reflected in DOM::NodeImpl interface
+    Node node([self impl]);
+    return domStringToNSString(node.namespaceURI());
+}
+
+- (NSString *)prefix
+{
+    return domStringToNSString([self impl]->prefix());
+}
+
+- (void)setPrefix:(NSString *)prefix error:(NSError **)error
+{
+    ASSERT(prefix);
+
+    int code;
+    [self impl]->setPrefix(NSStringToDOMString(prefix), code);
+    fillInError(error, code);
+}
+
+- (NSString *)localName
+{
+    return domStringToNSString([self impl]->localName());
+}
+
+- (BOOL)hasAttributes
+{
+    // Method not reflected in DOM::NodeImpl interface
+    Node node([self impl]);
+    return node.hasAttributes();
+}
+
+- (NSString *)HTMLString
+{
+    return [self impl]->recursive_toHTML(true).getNSString();
+}
+
+//
+// begin deprecated methods
+//
+- (void)setNodeValue:(NSString *)string
+{
+    [self setNodeValue:string error:nil];
+}
+
+- (id<DOMNode>)insert:(id<DOMNode>)newChild before:(id<DOMNode>)refChild
+{
+    return [self insertBefore:newChild :refChild error:nil];
+}
+
+- (id<DOMNode>)replace:(id<DOMNode>)newChild child:(id<DOMNode>)oldChild
+{
+    return [self replaceChild:newChild :oldChild error:nil];
+}
+
+- (id<DOMNode>)removeChild:(id<DOMNode>)oldChild
+{
+    return [self removeChild:oldChild error:nil];
+}
+
+- (id<DOMNode>)appendChild:(id<DOMNode>)newChild
+{
+    return [self appendChild:newChild error:nil];
+}
+
+- (void)setPrefix:(NSString *)prefix
+{
+    [self setPrefix:prefix error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMNamedNodeMap
+
+ at implementation WebCoreDOMNamedNodeMap
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMNamedNodeMap, NamedNodeMapImpl)
+
+// Note: only objects that derive directly from WebDOMObject need their own dealloc method.
+// This is due to the fact that some of the details impl objects derive from
+// khtml::Shared, others from khtml::TreeShared (which do not share a base type), and we 
+// have to cast to the right type in order to call the deref() function.
+- (void)dealloc
+{
+    NamedNodeMapImpl *instance = static_cast<NamedNodeMapImpl *>(details);
+    if (instance)
+        instance->deref();
+    [super dealloc];
+}
+
+- (id <DOMNode>)getNamedItem:(NSString *)name
+{
+    ASSERT(name);
+
+    // Method not reflected in DOM::NamedNodeMapImpl interface
+    NamedNodeMap map = NamedNodeMapImpl::createInstance([self impl]);
+    Node result(map.getNamedItem(NSStringToDOMString(name)));
+    return [WebCoreDOMNode objectWithImpl:result.handle()];
+}
+
+- (id <DOMNode>)setNamedItem:(id <DOMNode>)arg error:(NSError **)error
+{
+    if (!arg) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::NamedNodeMapImpl interface
+    try {
+        NamedNodeMap map = NamedNodeMapImpl::createInstance([self impl]);
+        Node result(map.setNamedItem(nodeImpl(arg)));
+        return [WebCoreDOMNode objectWithImpl:result.handle()];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMNode>)removeNamedItem:(NSString *)name error:(NSError **)error
+{
+    if (!name) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::NamedNodeMapImpl interface
+    try {
+        NamedNodeMap map = NamedNodeMapImpl::createInstance([self impl]);
+        Node result(map.removeNamedItem(NSStringToDOMString(name)));
+        return [WebCoreDOMNode objectWithImpl:result.handle()];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMNode>)item:(unsigned long)index
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->item(index)];
+}
+
+- (unsigned long)length
+{
+    return [self impl]->length();
+}
+
+- (id <DOMNode>)getNamedItemNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    if (!namespaceURI || !localName) {
+        return nil;
+    }
+
+    // Method not reflected in DOM::NamedNodeMapImpl interface
+    NamedNodeMap map = NamedNodeMapImpl::createInstance([self impl]);
+    Node result(map.getNamedItemNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName)));
+    return [WebCoreDOMNode objectWithImpl:result.handle()];
+}
+
+- (id <DOMNode>)setNamedItemNS:(id <DOMNode>)arg error:(NSError **)error
+{
+    if (!arg) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::NamedNodeMapImpl interface
+    try {
+        NamedNodeMap map = NamedNodeMapImpl::createInstance([self impl]);
+        Node result(map.setNamedItemNS(nodeImpl(arg)));
+        return [WebCoreDOMNode objectWithImpl:result.handle()];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMNode>)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName error:(NSError **)error
+{
+    if (!namespaceURI || !localName) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::NamedNodeMapImpl interface
+    try {
+        NamedNodeMap map = NamedNodeMapImpl::createInstance([self impl]);
+        Node result(map.removeNamedItemNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName)));
+        return [WebCoreDOMNode objectWithImpl:result.handle()];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+//
+// begin deprecated methods
+//
+- (id<DOMNode>)setNamedItem:(id<DOMNode>)arg
+{
+    return [self setNamedItem:arg error:nil];
+}
+
+- (id<DOMNode>)removeNamedItem:(NSString *)name
+{
+    return [self removeNamedItem:name error:nil];
+}
+
+- (id<DOMNode>)setNamedItemNS:(id<DOMNode>)arg
+{
+    return [self setNamedItemNS:arg error:nil];
+}
+
+- (id<DOMNode>)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    return [self removeNamedItemNS:namespaceURI :localName error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMNodeList
+
+ at implementation WebCoreDOMNodeList
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMNodeList, NodeListImpl)
+
+// Note: only objects that derive directly from WebDOMObject need their own dealloc method.
+// This is due to the fact that some of the details impl objects derive from
+// khtml::Shared, others from khtml::TreeShared (which do not share a base type), and we 
+// have to cast to the right type in order to call the deref() function.
+- (void)dealloc
+{
+    NodeListImpl *instance = static_cast<NodeListImpl *>(details);
+    if (instance)
+        instance->deref();
+    [super dealloc];
+}
+
+- (id <DOMNode>)item:(unsigned long)index
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->item(index)];
+}
+
+- (unsigned long)length
+{
+    return [self impl]->length();
+}
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMImplementation
+
+ at implementation WebCoreDOMImplementation
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMImplementation, DOMImplementationImpl)
+
+// Note: only objects that derive directly from WebDOMObject need their own dealloc method.
+// This is due to the fact that some of the details impl objects derive from
+// khtml::Shared, others from khtml::TreeShared (which do not share a base type), and we 
+// have to cast to the right type in order to call the deref() function.
+- (void)dealloc
+{
+    DOMImplementationImpl *instance = static_cast<DOMImplementationImpl *>(details);
+    if (instance)
+        instance->deref();
+    [super dealloc];
+}
+
+- (BOOL)hasFeature:(NSString *)feature :(NSString *)version
+{
+    ASSERT(feature);
+    ASSERT(version);
+
+    return [self impl]->hasFeature(NSStringToDOMString(feature), NSStringToDOMString(version));
+}
+
+- (id <DOMDocumentType>)createDocumentType:(NSString *)qualifiedName :(NSString *)publicId :(NSString *)systemId error:(NSError **)error
+{
+    ASSERT(qualifiedName);
+    ASSERT(publicId);
+    ASSERT(systemId);
+
+    int code;
+    DocumentTypeImpl *impl = [self impl]->createDocumentType(NSStringToDOMString(qualifiedName), NSStringToDOMString(publicId), NSStringToDOMString(systemId), code);
+    id <DOMDocumentType> result = [WebCoreDOMDocumentType objectWithImpl:impl];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMDocument>)createDocument:(NSString *)namespaceURI :(NSString *)qualifiedName :(id <DOMDocumentType>)doctype error:(NSError **)error
+{
+    ASSERT(namespaceURI);
+    ASSERT(qualifiedName);
+
+    int code;
+    DocumentType dt = DocumentTypeImpl::createInstance(documentTypeImpl(doctype));
+    DocumentImpl *impl = [self impl]->createDocument(NSStringToDOMString(namespaceURI), NSStringToDOMString(qualifiedName), dt, code);
+    id <DOMDocument> result = [WebCoreDOMDocument objectWithImpl:impl];
+    fillInError(error, code);
+    return result;
+}
+
+//
+// begin deprecated methods
+//
+- (id<DOMDocumentType>)createDocumentType:(NSString *)qualifiedName :(NSString *)publicId :(NSString *)systemId :(int *)exceptionCode
+{
+    ASSERT(qualifiedName);
+    ASSERT(publicId);
+    ASSERT(systemId);
+
+    DocumentTypeImpl *impl = [self impl]->createDocumentType(NSStringToDOMString(qualifiedName), NSStringToDOMString(publicId), NSStringToDOMString(systemId), *exceptionCode);
+    return [WebCoreDOMDocumentType objectWithImpl:impl];
+}
+
+- (id<DOMDocument>)createDocument:(NSString *)namespaceURI :(NSString *)qualifiedName :(id<DOMDocumentType>)doctype
+{
+    return [self createDocument:namespaceURI :qualifiedName :doctype error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMDocumentFragment
+
+ at implementation WebCoreDOMDocumentFragment
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMDocumentFragment, DocumentFragmentImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMDocument
+
+ at implementation WebCoreDOMDocument
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMDocument, DocumentImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (id <DOMDocumentType>)doctype
+{
+    return [WebCoreDOMDocumentType objectWithImpl:[self impl]->doctype()];
+}
+
+- (id <DOMImplementation>)implementation
+{
+    return [WebCoreDOMImplementation objectWithImpl:[self impl]->implementation()];
+}
+
+- (id <DOMElement>)documentElement
+{
+    return [WebCoreDOMElement objectWithImpl:[self impl]->documentElement()];
+}
+
+- (id <DOMElement>)createElement:(NSString *)tagName error:(NSError **)error
+{
+    ASSERT(tagName);
+
+    int code;
+    id <DOMElement> result = [WebCoreDOMElement objectWithImpl:[self impl]->createElement(NSStringToDOMString(tagName), code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMDocumentFragment>)createDocumentFragment
+{
+    return [WebCoreDOMDocumentFragment objectWithImpl:[self impl]->createDocumentFragment()];
+}
+
+- (id <DOMText>)createTextNode:(NSString *)data
+{
+    ASSERT(data);
+
+    return [WebCoreDOMText objectWithImpl:[self impl]->createTextNode(NSStringToDOMString(data))];
+}
+
+- (id <DOMComment>)createComment:(NSString *)data
+{
+    ASSERT(data);
+
+    return [WebCoreDOMComment objectWithImpl:[self impl]->createComment(NSStringToDOMString(data))];
+}
+
+- (id <DOMCDATASection>)createCDATASection:(NSString *)data error:(NSError **)error
+{
+    ASSERT(data);
+
+    // Documentation says we can raise a NOT_SUPPORTED_ERR.
+    // However, the lower layer does not report that error up to us.
+    return [WebCoreDOMCDATASection objectWithImpl:[self impl]->createCDATASection(NSStringToDOMString(data))];
+}
+
+- (id <DOMProcessingInstruction>)createProcessingInstruction:(NSString *)target :(NSString *)data error:(NSError **)error
+{
+    ASSERT(target);
+    ASSERT(data);
+
+    // Documentation says we can raise a INVALID_CHARACTER_ERR or a NOT_SUPPORTED_ERR.
+    // However, the lower layer does not report these errors up to us.
+    return [WebCoreDOMProcessingInstruction objectWithImpl:[self impl]->createProcessingInstruction(NSStringToDOMString(target), NSStringToDOMString(data))];
+}
+
+- (id <DOMAttr>)createAttribute:(NSString *)name error:(NSError **)error
+{
+    ASSERT(name);
+
+    // Method not reflected in DOM::DocumentImpl interface
+    try {
+        Document doc(DocumentImpl::createInstance([self impl]));
+        Attr result(doc.createAttribute(NSStringToDOMString(name)));
+        AttrImpl *impl = static_cast<AttrImpl *>(result.handle());
+        return [WebCoreDOMAttr objectWithImpl:impl];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMEntityReference>)createEntityReference:(NSString *)name error:(NSError **)error
+{
+    ASSERT(name);
+
+    // Documentation says we can raise a INVALID_CHARACTER_ERR or a NOT_SUPPORTED_ERR.
+    // However, the lower layer does not report these errors up to us.
+    return [WebCoreDOMEntityReference objectWithImpl:[self impl]->createEntityReference(NSStringToDOMString(name))];
+}
+
+- (id <DOMNodeList>)getElementsByTagName:(NSString *)tagname
+{
+    ASSERT(tagname);
+
+    return [WebCoreDOMNodeList objectWithImpl:[self impl]->getElementsByTagNameNS(0, NSStringToDOMString(tagname).implementation())];
+}
+
+- (id <DOMNode>)importNode:(id <DOMNode>)importedNode :(BOOL)deep error:(NSError **)error
+{
+    int code;
+    WebCoreDOMNode *result = [WebCoreDOMNode objectWithImpl:[self impl]->importNode(nodeImpl(importedNode), deep, code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMElement>)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName error:(NSError **)error
+{
+    ASSERT(namespaceURI);
+    ASSERT(qualifiedName);
+
+    int code;
+    id <DOMElement> result = [WebCoreDOMElement objectWithImpl:[self impl]->createElementNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(qualifiedName), code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMAttr>)createAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName error:(NSError **)error
+{
+    ASSERT(namespaceURI);
+    ASSERT(qualifiedName);
+
+    // Method not reflected in DOM::DocumentImpl interface
+    try {
+        Document doc(DocumentImpl::createInstance([self impl]));
+        Attr result(doc.createAttributeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(qualifiedName)));
+        AttrImpl *impl = static_cast<AttrImpl *>(result.handle());
+        return [WebCoreDOMAttr objectWithImpl:impl];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    ASSERT(namespaceURI);
+    ASSERT(localName);
+
+    return [WebCoreDOMNodeList objectWithImpl:[self impl]->getElementsByTagNameNS(NSStringToDOMString(namespaceURI).implementation(), NSStringToDOMString(localName).implementation())];
+}
+
+- (id <DOMElement>)getElementById:(NSString *)elementId
+{
+    ASSERT(elementId);
+
+    return [WebCoreDOMElement objectWithImpl:[self impl]->getElementById(NSStringToDOMString(elementId))];
+}
+
+//
+// begin deprecated methods
+//
+- (id<DOMElement>)createElement:(NSString *)tagName
+{
+    return [self createElement:tagName error:nil];
+}
+
+- (id<DOMElement>)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName
+{
+    return [self createElementNS:namespaceURI :qualifiedName error:nil];
+}
+
+- (id<DOMCDATASection>)createCDATASection:(NSString *)data
+{
+    return [self createCDATASection:data error:nil];
+}
+
+- (id<DOMProcessingInstruction>)createProcessingInstruction:(NSString *)target :(NSString *)data
+{
+    return [self createProcessingInstruction:target :data error:nil];
+}
+
+- (id<DOMAttr>)createAttribute:(NSString *)name;
+{
+    return [self createAttribute:name error:nil];
+}
+
+- (id<DOMEntityReference>)createEntityReference:(NSString *)name
+{
+    return [self createEntityReference:name error:nil];
+}
+
+- (id<DOMNode>)importNode:(id<DOMNode>)importedNode :(BOOL)deep
+{
+    return [self importNode:importedNode :deep error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMCharacterData
+
+ at implementation WebCoreDOMCharacterData
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMCharacterData, CharacterDataImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (NSString *)data
+{
+    // Documentation says we can raise a DOMSTRING_SIZE_ERR.
+    // However, the lower layer does not report that error up to us.
+    return domStringToNSString([self impl]->data());
+}
+
+- (void)setData:(NSString *)data error:(NSError **)error
+{
+    ASSERT(data);
+    
+    int code;
+    [self impl]->setData(NSStringToDOMString(data), code);
+    fillInError(error, code);
+}
+
+- (unsigned long)length
+{
+    return [self impl]->length();
+}
+
+- (NSString *)substringData:(unsigned long)offset :(unsigned long)count error:(NSError **)error
+{
+    int code;
+    NSString *result = domStringToNSString([self impl]->substringData(offset, count, code));
+    fillInError(error, code);
+    return result;
+}
+
+- (void)appendData:(NSString *)arg error:(NSError **)error
+{
+    ASSERT(arg);
+    
+    int code;
+    [self impl]->appendData(NSStringToDOMString(arg), code);
+    fillInError(error, code);
+}
+
+- (void)insertData:(unsigned long)offset :(NSString *)arg error:(NSError **)error
+{
+    ASSERT(arg);
+    
+    int code;
+    [self impl]->insertData(offset, NSStringToDOMString(arg), code);
+    fillInError(error, code);
+}
+
+- (void)deleteData:(unsigned long)offset :(unsigned long) count error:(NSError **)error;
+{
+    int code;
+    [self impl]->deleteData(offset, count, code);
+    fillInError(error, code);
+}
+
+- (void)replaceData:(unsigned long)offset :(unsigned long)count :(NSString *)arg error:(NSError **)error
+{
+    ASSERT(arg);
+
+    int code;
+    [self impl]->replaceData(offset, count, NSStringToDOMString(arg), code);
+    fillInError(error, code);
+}
+
+//
+// begin deprecated methods
+//
+- (void)setData: (NSString *)data
+{
+    [self setData:data error:nil];
+}
+
+- (NSString *)substringData: (unsigned long)offset :(unsigned long)count
+{
+    return [self substringData:offset :count error:nil];
+}
+
+- (void)appendData:(NSString *)arg
+{
+    [self appendData:arg error:nil];
+}
+
+- (void)insertData:(unsigned long)offset :(NSString *)arg
+{
+    [self insertData:offset :arg error:nil];
+}
+
+- (void)deleteData:(unsigned long)offset :(unsigned long)count
+{
+    [self deleteData:offset :count error:nil];
+}
+
+- (void)replaceData:(unsigned long)offset :(unsigned long)count :(NSString *)arg
+{
+    [self replaceData:offset :count :arg error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMAttr
+
+ at implementation WebCoreDOMAttr
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMAttr, AttrImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (NSString *)name
+{
+    return domStringToNSString([self impl]->nodeName());
+}
+
+- (BOOL)specified
+{
+    return [self impl]->specified();
+}
+
+- (NSString *)value
+{
+    return domStringToNSString([self impl]->nodeValue());
+}
+
+- (void)setValue:(NSString *)value error:(NSError **)error
+{
+    ASSERT(value);
+
+    int code;
+    [self impl]->setValue(NSStringToDOMString(value), code);
+    fillInError(error, code);
+}
+
+- (id <DOMElement>)ownerElement
+{
+    return [WebCoreDOMElement objectWithImpl:[self impl]->ownerElement()];
+}
+
+//
+// begin deprecated methods
+//
+- (void)setValue:(NSString *)value
+{
+    [self setValue:value error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMElement
+
+ at implementation WebCoreDOMElement
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMElement, ElementImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (NSString *)tagName
+{
+    return domStringToNSString([self impl]->tagName());
+}
+
+- (NSString *)getAttribute:(NSString *)name
+{
+    ASSERT(name);
+
+    return domStringToNSString([self impl]->getAttribute(NSStringToDOMString(name)));
+}
+
+- (void)setAttribute:(NSString *)name :(NSString *)value error:(NSError **)error
+{
+    ASSERT(name);
+    ASSERT(value);
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        element.setAttribute(NSStringToDOMString(name), NSStringToDOMString(value));
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+    }
+}
+
+- (void)removeAttribute:(NSString *)name error:(NSError **)error
+{
+    ASSERT(name);
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        element.removeAttribute(NSStringToDOMString(name));
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+    }
+}
+
+- (id <DOMAttr>)getAttributeNode:(NSString *)name
+{
+    ASSERT(name);
+
+    // Method not reflected in DOM::ElementImpl interface
+    Element element(ElementImpl::createInstance([self impl]));
+    Attr result(element.getAttributeNode(NSStringToDOMString(name)));
+    return [WebCoreDOMAttr objectWithImpl:static_cast<AttrImpl *>(result.handle())];
+}
+
+- (id <DOMAttr>)setAttributeNode:(id <DOMAttr>)newAttr error:(NSError **)error
+{
+    if (!newAttr) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        Attr attr(AttrImpl::createInstance(attrImpl(newAttr)));
+        Attr result(element.setAttributeNode(attr));
+        return [WebCoreDOMAttr objectWithImpl:static_cast<AttrImpl *>(result.handle())];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMAttr>)removeAttributeNode:(id <DOMAttr>)oldAttr error:(NSError **)error
+{
+    if (!oldAttr) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        Attr attr(AttrImpl::createInstance(attrImpl(oldAttr)));
+        Attr result(element.removeAttributeNode(attr));
+        return [WebCoreDOMAttr objectWithImpl:static_cast<AttrImpl *>(result.handle())];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMNodeList>)getElementsByTagName:(NSString *)name
+{
+    ASSERT(name);
+
+    return [WebCoreDOMNodeList objectWithImpl:[self impl]->getElementsByTagNameNS(0, NSStringToDOMString(name).implementation())];
+}
+
+- (NSString *)getAttributeNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    ASSERT(namespaceURI);
+    ASSERT(localName);
+
+    Element element(ElementImpl::createInstance([self impl]));
+    return domStringToNSString(element.getAttributeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName)));
+}
+
+- (void)setAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName :(NSString *)value error:(NSError **)error
+{
+    ASSERT(namespaceURI);
+    ASSERT(qualifiedName);
+    ASSERT(value);
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        element.setAttributeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(qualifiedName), NSStringToDOMString(value));
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+    }
+}
+
+- (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName error:(NSError **)error
+{
+    ASSERT(namespaceURI);
+    ASSERT(localName);
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        element.removeAttributeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName));
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+    }
+}
+
+- (id <DOMAttr>)getAttributeNodeNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    ASSERT(namespaceURI);
+    ASSERT(localName);
+
+    // Method not reflected in DOM::ElementImpl interface
+    Element element(ElementImpl::createInstance([self impl]));
+    Attr result(element.getAttributeNodeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName)));
+    return [WebCoreDOMAttr objectWithImpl:static_cast<AttrImpl *>(result.handle())];
+}
+
+- (id <DOMAttr>)setAttributeNodeNS:(id <DOMAttr>)newAttr error:(NSError **)error
+{
+    if (!newAttr) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        Attr attr(AttrImpl::createInstance(attrImpl(newAttr)));
+        Attr result(element.setAttributeNodeNS(attr));
+        return [WebCoreDOMAttr objectWithImpl:static_cast<AttrImpl *>(result.handle())];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    ASSERT(namespaceURI);
+    ASSERT(localName);
+
+    return [WebCoreDOMNodeList objectWithImpl:[self impl]->getElementsByTagNameNS(NSStringToDOMString(namespaceURI).implementation(), NSStringToDOMString(localName).implementation())];
+}
+
+- (BOOL)hasAttribute:(NSString *)name
+{
+    ASSERT(name);
+
+    // Method not reflected in DOM::ElementImpl interface
+    Element element(ElementImpl::createInstance([self impl]));
+    return element.hasAttribute(NSStringToDOMString(name));
+}
+
+- (BOOL)hasAttributeNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    ASSERT(namespaceURI);
+    ASSERT(localName);
+
+    // Method not reflected in DOM::ElementImpl interface
+    Element element(ElementImpl::createInstance([self impl]));
+    return element.hasAttributeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName));
+}
+
+//
+// begin deprecated methods
+//
+- (void)setAttribute:(NSString *)name :(NSString *)value
+{
+    [self setAttribute:name :value error:nil];
+}
+
+- (void)removeAttribute:(NSString *)name
+{
+    [self removeAttribute:name error:nil];
+}
+
+- (id<DOMAttr>)setAttributeNode:(id<DOMAttr>)newAttr
+{
+    return [self setAttributeNode:newAttr error:nil];
+}
+
+- (id<DOMAttr>)removeAttributeNode:(id<DOMAttr>)oldAttr
+{
+    return [self removeAttributeNode:oldAttr error:nil];
+}
+
+- (void)setAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName :(NSString *)value
+{
+    [self setAttributeNS:namespaceURI :qualifiedName :value error:nil];
+}
+
+- (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    [self removeAttributeNS:namespaceURI :localName error:nil];
+}
+
+- (id<DOMAttr>)setAttributeNodeNS:(id<DOMAttr>)newAttr
+{
+    return [self setAttributeNodeNS:newAttr error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMText
+
+ at implementation WebCoreDOMText
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMText, TextImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (id <DOMText>)splitText:(unsigned long)offset error:(NSError **)error
+{
+    int code;
+    id <DOMText> result = [WebCoreDOMText objectWithImpl:[self impl]->splitText(offset, code)];
+    fillInError(error, code);
+    return result;
+}
+
+//
+// begin deprecated methods
+//
+- (id<DOMText>)splitText:(unsigned long)offset
+{
+    return [self splitText:offset error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMComment
+
+ at implementation WebCoreDOMComment
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMComment, CommentImpl)
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMCDATASection
+
+ at implementation WebCoreDOMCDATASection
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMCDATASection, CDATASectionImpl)
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMDocumentType
+
+ at implementation WebCoreDOMDocumentType
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMDocumentType, DocumentTypeImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (NSString *)name
+{
+    return domStringToNSString([self impl]->publicId());
+}
+
+- (id <DOMNamedNodeMap>)entities
+{
+    return [WebCoreDOMNamedNodeMap objectWithImpl:[self impl]->entities()];
+}
+
+- (id <DOMNamedNodeMap>)notations
+{
+    return [WebCoreDOMNamedNodeMap objectWithImpl:[self impl]->notations()];
+}
+
+- (NSString *)publicId
+{
+    return domStringToNSString([self impl]->publicId());
+}
+
+- (NSString *)systemId
+{
+    return domStringToNSString([self impl]->systemId());
+}
+
+- (NSString *)internalSubset
+{
+    return domStringToNSString([self impl]->internalSubset());
+}
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMNotation
+
+ at implementation WebCoreDOMNotation
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMNotation, NotationImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (NSString *)publicId
+{
+    return domStringToNSString([self impl]->publicId());
+}
+
+- (NSString *)systemId
+{
+    return domStringToNSString([self impl]->systemId());
+}
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMEntity
+
+ at implementation WebCoreDOMEntity
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMEntity, EntityImpl)
+
+- (NSString *)publicId
+{
+    return domStringToNSString([self impl]->publicId());
+}
+
+- (NSString *)systemId
+{
+    return domStringToNSString([self impl]->systemId());
+}
+
+- (NSString *)notationName
+{
+    return domStringToNSString([self impl]->notationName());
+}
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMEntityReference
+
+ at implementation WebCoreDOMEntityReference
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMEntityReference, EntityReferenceImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMProcessingInstruction
+
+ at implementation WebCoreDOMProcessingInstruction
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMProcessingInstruction, ProcessingInstructionImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (NSString *)target
+{
+    return domStringToNSString([self impl]->target());
+}
+
+- (NSString *)data
+{
+    return domStringToNSString([self impl]->data());
+}
+
+- (void)setData:(NSString *)data error:(NSError **)error
+{
+    ASSERT(data);
+
+    int code;
+    [self impl]->setData(NSStringToDOMString(data), code);
+    fillInError(error, code);
+}
+
+//
+// begin deprecated methods
+//
+- (void)setData:(NSString *)data
+{
+    [self setData:data error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMRange
+
+ at implementation WebCoreDOMRange
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMRange, RangeImpl)
+
+// Note: only objects that derive directly from WebDOMObject need their own dealloc method.
+// This is due to the fact that some of the details impl objects derive from
+// khtml::Shared, others from khtml::TreeShared (which do not share a base type), and we 
+// have to cast to the right type in order to call the deref() function.
+- (void)dealloc
+{
+    RangeImpl *instance = static_cast<RangeImpl *>(details);
+    if (instance)
+        instance->deref();
+    [super dealloc];
+}
+
+- (id <DOMNode>)startContainer:(NSError **)error
+{
+    int code;
+    id <DOMNode> result = [WebCoreDOMNode objectWithImpl:[self impl]->startContainer(code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (long)startOffset:(NSError **)error
+{
+    int code;
+    long result = [self impl]->startOffset(code);
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMNode>)endContainer:(NSError **)error
+{
+    int code;
+    id <DOMNode> result = [WebCoreDOMNode objectWithImpl:[self impl]->endContainer(code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (long)endOffset:(NSError **)error
+{
+    int code;
+    long result = [self impl]->endOffset(code);
+    fillInError(error, code);
+    return result;
+}
+
+- (BOOL)collapsed:(NSError **)error
+{
+    int code;
+    BOOL result = [self impl]->collapsed(code);
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMNode>)commonAncestorContainer:(NSError **)error
+{
+    int code;
+    id <DOMNode> result = [WebCoreDOMNode objectWithImpl:[self impl]->commonAncestorContainer(code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (void)setStart:(id <DOMNode>)refNode :(long)offset error:(NSError **)error
+{
+    int code;
+    [self impl]->setStart(nodeImpl(refNode), offset, code);
+    fillInError(error, code);
+}
+
+- (void)setEnd:(id <DOMNode>)refNode :(long)offset error:(NSError **)error
+{
+    int code;
+    [self impl]->setEnd(nodeImpl(refNode), offset, code);
+    fillInError(error, code);
+}
+
+- (void)setStartBefore:(id <DOMNode>)refNode error:(NSError **)error
+{
+    int code;
+    [self impl]->setStartBefore(nodeImpl(refNode), code);
+    fillInError(error, code);
+}
+
+- (void)setStartAfter:(id <DOMNode>)refNode error:(NSError **)error
+{
+    int code;
+    [self impl]->setStartAfter(nodeImpl(refNode), code);
+    fillInError(error, code);
+}
+
+- (void)setEndBefore:(id <DOMNode>)refNode error:(NSError **)error
+{
+    int code;
+    [self impl]->setEndBefore(nodeImpl(refNode), code);
+    fillInError(error, code);
+}
+
+- (void)setEndAfter:(id <DOMNode>)refNode error:(NSError **)error
+{
+    int code;
+    [self impl]->setEndAfter(nodeImpl(refNode), code);
+    fillInError(error, code);
+}
+
+- (void)collapse:(BOOL)toStart error:(NSError **)error
+{
+    int code;
+    [self impl]->collapse(toStart, code);
+    fillInError(error, code);
+}
+
+- (void)selectNode:(id <DOMNode>)refNode error:(NSError **)error
+{
+    int code;
+    [self impl]->selectNode(nodeImpl(refNode), code);
+    fillInError(error, code);
+}
+
+- (void)selectNodeContents:(id <DOMNode>)refNode error:(NSError **)error
+{
+    int code;
+    [self impl]->selectNodeContents(nodeImpl(refNode), code);
+    fillInError(error, code);
+}
+
+- (short)compareBoundaryPoints:(unsigned short)how :(id <DOMRange>)sourceRange error:(NSError **)error
+{
+    int code;
+    short result = [self impl]->compareBoundaryPoints(static_cast<Range::CompareHow>(how), rangeImpl(sourceRange), code);
+    fillInError(error, code);
+    return result;
+}
+
+- (void)deleteContents:(NSError **)error
+{
+    int code;
+    [self impl]->deleteContents(code);
+    fillInError(error, code);
+}
+
+- (id <DOMDocumentFragment>)extractContents:(NSError **)error
+{
+    int code;
+    id <DOMDocumentFragment> result = [WebCoreDOMDocumentFragment objectWithImpl:[self impl]->extractContents(code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMDocumentFragment>)cloneContents:(NSError **)error
+{
+    int code;
+    id <DOMDocumentFragment> result = [WebCoreDOMDocumentFragment objectWithImpl:[self impl]->cloneContents(code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (void)insertNode:(id <DOMNode>)newNode error:(NSError **)error
+{
+    int code;
+    [self impl]->insertNode(nodeImpl(newNode), code);
+    fillInError(error, code);
+}
+
+- (void)surroundContents:(id <DOMNode>)newParent error:(NSError **)error
+{
+    int code;
+    [self impl]->surroundContents(nodeImpl(newParent), code);
+    fillInError(error, code);
+}
+
+- (id <DOMRange>)cloneRange:(NSError **)error
+{
+    int code;
+    id <DOMRange> result = [WebCoreDOMRange objectWithImpl:[self impl]->cloneRange(code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (NSString *)toString:(NSError **)error
+{
+    int code;
+    NSString *result = domStringToNSString([self impl]->toString(code));
+    fillInError(error, code);
+    return result;
+}
+
+- (void)detach:(NSError **)error
+{
+    int code;
+    [self impl]->detach(code);
+    fillInError(error, code);
+}
+
+ at end
+
+//------------------------------------------------------------------------------------------
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 74cb9e8..af273a4 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -34,8 +34,9 @@
 #import "KWQPrinter.h"
 #import "KWQWindowWidget.h"
 #import "WebCoreBridge.h"
-#import "WebCoreDOMPrivate.h"
+#import "WebCoreDOM.h"
 #import "WebCoreViewFactory.h"
+#import "DOM.h"
 #import "csshelper.h"
 #import "html_documentimpl.h"
 #import "html_misc.h"
@@ -572,9 +573,11 @@ void KWQKHTMLPart::recordFormValue(const QString &name, const QString &value, HT
     if (!_formValuesAboutToBeSubmitted) {
         _formValuesAboutToBeSubmitted = [[NSMutableDictionary alloc] init];
         ASSERT(!_formAboutToBeSubmitted);
-        _formAboutToBeSubmitted = [[WebCoreDOMElement elementWithImpl:element] retain];
+        _formAboutToBeSubmitted = [[WebCoreDOMElement objectWithImpl:element] retain];
     } else {
-        ASSERT([_formAboutToBeSubmitted elementImpl] == element);
+        if ([_formAboutToBeSubmitted isKindOfClass:[WebCoreDOMElement class]]) {
+            ASSERT([(WebCoreDOMElement *)_formAboutToBeSubmitted impl] == element);
+        }
     }
     [_formValuesAboutToBeSubmitted setObject:value.getNSString() forKey:name.getNSString()];
 }
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 61b69ce..f601a4c 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -59,9 +59,9 @@ typedef khtml::RenderPart KHTMLRenderPart;
 @protocol WebCoreResourceLoader;
 @protocol WebCoreFileButton;
 @protocol WebCoreFileButtonDelegate;
- at protocol WebDOMDocument;
- at protocol WebDOMNode;
- at protocol WebDOMElement;
+ at protocol DOMDocument;
+ at protocol DOMNode;
+ at protocol DOMElement;
 
 extern NSString *WebCoreElementDOMNodeKey;
 extern NSString *WebCoreElementFrameKey;
@@ -179,15 +179,15 @@ typedef enum {
 - (NSString *)renderTreeAsExternalRepresentation;
 
 - (NSDictionary *)elementAtPoint:(NSPoint)point;
-- (id <WebDOMElement>)elementWithName:(NSString *)name inForm:(id <WebDOMElement>)form;
-- (id <WebDOMElement>)elementForView:(NSView *)view;
-- (BOOL)elementDoesAutoComplete:(id <WebDOMElement>)element;
-- (BOOL)elementIsPassword:(id <WebDOMElement>)element;
-- (id <WebDOMElement>)formForElement:(id <WebDOMElement>)element;
-- (id <WebDOMElement>)currentForm;
-- (NSArray *)controlsInForm:(id <WebDOMElement>)form;
-- (NSString *)searchForLabels:(NSArray *)labels beforeElement:(id <WebDOMElement>)element;
-- (NSString *)matchLabels:(NSArray *)labels againstElement:(id <WebDOMElement>)element;
+- (id <DOMElement>)elementWithName:(NSString *)name inForm:(id <DOMElement>)form;
+- (id <DOMElement>)elementForView:(NSView *)view;
+- (BOOL)elementDoesAutoComplete:(id <DOMElement>)element;
+- (BOOL)elementIsPassword:(id <DOMElement>)element;
+- (id <DOMElement>)formForElement:(id <DOMElement>)element;
+- (id <DOMElement>)currentForm;
+- (NSArray *)controlsInForm:(id <DOMElement>)form;
+- (NSString *)searchForLabels:(NSArray *)labels beforeElement:(id <DOMElement>)element;
+- (NSString *)matchLabels:(NSArray *)labels againstElement:(id <DOMElement>)element;
 
 - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
 - (void)jumpToSelection;
@@ -198,9 +198,9 @@ typedef enum {
 
 - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string;
 
-- (id <WebDOMDocument>)DOMDocument;
+- (id <DOMDocument>)DOMDocument;
 
-- (void)setSelectionFrom:(id <WebDOMNode>)start startOffset:(int)startOffset to:(id <WebDOMNode>)end endOffset:(int) endOffset;
+- (void)setSelectionFrom:(id <DOMNode>)start startOffset:(int)startOffset to:(id <DOMNode>)end endOffset:(int) endOffset;
 
 - (BOOL)isSelectionEditable;
 - (BOOL)moveCaretToPoint:(NSPoint)point;
@@ -225,12 +225,12 @@ typedef enum {
 - (NSRect)visibleSelectionRect;
 - (NSImage *)selectionImage;
 
-- (id <WebDOMNode>)selectionStart;
+- (id <DOMNode>)selectionStart;
 - (int)selectionStartOffset;
-- (id <WebDOMNode>)selectionEnd;
+- (id <DOMNode>)selectionEnd;
 - (int)selectionEndOffset;
 
-- (NSAttributedString *)attributedStringFrom:(id <WebDOMNode>)startNode startOffset:(int)startOffset to:(id <WebDOMNode>)endNode endOffset:(int)endOffset;
+- (NSAttributedString *)attributedStringFrom:(id <DOMNode>)startNode startOffset:(int)startOffset to:(id <DOMNode>)endNode endOffset:(int)endOffset;
 
 + (NSString *)stringWithData:(NSData *)data textEncoding:(CFStringEncoding)textEncoding;
 + (NSString *)stringWithData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
@@ -267,8 +267,8 @@ typedef enum {
 - (void)frameDetached;
 - (NSView *)documentView;
 
-- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload onLoadEvent:(BOOL)onLoad target:(NSString *)target triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values;
-- (void)postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values;
+- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload onLoadEvent:(BOOL)onLoad target:(NSString *)target triggeringEvent:(NSEvent *)event form:(NSObject <DOMElement> *)form formValues:(NSDictionary *)values;
+- (void)postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(NSObject <DOMElement> *)form formValues:(NSDictionary *)values;
 
 - (WebCoreBridge *)createWindowWithURL:(NSURL *)URL frameName:(NSString *)name;
 - (void)showWindow;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 4928611..f828636 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -29,6 +29,7 @@
 #import "dom_node.h"
 #import "dom_docimpl.h"
 #import "dom_nodeimpl.h"
+#import "dom2_rangeimpl.h"
 #import "htmlediting.h"
 #import "html_documentimpl.h"
 #import "html_formimpl.h"
@@ -64,7 +65,8 @@
 #import "KWQPrinter.h"
 #import "KWQAccObjectCache.h"
 
-#import "WebCoreDOMPrivate.h"
+#import "DOM.h"
+#import "WebCoreDOM.h"
 #import "WebCoreImageRenderer.h"
 #import "WebCoreTextRendererFactory.h"
 #import "WebCoreViewFactory.h"
@@ -711,7 +713,7 @@ static BOOL nowPrinting(WebCoreBridge *self)
     return _part->sendContextMenuEvent(event);
 }
 
-- (id <WebDOMElement>)elementForView:(NSView *)view
+- (id <DOMElement>)elementForView:(NSView *)view
 {
     // FIXME: implemented currently for only a subset of the KWQ widgets
     if ([view conformsToProtocol:@protocol(KWQWidgetHolder)]) {
@@ -719,7 +721,7 @@ static BOOL nowPrinting(WebCoreBridge *self)
         QWidget *widget = [widgetHolder widget];
         if (widget != nil) {
             NodeImpl *node = static_cast<const RenderWidget *>(widget->eventFilterObject())->element();
-            return [WebCoreDOMElement elementWithImpl:static_cast<ElementImpl *>(node)];
+            return [WebCoreDOMElement objectWithImpl:static_cast<ElementImpl *>(node)];
         }
     }
     return nil;
@@ -737,27 +739,27 @@ static NSView *viewForElement(DOM::ElementImpl *elementImpl)
     return nil;
 }
 
-static HTMLInputElementImpl *inputElementFromDOMElement(id <WebDOMElement>element)
+static HTMLInputElementImpl *inputElementFromDOMElement(id <DOMElement> element)
 {
     ASSERT([(NSObject *)element isKindOfClass:[WebCoreDOMElement class]]);
-    DOM::ElementImpl *domElement = [(WebCoreDOMElement *)element elementImpl];
+    DOM::ElementImpl *domElement = [(WebCoreDOMElement *)element impl];
     if (domElement && idFromNode(domElement) == ID_INPUT) {
         return static_cast<HTMLInputElementImpl *>(domElement);
     }
     return nil;
 }
 
-static HTMLFormElementImpl *formElementFromDOMElement(id <WebDOMElement>element)
+static HTMLFormElementImpl *formElementFromDOMElement(id <DOMElement> element)
 {
     ASSERT([(NSObject *)element isKindOfClass:[WebCoreDOMElement class]]);
-    DOM::ElementImpl *domElement = [(WebCoreDOMElement *)element elementImpl];
+    DOM::ElementImpl *domElement = [(WebCoreDOMElement *)element impl];
     if (domElement && idFromNode(domElement) == ID_FORM) {
         return static_cast<HTMLFormElementImpl *>(domElement);
     }
     return nil;
 }
 
-- (id <WebDOMElement>)elementWithName:(NSString *)name inForm:(id <WebDOMElement>)form
+- (id <DOMElement>)elementWithName:(NSString *)name inForm:(id <DOMElement>)form
 {
     HTMLFormElementImpl *formElement = formElementFromDOMElement(form);
     if (formElement) {
@@ -767,14 +769,14 @@ static HTMLFormElementImpl *formElementFromDOMElement(id <WebDOMElement>element)
             HTMLGenericFormElementImpl *elt = elements.at(i);
             // Skip option elements, other duds
             if (elt->name() == targetName) {
-                return [WebCoreDOMElement elementWithImpl:elt];
+                return [WebCoreDOMElement objectWithImpl:elt];
             }
         }
     }
     return nil;
 }
 
-- (BOOL)elementDoesAutoComplete:(id <WebDOMElement>)element
+- (BOOL)elementDoesAutoComplete:(id <DOMElement>)element
 {
     HTMLInputElementImpl *inputElement = inputElementFromDOMElement(element);
     return inputElement != nil
@@ -782,32 +784,32 @@ static HTMLFormElementImpl *formElementFromDOMElement(id <WebDOMElement>element)
         && inputElement->autoComplete();
 }
 
-- (BOOL)elementIsPassword:(id <WebDOMElement>)element
+- (BOOL)elementIsPassword:(id <DOMElement>)element
 {
     HTMLInputElementImpl *inputElement = inputElementFromDOMElement(element);
     return inputElement != nil
         && inputElement->inputType() == HTMLInputElementImpl::PASSWORD;
 }
 
-- (id <WebDOMElement>)formForElement:(id <WebDOMElement>)element;
+- (id <DOMElement>)formForElement:(id <DOMElement>)element;
 {
     HTMLInputElementImpl *inputElement = inputElementFromDOMElement(element);
     if (inputElement) {
         HTMLFormElementImpl *formElement = inputElement->form();
         if (formElement) {
-            return [WebCoreDOMElement elementWithImpl:formElement];
+            return [WebCoreDOMElement objectWithImpl:formElement];
         }
     }
     return nil;
 }
 
-- (id <WebDOMElement>)currentForm
+- (id <DOMElement>)currentForm
 {
     HTMLFormElementImpl *formElement = _part->currentForm();
-    return formElement ? [WebCoreDOMElement elementWithImpl:formElement] : nil;
+    return formElement ? [WebCoreDOMElement objectWithImpl:formElement] : nil;
 }
 
-- (NSArray *)controlsInForm:(id <WebDOMElement>)form
+- (NSArray *)controlsInForm:(id <DOMElement>)form
 {
     NSMutableArray *results = nil;
     HTMLFormElementImpl *formElement = formElementFromDOMElement(form);
@@ -829,16 +831,16 @@ static HTMLFormElementImpl *formElementFromDOMElement(id <WebDOMElement>element)
     return results;
 }
 
-- (NSString *)searchForLabels:(NSArray *)labels beforeElement:(id <WebDOMElement>)element
+- (NSString *)searchForLabels:(NSArray *)labels beforeElement:(id <DOMElement>)element
 {
     ASSERT([(NSObject *)element isKindOfClass:[WebCoreDOMElement class]]);
-    return _part->searchForLabelsBeforeElement(labels, [(WebCoreDOMElement *)element elementImpl]);
+    return _part->searchForLabelsBeforeElement(labels, [(WebCoreDOMElement *)element impl]);
 }
 
-- (NSString *)matchLabels:(NSArray *)labels againstElement:(id <WebDOMElement>)element
+- (NSString *)matchLabels:(NSArray *)labels againstElement:(id <DOMElement>)element
 {
     ASSERT([(NSObject *)element isKindOfClass:[WebCoreDOMElement class]]);
-    return _part->matchLabelsAgainstElement(labels, [(WebCoreDOMElement *)element elementImpl]);
+    return _part->matchLabelsAgainstElement(labels, [(WebCoreDOMElement *)element impl]);
 }
 
 - (NSDictionary *)elementAtPoint:(NSPoint)point
@@ -909,7 +911,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(id <WebDOMElement>element)
         [element setObject:[NSNumber numberWithBool:node->isContentEditable()]
                     forKey:WebCoreElementIsEditableKey];
         
-        [element setObject:[WebCoreDOMNode nodeWithImpl:node] forKey:WebCoreElementDOMNodeKey];
+        [element setObject:[WebCoreDOMNode objectWithImpl:node] forKey:WebCoreElementDOMNodeKey];
     
         if (node->renderer() && node->renderer()->isImage()) {
             RenderImage *r = static_cast<RenderImage *>(node->renderer());
@@ -1014,12 +1016,12 @@ static HTMLFormElementImpl *formElementFromDOMElement(id <WebDOMElement>element)
     return _part->executeScript(QString::fromNSString(string), true).asString().getNSString();
 }
 
-- (id<WebDOMDocument>)DOMDocument
+- (id<DOMDocument>)DOMDocument
 {
-    return [WebCoreDOMDocument documentWithImpl:_part->xmlDocImpl()];
+    return [WebCoreDOMDocument objectWithImpl:_part->xmlDocImpl()];
 }
 
-- (void)setSelectionFrom:(id<WebDOMNode>)start startOffset:(int)startOffset to:(id<WebDOMNode>)end endOffset:(int) endOffset
+- (void)setSelectionFrom:(id<DOMNode>)start startOffset:(int)startOffset to:(id<DOMNode>)end endOffset:(int) endOffset
 {
     WebCoreDOMNode *startNode = start;
     WebCoreDOMNode *endNode = end;
@@ -1032,16 +1034,16 @@ static HTMLFormElementImpl *formElementFromDOMElement(id <WebDOMElement>element)
     return _part->attributedString(_part->selectionStart(), _part->selectionStartOffset(), _part->selectionEnd(), _part->selectionEndOffset());
 }
 
-- (NSAttributedString *)attributedStringFrom:(id<WebDOMNode>)start startOffset:(int)startOffset to:(id<WebDOMNode>)end endOffset:(int)endOffset
+- (NSAttributedString *)attributedStringFrom:(id<DOMNode>)start startOffset:(int)startOffset to:(id<DOMNode>)end endOffset:(int)endOffset
 {
     WebCoreDOMNode *startNode = start;
     WebCoreDOMNode *endNode = end;
     return _part->attributedString([startNode impl], startOffset, [endNode impl], endOffset);
 }
 
-- (id<WebDOMNode>)selectionStart
+- (id<DOMNode>)selectionStart
 {
-    return [WebCoreDOMNode nodeWithImpl:_part->selectionStart()];
+    return [WebCoreDOMNode objectWithImpl:_part->selectionStart()];
 }
 
 - (int)selectionStartOffset
@@ -1049,9 +1051,9 @@ static HTMLFormElementImpl *formElementFromDOMElement(id <WebDOMElement>element)
     return _part->selectionStartOffset();
 }
 
-- (id<WebDOMNode>)selectionEnd
+- (id<DOMNode>)selectionEnd
 {
-    return [WebCoreDOMNode nodeWithImpl:_part->selectionEnd()];
+    return [WebCoreDOMNode objectWithImpl:_part->selectionEnd()];
 }
 
 - (int)selectionEndOffset
diff --git a/WebCore/kwq/WebCoreDOM.h b/WebCore/kwq/WebCoreDOM.h
index 8ced47d..8702d5d 100644
--- a/WebCore/kwq/WebCoreDOM.h
+++ b/WebCore/kwq/WebCoreDOM.h
@@ -23,86 +23,290 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#import <Foundation/Foundation.h>
+#import "DOM.h"
 
 namespace DOM {
+    class AttrImpl;
+    class CDATASectionImpl;
+    class CharacterDataImpl;
+    class CommentImpl;
+    class DocumentFragmentImpl;
+    class DocumentTypeImpl;
+    class DocumentImpl;
     class DOMImplementationImpl;
+    class ElementImpl;
+    class EntityImpl;
+    class EntityReferenceImpl;
+    class NamedNodeMapImpl;
     class NodeImpl;
     class NodeListImpl;
-    class NamedNodeMapImpl;
+    class NotationImpl;
+    class ProcessingInstructionImpl;
+    class RangeImpl;
+    class TextImpl;
 }
 
- at protocol WebDOMAttr;
- at protocol WebDOMCharacterData;
- at protocol WebDOMComment;
- at protocol WebDOMCDATASection;
- at protocol WebDOMDocument;
- at protocol WebDOMDocumentFragment;
- at protocol WebDOMDocumentType;
- at protocol WebDOMElement;
- at protocol WebDOMEntityReference;
- at protocol WebDOMImplementation;
- at protocol WebDOMNamedNodeMap;
- at protocol WebDOMNode;
- at protocol WebDOMNodeList;
- at protocol WebDOMProcessingInstruction;
- at protocol WebDOMText;
+ at class NSObject;
 
- at interface WebCoreDOMNode : NSObject <WebDOMNode>
+ at interface WebCoreDOMObject : NSObject
 {
-    DOM::NodeImpl *impl;
+    void *details;
 }
+- (id)initWithDetails:(void *)d;
 @end
 
- at interface WebCoreDOMNamedNodeMap : NSObject <WebDOMNamedNodeMap>
-{
-    DOM::NamedNodeMapImpl *impl;
-}
+ at protocol WebCoreNodeImplWrapper
+- (DOM::NodeImpl *)impl;
 @end
 
- at interface WebCoreDOMNodeList : NSObject <WebDOMNodeList>
-{
-    DOM::NodeListImpl *impl;
-}
+ at protocol WebCoreNamedNodeMapImplWrapper
+- (DOM::NamedNodeMapImpl *)impl;
 @end
 
- at interface WebCoreDOMImplementation : NSObject <WebDOMImplementation>
-{
-    DOM::DOMImplementationImpl *impl;
-}
+ at protocol WebCoreNodeListImplWrapper
+- (DOM::NodeListImpl *)impl;
+ at end
+
+ at protocol WebCoreDOMImplementationImplWrapper
+- (DOM::DOMImplementationImpl *)impl;
+ at end
+
+ at protocol WebCoreDocumentFragmentImplWrapper
+- (DOM::DocumentFragmentImpl *)impl;
+ at end
+
+ at protocol WebCoreDocumentImplWrapper
+- (DOM::DocumentImpl *)impl;
 @end
 
- at interface WebCoreDOMDocumentType : WebCoreDOMNode <WebDOMDocumentType>
+ at protocol WebCoreCharacterDataImplWrapper
+- (DOM::CharacterDataImpl *)impl;
 @end
 
- at interface WebCoreDOMDocument : WebCoreDOMNode <WebDOMDocument>
+ at protocol WebCoreAttrImplWrapper
+- (DOM::AttrImpl *)impl;
 @end
 
- at interface WebCoreDOMEntityReference : WebCoreDOMNode <WebDOMEntityReference>
+ at protocol WebCoreElementImplWrapper
+- (DOM::ElementImpl *)impl;
 @end
 
- at interface WebCoreDOMElement : WebCoreDOMNode <WebDOMElement>
+ at protocol WebCoreTextImplWrapper
+- (DOM::TextImpl *)impl;
 @end
 
- at interface WebCoreDOMAttr : WebCoreDOMNode <WebDOMAttr> 
+ at protocol WebCoreCommentImplWrapper
+- (DOM::CommentImpl *)impl;
 @end
 
- at interface WebCoreDOMDocumentFragment : WebCoreDOMNode <WebDOMDocumentFragment>
+ at protocol WebCoreCDATASectionImplWrapper
+- (DOM::CDATASectionImpl *)impl;
 @end
 
- at interface WebCoreDOMCharacterData : WebCoreDOMNode <WebDOMCharacterData>
+ at protocol WebCoreDocumentTypeImplWrapper
+- (DOM::DocumentTypeImpl *)impl;
 @end
 
- at interface WebCoreDOMText : WebCoreDOMCharacterData <WebDOMText>
+ at protocol WebCoreNotationImplWrapper
+- (DOM::NotationImpl *)impl;
 @end
 
- at interface WebCoreDOMComment : WebCoreDOMCharacterData <WebDOMComment>
+ at protocol WebCoreEntityImplWrapper
+- (DOM::EntityImpl *)impl;
 @end
 
- at interface WebCoreDOMCDATASection : WebCoreDOMText <WebDOMCDATASection>
+ at protocol WebCoreEntityReferenceImplWrapper
+- (DOM::EntityReferenceImpl *)impl;
 @end
 
- at interface WebCoreDOMProcessingInstruction : WebCoreDOMNode <WebDOMProcessingInstruction>
+ at protocol WebCoreProcessingInstructionImplWrapper
+- (DOM::ProcessingInstructionImpl *)impl;
 @end
 
+ at protocol WebCoreRangeImplWrapper
+- (DOM::RangeImpl *)impl;
+ at end
+
+ at interface WebCoreDOMNode : WebCoreDOMObject <DOMNode, WebCoreNodeImplWrapper>
++ (WebCoreDOMNode *)objectWithImpl:(DOM::NodeImpl *)impl;
+- (id)initWithNodeImpl:(DOM::NodeImpl *)impl;
+ at end
+
+ at interface WebCoreDOMNamedNodeMap : WebCoreDOMObject <DOMNamedNodeMap, WebCoreNamedNodeMapImplWrapper>
++ (WebCoreDOMNamedNodeMap *)objectWithImpl:(DOM::NamedNodeMapImpl *)impl;
+- (id)initWithNamedNodeMapImpl:(DOM::NamedNodeMapImpl *)impl;
+ at end
+
+ at interface WebCoreDOMNodeList : WebCoreDOMObject <DOMNodeList, WebCoreNodeListImplWrapper>
++ (WebCoreDOMNodeList *)objectWithImpl:(DOM::NodeListImpl *)impl;
+- (id)initWithNodeListImpl:(DOM::NodeListImpl *)impl;
+ at end
+
+ at interface WebCoreDOMImplementation : WebCoreDOMObject <DOMImplementation, WebCoreDOMImplementationImplWrapper>
++ (WebCoreDOMImplementation *)objectWithImpl:(DOM::DOMImplementationImpl *)impl;
+- (id)initWithDOMImplementationImpl:(DOM::DOMImplementationImpl *)impl;
+ at end
+
+ at interface WebCoreDOMDocumentFragment : WebCoreDOMNode <DOMDocumentFragment, WebCoreDocumentFragmentImplWrapper>
++ (WebCoreDOMDocumentFragment *)objectWithImpl:(DOM::DocumentFragmentImpl *)impl;
+- (id)initWithDocumentFragmentImpl:(DOM::DocumentFragmentImpl *)impl;
+ at end
+
+ at interface WebCoreDOMDocument : WebCoreDOMNode <DOMDocument, WebCoreDocumentImplWrapper>
++ (WebCoreDOMDocument *)objectWithImpl:(DOM::DocumentImpl *)impl;
+- (id)initWithDocumentImpl:(DOM::DocumentImpl *)impl;
+ at end
+
+ at interface WebCoreDOMCharacterData : WebCoreDOMNode <DOMCharacterData, WebCoreCharacterDataImplWrapper>
++ (WebCoreDOMCharacterData *)objectWithImpl:(DOM::CharacterDataImpl *)impl;
+- (id)initWithCharacterDataImpl:(DOM::CharacterDataImpl *)impl;
+ at end
+
+ at interface WebCoreDOMAttr : WebCoreDOMNode <DOMAttr, WebCoreAttrImplWrapper>
++ (WebCoreDOMAttr *)objectWithImpl:(DOM::AttrImpl *)impl;
+- (id)initWithAttrImpl:(DOM::AttrImpl *)impl;
+ at end
+
+ at interface WebCoreDOMElement : WebCoreDOMNode <DOMElement, WebCoreElementImplWrapper>
++ (WebCoreDOMElement *)objectWithImpl:(DOM::ElementImpl *)impl;
+- (id)initWithElementImpl:(DOM::ElementImpl *)impl;
+ at end
+
+ at interface WebCoreDOMText : WebCoreDOMCharacterData <DOMText, WebCoreTextImplWrapper>
++ (WebCoreDOMText *)objectWithImpl:(DOM::TextImpl *)impl;
+- (id)initWithTextImpl:(DOM::TextImpl *)impl;
+ at end
+
+ at interface WebCoreDOMComment : WebCoreDOMCharacterData <WebCoreCommentImplWrapper>
++ (WebCoreDOMComment *)objectWithImpl:(DOM::CommentImpl *)impl;
+- (id)initWithCommentImpl:(DOM::CommentImpl *)impl;
+ at end
+
+ at interface WebCoreDOMCDATASection : WebCoreDOMText <DOMCDATASection, WebCoreCDATASectionImplWrapper>
++ (WebCoreDOMCDATASection *)objectWithImpl:(DOM::CDATASectionImpl *)impl;
+- (id)initWithCDATASectionImpl:(DOM::CDATASectionImpl *)impl;
+ at end
+
+ at interface WebCoreDOMDocumentType : WebCoreDOMNode <DOMDocumentType, WebCoreDocumentTypeImplWrapper>
++ (WebCoreDOMDocumentType *)objectWithImpl:(DOM::DocumentTypeImpl *)impl;
+- (id)initWithDocumentTypeImpl:(DOM::DocumentTypeImpl *)impl;
+ at end
+
+ at interface WebCoreDOMNotation : WebCoreDOMNode <DOMNotation, WebCoreNotationImplWrapper>
++ (WebCoreDOMNotation *)objectWithImpl:(DOM::NotationImpl *)impl;
+- (id)initWithNotationImpl:(DOM::NotationImpl *)impl;
+ at end
+
+ at interface WebCoreDOMEntity : WebCoreDOMNode <DOMEntity, WebCoreEntityImplWrapper>
++ (WebCoreDOMEntity *)objectWithImpl:(DOM::EntityImpl *)impl;
+- (id)initWithEntityImpl:(DOM::EntityImpl *)impl;
+ at end
+
+ at interface WebCoreDOMEntityReference : WebCoreDOMNode <DOMEntityReference, WebCoreEntityReferenceImplWrapper>
++ (WebCoreDOMEntityReference *)objectWithImpl:(DOM::EntityReferenceImpl *)impl;
+- (id)initWithEntityReferenceImpl:(DOM::EntityReferenceImpl *)impl;
+ at end
+
+ at interface WebCoreDOMProcessingInstruction : WebCoreDOMNode <DOMProcessingInstruction, WebCoreProcessingInstructionImplWrapper>
++ (WebCoreDOMProcessingInstruction *)objectWithImpl:(DOM::ProcessingInstructionImpl *)impl;
+- (id)initWithProcessingInstructionImpl:(DOM::ProcessingInstructionImpl *)impl;
+ at end
+
+ at interface WebCoreDOMRange : WebCoreDOMObject <DOMRange, WebCoreRangeImplWrapper>
++ (WebCoreDOMRange *)objectWithImpl:(DOM::RangeImpl *)impl;
+- (id)initWithRangeImpl:(DOM::RangeImpl *)impl;
+ at end
+
+
+//------------------------------------------------------------------------------------------
+// Impl accessor conveniences
 
+inline DOM::NodeImpl *nodeImpl(id <DOMNode> instance)
+{
+    return [(id <WebCoreNodeImplWrapper>)instance impl];
+}
+
+inline DOM::NamedNodeMapImpl *namedNodeMapImpl(id <DOMNamedNodeMap> instance)
+{
+    return [(id <WebCoreNamedNodeMapImplWrapper>)instance impl];
+}
+
+inline DOM::NodeListImpl *nodeListImpl(id <DOMNodeList> instance)
+{
+    return [(id <WebCoreNodeListImplWrapper>)instance impl];
+}
+
+inline DOM::DOMImplementationImpl *domImplementationImpl(id <DOMImplementation> instance)
+{
+    return [(id <WebCoreDOMImplementationImplWrapper>)instance impl];
+}
+
+inline DOM::DocumentFragmentImpl *documentFragmentImpl(id <DOMDocumentFragment> instance)
+{
+    return [(id <WebCoreDocumentFragmentImplWrapper>)instance impl];
+}
+
+inline DOM::DocumentImpl *documentImpl(id <DOMDocument> instance)
+{
+    return [(id <WebCoreDocumentImplWrapper>)instance impl];
+}
+
+inline DOM::CharacterDataImpl *characterDataImpl(id <DOMCharacterData> instance)
+{
+    return [(id <WebCoreCharacterDataImplWrapper>)instance impl];
+}
+
+inline DOM::AttrImpl *attrImpl(id <DOMAttr> instance)
+{
+    return [(id <WebCoreAttrImplWrapper>)instance impl];
+}
+
+inline DOM::ElementImpl *elementImpl(id <DOMElement> instance)
+{
+    return [(id <WebCoreElementImplWrapper>)instance impl];
+}
+
+inline DOM::TextImpl *textImpl(id <DOMText> instance)
+{
+    return [(id <WebCoreTextImplWrapper>)instance impl];
+}
+
+inline DOM::CommentImpl *commentImpl(id <DOMComment> instance)
+{
+    return [(id <WebCoreCommentImplWrapper>)instance impl];
+}
+
+inline DOM::CDATASectionImpl *cdataSectionImpl(id <DOMCDATASection> instance)
+{
+    return [(id <WebCoreCDATASectionImplWrapper>)instance impl];
+}
+
+inline DOM::DocumentTypeImpl *documentTypeImpl(id <DOMDocumentType> instance)
+{
+    return [(id <WebCoreDocumentTypeImplWrapper>)instance impl];
+}
+
+inline DOM::NotationImpl *notationImpl(id <DOMNotation> instance)
+{
+    return [(id <WebCoreNotationImplWrapper>)instance impl];
+}
+
+inline DOM::EntityImpl *entityImpl(id <DOMEntity> instance)
+{
+    return [(id <WebCoreEntityImplWrapper>)instance impl];
+}
+
+inline DOM::EntityReferenceImpl *entityReferenceImpl(id <DOMEntityReference> instance)
+{
+    return [(id <WebCoreEntityReferenceImplWrapper>)instance impl];
+}
+
+inline DOM::ProcessingInstructionImpl *processingInstructionImpl(id <DOMProcessingInstruction> instance)
+{
+    return [(id <WebCoreProcessingInstructionImplWrapper>)instance impl];
+}
+
+inline DOM::RangeImpl *rangeImpl(id <DOMRange> instance)
+{
+    return [(id <WebCoreRangeImplWrapper>)instance impl];
+}
diff --git a/WebCore/kwq/WebCoreDOM.mm b/WebCore/kwq/WebCoreDOM.mm
new file mode 100644
index 0000000..5f111fd
--- /dev/null
+++ b/WebCore/kwq/WebCoreDOM.mm
@@ -0,0 +1,1794 @@
+/*
+ * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import "WebCoreDOM.h"
+
+#import <Foundation/Foundation.h>
+
+#import <dom/dom_doc.h>
+#import <dom/dom_element.h>
+#import <dom/dom_exception.h>
+#import <dom/dom_node.h>
+#import <dom/dom_string.h>
+#import <dom/dom_text.h>
+#import <dom/dom_xml.h>
+#import <dom/dom2_range.h>
+#import <xml/dom_docimpl.h>
+#import <xml/dom_elementimpl.h>
+#import <xml/dom_nodeimpl.h>
+#import <xml/dom_stringimpl.h>
+#import <xml/dom_textimpl.h>
+#import <xml/dom_xmlimpl.h>
+#import <xml/dom2_rangeimpl.h>
+
+#import "KWQAssertions.h"
+#import "KWQLogging.h"
+
+using DOM::Attr;
+using DOM::AttrImpl;
+using DOM::CDATASectionImpl;
+using DOM::CharacterData;
+using DOM::CharacterDataImpl;
+using DOM::CommentImpl;
+using DOM::DocumentFragmentImpl;
+using DOM::DocumentType;
+using DOM::DocumentTypeImpl;
+using DOM::Document;
+using DOM::DocumentImpl;
+using DOM::DOMException;
+using DOM::DOMImplementation;
+using DOM::DOMImplementationImpl;
+using DOM::DOMString;
+using DOM::DOMStringImpl;
+using DOM::Element;
+using DOM::ElementImpl;
+using DOM::EntityImpl;
+using DOM::EntityReferenceImpl;
+using DOM::NamedNodeMap;
+using DOM::NamedNodeMapImpl;
+using DOM::Node;
+using DOM::NodeImpl;
+using DOM::NodeListImpl;
+using DOM::NotationImpl;
+using DOM::ProcessingInstruction;
+using DOM::ProcessingInstructionImpl;
+using DOM::Range;
+using DOM::RangeImpl;
+using DOM::TextImpl;
+
+//------------------------------------------------------------------------------------------
+// Static functions and data
+#pragma mark Static functions and data 
+
+NSString * const DOMErrorDomain = @"DOMErrorDomain";
+
+static CFMutableDictionaryRef wrapperCache(void)
+{
+    static CFMutableDictionaryRef wrapperCache = NULL;
+    if (!wrapperCache) {
+        // No need to retain/free either impl key, or id value.  Items will be removed
+        // from the cache in WebCoreDOMNode's dealloc method.
+        wrapperCache = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
+    }
+    return wrapperCache;
+}
+
+static id wrapperForImpl(const void *impl)
+{
+    return (id)CFDictionaryGetValue(wrapperCache(), impl);
+}
+
+static void setWrapperForImpl(id wrapper, const void *impl)
+{
+    CFDictionarySetValue(wrapperCache(), impl, wrapper);
+}
+
+static void removeWrapperForImpl(const void *impl)
+{
+    CFDictionaryRemoveValue(wrapperCache(), impl);
+}
+
+static NSString *domStringToNSString(const DOMString &aString)
+{
+    return [NSString stringWithCharacters:(unichar *)aString.unicode() length:aString.length()];
+}
+
+static DOMString NSStringToDOMString(NSString *aString)
+{
+    QChar *chars = (QChar *)malloc([aString length] * sizeof(QChar));
+    [aString getCharacters:(unichar *)chars];
+    DOMString ret(chars, [aString length]);
+    free(chars);
+    return ret;
+}
+
+static void fillInError(NSError **error, int code)
+{
+    if (!error || !code)
+        return;
+        
+    *error = [NSError errorWithDomain:DOMErrorDomain code:code userInfo:nil];
+}
+    
+//------------------------------------------------------------------------------------------
+// Macros
+
+#define WEB_CORE_INTERNAL_METHODS(ObjCClass,CPlusPlusClass) \
++ (ObjCClass *)objectWithImpl:(CPlusPlusClass *)impl \
+{ \
+    if (!impl) \
+        return nil; \
+    id cachedInstance; \
+    cachedInstance = wrapperForImpl(impl); \
+    if (cachedInstance) \
+        return [[cachedInstance retain] autorelease]; \
+    ObjCClass *instance = [ObjCClass alloc]; \
+    return [[instance initWith##CPlusPlusClass:impl] autorelease]; \
+} \
+- (id)initWith##CPlusPlusClass:(CPlusPlusClass *)impl \
+{ \
+    if (!impl) { \
+        [self release]; \
+        return nil; \
+    } \
+    self = [super initWithDetails:impl]; \
+    if (self) \
+        static_cast<CPlusPlusClass *>(details)->ref(); \
+    return self; \
+} \
+- (CPlusPlusClass *)impl \
+{ \
+    ASSERT(details); \
+    return static_cast<CPlusPlusClass *>(details); \
+}
+    
+//------------------------------------------------------------------------------------------
+// Factory methods
+
+DOM::NodeList DOM::NodeListImpl::createInstance(DOM::NodeListImpl *impl)
+{
+    return DOM::NodeList(impl);
+}
+
+DOM::NamedNodeMap DOM::NamedNodeMapImpl::createInstance(DOM::NamedNodeMapImpl *impl)
+{
+    return DOM::NamedNodeMap(impl);
+}
+
+DOM::Attr DOM::AttrImpl::createInstance(DOM::AttrImpl *impl)
+{
+    return DOM::Attr(impl);
+}
+
+DOM::Element DOM::ElementImpl::createInstance(DOM::ElementImpl *impl)
+{
+    return DOM::Element(impl);
+}
+
+DOM::CharacterData DOM::CharacterDataImpl::createInstance(DOM::CharacterDataImpl *impl)
+{
+    return DOM::CharacterData(impl);
+}
+
+DOM::Text DOM::TextImpl::createInstance(DOM::TextImpl *impl)
+{
+    return DOM::Text(impl);
+}
+
+DOM::ProcessingInstruction DOM::ProcessingInstructionImpl::createInstance(ProcessingInstructionImpl *impl)
+{
+    return DOM::ProcessingInstruction(impl);
+}
+
+DOM::DOMImplementation DOM::DOMImplementationImpl::createInstance(DOM::DOMImplementationImpl *impl)
+{
+    return DOM::DOMImplementation(impl);
+}
+
+DOM::DocumentType DOM::DocumentTypeImpl::createInstance(DOM::DocumentTypeImpl *impl)
+{
+    return DOM::DocumentType(impl);
+}
+
+DOM::Document DOM::DocumentImpl::createInstance(DOM::DocumentImpl *impl)
+{
+    return DOM::Document(impl);
+}
+
+DOM::Range DOM::RangeImpl::createInstance(DOM::RangeImpl *impl)
+{
+    return DOM::Range(impl);
+}
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMObject
+
+ at implementation WebCoreDOMObject
+
+- (id)initWithDetails:(void *)d
+{
+    if (!d) {
+        [self release];
+        return nil;
+    }
+
+    id cachedInstance;
+    cachedInstance = wrapperForImpl(d);
+    if (cachedInstance) {
+        [self release];
+        return [cachedInstance retain];
+    }
+
+    [super init];
+    details = d;
+    setWrapperForImpl(self, details);
+    return self;
+}
+
+- (void)dealloc
+{
+    if (details)
+        removeWrapperForImpl(details);
+    [super dealloc];
+}
+
+- (unsigned)hash
+{
+    return (unsigned)details;
+}
+
+- (BOOL)isEqual:(id)other
+{
+    if (self == other)
+        return YES;
+        
+    if ([other isKindOfClass:[WebCoreDOMObject class]] && ((WebCoreDOMObject *)other)->details == details)
+        return YES;
+        
+    return NO;
+}
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMNode
+
+ at implementation WebCoreDOMNode
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMNode, NodeImpl)
+
+// Note: only objects that derive directly from WebDOMObject need their own dealloc method.
+// This is due to the fact that some of the details impl objects derive from
+// khtml::Shared, others from khtml::TreeShared (which do not share a base type), and we 
+// have to cast to the right type in order to call the deref() function.
+- (void)dealloc
+{
+    NodeImpl *instance = static_cast<NodeImpl *>(details);
+    if (instance)
+        instance->deref();
+    [super dealloc];
+}
+
+- (NSString *)nodeName
+{
+    return domStringToNSString([self impl]->nodeName());
+}
+
+- (NSString *)nodeValue
+{
+    // Documentation says we can raise a DOMSTRING_SIZE_ERR.
+    // However, the lower layer does not report that error up to us.
+    return domStringToNSString([self impl]->nodeValue());
+}
+
+- (void)setNodeValue:(NSString *)string error:(NSError **)error
+{
+    ASSERT(string);
+    
+    int code;
+    [self impl]->setNodeValue(NSStringToDOMString(string), code);
+    fillInError(error, code);
+}
+
+- (unsigned short)nodeType
+{
+    return [self impl]->nodeType();
+}
+
+- (id <DOMNode>)parentNode
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->parentNode()];
+}
+
+- (id <DOMNodeList>)childNodes
+{
+    return [WebCoreDOMNodeList objectWithImpl:[self impl]->childNodes()];
+}
+
+- (id <DOMNode>)firstChild
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->firstChild()];
+}
+
+- (id <DOMNode>)lastChild
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->lastChild()];
+}
+
+- (id <DOMNode>)previousSibling
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->previousSibling()];
+}
+
+- (id <DOMNode>)nextSibling
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->nextSibling()];
+}
+
+- (id <DOMNamedNodeMap>)attributes
+{
+    // DOM level 2 core specification says: 
+    // A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
+    return nil;
+}
+
+- (id <DOMDocument>)ownerDocument
+{
+    return [WebCoreDOMDocument objectWithImpl:[self impl]->getDocument()];
+}
+
+- (id <DOMNode>)insertBefore:(id <DOMNode>)newChild :(id <DOMNode>)refChild error:(NSError **)error
+{
+    if (!newChild || !refChild) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    int code;
+    WebCoreDOMNode *result = [WebCoreDOMNode objectWithImpl:[self impl]->insertBefore(nodeImpl(newChild), nodeImpl(refChild), code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMNode>)replaceChild:(id <DOMNode>)newChild :(id <DOMNode>)oldChild error:(NSError **)error
+{
+    if (!newChild || !oldChild) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    int code;
+    WebCoreDOMNode *result = [WebCoreDOMNode objectWithImpl:[self impl]->replaceChild(nodeImpl(newChild), nodeImpl(oldChild), code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMNode>)removeChild:(id <DOMNode>)oldChild error:(NSError **)error
+{
+    if (!oldChild) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    int code;
+    WebCoreDOMNode *result = [WebCoreDOMNode objectWithImpl:[self impl]->removeChild(nodeImpl(oldChild), code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMNode>)appendChild:(id <DOMNode>)newChild error:(NSError **)error
+{
+    if (!newChild) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    int code;
+    WebCoreDOMNode *result = [WebCoreDOMNode objectWithImpl:[self impl]->appendChild(nodeImpl(newChild), code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (BOOL)hasChildNodes
+{
+    return [self impl]->hasChildNodes();
+}
+
+- (id <DOMNode>)cloneNode:(BOOL)deep
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->cloneNode(deep)];
+}
+
+- (void)normalize
+{
+    [self impl]->normalize();
+}
+
+- (BOOL)isSupported:(NSString *)feature :(NSString *)version
+{
+    ASSERT(feature);
+    ASSERT(version);
+
+    // Method not reflected in DOM::NodeImpl interface
+    Node node([self impl]);
+    return node.isSupported(NSStringToDOMString(feature), NSStringToDOMString(version));
+}
+
+- (NSString *)namespaceURI
+{
+    // Method not reflected in DOM::NodeImpl interface
+    Node node([self impl]);
+    return domStringToNSString(node.namespaceURI());
+}
+
+- (NSString *)prefix
+{
+    return domStringToNSString([self impl]->prefix());
+}
+
+- (void)setPrefix:(NSString *)prefix error:(NSError **)error
+{
+    ASSERT(prefix);
+
+    int code;
+    [self impl]->setPrefix(NSStringToDOMString(prefix), code);
+    fillInError(error, code);
+}
+
+- (NSString *)localName
+{
+    return domStringToNSString([self impl]->localName());
+}
+
+- (BOOL)hasAttributes
+{
+    // Method not reflected in DOM::NodeImpl interface
+    Node node([self impl]);
+    return node.hasAttributes();
+}
+
+- (NSString *)HTMLString
+{
+    return [self impl]->recursive_toHTML(true).getNSString();
+}
+
+//
+// begin deprecated methods
+//
+- (void)setNodeValue:(NSString *)string
+{
+    [self setNodeValue:string error:nil];
+}
+
+- (id<DOMNode>)insert:(id<DOMNode>)newChild before:(id<DOMNode>)refChild
+{
+    return [self insertBefore:newChild :refChild error:nil];
+}
+
+- (id<DOMNode>)replace:(id<DOMNode>)newChild child:(id<DOMNode>)oldChild
+{
+    return [self replaceChild:newChild :oldChild error:nil];
+}
+
+- (id<DOMNode>)removeChild:(id<DOMNode>)oldChild
+{
+    return [self removeChild:oldChild error:nil];
+}
+
+- (id<DOMNode>)appendChild:(id<DOMNode>)newChild
+{
+    return [self appendChild:newChild error:nil];
+}
+
+- (void)setPrefix:(NSString *)prefix
+{
+    [self setPrefix:prefix error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMNamedNodeMap
+
+ at implementation WebCoreDOMNamedNodeMap
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMNamedNodeMap, NamedNodeMapImpl)
+
+// Note: only objects that derive directly from WebDOMObject need their own dealloc method.
+// This is due to the fact that some of the details impl objects derive from
+// khtml::Shared, others from khtml::TreeShared (which do not share a base type), and we 
+// have to cast to the right type in order to call the deref() function.
+- (void)dealloc
+{
+    NamedNodeMapImpl *instance = static_cast<NamedNodeMapImpl *>(details);
+    if (instance)
+        instance->deref();
+    [super dealloc];
+}
+
+- (id <DOMNode>)getNamedItem:(NSString *)name
+{
+    ASSERT(name);
+
+    // Method not reflected in DOM::NamedNodeMapImpl interface
+    NamedNodeMap map = NamedNodeMapImpl::createInstance([self impl]);
+    Node result(map.getNamedItem(NSStringToDOMString(name)));
+    return [WebCoreDOMNode objectWithImpl:result.handle()];
+}
+
+- (id <DOMNode>)setNamedItem:(id <DOMNode>)arg error:(NSError **)error
+{
+    if (!arg) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::NamedNodeMapImpl interface
+    try {
+        NamedNodeMap map = NamedNodeMapImpl::createInstance([self impl]);
+        Node result(map.setNamedItem(nodeImpl(arg)));
+        return [WebCoreDOMNode objectWithImpl:result.handle()];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMNode>)removeNamedItem:(NSString *)name error:(NSError **)error
+{
+    if (!name) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::NamedNodeMapImpl interface
+    try {
+        NamedNodeMap map = NamedNodeMapImpl::createInstance([self impl]);
+        Node result(map.removeNamedItem(NSStringToDOMString(name)));
+        return [WebCoreDOMNode objectWithImpl:result.handle()];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMNode>)item:(unsigned long)index
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->item(index)];
+}
+
+- (unsigned long)length
+{
+    return [self impl]->length();
+}
+
+- (id <DOMNode>)getNamedItemNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    if (!namespaceURI || !localName) {
+        return nil;
+    }
+
+    // Method not reflected in DOM::NamedNodeMapImpl interface
+    NamedNodeMap map = NamedNodeMapImpl::createInstance([self impl]);
+    Node result(map.getNamedItemNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName)));
+    return [WebCoreDOMNode objectWithImpl:result.handle()];
+}
+
+- (id <DOMNode>)setNamedItemNS:(id <DOMNode>)arg error:(NSError **)error
+{
+    if (!arg) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::NamedNodeMapImpl interface
+    try {
+        NamedNodeMap map = NamedNodeMapImpl::createInstance([self impl]);
+        Node result(map.setNamedItemNS(nodeImpl(arg)));
+        return [WebCoreDOMNode objectWithImpl:result.handle()];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMNode>)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName error:(NSError **)error
+{
+    if (!namespaceURI || !localName) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::NamedNodeMapImpl interface
+    try {
+        NamedNodeMap map = NamedNodeMapImpl::createInstance([self impl]);
+        Node result(map.removeNamedItemNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName)));
+        return [WebCoreDOMNode objectWithImpl:result.handle()];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+//
+// begin deprecated methods
+//
+- (id<DOMNode>)setNamedItem:(id<DOMNode>)arg
+{
+    return [self setNamedItem:arg error:nil];
+}
+
+- (id<DOMNode>)removeNamedItem:(NSString *)name
+{
+    return [self removeNamedItem:name error:nil];
+}
+
+- (id<DOMNode>)setNamedItemNS:(id<DOMNode>)arg
+{
+    return [self setNamedItemNS:arg error:nil];
+}
+
+- (id<DOMNode>)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    return [self removeNamedItemNS:namespaceURI :localName error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMNodeList
+
+ at implementation WebCoreDOMNodeList
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMNodeList, NodeListImpl)
+
+// Note: only objects that derive directly from WebDOMObject need their own dealloc method.
+// This is due to the fact that some of the details impl objects derive from
+// khtml::Shared, others from khtml::TreeShared (which do not share a base type), and we 
+// have to cast to the right type in order to call the deref() function.
+- (void)dealloc
+{
+    NodeListImpl *instance = static_cast<NodeListImpl *>(details);
+    if (instance)
+        instance->deref();
+    [super dealloc];
+}
+
+- (id <DOMNode>)item:(unsigned long)index
+{
+    return [WebCoreDOMNode objectWithImpl:[self impl]->item(index)];
+}
+
+- (unsigned long)length
+{
+    return [self impl]->length();
+}
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMImplementation
+
+ at implementation WebCoreDOMImplementation
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMImplementation, DOMImplementationImpl)
+
+// Note: only objects that derive directly from WebDOMObject need their own dealloc method.
+// This is due to the fact that some of the details impl objects derive from
+// khtml::Shared, others from khtml::TreeShared (which do not share a base type), and we 
+// have to cast to the right type in order to call the deref() function.
+- (void)dealloc
+{
+    DOMImplementationImpl *instance = static_cast<DOMImplementationImpl *>(details);
+    if (instance)
+        instance->deref();
+    [super dealloc];
+}
+
+- (BOOL)hasFeature:(NSString *)feature :(NSString *)version
+{
+    ASSERT(feature);
+    ASSERT(version);
+
+    return [self impl]->hasFeature(NSStringToDOMString(feature), NSStringToDOMString(version));
+}
+
+- (id <DOMDocumentType>)createDocumentType:(NSString *)qualifiedName :(NSString *)publicId :(NSString *)systemId error:(NSError **)error
+{
+    ASSERT(qualifiedName);
+    ASSERT(publicId);
+    ASSERT(systemId);
+
+    int code;
+    DocumentTypeImpl *impl = [self impl]->createDocumentType(NSStringToDOMString(qualifiedName), NSStringToDOMString(publicId), NSStringToDOMString(systemId), code);
+    id <DOMDocumentType> result = [WebCoreDOMDocumentType objectWithImpl:impl];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMDocument>)createDocument:(NSString *)namespaceURI :(NSString *)qualifiedName :(id <DOMDocumentType>)doctype error:(NSError **)error
+{
+    ASSERT(namespaceURI);
+    ASSERT(qualifiedName);
+
+    int code;
+    DocumentType dt = DocumentTypeImpl::createInstance(documentTypeImpl(doctype));
+    DocumentImpl *impl = [self impl]->createDocument(NSStringToDOMString(namespaceURI), NSStringToDOMString(qualifiedName), dt, code);
+    id <DOMDocument> result = [WebCoreDOMDocument objectWithImpl:impl];
+    fillInError(error, code);
+    return result;
+}
+
+//
+// begin deprecated methods
+//
+- (id<DOMDocumentType>)createDocumentType:(NSString *)qualifiedName :(NSString *)publicId :(NSString *)systemId :(int *)exceptionCode
+{
+    ASSERT(qualifiedName);
+    ASSERT(publicId);
+    ASSERT(systemId);
+
+    DocumentTypeImpl *impl = [self impl]->createDocumentType(NSStringToDOMString(qualifiedName), NSStringToDOMString(publicId), NSStringToDOMString(systemId), *exceptionCode);
+    return [WebCoreDOMDocumentType objectWithImpl:impl];
+}
+
+- (id<DOMDocument>)createDocument:(NSString *)namespaceURI :(NSString *)qualifiedName :(id<DOMDocumentType>)doctype
+{
+    return [self createDocument:namespaceURI :qualifiedName :doctype error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMDocumentFragment
+
+ at implementation WebCoreDOMDocumentFragment
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMDocumentFragment, DocumentFragmentImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMDocument
+
+ at implementation WebCoreDOMDocument
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMDocument, DocumentImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (id <DOMDocumentType>)doctype
+{
+    return [WebCoreDOMDocumentType objectWithImpl:[self impl]->doctype()];
+}
+
+- (id <DOMImplementation>)implementation
+{
+    return [WebCoreDOMImplementation objectWithImpl:[self impl]->implementation()];
+}
+
+- (id <DOMElement>)documentElement
+{
+    return [WebCoreDOMElement objectWithImpl:[self impl]->documentElement()];
+}
+
+- (id <DOMElement>)createElement:(NSString *)tagName error:(NSError **)error
+{
+    ASSERT(tagName);
+
+    int code;
+    id <DOMElement> result = [WebCoreDOMElement objectWithImpl:[self impl]->createElement(NSStringToDOMString(tagName), code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMDocumentFragment>)createDocumentFragment
+{
+    return [WebCoreDOMDocumentFragment objectWithImpl:[self impl]->createDocumentFragment()];
+}
+
+- (id <DOMText>)createTextNode:(NSString *)data
+{
+    ASSERT(data);
+
+    return [WebCoreDOMText objectWithImpl:[self impl]->createTextNode(NSStringToDOMString(data))];
+}
+
+- (id <DOMComment>)createComment:(NSString *)data
+{
+    ASSERT(data);
+
+    return [WebCoreDOMComment objectWithImpl:[self impl]->createComment(NSStringToDOMString(data))];
+}
+
+- (id <DOMCDATASection>)createCDATASection:(NSString *)data error:(NSError **)error
+{
+    ASSERT(data);
+
+    // Documentation says we can raise a NOT_SUPPORTED_ERR.
+    // However, the lower layer does not report that error up to us.
+    return [WebCoreDOMCDATASection objectWithImpl:[self impl]->createCDATASection(NSStringToDOMString(data))];
+}
+
+- (id <DOMProcessingInstruction>)createProcessingInstruction:(NSString *)target :(NSString *)data error:(NSError **)error
+{
+    ASSERT(target);
+    ASSERT(data);
+
+    // Documentation says we can raise a INVALID_CHARACTER_ERR or a NOT_SUPPORTED_ERR.
+    // However, the lower layer does not report these errors up to us.
+    return [WebCoreDOMProcessingInstruction objectWithImpl:[self impl]->createProcessingInstruction(NSStringToDOMString(target), NSStringToDOMString(data))];
+}
+
+- (id <DOMAttr>)createAttribute:(NSString *)name error:(NSError **)error
+{
+    ASSERT(name);
+
+    // Method not reflected in DOM::DocumentImpl interface
+    try {
+        Document doc(DocumentImpl::createInstance([self impl]));
+        Attr result(doc.createAttribute(NSStringToDOMString(name)));
+        AttrImpl *impl = static_cast<AttrImpl *>(result.handle());
+        return [WebCoreDOMAttr objectWithImpl:impl];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMEntityReference>)createEntityReference:(NSString *)name error:(NSError **)error
+{
+    ASSERT(name);
+
+    // Documentation says we can raise a INVALID_CHARACTER_ERR or a NOT_SUPPORTED_ERR.
+    // However, the lower layer does not report these errors up to us.
+    return [WebCoreDOMEntityReference objectWithImpl:[self impl]->createEntityReference(NSStringToDOMString(name))];
+}
+
+- (id <DOMNodeList>)getElementsByTagName:(NSString *)tagname
+{
+    ASSERT(tagname);
+
+    return [WebCoreDOMNodeList objectWithImpl:[self impl]->getElementsByTagNameNS(0, NSStringToDOMString(tagname).implementation())];
+}
+
+- (id <DOMNode>)importNode:(id <DOMNode>)importedNode :(BOOL)deep error:(NSError **)error
+{
+    int code;
+    WebCoreDOMNode *result = [WebCoreDOMNode objectWithImpl:[self impl]->importNode(nodeImpl(importedNode), deep, code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMElement>)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName error:(NSError **)error
+{
+    ASSERT(namespaceURI);
+    ASSERT(qualifiedName);
+
+    int code;
+    id <DOMElement> result = [WebCoreDOMElement objectWithImpl:[self impl]->createElementNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(qualifiedName), code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMAttr>)createAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName error:(NSError **)error
+{
+    ASSERT(namespaceURI);
+    ASSERT(qualifiedName);
+
+    // Method not reflected in DOM::DocumentImpl interface
+    try {
+        Document doc(DocumentImpl::createInstance([self impl]));
+        Attr result(doc.createAttributeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(qualifiedName)));
+        AttrImpl *impl = static_cast<AttrImpl *>(result.handle());
+        return [WebCoreDOMAttr objectWithImpl:impl];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    ASSERT(namespaceURI);
+    ASSERT(localName);
+
+    return [WebCoreDOMNodeList objectWithImpl:[self impl]->getElementsByTagNameNS(NSStringToDOMString(namespaceURI).implementation(), NSStringToDOMString(localName).implementation())];
+}
+
+- (id <DOMElement>)getElementById:(NSString *)elementId
+{
+    ASSERT(elementId);
+
+    return [WebCoreDOMElement objectWithImpl:[self impl]->getElementById(NSStringToDOMString(elementId))];
+}
+
+//
+// begin deprecated methods
+//
+- (id<DOMElement>)createElement:(NSString *)tagName
+{
+    return [self createElement:tagName error:nil];
+}
+
+- (id<DOMElement>)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName
+{
+    return [self createElementNS:namespaceURI :qualifiedName error:nil];
+}
+
+- (id<DOMCDATASection>)createCDATASection:(NSString *)data
+{
+    return [self createCDATASection:data error:nil];
+}
+
+- (id<DOMProcessingInstruction>)createProcessingInstruction:(NSString *)target :(NSString *)data
+{
+    return [self createProcessingInstruction:target :data error:nil];
+}
+
+- (id<DOMAttr>)createAttribute:(NSString *)name;
+{
+    return [self createAttribute:name error:nil];
+}
+
+- (id<DOMEntityReference>)createEntityReference:(NSString *)name
+{
+    return [self createEntityReference:name error:nil];
+}
+
+- (id<DOMNode>)importNode:(id<DOMNode>)importedNode :(BOOL)deep
+{
+    return [self importNode:importedNode :deep error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMCharacterData
+
+ at implementation WebCoreDOMCharacterData
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMCharacterData, CharacterDataImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (NSString *)data
+{
+    // Documentation says we can raise a DOMSTRING_SIZE_ERR.
+    // However, the lower layer does not report that error up to us.
+    return domStringToNSString([self impl]->data());
+}
+
+- (void)setData:(NSString *)data error:(NSError **)error
+{
+    ASSERT(data);
+    
+    int code;
+    [self impl]->setData(NSStringToDOMString(data), code);
+    fillInError(error, code);
+}
+
+- (unsigned long)length
+{
+    return [self impl]->length();
+}
+
+- (NSString *)substringData:(unsigned long)offset :(unsigned long)count error:(NSError **)error
+{
+    int code;
+    NSString *result = domStringToNSString([self impl]->substringData(offset, count, code));
+    fillInError(error, code);
+    return result;
+}
+
+- (void)appendData:(NSString *)arg error:(NSError **)error
+{
+    ASSERT(arg);
+    
+    int code;
+    [self impl]->appendData(NSStringToDOMString(arg), code);
+    fillInError(error, code);
+}
+
+- (void)insertData:(unsigned long)offset :(NSString *)arg error:(NSError **)error
+{
+    ASSERT(arg);
+    
+    int code;
+    [self impl]->insertData(offset, NSStringToDOMString(arg), code);
+    fillInError(error, code);
+}
+
+- (void)deleteData:(unsigned long)offset :(unsigned long) count error:(NSError **)error;
+{
+    int code;
+    [self impl]->deleteData(offset, count, code);
+    fillInError(error, code);
+}
+
+- (void)replaceData:(unsigned long)offset :(unsigned long)count :(NSString *)arg error:(NSError **)error
+{
+    ASSERT(arg);
+
+    int code;
+    [self impl]->replaceData(offset, count, NSStringToDOMString(arg), code);
+    fillInError(error, code);
+}
+
+//
+// begin deprecated methods
+//
+- (void)setData: (NSString *)data
+{
+    [self setData:data error:nil];
+}
+
+- (NSString *)substringData: (unsigned long)offset :(unsigned long)count
+{
+    return [self substringData:offset :count error:nil];
+}
+
+- (void)appendData:(NSString *)arg
+{
+    [self appendData:arg error:nil];
+}
+
+- (void)insertData:(unsigned long)offset :(NSString *)arg
+{
+    [self insertData:offset :arg error:nil];
+}
+
+- (void)deleteData:(unsigned long)offset :(unsigned long)count
+{
+    [self deleteData:offset :count error:nil];
+}
+
+- (void)replaceData:(unsigned long)offset :(unsigned long)count :(NSString *)arg
+{
+    [self replaceData:offset :count :arg error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMAttr
+
+ at implementation WebCoreDOMAttr
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMAttr, AttrImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (NSString *)name
+{
+    return domStringToNSString([self impl]->nodeName());
+}
+
+- (BOOL)specified
+{
+    return [self impl]->specified();
+}
+
+- (NSString *)value
+{
+    return domStringToNSString([self impl]->nodeValue());
+}
+
+- (void)setValue:(NSString *)value error:(NSError **)error
+{
+    ASSERT(value);
+
+    int code;
+    [self impl]->setValue(NSStringToDOMString(value), code);
+    fillInError(error, code);
+}
+
+- (id <DOMElement>)ownerElement
+{
+    return [WebCoreDOMElement objectWithImpl:[self impl]->ownerElement()];
+}
+
+//
+// begin deprecated methods
+//
+- (void)setValue:(NSString *)value
+{
+    [self setValue:value error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMElement
+
+ at implementation WebCoreDOMElement
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMElement, ElementImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (NSString *)tagName
+{
+    return domStringToNSString([self impl]->tagName());
+}
+
+- (NSString *)getAttribute:(NSString *)name
+{
+    ASSERT(name);
+
+    return domStringToNSString([self impl]->getAttribute(NSStringToDOMString(name)));
+}
+
+- (void)setAttribute:(NSString *)name :(NSString *)value error:(NSError **)error
+{
+    ASSERT(name);
+    ASSERT(value);
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        element.setAttribute(NSStringToDOMString(name), NSStringToDOMString(value));
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+    }
+}
+
+- (void)removeAttribute:(NSString *)name error:(NSError **)error
+{
+    ASSERT(name);
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        element.removeAttribute(NSStringToDOMString(name));
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+    }
+}
+
+- (id <DOMAttr>)getAttributeNode:(NSString *)name
+{
+    ASSERT(name);
+
+    // Method not reflected in DOM::ElementImpl interface
+    Element element(ElementImpl::createInstance([self impl]));
+    Attr result(element.getAttributeNode(NSStringToDOMString(name)));
+    return [WebCoreDOMAttr objectWithImpl:static_cast<AttrImpl *>(result.handle())];
+}
+
+- (id <DOMAttr>)setAttributeNode:(id <DOMAttr>)newAttr error:(NSError **)error
+{
+    if (!newAttr) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        Attr attr(AttrImpl::createInstance(attrImpl(newAttr)));
+        Attr result(element.setAttributeNode(attr));
+        return [WebCoreDOMAttr objectWithImpl:static_cast<AttrImpl *>(result.handle())];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMAttr>)removeAttributeNode:(id <DOMAttr>)oldAttr error:(NSError **)error
+{
+    if (!oldAttr) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        Attr attr(AttrImpl::createInstance(attrImpl(oldAttr)));
+        Attr result(element.removeAttributeNode(attr));
+        return [WebCoreDOMAttr objectWithImpl:static_cast<AttrImpl *>(result.handle())];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMNodeList>)getElementsByTagName:(NSString *)name
+{
+    ASSERT(name);
+
+    return [WebCoreDOMNodeList objectWithImpl:[self impl]->getElementsByTagNameNS(0, NSStringToDOMString(name).implementation())];
+}
+
+- (NSString *)getAttributeNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    ASSERT(namespaceURI);
+    ASSERT(localName);
+
+    Element element(ElementImpl::createInstance([self impl]));
+    return domStringToNSString(element.getAttributeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName)));
+}
+
+- (void)setAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName :(NSString *)value error:(NSError **)error
+{
+    ASSERT(namespaceURI);
+    ASSERT(qualifiedName);
+    ASSERT(value);
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        element.setAttributeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(qualifiedName), NSStringToDOMString(value));
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+    }
+}
+
+- (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName error:(NSError **)error
+{
+    ASSERT(namespaceURI);
+    ASSERT(localName);
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        element.removeAttributeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName));
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+    }
+}
+
+- (id <DOMAttr>)getAttributeNodeNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    ASSERT(namespaceURI);
+    ASSERT(localName);
+
+    // Method not reflected in DOM::ElementImpl interface
+    Element element(ElementImpl::createInstance([self impl]));
+    Attr result(element.getAttributeNodeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName)));
+    return [WebCoreDOMAttr objectWithImpl:static_cast<AttrImpl *>(result.handle())];
+}
+
+- (id <DOMAttr>)setAttributeNodeNS:(id <DOMAttr>)newAttr error:(NSError **)error
+{
+    if (!newAttr) {
+        fillInError(error, NOT_FOUND_ERR);
+        return nil;
+    }
+
+    // Method not reflected in DOM::ElementImpl interface
+    try {
+        Element element(ElementImpl::createInstance([self impl]));
+        Attr attr(AttrImpl::createInstance(attrImpl(newAttr)));
+        Attr result(element.setAttributeNodeNS(attr));
+        return [WebCoreDOMAttr objectWithImpl:static_cast<AttrImpl *>(result.handle())];
+    } 
+    catch (const DOMException &e) {
+        fillInError(error, e.code);
+        return nil;
+    }
+}
+
+- (id <DOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    ASSERT(namespaceURI);
+    ASSERT(localName);
+
+    return [WebCoreDOMNodeList objectWithImpl:[self impl]->getElementsByTagNameNS(NSStringToDOMString(namespaceURI).implementation(), NSStringToDOMString(localName).implementation())];
+}
+
+- (BOOL)hasAttribute:(NSString *)name
+{
+    ASSERT(name);
+
+    // Method not reflected in DOM::ElementImpl interface
+    Element element(ElementImpl::createInstance([self impl]));
+    return element.hasAttribute(NSStringToDOMString(name));
+}
+
+- (BOOL)hasAttributeNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    ASSERT(namespaceURI);
+    ASSERT(localName);
+
+    // Method not reflected in DOM::ElementImpl interface
+    Element element(ElementImpl::createInstance([self impl]));
+    return element.hasAttributeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName));
+}
+
+//
+// begin deprecated methods
+//
+- (void)setAttribute:(NSString *)name :(NSString *)value
+{
+    [self setAttribute:name :value error:nil];
+}
+
+- (void)removeAttribute:(NSString *)name
+{
+    [self removeAttribute:name error:nil];
+}
+
+- (id<DOMAttr>)setAttributeNode:(id<DOMAttr>)newAttr
+{
+    return [self setAttributeNode:newAttr error:nil];
+}
+
+- (id<DOMAttr>)removeAttributeNode:(id<DOMAttr>)oldAttr
+{
+    return [self removeAttributeNode:oldAttr error:nil];
+}
+
+- (void)setAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName :(NSString *)value
+{
+    [self setAttributeNS:namespaceURI :qualifiedName :value error:nil];
+}
+
+- (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName
+{
+    [self removeAttributeNS:namespaceURI :localName error:nil];
+}
+
+- (id<DOMAttr>)setAttributeNodeNS:(id<DOMAttr>)newAttr
+{
+    return [self setAttributeNodeNS:newAttr error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMText
+
+ at implementation WebCoreDOMText
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMText, TextImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (id <DOMText>)splitText:(unsigned long)offset error:(NSError **)error
+{
+    int code;
+    id <DOMText> result = [WebCoreDOMText objectWithImpl:[self impl]->splitText(offset, code)];
+    fillInError(error, code);
+    return result;
+}
+
+//
+// begin deprecated methods
+//
+- (id<DOMText>)splitText:(unsigned long)offset
+{
+    return [self splitText:offset error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMComment
+
+ at implementation WebCoreDOMComment
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMComment, CommentImpl)
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMCDATASection
+
+ at implementation WebCoreDOMCDATASection
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMCDATASection, CDATASectionImpl)
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMDocumentType
+
+ at implementation WebCoreDOMDocumentType
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMDocumentType, DocumentTypeImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (NSString *)name
+{
+    return domStringToNSString([self impl]->publicId());
+}
+
+- (id <DOMNamedNodeMap>)entities
+{
+    return [WebCoreDOMNamedNodeMap objectWithImpl:[self impl]->entities()];
+}
+
+- (id <DOMNamedNodeMap>)notations
+{
+    return [WebCoreDOMNamedNodeMap objectWithImpl:[self impl]->notations()];
+}
+
+- (NSString *)publicId
+{
+    return domStringToNSString([self impl]->publicId());
+}
+
+- (NSString *)systemId
+{
+    return domStringToNSString([self impl]->systemId());
+}
+
+- (NSString *)internalSubset
+{
+    return domStringToNSString([self impl]->internalSubset());
+}
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMNotation
+
+ at implementation WebCoreDOMNotation
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMNotation, NotationImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (NSString *)publicId
+{
+    return domStringToNSString([self impl]->publicId());
+}
+
+- (NSString *)systemId
+{
+    return domStringToNSString([self impl]->systemId());
+}
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMEntity
+
+ at implementation WebCoreDOMEntity
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMEntity, EntityImpl)
+
+- (NSString *)publicId
+{
+    return domStringToNSString([self impl]->publicId());
+}
+
+- (NSString *)systemId
+{
+    return domStringToNSString([self impl]->systemId());
+}
+
+- (NSString *)notationName
+{
+    return domStringToNSString([self impl]->notationName());
+}
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMEntityReference
+
+ at implementation WebCoreDOMEntityReference
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMEntityReference, EntityReferenceImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMProcessingInstruction
+
+ at implementation WebCoreDOMProcessingInstruction
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMProcessingInstruction, ProcessingInstructionImpl)
+
+// Note: This object does not need its own dealloc method, since it derives from
+// WebCoreDOMNode. See the dealloc method comment on that method for more information. 
+
+- (NSString *)target
+{
+    return domStringToNSString([self impl]->target());
+}
+
+- (NSString *)data
+{
+    return domStringToNSString([self impl]->data());
+}
+
+- (void)setData:(NSString *)data error:(NSError **)error
+{
+    ASSERT(data);
+
+    int code;
+    [self impl]->setData(NSStringToDOMString(data), code);
+    fillInError(error, code);
+}
+
+//
+// begin deprecated methods
+//
+- (void)setData:(NSString *)data
+{
+    [self setData:data error:nil];
+}
+//
+// end deprecated methods
+//
+
+ at end
+
+//------------------------------------------------------------------------------------------
+// WebCoreDOMRange
+
+ at implementation WebCoreDOMRange
+
+WEB_CORE_INTERNAL_METHODS(WebCoreDOMRange, RangeImpl)
+
+// Note: only objects that derive directly from WebDOMObject need their own dealloc method.
+// This is due to the fact that some of the details impl objects derive from
+// khtml::Shared, others from khtml::TreeShared (which do not share a base type), and we 
+// have to cast to the right type in order to call the deref() function.
+- (void)dealloc
+{
+    RangeImpl *instance = static_cast<RangeImpl *>(details);
+    if (instance)
+        instance->deref();
+    [super dealloc];
+}
+
+- (id <DOMNode>)startContainer:(NSError **)error
+{
+    int code;
+    id <DOMNode> result = [WebCoreDOMNode objectWithImpl:[self impl]->startContainer(code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (long)startOffset:(NSError **)error
+{
+    int code;
+    long result = [self impl]->startOffset(code);
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMNode>)endContainer:(NSError **)error
+{
+    int code;
+    id <DOMNode> result = [WebCoreDOMNode objectWithImpl:[self impl]->endContainer(code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (long)endOffset:(NSError **)error
+{
+    int code;
+    long result = [self impl]->endOffset(code);
+    fillInError(error, code);
+    return result;
+}
+
+- (BOOL)collapsed:(NSError **)error
+{
+    int code;
+    BOOL result = [self impl]->collapsed(code);
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMNode>)commonAncestorContainer:(NSError **)error
+{
+    int code;
+    id <DOMNode> result = [WebCoreDOMNode objectWithImpl:[self impl]->commonAncestorContainer(code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (void)setStart:(id <DOMNode>)refNode :(long)offset error:(NSError **)error
+{
+    int code;
+    [self impl]->setStart(nodeImpl(refNode), offset, code);
+    fillInError(error, code);
+}
+
+- (void)setEnd:(id <DOMNode>)refNode :(long)offset error:(NSError **)error
+{
+    int code;
+    [self impl]->setEnd(nodeImpl(refNode), offset, code);
+    fillInError(error, code);
+}
+
+- (void)setStartBefore:(id <DOMNode>)refNode error:(NSError **)error
+{
+    int code;
+    [self impl]->setStartBefore(nodeImpl(refNode), code);
+    fillInError(error, code);
+}
+
+- (void)setStartAfter:(id <DOMNode>)refNode error:(NSError **)error
+{
+    int code;
+    [self impl]->setStartAfter(nodeImpl(refNode), code);
+    fillInError(error, code);
+}
+
+- (void)setEndBefore:(id <DOMNode>)refNode error:(NSError **)error
+{
+    int code;
+    [self impl]->setEndBefore(nodeImpl(refNode), code);
+    fillInError(error, code);
+}
+
+- (void)setEndAfter:(id <DOMNode>)refNode error:(NSError **)error
+{
+    int code;
+    [self impl]->setEndAfter(nodeImpl(refNode), code);
+    fillInError(error, code);
+}
+
+- (void)collapse:(BOOL)toStart error:(NSError **)error
+{
+    int code;
+    [self impl]->collapse(toStart, code);
+    fillInError(error, code);
+}
+
+- (void)selectNode:(id <DOMNode>)refNode error:(NSError **)error
+{
+    int code;
+    [self impl]->selectNode(nodeImpl(refNode), code);
+    fillInError(error, code);
+}
+
+- (void)selectNodeContents:(id <DOMNode>)refNode error:(NSError **)error
+{
+    int code;
+    [self impl]->selectNodeContents(nodeImpl(refNode), code);
+    fillInError(error, code);
+}
+
+- (short)compareBoundaryPoints:(unsigned short)how :(id <DOMRange>)sourceRange error:(NSError **)error
+{
+    int code;
+    short result = [self impl]->compareBoundaryPoints(static_cast<Range::CompareHow>(how), rangeImpl(sourceRange), code);
+    fillInError(error, code);
+    return result;
+}
+
+- (void)deleteContents:(NSError **)error
+{
+    int code;
+    [self impl]->deleteContents(code);
+    fillInError(error, code);
+}
+
+- (id <DOMDocumentFragment>)extractContents:(NSError **)error
+{
+    int code;
+    id <DOMDocumentFragment> result = [WebCoreDOMDocumentFragment objectWithImpl:[self impl]->extractContents(code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (id <DOMDocumentFragment>)cloneContents:(NSError **)error
+{
+    int code;
+    id <DOMDocumentFragment> result = [WebCoreDOMDocumentFragment objectWithImpl:[self impl]->cloneContents(code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (void)insertNode:(id <DOMNode>)newNode error:(NSError **)error
+{
+    int code;
+    [self impl]->insertNode(nodeImpl(newNode), code);
+    fillInError(error, code);
+}
+
+- (void)surroundContents:(id <DOMNode>)newParent error:(NSError **)error
+{
+    int code;
+    [self impl]->surroundContents(nodeImpl(newParent), code);
+    fillInError(error, code);
+}
+
+- (id <DOMRange>)cloneRange:(NSError **)error
+{
+    int code;
+    id <DOMRange> result = [WebCoreDOMRange objectWithImpl:[self impl]->cloneRange(code)];
+    fillInError(error, code);
+    return result;
+}
+
+- (NSString *)toString:(NSError **)error
+{
+    int code;
+    NSString *result = domStringToNSString([self impl]->toString(code));
+    fillInError(error, code);
+    return result;
+}
+
+- (void)detach:(NSError **)error
+{
+    int code;
+    [self impl]->detach(code);
+    fillInError(error, code);
+}
+
+ at end
+
+//------------------------------------------------------------------------------------------
diff --git a/WebCore/kwq/WebCoreDOMDocument.mm b/WebCore/kwq/WebCoreDOMDocument.mm
deleted file mode 100644
index d626ad5..0000000
--- a/WebCore/kwq/WebCoreDOMDocument.mm
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#import "WebCoreDOMPrivate.h"
-
-DOM::DOMImplementation DOM::DOMImplementationImpl::createInstance(DOM::DOMImplementationImpl *impl)
-{
-    return DOM::DOMImplementation(impl);
-}
-
-DOM::DocumentType DOM::DocumentTypeImpl::createInstance (DOM::DocumentTypeImpl *impl)
-{
-    return DOM::DocumentType (impl);
-}
-
-DOM::Document DOM::DocumentImpl::createInstance (DOM::DocumentImpl *impl)
-{
-    return DOM::Document (impl);
-}
-
-NSString *domStringToNSString(DOM::DOMString &aString)
-{
-    return [NSString stringWithCharacters: (unichar *)aString.unicode() length: aString.length()];
-}
-
-DOM::DOMString NSStringToDOMString(NSString *aString)
-{
-    QChar *chars = (QChar *)malloc([aString length] * sizeof(QChar));
-    [aString getCharacters:(unichar *)chars];
-    DOM::DOMString ret(chars, [aString length]);
-    free (chars);
-    return ret;
-}
-
-
- at implementation WebCoreDOMDocumentType
-
-+ (WebCoreDOMDocumentType *)documentTypeWithImpl: (DOM::DocumentTypeImpl *)_impl
-{
-    WebCoreDOMDocumentType *obj = [[self class] alloc];
-    return [[obj initWithImpl:_impl] autorelease];
-}
-
-- (DOM::DocumentTypeImpl *)documentTypeImpl
-{
-    return static_cast<DOM::DocumentTypeImpl *>(impl);
-}
-
-- (NSString *)name
-{
-    DOM::DOMString name = [self documentTypeImpl]->name();
-    return domStringToNSString(name);
-}
-
-- (id<WebDOMNamedNodeMap>)entities
-{
-    return [WebCoreDOMNamedNodeMap namedNodeMapWithImpl:[self documentTypeImpl]->entities()];
-}
-
-- (id<WebDOMNamedNodeMap>)notations
-{
-    return [WebCoreDOMNamedNodeMap namedNodeMapWithImpl:[self documentTypeImpl]->entities()];
-}
-
-- (NSString *)publicId
-{
-    DOM::DOMString publicId = [self documentTypeImpl]->publicId();
-    return domStringToNSString(publicId);
-}
-
-- (NSString *)systemId
-{
-    DOM::DOMString systemId = [self documentTypeImpl]->systemId();
-    return domStringToNSString(systemId);
-}
-
-- (NSString *)internalSubset
-{
-    DOM::DOMString internalSubset = [self documentTypeImpl]->internalSubset();
-    return domStringToNSString(internalSubset);
-}
- at end
-
-
- at implementation WebCoreDOMImplementation
-
-+ (WebCoreDOMImplementation *)implementionatWithImpl: (DOM::DOMImplementationImpl *)_impl
-{
-    WebCoreDOMImplementation *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease];
-}
-
-- (void)dealloc
-{
-    impl->deref();
-    [super dealloc];
-}
-
-- (DOM::DOMImplementationImpl *)DOMImplementationImpl
-{
-    return static_cast<DOM::DOMImplementationImpl *>(impl);
-}
-
-- (BOOL)hasFeature: (NSString *)feature : (NSString *)version
-{
-    return [self DOMImplementationImpl]->hasFeature(NSStringToDOMString(feature),NSStringToDOMString(version));
-}
-
-- (id<WebDOMDocumentType>)createDocumentType: (NSString *)qualifiedName :(NSString *)publicId :(NSString *)systemId;
-{
-    DOM::DOMString _qualifiedName = NSStringToDOMString(qualifiedName);
-    DOM::DOMString _publicId = NSStringToDOMString(publicId);
-    DOM::DOMString _systemId = NSStringToDOMString(systemId);
-    DOM::DOMImplementation instance = DOM::DOMImplementationImpl::createInstance([self DOMImplementationImpl]);
-    DOM::DocumentType ret;
-    
-    ret = instance.createDocumentType (_qualifiedName, _publicId, _systemId);
-    
-    return [WebCoreDOMDocumentType documentTypeWithImpl: (DOM::DocumentTypeImpl *)ret.handle()];
-}
-
-- (id<WebDOMDocument>)createDocument: (NSString *)namespaceURI :(NSString *)qualifiedName :doctype
-{
-    DOM::DOMString _namespaceURI = NSStringToDOMString(namespaceURI);
-    DOM::DOMString _qualifiedName = NSStringToDOMString(qualifiedName);
-    DOM::DOMImplementation instance = DOM::DOMImplementationImpl::createInstance([self DOMImplementationImpl]);
-    DOM::DocumentType docTypeInstance = DOM::DocumentTypeImpl::createInstance([(WebCoreDOMDocumentType *)doctype documentTypeImpl]);
-    DOM::Document ret;
-    
-    ret = instance.createDocument (_namespaceURI, _qualifiedName, docTypeInstance);
-    
-    return [WebCoreDOMDocument documentWithImpl: (DOM::DocumentImpl *)ret.handle()];
-}
- at end
-
-
-
- at implementation WebCoreDOMDocument
-
-+ (WebCoreDOMDocument *)documentWithImpl: (DOM::DocumentImpl *)_impl
-{
-    WebCoreDOMDocument *obj = [WebCoreDOMDocument alloc];
-    return [[obj initWithImpl: _impl] autorelease];
-}
-
-- (DOM::DocumentImpl *)documentImpl
-{
-    return static_cast<DOM::DocumentImpl *>(impl);
-}
-
-
-- (id<WebDOMDocumentType>)doctype
-{
-    return [WebCoreDOMDocumentType documentTypeWithImpl: [self documentImpl]->doctype()];
-}
-
-- (id<WebDOMImplementation>)implementation
-{
-    return [WebCoreDOMImplementation implementationWithImpl: [self documentImpl]->implementation()];
-}
-
-- (id<WebDOMElement>)documentElement
-{
-    return [WebCoreDOMElement elementWithImpl: [self documentImpl]->documentElement()];
-}
-
-- (id<WebDOMElement>)createElement:(NSString *)tagName
-{
-    int exceptionCode;
-    return [WebCoreDOMElement elementWithImpl: [self documentImpl]->createElement(NSStringToDOMString(tagName), exceptionCode)];
-}
-
-- (id<WebDOMElement>)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName
-{
-    int exceptionCode;
-    return [WebCoreDOMElement elementWithImpl: [self documentImpl]->createElementNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(qualifiedName), exceptionCode)];
-}
-
-- (id<WebDOMDocumentFragment>)createDocumentFragment
-{
-    return [WebCoreDOMDocumentFragment documentFragmentWithImpl: [self documentImpl]->createDocumentFragment()];
-}
-
-- (id<WebDOMText>)createTextNode:(NSString *)data
-{
-    return [WebCoreDOMText textWithImpl: [self documentImpl]->createTextNode(NSStringToDOMString(data))];
-}
-
-- (id<WebDOMComment>)createComment:(NSString *)data
-{
-    return [WebCoreDOMComment commentWithImpl: [self documentImpl]->createComment(NSStringToDOMString(data))];
-}
-
-- (id<WebDOMCDATASection>)createCDATASection:(NSString *)data
-{
-    return [WebCoreDOMCDATASection CDATASectionWithImpl: [self documentImpl]->createCDATASection(NSStringToDOMString(data))];
-}
-
-- (id<WebDOMProcessingInstruction>)createProcessingInstruction:(NSString *)target :(NSString *)data
-{
-    DOM::DOMString _target = NSStringToDOMString(target);
-    DOM::DOMString _data = NSStringToDOMString(data);
-    return [WebCoreDOMProcessingInstruction processingInstructionWithImpl: [self documentImpl]->createProcessingInstruction(_target,_data)];
-}
-
-- (id<WebDOMAttr>)createAttribute:(NSString *)name
-{
-    DOM::DOMString _name = NSStringToDOMString(name);
-    DOM::Document instance = DOM::DocumentImpl::createInstance([self documentImpl]);
-    DOM::AttrImpl *attr = (DOM::AttrImpl *)instance.createAttribute(_name).handle();
-    return [WebCoreDOMAttr attrWithImpl: attr];
-}
-
-- (id<WebDOMAttr>)createAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName
-{
-    DOM::DOMString _namespaceURI = NSStringToDOMString(namespaceURI);
-    DOM::DOMString _qualifiedName = NSStringToDOMString(qualifiedName);
-    DOM::Document instance = DOM::DocumentImpl::createInstance([self documentImpl]);
-    DOM::Attr ret;
-    
-    ret= instance.createAttributeNS (_namespaceURI,_qualifiedName);
-    
-    return [WebCoreDOMAttr attrWithImpl:(DOM::AttrImpl *)ret.handle()];
-}
-
-- (id<WebDOMEntityReference>)createEntityReference:(NSString *)name
-{
-    return [WebCoreDOMEntityReference entityReferenceWithImpl: [self documentImpl]->createEntityReference(NSStringToDOMString(name))];
-}
-
-- (id<WebDOMElement>)getElementById:(NSString *)elementId
-{
-    DOM::DOMString _elementId = NSStringToDOMString(elementId);
-    return [WebCoreDOMElement elementWithImpl: [self documentImpl]->getElementById(_elementId)];
-}
-
-- (id<WebDOMNodeList>)getElementsByTagName:(NSString *)tagname
-{
-    DOM::DOMString _tagname = NSStringToDOMString(tagname);
-    DOM::Document instance = DOM::DocumentImpl::createInstance([self documentImpl]);
-    DOM::NodeListImpl *nodeList = (DOM::NodeListImpl *)instance.getElementsByTagName(_tagname).handle();
-    return [WebCoreDOMNodeList nodeListWithImpl: nodeList];
-}
-
-- (id<WebDOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName
-{
-    DOM::DOMString _namespaceURI = NSStringToDOMString(namespaceURI);
-    DOM::DOMString _localName = NSStringToDOMString(localName);
-    DOM::Document instance = DOM::DocumentImpl::createInstance([self documentImpl]);
-    DOM::NodeList ret;
-    
-    ret = instance.getElementsByTagNameNS(_namespaceURI,_localName);
-    
-    return [WebCoreDOMNodeList nodeListWithImpl: (DOM::NodeListImpl *)ret.handle()];
-}
-
-- (id<WebDOMNode>)importNode:importedNode :(BOOL)deep
-{
-    WebCoreDOMNode *node = importedNode;
-    DOM::Node importNode([node impl]);
-    DOM::Document instance = DOM::DocumentImpl::createInstance([self documentImpl]);
-    DOM::Node ret;
-    
-    ret = instance.importNode(importNode,deep);
-    
-    return [WebCoreDOMNode nodeWithImpl: (DOM::NodeImpl *)ret.handle()];
-}
-
- at end
diff --git a/WebCore/kwq/WebCoreDOMNode.mm b/WebCore/kwq/WebCoreDOMNode.mm
deleted file mode 100644
index a5c009f..0000000
--- a/WebCore/kwq/WebCoreDOMNode.mm
+++ /dev/null
@@ -1,821 +0,0 @@
-/*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#import "WebCoreDOMPrivate.h"
-
-// Psuedo templates for init and dealloc.
-#define INIT_WITH_IMPL(_impl) \
-    if (!_impl){\
-        [self release];\
-        return nil;\
-    }\
-    \
-    id cachedInstance;\
-    cachedInstance = wrapperForImpl(_impl);\
-    if (cachedInstance){\
-        [self release];\
-        return [cachedInstance retain];\
-    }\
-    \
-    [super init];\
-    impl = _impl;\
-    setWrapperForImpl(self, _impl);\
-    impl->ref();\
-    return self;
-
-#define DEALLOC_WITH_IMPL(impl) \
-    if (impl){\
-        removeWrapperForImpl (impl);\
-        [self impl]->deref();\
-    }\
-    [super dealloc];
-
-static Boolean WrapperKeyEqual(const void *value1, const void *value2)
-{
-    return value1 == value2;
-}
-
-static CFHashCode WrapperKeyHash(const void *value)
-{
-    return ((unsigned int)value) >> 2;
-}
-
-static CFMutableDictionaryRef wrapperCache()
-{
-    static CFMutableDictionaryRef wrapperCache = NULL;
-    if (!wrapperCache) {
-        // No need to retain/free either impl key, or id value.  Items will be removed
-        // from the cache in WebDOMNode's dealloc method.
-        static const CFDictionaryKeyCallBacks wrapperKeyCallBacks = { 0, NULL, NULL, NULL, WrapperKeyEqual, WrapperKeyHash };
-        static const CFDictionaryValueCallBacks wrapperValueCallBacks = { 0, NULL, NULL, NULL, NULL };
-        wrapperCache = CFDictionaryCreateMutable(NULL, 0, &wrapperKeyCallBacks, &wrapperValueCallBacks);
-    }
-    return wrapperCache;
-}
-
-static id wrapperForImpl (const void *impl)
-{
-    return (id)CFDictionaryGetValue(wrapperCache(), impl);
-}
-
-static void setWrapperForImpl (id wrapper, const void *impl)
-{
-    CFDictionarySetValue (wrapperCache(), (const void *)impl, wrapper);
-}
-
-static void removeWrapperForImpl (const void *impl)
-{
-    CFDictionaryRemoveValue (wrapperCache(), impl);
-}
-
-DOM::NodeList DOM::NodeListImpl::createInstance(DOM::NodeListImpl *impl)
-{
-    return DOM::NodeList(impl);
-}
-
-DOM::NamedNodeMap DOM::NamedNodeMapImpl::createInstance(DOM::NamedNodeMapImpl *impl)
-{
-    return DOM::NamedNodeMap(impl);
-}
-
-DOM::Attr DOM::AttrImpl::createInstance(DOM::AttrImpl *impl)
-{
-    return DOM::Attr(impl);
-}
-
-DOM::Element DOM::ElementImpl::createInstance(DOM::ElementImpl *impl)
-{
-    return DOM::Element(impl);
-}
-
-DOM::CharacterData DOM::CharacterDataImpl::createInstance(DOM::CharacterDataImpl *impl)
-{
-    return DOM::CharacterData(impl);
-}
-
-DOM::Text DOM::TextImpl::createInstance(DOM::TextImpl *impl)
-{
-    return DOM::Text(impl);
-}
-
-DOM::ProcessingInstruction DOM::ProcessingInstructionImpl::createInstance(ProcessingInstructionImpl *impl)
-{
-    return DOM::ProcessingInstruction(impl);
-}
-
- at implementation WebCoreDOMNode
-
-+ (WebCoreDOMNode *)nodeWithImpl: (DOM::NodeImpl *)_impl
-{
-    if (!_impl) {
-        return nil;
-    }
-    WebCoreDOMNode *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease];
-}
-
-- initWithImpl:(DOM::NodeImpl *)_impl
-{
-    INIT_WITH_IMPL (_impl);
-}
-
-- (void)dealloc
-{
-    DEALLOC_WITH_IMPL (impl);
-}
-
-- (BOOL)isEqual:(id)other
-{
-    WebCoreDOMNode *otherNode = (WebCoreDOMNode *)other;
-    return self == otherNode
-        || ([otherNode isMemberOfClass:[self class]] && impl == otherNode->impl);
-}
-
-- (unsigned)hash {
-    // cribbed from NSObject, FWIW
-    return ((unsigned)impl) >> 2;
-}
-
-- (DOM::NodeImpl *)impl
-{
-    return impl;
-}
-
-- (NSString *)nodeName
-{
-    DOM::DOMString _nodeName = [self impl]->nodeName();
-    return domStringToNSString(_nodeName);
-}
-
-- (NSString *)nodeValue
-{
-    DOM::DOMString _nodeValue = [self impl]->nodeValue();
-    return domStringToNSString(_nodeValue);
-}
-
-- (void)setNodeValue: (NSString *)string
-{
-    DOM::Node instance([self impl]);
-    DOM::DOMString _string = NSStringToDOMString(string);
-    instance.setNodeValue(_string);
-}
-
-- (unsigned short)nodeType
-{
-    return [self impl]->nodeType();
-}
-
-- (id<WebDOMNode>)parentNode
-{
-    return [WebCoreDOMNode nodeWithImpl: [self impl]->parentNode()];
-}
-
-- (id<WebDOMNodeList>)childNodes;
-{
-    return [WebCoreDOMNodeList nodeListWithImpl: [self impl]->childNodes()];
-}
-
-- (id<WebDOMNode>)firstChild
-{
-    DOM::Node instance([self impl]);
-    DOM::NodeImpl *firstChild = instance.firstChild().handle();
-    
-    if (firstChild)
-        return [WebCoreDOMNode nodeWithImpl: firstChild];
-    return nil;
-}
-
-- (id<WebDOMNode>)lastChild
-{
-    DOM::Node instance([self impl]);
-    DOM::NodeImpl *lastChild = instance.lastChild().handle();
-    
-    if (lastChild)
-        return [WebCoreDOMNode nodeWithImpl: lastChild];
-
-    return nil;
-}
-
-- (id<WebDOMNode>) previousSibling
-{
-    return [WebCoreDOMNode nodeWithImpl: [self impl]->previousSibling()];
-}
-
-- (id<WebDOMNode>)nextSibling
-{
-    return [WebCoreDOMNode nodeWithImpl: [self impl]->nextSibling()];
-}
-
-- (id<WebDOMNamedNodeMap>)attributes;
-{
-    DOM::Node instance([self impl]);
-    DOM::NamedNodeMap ret;
-    
-    ret = instance.attributes();
-    return [WebCoreDOMNamedNodeMap namedNodeMapWithImpl: (DOM::NamedNodeMapImpl *)ret.handle()];
-}
-
-- (id<WebDOMDocument>)ownerDocument
-{
-    DOM::Node instance([self impl]);
-    DOM::Document ret;
-    
-    ret = instance.ownerDocument();
-    return [WebCoreDOMDocument documentWithImpl: (DOM::DocumentImpl *)ret.handle()];
-}
-
-- (id<WebDOMNode>)insert:(id<WebDOMNode>)newChild before:(id<WebDOMNode>)refChild
-{
-    DOM::Node instance([self impl]);
-    WebCoreDOMNode *newChildNode = newChild;
-    WebCoreDOMNode *refChildNode = refChild;
-    DOM::Node _newChild([newChildNode impl]);
-    DOM::Node _refChild([refChildNode impl]);
-    DOM::Node ret;
-    
-    ret = instance.insertBefore (_newChild, _refChild);
-    return [WebCoreDOMNode nodeWithImpl: (DOM::NodeImpl *)ret.handle()];
-}
-
-- (id<WebDOMNode>)replace:(id<WebDOMNode>)newChild child:(id<WebDOMNode>)oldChild
-{
-    DOM::Node instance([self impl]);
-    WebCoreDOMNode *newChildNode = newChild;
-    WebCoreDOMNode *oldChildNode = oldChild;
-    DOM::Node _newChild([newChildNode impl]);
-    DOM::Node _oldChild([oldChildNode impl]);
-    DOM::Node ret;
-    
-    ret = instance.replaceChild (_newChild, _oldChild);
-    return [WebCoreDOMNode nodeWithImpl: (DOM::NodeImpl *)ret.handle()];
-}
-
-- (id<WebDOMNode>)removeChild:(id<WebDOMNode>)oldChild
-{
-    DOM::Node instance([self impl]);
-    WebCoreDOMNode *oldChildNode = oldChild;
-    DOM::Node _oldChild([oldChildNode impl]);
-    DOM::Node ret;
-    
-    ret = instance.removeChild (_oldChild);
-    return [WebCoreDOMNode nodeWithImpl: (DOM::NodeImpl *)ret.handle()];
-}
-
-- (id<WebDOMNode>)appendChild:(id<WebDOMNode>)newChild;
-{
-    DOM::Node instance([self impl]);
-    WebCoreDOMNode *newChildNode = newChild;
-    DOM::Node _newChild([newChildNode impl]);
-    DOM::Node ret;
-    
-    ret = instance.appendChild (_newChild);
-    return [WebCoreDOMNode nodeWithImpl: (DOM::NodeImpl *)ret.handle()];
-}
-
-- (BOOL)hasChildNodes
-{
-    return [self impl]->hasChildNodes();
-}
-
-- (id<WebDOMNode>)cloneNode: (BOOL) deep
-{
-    return [WebCoreDOMNode nodeWithImpl: [self impl]->cloneNode(deep)];
-}
-
-- (void)normalize
-{
-    [self impl]->normalize();
-}
-
-- (BOOL)isSupported:(NSString *)feature : (NSString *)version
-{
-    DOM::Node instance([self impl]);
-    
-    return instance.isSupported (NSStringToDOMString(feature), NSStringToDOMString(version));
-}
-
-- (NSString *)namespaceURI
-{
-    DOM::Node instance([self impl]);
-    DOM::DOMString _namespaceURI = instance.namespaceURI();
-    
-    return domStringToNSString (_namespaceURI);
-}
-
-- (NSString *)prefix
-{
-    DOM::DOMString _prefix = [self impl]->prefix();
-    
-    return domStringToNSString(_prefix);
-}
-
-- (void)setPrefix: (NSString *)prefix
-{
-    DOM::Node instance([self impl]);
-    instance.setPrefix(NSStringToDOMString(prefix));
-}
-
-- (NSString *)localName
-{
-    DOM::DOMString _localName = [self impl]->localName();
-    
-    return domStringToNSString(_localName);
-}
-
-- (BOOL)hasAttributes;
-{
-    DOM::Node instance([self impl]);
-    return instance.hasAttributes();
-}
-
-- (NSString *)HTMLString
-{
-    DOM::Node instance([self impl]);
-    return instance.handle()->recursive_toHTML(true).getNSString();
-}
-
- at end
-
-
- at implementation WebCoreDOMNodeList
-
-+ (WebCoreDOMNodeList *)nodeListWithImpl: (DOM::NodeListImpl *)_impl
-{
-    WebCoreDOMNodeList *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease];
-}
-
-- initWithImpl:(DOM::NodeListImpl *)_impl
-{
-    INIT_WITH_IMPL (_impl);
-}
-
-- (void)dealloc
-{
-    DEALLOC_WITH_IMPL (impl);
-}
-
-- (DOM::NodeListImpl *)impl
-{
-    return impl;
-}
-
-- (unsigned long)length
-{
-    return [self impl]->length();
-}
-
-- (id<WebDOMNode>)item: (unsigned long)index
-{
-    DOM::NodeList instance = DOM::NodeListImpl::createInstance([self impl]);
-    
-    return [WebCoreDOMNode nodeWithImpl: (DOM::NodeImpl *)instance.item(index).handle()];
-}
-
- at end
-
-
- at implementation WebCoreDOMNamedNodeMap
-
-+ (WebCoreDOMNamedNodeMap *)namedNodeMapWithImpl: (DOM::NamedNodeMapImpl *)_impl
-{
-    WebCoreDOMNamedNodeMap *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease];
-}
-
-- initWithImpl:(DOM::NamedNodeMapImpl *)_impl
-{
-    INIT_WITH_IMPL (_impl);
-}
-
-- (void)dealloc
-{
-    DEALLOC_WITH_IMPL (impl);
-}
-
-- (DOM::NamedNodeMapImpl *)impl
-{
-    return impl;
-}
-
-- (unsigned long) length
-{
-    return [self impl]->length();
-}
-
-- (id<WebDOMNode>)getNamedItem:(NSString *)name
-{
-    DOM::NamedNodeMap instance = DOM::NamedNodeMapImpl::createInstance([self impl]);
-    
-    return [WebCoreDOMNode nodeWithImpl: (DOM::NodeImpl *)instance.getNamedItem(NSStringToDOMString(name)).handle()];
-}
-
-- (id<WebDOMNode>)setNamedItem:(id<WebDOMNode>)arg
-{
-    DOM::NamedNodeMap instance = DOM::NamedNodeMapImpl::createInstance([self impl]);
-    WebCoreDOMNode *node = arg;
-    DOM::Node _arg ([node impl]);
-    
-    return [WebCoreDOMNode nodeWithImpl: (DOM::NodeImpl *)instance.setNamedItem(_arg).handle()];
-}
-
-
-- (id<WebDOMNode>)removeNamedItem:(NSString *)name;
-{
-    DOM::NamedNodeMap instance = DOM::NamedNodeMapImpl::createInstance([self impl]);
-    
-    return [WebCoreDOMNode nodeWithImpl: (DOM::NodeImpl *)instance.removeNamedItem(NSStringToDOMString(name)).handle()];
-}
-
-- (id<WebDOMNode>)item:(unsigned long) index;
-{
-    return [WebCoreDOMNode nodeWithImpl: [self impl]->item(index)];
-}
-
-- (id<WebDOMNode>)getNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
-{
-    DOM::NamedNodeMap instance = DOM::NamedNodeMapImpl::createInstance([self impl]);
-    
-    return [WebCoreDOMNode nodeWithImpl: (DOM::NodeImpl *)instance.getNamedItemNS(NSStringToDOMString(namespaceURI),NSStringToDOMString(localName)).handle()];
-}
-
-- (id<WebDOMNode>)setNamedItemNS:(id<WebDOMNode>)arg;
-{
-    DOM::NamedNodeMap instance = DOM::NamedNodeMapImpl::createInstance([self impl]);
-    WebCoreDOMNode *node = arg;
-    DOM::Node _arg ([node impl]);
-    
-    return [WebCoreDOMNode nodeWithImpl: (DOM::NodeImpl *)instance.setNamedItemNS(_arg).handle()];
-}
-
-- (id<WebDOMNode>)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
-{
-    DOM::NamedNodeMap instance = DOM::NamedNodeMapImpl::createInstance([self impl]);
-    
-    return [WebCoreDOMNode nodeWithImpl: (DOM::NodeImpl *)instance.removeNamedItemNS(NSStringToDOMString(namespaceURI),NSStringToDOMString(localName)).handle()];
-}
-
- at end
-
- at implementation WebCoreDOMAttr
-
-+ (WebCoreDOMAttr *)attrWithImpl: (DOM::AttrImpl *)_impl
-{
-    WebCoreDOMAttr *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease];
-}
-
-- (DOM::AttrImpl *)attrImpl
-{
-    return static_cast<DOM::AttrImpl *>(impl);
-}
-
-- (NSString *)name
-{
-    DOM::Attr instance = DOM::AttrImpl::createInstance([self attrImpl]);
-    DOM::DOMString _name = instance.name();
-    return domStringToNSString(_name);
-}
-
-- (BOOL)specified
-{
-    return [self attrImpl]->specified();
-}
-
-- (NSString *)value
-{
-    DOM::Attr instance = DOM::AttrImpl::createInstance([self attrImpl]);
-    DOM::DOMString _value = instance.value();
-    
-    return domStringToNSString(_value);
-}
-
-- (void)setValue:(NSString *)value;
-{
-    DOM::Attr instance = DOM::AttrImpl::createInstance([self attrImpl]);
-    instance.setValue (NSStringToDOMString(value));
-}
-
-- (id<WebDOMElement>)ownerElement
-{
-    DOM::Attr instance = DOM::AttrImpl::createInstance([self attrImpl]);
-    return [WebCoreDOMElement elementWithImpl: (DOM::ElementImpl *)instance.ownerElement().handle()];
-}
-
- at end
-
-
- at implementation WebCoreDOMDocumentFragment
-
-+ (WebCoreDOMDocumentFragment *)documentFragmentWithImpl: (DOM::DocumentFragmentImpl *)_impl 
-{
-    WebCoreDOMDocumentFragment *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease]; 
-}
-- (DOM::DocumentFragmentImpl *)documentFragmentImpl { return static_cast<DOM::DocumentFragmentImpl *>(impl); }
-
-// No additional methods.
- at end
-
- at implementation WebCoreDOMElement
-
-+ (WebCoreDOMElement *)elementWithImpl: (DOM::ElementImpl *)_impl {
-    WebCoreDOMElement *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease]; 
-}
-
-- (DOM::ElementImpl *)elementImpl { return static_cast<DOM::ElementImpl *>(impl); }
-
-- (NSString *)tagName
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    DOM::DOMString _tagName = instance.tagName();
-
-    return domStringToNSString(_tagName);
-}
-
-- (NSString *)getAttribute: (NSString *)name;
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    DOM::DOMString _attribute = instance.getAttribute(NSStringToDOMString(name));
-
-    return domStringToNSString(_attribute);
-}
-
-- (void)setAttribute:(NSString *)name :(NSString *)value
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    instance.setAttribute(NSStringToDOMString(name), NSStringToDOMString(value));
-}
-
-- (void)removeAttribute:(NSString *)name
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    instance.removeAttribute(NSStringToDOMString(name));
-}
-
-- (id<WebDOMAttr>)getAttributeNode:(NSString *)name
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    DOM::Attr ret = instance.getAttributeNode(NSStringToDOMString(name));
-    
-    return [WebCoreDOMAttr attrWithImpl: (DOM::AttrImpl *)ret.handle()];
-}
-
-- (id<WebDOMAttr>)setAttributeNode:(id<WebDOMAttr>)newAttr;
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    DOM::Attr _newAttr = DOM::AttrImpl::createInstance([(WebCoreDOMAttr *)newAttr attrImpl]);
-    DOM::Attr ret = instance.setAttributeNode(_newAttr);
-    
-    return [WebCoreDOMAttr attrWithImpl: (DOM::AttrImpl *)ret.handle()];
-}
-
-- (id<WebDOMAttr>)removeAttributeNode:(id<WebDOMAttr>)oldAttr
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    DOM::Attr _oldAttr = DOM::AttrImpl::createInstance([(WebCoreDOMAttr *)oldAttr attrImpl]);
-    DOM::Attr ret = instance.removeAttributeNode(_oldAttr);
-    
-    return [WebCoreDOMAttr attrWithImpl: (DOM::AttrImpl *)ret.handle()];
-}
-
-- (id<WebDOMNodeList>)getElementsByTagName:(NSString *)name
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    DOM::NodeList ret = instance.getElementsByTagName(NSStringToDOMString(name));
-    
-    return [WebCoreDOMNodeList nodeListWithImpl: (DOM::NodeListImpl *)ret.handle()];
-}
-
-- (id<WebDOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    DOM::NodeList ret = instance.getElementsByTagNameNS(NSStringToDOMString(namespaceURI),NSStringToDOMString(localName));
-    
-    return [WebCoreDOMNodeList nodeListWithImpl: (DOM::NodeListImpl *)ret.handle()];
-}
-
-- (NSString *)getAttributeNS:(NSString *)namespaceURI :(NSString *)localName
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    DOM::DOMString ret = instance.getAttributeNS(NSStringToDOMString(namespaceURI),NSStringToDOMString(localName));
-    
-    return domStringToNSString(ret);
-}
-
-- (void)setAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName :(NSString *)value
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    instance.setAttributeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(qualifiedName), NSStringToDOMString(value));
-}
-
-- (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    instance.removeAttributeNS(NSStringToDOMString(namespaceURI),NSStringToDOMString(localName));
-}
-
-- (id<WebDOMAttr>)getAttributeNodeNS:(NSString *)namespaceURI :(NSString *)localName;
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    DOM::Attr ret = instance.getAttributeNodeNS(NSStringToDOMString(namespaceURI), NSStringToDOMString(localName));
-    
-    return [WebCoreDOMAttr attrWithImpl: (DOM::AttrImpl *)ret.handle()];
-}
-
-- (id<WebDOMAttr>)setAttributeNodeNS:(id<WebDOMAttr>)newAttr;
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    DOM::Attr _newAttr = DOM::AttrImpl::createInstance([(WebCoreDOMAttr *)newAttr attrImpl]);
-    DOM::Attr ret = instance.setAttributeNodeNS(_newAttr);
-    
-    return [WebCoreDOMAttr attrWithImpl: (DOM::AttrImpl *)ret.handle()];
-}
-
-- (BOOL)hasAttribute: (NSString *)name;
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    
-    return instance.hasAttribute (NSStringToDOMString(name));
-}
-
-- (BOOL)hasAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
-{
-    DOM::Element instance = DOM::ElementImpl::createInstance([self elementImpl]);
-    
-    return instance.hasAttributeNS (NSStringToDOMString(namespaceURI), NSStringToDOMString(localName));
-}
-
- at end
-
-
- at implementation WebCoreDOMEntityReference
-
-+ (WebCoreDOMEntityReference *)entityReferenceWithImpl: (DOM::EntityReferenceImpl *)_impl {
-    WebCoreDOMEntityReference *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease]; 
-}
-
-- (DOM::EntityReferenceImpl *)entityReferenceImpl { return static_cast<DOM::EntityReferenceImpl *>(impl); }
-
- at end
-
- at implementation WebCoreDOMCharacterData
-
-+ (WebCoreDOMCharacterData *)commentWithImpl: (DOM::CharacterDataImpl *)_impl {
-    WebCoreDOMCharacterData *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease]; 
-}
-
-- (DOM::CharacterDataImpl *)characterDataImpl { return static_cast<DOM::CharacterDataImpl *>(impl); }
-
-- (NSString *)data
-{
-    DOM::CharacterData instance = DOM::CharacterDataImpl::createInstance([self characterDataImpl]);
-    DOM::DOMString data = instance.data();
-    return domStringToNSString(data);
-}
-
-- (void)setData: (NSString *)data
-{
-    DOM::CharacterData instance = DOM::CharacterDataImpl::createInstance([self characterDataImpl]);
-    return instance.setData(NSStringToDOMString(data));
-}
-
-- (unsigned long)length
-{
-    DOM::CharacterData instance = DOM::CharacterDataImpl::createInstance([self characterDataImpl]);
-    return instance.length();
-}
-
-- (NSString *)substringData: (unsigned long)offset :(unsigned long)count
-{
-    DOM::CharacterData instance = DOM::CharacterDataImpl::createInstance([self characterDataImpl]);
-    DOM::DOMString substring = instance.substringData(offset,count);
-    return domStringToNSString(substring);
-}
-
-- (void)appendData:(NSString *)arg
-{
-    DOM::CharacterData instance = DOM::CharacterDataImpl::createInstance([self characterDataImpl]);
-    instance.appendData(NSStringToDOMString(arg));
-}
-
-- (void)insertData:(unsigned long)offset :(NSString *)arg
-{
-    DOM::CharacterData instance = DOM::CharacterDataImpl::createInstance([self characterDataImpl]);
-    instance.insertData(offset, NSStringToDOMString(arg));
-}
-
-- (void)deleteData:(unsigned long)offset :(unsigned long) count
-{
-    DOM::CharacterData instance = DOM::CharacterDataImpl::createInstance([self characterDataImpl]);
-    instance.deleteData(offset, count);
-}
-
-- (void)replaceData:(unsigned long)offset :(unsigned long)count :(NSString *)arg;
-{
-    DOM::CharacterData instance = DOM::CharacterDataImpl::createInstance([self characterDataImpl]);
-    instance.replaceData(offset, count, NSStringToDOMString(arg));
-}
-
- at end
-
- at implementation WebCoreDOMComment
-
-+ (WebCoreDOMComment *)commentWithImpl: (DOM::CommentImpl *)_impl {
-    WebCoreDOMComment *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease]; 
-}
-
-- (DOM::CommentImpl *)commentImpl { return static_cast<DOM::CommentImpl *>(impl); }
-
-// No additional methods.
-
- at end
-
- at implementation WebCoreDOMText
-
-+ (WebCoreDOMText *)textWithImpl: (DOM::TextImpl *)_impl {
-    WebCoreDOMText *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease]; 
-}
-
-- (DOM::TextImpl *)textImpl { return static_cast<DOM::TextImpl *>(impl); }
-
-- (id<WebDOMText>)splitText: (unsigned long)offset
-{
-    DOM::Text instance = DOM::TextImpl::createInstance([self textImpl]);
-    return [WebCoreDOMText textWithImpl: (DOM::TextImpl *)instance.splitText(offset).handle()];
-}
-
- at end
-
- at implementation WebCoreDOMCDATASection
-
-+ (WebCoreDOMCDATASection *)CDATASectionWithImpl: (DOM::CDATASectionImpl *)_impl
-{
-    WebCoreDOMCDATASection *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease];
-}
-- (DOM::CDATASectionImpl *)CDATASectionImpl { return static_cast<DOM::CDATASectionImpl *>(impl); }
-
-// No additional methods.
- at end
-
- at implementation WebCoreDOMProcessingInstruction
-
-+ (WebCoreDOMProcessingInstruction *)processingInstructionWithImpl: (DOM::ProcessingInstructionImpl *)_impl
-{
-    WebCoreDOMProcessingInstruction *obj = [[self class] alloc];
-    return [[obj initWithImpl: _impl] autorelease]; 
-}
-
-- (DOM::ProcessingInstructionImpl *)processingInstructionImpl { return static_cast<DOM::ProcessingInstructionImpl *>(impl); }
-
-- (NSString *)target;
-{
-    DOM::ProcessingInstruction instance = DOM::ProcessingInstructionImpl::createInstance([self processingInstructionImpl]);
-    DOM::DOMString data = instance.data();
-    return domStringToNSString(data);
-}
-
-- (NSString *)data
-{
-    DOM::ProcessingInstruction instance = DOM::ProcessingInstructionImpl::createInstance([self processingInstructionImpl]);
-    DOM::DOMString data = instance.data();
-    return domStringToNSString(data);
-}
-
-- (void)setData:(NSString *)data
-{
-    DOM::ProcessingInstruction instance = DOM::ProcessingInstructionImpl::createInstance([self processingInstructionImpl]);
-    return instance.setData(NSStringToDOMString(data));
-}
-
- at end
-
-
diff --git a/WebCore/kwq/WebCoreDOMPrivate.h b/WebCore/kwq/WebCoreDOMPrivate.h
deleted file mode 100644
index be0c38e..0000000
--- a/WebCore/kwq/WebCoreDOMPrivate.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#import "dom_element.h"
-#import "dom_node.h"
-#import "dom_string.h"
-#import "dom_text.h"
-#import "dom_xml.h"
-#import "dom_textimpl.h"
-#import "dom_xmlimpl.h"
-#import "dom2_rangeimpl.h"
-#import "dom2_eventsimpl.h"
-#import "xml_tokenizer.h"
-#import "dom_docimpl.h"
-#import "dom_nodeimpl.h"
-
-#import "WebCoreDOM.h"
-
-extern NSString *domStringToNSString(DOM::DOMString &aString);
-extern DOM::DOMString NSStringToDOMString(NSString *aString);
-
- at interface WebCoreDOMDocumentType (CorePrivate)
-+ (WebCoreDOMDocumentType *)documentTypeWithImpl:(DOM::DocumentTypeImpl *)impl;
-- (DOM::DocumentTypeImpl *)documentTypeImpl;
- at end
-
- at interface WebCoreDOMImplementation (CorePrivate)
-+ (WebCoreDOMImplementation *)implementationWithImpl:(DOM::DOMImplementationImpl *)impl;
-- initWithImpl:(DOM::DOMImplementationImpl *)coreImpl;
-- (DOM::DOMImplementationImpl *)DOMImplementationImpl;
- at end
-
- at interface WebCoreDOMDocument (CorePrivate)
-+ (WebCoreDOMDocument *)documentWithImpl:(DOM::DocumentImpl *)impl;
-- (DOM::DocumentImpl *)documentImpl;
- at end
-
- at interface WebCoreDOMNamedNodeMap (CorePrivate)
-+ (WebCoreDOMNamedNodeMap *)namedNodeMapWithImpl:(DOM::NamedNodeMapImpl *)impl;
-- initWithImpl:(DOM::NamedNodeMapImpl *)coreImpl;
-- (DOM::NamedNodeMapImpl *)impl;
- at end
-
- at interface WebCoreDOMElement (CorePrivate)
-+ (WebCoreDOMElement *)elementWithImpl:(DOM::ElementImpl *)impl;
-- (DOM::ElementImpl *)elementImpl;
- at end
-
- at interface WebCoreDOMAttr (CorePrivate)
-+ (WebCoreDOMAttr *)attrWithImpl:(DOM::AttrImpl *)impl;
-- (DOM::AttrImpl *)attrImpl;
- at end
-
- at interface WebCoreDOMDocumentFragment (CorePrivate)
-+ (WebCoreDOMDocumentFragment *)documentFragmentWithImpl:(DOM::DocumentFragmentImpl *)impl;
-- (DOM::DocumentFragmentImpl *)documentFragmentImpl;
- at end
-
- at interface WebCoreDOMCharacterData (CorePrivate)
-+ (WebCoreDOMCharacterData *)characterDataWithImpl:(DOM::CharacterDataImpl *)impl;
-- initWithImpl:(DOM::CharacterDataImpl *)coreImpl;
-- (DOM::CharacterDataImpl *)impl;
- at end
-
- at interface WebCoreDOMText (CorePrivate)
-+ (WebCoreDOMText *)textWithImpl:(DOM::TextImpl *)impl;
-- (DOM::TextImpl *)textImpl;
- at end
-
- at interface WebCoreDOMComment (CorePrivate)
-+ (WebCoreDOMComment *)commentWithImpl:(DOM::CommentImpl *)impl;
-- (DOM::CommentImpl *)commentImpl;
- at end
-
- at interface WebCoreDOMCDATASection (CorePrivate)
-+ (WebCoreDOMCDATASection *)CDATASectionWithImpl:(DOM::CDATASectionImpl *)impl;
-- (DOM::CDATASectionImpl *)CDATASectionImpl;
- at end
-
- at interface WebCoreDOMProcessingInstruction (CorePrivate)
-+ (WebCoreDOMProcessingInstruction *)processingInstructionWithImpl:(DOM::ProcessingInstructionImpl *)impl;
-- (DOM::ProcessingInstructionImpl *)processingInstructionImpl;
- at end
-
- at interface WebCoreDOMEntityReference (CorePrivate)
-+ (WebCoreDOMEntityReference *)entityReferenceWithImpl:(DOM::EntityReferenceImpl *)impl;
-- (DOM::EntityReferenceImpl *)entityReferenceImpl;
- at end
-
- at interface WebCoreDOMNode (CorePrivate)
-+ (WebCoreDOMNode *)nodeWithImpl:(DOM::NodeImpl *)impl;
-- initWithImpl:(DOM::NodeImpl *)coreImpl;
-- (DOM::NodeImpl *)impl;
- at end
-
- at interface WebCoreDOMNodeList (CorePrivate)
-+ (WebCoreDOMNodeList *)nodeListWithImpl:(DOM::NodeListImpl *)impl;
-- initWithImpl:(DOM::NodeListImpl *)coreImpl;
-- (DOM::NodeListImpl *)impl;
- at end
-
diff --git a/WebCore/kwq/WebDOMDocument.h b/WebCore/kwq/WebDOMDocument.h
deleted file mode 100644
index cf61c59..0000000
--- a/WebCore/kwq/WebDOMDocument.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#import <Foundation/Foundation.h>
-
- at protocol WebDOMAttr;
- at protocol WebDOMComment;
- at protocol WebDOMCDATASection;
- at protocol WebDOMDocument;
- at protocol WebDOMElement;
- at protocol WebDOMEntityReference;
- at protocol WebDOMNamedNodeMap;
- at protocol WebDOMNode;
- at protocol WebDOMNodeList;
- at protocol WebDOMProcessingInstruction;
- at protocol WebDOMText;
-
-
- at protocol WebDOMDocumentType <WebDOMNode>
-
-- (NSString *)name;
-
-- (id<WebDOMNamedNodeMap>)entities;
-
-- (id<WebDOMNamedNodeMap>)notations;
-
-- (NSString *)publicId;
-
-- (NSString *)systemId;
-
-- (NSString *)internalSubset;
-
- at end
-
-
- at protocol WebDOMDocumentFragment <WebDOMNode>
-
- at end
-
-
- at protocol WebDOMImplementation
-
-- (BOOL)hasFeature:(NSString *)feature :(NSString *)version;
-
-- (id<WebDOMDocumentType>)createDocumentType:(NSString *)qualifiedName
-                                      :(NSString *)publicId
-                                      :(NSString *)systemId
-                                      :(int *)exceptionCode;
-
-- (id<WebDOMDocument>)createDocument:(NSString *)namespaceURI
-                              :(NSString *)qualifiedName
-                              :(id<WebDOMDocumentType>)doctype;
-
- at end
-
-
- at protocol WebDOMDocument <WebDOMNode>
-
-- (id<WebDOMDocumentType>)doctype;
-
-- (id<WebDOMImplementation>)implementation;
-
-- (id<WebDOMElement>)documentElement;
-
-- (id<WebDOMElement>)createElement:(NSString *)tagName;
-
-- (id<WebDOMElement>)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName;
-
-- (id<WebDOMDocumentFragment>)createDocumentFragment;
-
-- (id<WebDOMText>)createTextNode:(NSString *)data;
-
-- (id<WebDOMComment>)createComment:(NSString *)data;
-
-- (id<WebDOMCDATASection>)createCDATASection:(NSString *)data;
-
-- (id<WebDOMProcessingInstruction>)createProcessingInstruction:(NSString *)target :(NSString *)data;
-
-- (id<WebDOMAttr>)createAttribute:(NSString *)name;
-
-- (id<WebDOMAttr>)createAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName;
-
-- (id<WebDOMEntityReference>)createEntityReference:(NSString *)name;
-
-- (id<WebDOMElement>)getElementById:(NSString *)elementId;
-
-- (id<WebDOMNodeList>)getElementsByTagName:(NSString *)tagname;
-
-- (id<WebDOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
-
-- (id<WebDOMNode>)importNode:(id<WebDOMNode>)importedNode :(BOOL)deep;
-
- at end
diff --git a/WebCore/kwq/WebDOMElement.h b/WebCore/kwq/WebDOMElement.h
deleted file mode 100644
index 8257597..0000000
--- a/WebCore/kwq/WebDOMElement.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#import <Foundation/Foundation.h>
-
- at protocol WebDOMElement;
- at protocol WebDOMNode;
- at protocol WebDOMNodeList;
-
-
- at protocol WebDOMAttr <WebDOMNode>
-
-- (NSString *)name;
-
-- (BOOL)specified;
-
-- (NSString *)value;
-
-- (void)setValue:(NSString *)value;
-
-- (id<WebDOMElement>)ownerElement;
-
- at end
-
-
- at protocol WebDOMCharacterData <WebDOMNode>
-
-- (NSString *)data;
-
-- (void)setData:(NSString *)data;
-
-- (unsigned long)length;
-
-- (NSString *)substringData:(unsigned long)offset :(unsigned long)count;
-
-- (void)appendData:(NSString *)arg;
-
-- (void)insertData:(unsigned long)offset :(NSString *)arg;
-
-- (void)deleteData:(unsigned long)offset :(unsigned long) count;
-
-- (void)replaceData:(unsigned long)offset :(unsigned long)count :(NSString *)arg;
- at end
-
-
- at protocol WebDOMComment <WebDOMCharacterData>
-
- at end
-
-
- at protocol WebDOMText <WebDOMCharacterData>
-
-- (id<WebDOMText>)splitText:(unsigned long)offset;
-
- at end
-
-
- at protocol WebDOMCDATASection <WebDOMText>
-
- at end
-
-
- at protocol WebDOMProcessingInstruction <WebDOMNode>
-
-- (NSString *)target;
-
-- (NSString *)data;
-
-- (void)setData:(NSString *)data;
-
- at end
-
-
- at protocol WebDOMEntityReference <WebDOMNode>
-
- at end
-
-
- at protocol WebDOMElement <NSObject>
-
-- (NSString *)tagName;
-
-- (NSString *)getAttribute:(NSString *)name;
-
-- (void)setAttribute:(NSString *)name :(NSString *)value;
-
-- (void)removeAttribute:(NSString *)name;
-
-- (id<WebDOMAttr>)getAttributeNode:(NSString *)name;
-
-- (id<WebDOMAttr>)setAttributeNode:(id<WebDOMAttr>)newAttr;
-
-- (id<WebDOMAttr>)removeAttributeNode:(id<WebDOMAttr>)oldAttr;
-
-- (id<WebDOMNodeList>)getElementsByTagName:(NSString *)name;
-
-- (id<WebDOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
-
-- (NSString *)getAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
-
-- (void)setAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName :(NSString *)value;
-
-- (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
-
-- (id<WebDOMAttr>)getAttributeNodeNS:(NSString *)namespaceURI :(NSString *)localName;
-
-- (id<WebDOMAttr>)setAttributeNodeNS:(id<WebDOMAttr>)newAttr;
-
-- (BOOL)hasAttribute:(NSString *)name;
-
-- (BOOL)hasAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
-
- at end
diff --git a/WebCore/kwq/WebDOMNode.h b/WebCore/kwq/WebDOMNode.h
deleted file mode 100644
index 01f5189..0000000
--- a/WebCore/kwq/WebDOMNode.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#import <Foundation/Foundation.h>
-
- at protocol WebDOMDocument;
- at protocol WebDOMNamedNodeMap;
- at protocol WebDOMNodeList;
-
-enum WebNodeType {
-    ELEMENT_NODE = 1,
-    ATTRIBUTE_NODE = 2,
-    TEXT_NODE = 3,
-    CDATA_SECTION_NODE = 4,
-    ENTITY_REFERENCE_NODE = 5,
-    ENTITY_NODE = 6,
-    PROCESSING_INSTRUCTION_NODE = 7,
-    COMMENT_NODE = 8,
-    DOCUMENT_NODE = 9,
-    DOCUMENT_TYPE_NODE = 10,
-    DOCUMENT_FRAGMENT_NODE = 11,
-    NOTATION_NODE = 12
-};
-
- at protocol WebDOMNode <NSObject>
-
-- (NSString *)nodeName;
-- (NSString *)nodeValue;
-- (void)setNodeValue:(NSString *)string; 
-- (unsigned short)nodeType;
-- (id<WebDOMNode>)parentNode;
-- (id<WebDOMNodeList>)childNodes;
-- (id<WebDOMNode>)firstChild;
-- (id<WebDOMNode>)lastChild;
-- (id<WebDOMNode>)previousSibling;
-- (id<WebDOMNode>)nextSibling;
-- (id<WebDOMNamedNodeMap>)attributes;
-- (id<WebDOMDocument>)ownerDocument;
-- (id<WebDOMNode>)insert:(id<(WebDOMNode)>)newChild before:(id<WebDOMNode>)refChild;
-- (id<WebDOMNode>)replace:(id<WebDOMNode>)newChild child:(id<WebDOMNode>)oldChild;
-- (id<WebDOMNode>)removeChild:(id<WebDOMNode>)oldChild;
-- (id<WebDOMNode>)appendChild:(id<WebDOMNode>)newChild;
-- (BOOL)hasChildNodes;
-- (id<WebDOMNode>)cloneNode:(BOOL) deep;
-- (void)normalize;
-- (BOOL)isSupported:(NSString *)feature :(NSString *)version;
-- (NSString *)namespaceURI;
-- (NSString *)prefix;
-- (void)setPrefix:(NSString *)prefix;
-- (NSString *)localName;
-- (BOOL)hasAttributes;
-
- at end
-
-
- at protocol WebDOMNamedNodeMap <NSObject>
-
-- (unsigned long) length;
-- (id<WebDOMNode>)getNamedItem:(NSString *)name;
-- (id<WebDOMNode>)setNamedItem:(id<WebDOMNode>)arg;
-- (id<WebDOMNode>)removeNamedItem:(NSString *)name;
-- (id<WebDOMNode>)item:(unsigned long) index;
-- (id<WebDOMNode>)getNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
-- (id<WebDOMNode>)setNamedItemNS:(id<WebDOMNode>)arg;
-- (id<WebDOMNode>)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
-
- at end
-
-
- at protocol WebDOMNodeList <NSObject>
-
-- (unsigned long)length;
-- (id<WebDOMNode>)item:(unsigned long)index;
-
- at end
-
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 7dae01c..9a926df 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,60 @@
+2004-02-26  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Chris
+
+        Updated usage of DOM SPI to use new names and conventions. 
+
+        Unless indicated otherwise, the changes were to update protocol names for, which
+        changed from using a "WebDOM" prefix to a "DOM" prefix, and changing now need 
+        only include the DOM.h header from WebKit to get everything.
+
+        * DOM.subproj/DOM-compat.h: Added. This header contains some compatibility declarations
+        to work with older clients of our DOM SPI. Though this file is checked into WebKit, 
+        it really lives and should be updated in WebCore. It is copied into WebKit by the build 
+        system as needed.
+        * DOM.subproj/DOM.h: Added. This file includes the new "guts" of the DOM SPI. As above,
+        this file is checked into WebKit, it really lives and should be updated in WebCore.
+        It is copied into WebKit by the build system as needed.
+        * DOM.subproj/WebDOMDocument.h: Removed declarations. Now just includes DOM.h and DOM-compat.h
+        * DOM.subproj/WebDOMDocument.m: Removed.
+        * DOM.subproj/WebDOMElement.h: Removed declarations. Now just includes DOM.h and DOM-compat.h
+        * DOM.subproj/WebDOMElement.m: Removed.
+        * DOM.subproj/WebDOMNode.h: Removed declarations. Now just includes DOM.h and DOM-compat.h
+        * DOM.subproj/WebDOMNode.m: Removed.
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge loadURL:referrer:reload:onLoadEvent:target:triggeringEvent:form:formValues:])
+        (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:])
+        * WebKit.pbproj/project.pbxproj:
+        * WebView.subproj/WebDefaultContextMenuDelegate.m:
+        * WebView.subproj/WebFormDelegate.h:
+        * WebView.subproj/WebFormDelegate.m:
+        (-[WebFormDelegate frame:sourceFrame:willSubmitForm:withValues:submissionListener:])
+        * WebView.subproj/WebFrame.h: Unrelated change. Removed -undoManager accessor from public header. Moved to private header.
+        * WebView.subproj/WebFrame.m: 
+        (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:])
+        (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:])
+        (-[WebFrame undoManager]): Moved -undoManager accessor to private category implementation.
+        (-[WebFormState initWithForm:values:sourceFrame:])
+        (-[WebFormState form])
+        (-[WebFrame childFrames])
+        * WebView.subproj/WebFramePrivate.h: Moved in -undoManager accessor.
+        * WebView.subproj/WebHTMLRepresentation.h:
+        * WebView.subproj/WebHTMLRepresentation.m:
+        (-[WebHTMLRepresentation DOMDocument])
+        (-[WebHTMLRepresentation setSelectionFrom:startOffset:to:endOffset:])
+        (-[WebHTMLRepresentation attributedStringFrom:startOffset:to:endOffset:])
+        (-[WebHTMLRepresentation elementWithName:inForm:])
+        (-[WebHTMLRepresentation elementForView:])
+        (-[WebHTMLRepresentation elementDoesAutoComplete:])
+        (-[WebHTMLRepresentation elementIsPassword:])
+        (-[WebHTMLRepresentation formForElement:])
+        (-[WebHTMLRepresentation controlsInForm:])
+        (-[WebHTMLRepresentation searchForLabels:beforeElement:])
+        (-[WebHTMLRepresentation matchLabels:againstElement:])
+        * WebView.subproj/WebHTMLView.m:
+        * copy-webcore-files-to-webkit: Added. Copies DOM.h and DOM-compat.h from WebCore when they
+        have been updated there.
+
 2004-02-25  John Sullivan  <sullivan at apple.com>
 
         WebKit part of fix for <rdar://problem/3546370>: add a way to tab to menus, 
diff --git a/WebKit/DOM.subproj/DOM-compat.h b/WebKit/DOM.subproj/DOM-compat.h
new file mode 100644
index 0000000..beb7f71
--- /dev/null
+++ b/WebKit/DOM.subproj/DOM-compat.h
@@ -0,0 +1,80 @@
+/*	
+    DOM-compat.h
+    Copyright 2004, Apple, Inc. All rights reserved.
+*/
+
+ at protocol DOMNode;
+ at protocol DOMNamedNodeMap;
+ at protocol DOMNodeList;
+ at protocol DOMImplementation;
+ at protocol DOMDocumentFragment;
+ at protocol DOMDocument;
+ at protocol DOMCharacterData;
+ at protocol DOMAttr;
+ at protocol DOMElement;
+ at protocol DOMText;
+ at protocol DOMComment;
+ at protocol DOMCDATASection;
+ at protocol DOMDocumentType;
+ at protocol DOMNotation;
+ at protocol DOMEntity;
+ at protocol DOMEntityReference;
+ at protocol DOMProcessingInstruction;
+
+ at protocol WebDOMNode <DOMNode>
+ at end
+
+ at protocol WebDOMNamedNodeMap <DOMNamedNodeMap>
+ at end
+
+ at protocol WebDOMNodeList <DOMNodeList>
+ at end
+
+ at protocol WebDOMDocumentType <DOMDocumentType>
+ at end
+
+ at protocol WebDOMDocumentFragment <DOMDocumentFragment>
+ at end
+
+ at protocol WebDOMImplementation <DOMImplementation>
+ at end
+
+ at protocol WebDOMDocument <DOMDocument>
+ at end
+
+ at protocol WebDOMAttr <DOMAttr>
+ at end
+
+ at protocol WebDOMCharacterData <DOMCharacterData>
+ at end
+
+ at protocol WebDOMComment <DOMComment>
+ at end
+
+ at protocol WebDOMText <DOMText>
+ at end
+
+ at protocol WebDOMCDATASection <DOMCDATASection>
+ at end
+
+ at protocol WebDOMProcessingInstruction <DOMProcessingInstruction>
+ at end
+
+ at protocol WebDOMEntityReference <DOMEntityReference>
+ at end
+
+ at protocol WebDOMElement <DOMElement>
+ at end
+
+#define WebNodeType DOMNodeType
+#define WebDOMAttr DOMAttr
+#define WebDOMComment DOMComment
+#define WebDOMCDATASection DOMCDATASection
+#define WebDOMDocument DOMDocument
+#define WebDOMElement DOMElement
+#define WebDOMEntityReference DOMEntityReference
+#define WebDOMNamedNodeMap DOMNamedNodeMap
+#define WebDOMNode DOMNode
+#define WebDOMNodeList DOMNodeList
+#define WebDOMProcessingInstruction DOMProcessingInstruction
+#define WebDOMText DOMText
diff --git a/WebKit/DOM.subproj/DOM.h b/WebKit/DOM.subproj/DOM.h
new file mode 100644
index 0000000..3d8d75b
--- /dev/null
+++ b/WebKit/DOM.subproj/DOM.h
@@ -0,0 +1,351 @@
+/*
+ * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+//=========================================================================
+//=========================================================================
+//=========================================================================
+
+// Important Note:
+// Though this file appears as an exported header from WebKit, the
+// version you should edit is in WebCore. The WebKit version is copied
+// to WebKit during the build process.
+
+//=========================================================================
+//=========================================================================
+//=========================================================================
+
+enum DOMNodeType {
+    ELEMENT_NODE                   = 1,
+    ATTRIBUTE_NODE                 = 2,
+    TEXT_NODE                      = 3,
+    CDATA_SECTION_NODE             = 4,
+    ENTITY_REFERENCE_NODE          = 5,
+    ENTITY_NODE                    = 6,
+    PROCESSING_INSTRUCTION_NODE    = 7,
+    COMMENT_NODE                   = 8,
+    DOCUMENT_NODE                  = 9,
+    DOCUMENT_TYPE_NODE             = 10,
+    DOCUMENT_FRAGMENT_NODE         = 11,
+    NOTATION_NODE                  = 12,
+};
+
+enum DOMExceptionCode {
+    INDEX_SIZE_ERR                 = 1,
+    DOMSTRING_SIZE_ERR             = 2,
+    HIERARCHY_REQUEST_ERR          = 3,
+    WRONG_DOCUMENT_ERR             = 4,
+    INVALID_CHARACTER_ERR          = 5,
+    NO_DATA_ALLOWED_ERR            = 6,
+    NO_MODIFICATION_ALLOWED_ERR    = 7,
+    NOT_FOUND_ERR                  = 8,
+    NOT_SUPPORTED_ERR              = 9,
+    INUSE_ATTRIBUTE_ERR            = 10,
+    INVALID_STATE_ERR              = 11,
+    SYNTAX_ERR                     = 12,
+    INVALID_MODIFICATION_ERR       = 13,
+    NAMESPACE_ERR                  = 14,
+    INVALID_ACCESS_ERR             = 15,
+};
+
+extern NSString * const DOMErrorDomain;
+
+ at class NSError;
+ at class NSString;
+
+ at protocol NSObject;
+ at protocol DOMNode;
+ at protocol DOMNamedNodeMap;
+ at protocol DOMNodeList;
+ at protocol DOMImplementation;
+ at protocol DOMDocumentFragment;
+ at protocol DOMDocument;
+ at protocol DOMCharacterData;
+ at protocol DOMAttr;
+ at protocol DOMElement;
+ at protocol DOMText;
+ at protocol DOMComment;
+ at protocol DOMCDATASection;
+ at protocol DOMDocumentType;
+ at protocol DOMNotation;
+ at protocol DOMEntity;
+ at protocol DOMEntityReference;
+ at protocol DOMProcessingInstruction;
+ at protocol DOMRange;
+
+ at protocol DOMNode <NSObject>
+- (NSString *)nodeName;
+- (NSString *)nodeValue;
+- (void)setNodeValue:(NSString *)string error:(NSError **)error;
+- (unsigned short)nodeType;
+- (id <DOMNode>)parentNode;
+- (id <DOMNodeList>)childNodes;
+- (id <DOMNode>)firstChild;
+- (id <DOMNode>)lastChild;
+- (id <DOMNode>)previousSibling;
+- (id <DOMNode>)nextSibling;
+- (id <DOMNamedNodeMap>)attributes;
+- (id <DOMDocument>)ownerDocument;
+- (id <DOMNode>)insertBefore:(id <DOMNode>)newChild :(id <DOMNode>)refChild error:(NSError **)error;
+- (id <DOMNode>)replaceChild:(id <DOMNode>)newChild :(id <DOMNode>)oldChild error:(NSError **)error;
+- (id <DOMNode>)removeChild:(id <DOMNode>)oldChild error:(NSError **)error;
+- (id <DOMNode>)appendChild:(id <DOMNode>)newChild error:(NSError **)error;
+- (BOOL)hasChildNodes;
+- (id <DOMNode>)cloneNode:(BOOL)deep;
+- (void)normalize;
+- (BOOL)isSupported:(NSString *)feature :(NSString *)version;
+- (NSString *)namespaceURI;
+- (NSString *)prefix;
+- (void)setPrefix:(NSString *)prefix error:(NSError **)error;
+- (NSString *)localName;
+- (BOOL)hasAttributes;
+- (NSString *)HTMLString;
+// begin deprecated methods
+- (void)setNodeValue:(NSString *)string;
+- (id<DOMNode>)insert:(id<DOMNode>)newChild before:(id<DOMNode>)refChild;
+- (id<DOMNode>)replace:(id<DOMNode>)newChild child:(id<DOMNode>)oldChild;
+- (id<DOMNode>)removeChild:(id<DOMNode>)oldChild;
+- (id<DOMNode>)appendChild:(id<DOMNode>)newChild;
+- (void)setPrefix:(NSString *)prefix;
+// end deprecated methods
+ at end
+
+ at protocol DOMNamedNodeMap <NSObject>
+- (id <DOMNode>)getNamedItem:(NSString *)name;
+- (id <DOMNode>)setNamedItem:(id <DOMNode>)arg error:(NSError **)error;
+- (id <DOMNode>)removeNamedItem:(NSString *)name error:(NSError **)error;
+- (id <DOMNode>)item:(unsigned long)index;
+- (unsigned long)length;
+- (id <DOMNode>)getNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
+- (id <DOMNode>)setNamedItemNS:(id <DOMNode>)arg error:(NSError **)error;
+- (id <DOMNode>)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName error:(NSError **)error;
+// begin deprecated methods
+- (id<DOMNode>)setNamedItem:(id<DOMNode>)arg;
+- (id<DOMNode>)removeNamedItem:(NSString *)name;
+- (id<DOMNode>)setNamedItemNS:(id<DOMNode>)arg;
+- (id<DOMNode>)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMNodeList <NSObject>
+- (id <DOMNode>)item:(unsigned long)index;
+- (unsigned long)length;
+ at end
+
+
+ at protocol DOMImplementation <NSObject>
+- (BOOL)hasFeature:(NSString *)feature :(NSString *)version;
+- (id <DOMDocumentType>)createDocumentType:(NSString *)qualifiedName :(NSString *)publicId :(NSString *)systemId error:(NSError **)error;
+- (id <DOMDocument>)createDocument:(NSString *)namespaceURI :(NSString *)qualifiedName :(id <DOMDocumentType>)doctype error:(NSError **)error;
+// begin deprecated methods
+- (id<DOMDocumentType>)createDocumentType:(NSString *)qualifiedName :(NSString *)publicId :(NSString *)systemId :(int *)exceptionCode;
+- (id<DOMDocument>)createDocument:(NSString *)namespaceURI :(NSString *)qualifiedName :(id<DOMDocumentType>)doctype;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMDocumentFragment <DOMNode>
+ at end
+
+
+ at protocol DOMDocument <DOMNode>
+- (id <DOMDocumentType>)doctype;
+- (id <DOMImplementation>)implementation;
+- (id <DOMElement>)documentElement;
+- (id <DOMElement>)createElement:(NSString *)tagName error:(NSError **)error;
+- (id <DOMDocumentFragment>)createDocumentFragment;
+- (id <DOMText>)createTextNode:(NSString *)data;
+- (id <DOMComment>)createComment:(NSString *)data;
+- (id <DOMCDATASection>)createCDATASection:(NSString *)data error:(NSError **)error;
+- (id <DOMProcessingInstruction>)createProcessingInstruction:(NSString *)target :(NSString *)data error:(NSError **)error;
+- (id <DOMAttr>)createAttribute:(NSString *)name error:(NSError **)error;
+- (id <DOMEntityReference>)createEntityReference:(NSString *)name error:(NSError **)error;
+- (id <DOMNodeList>)getElementsByTagName:(NSString *)tagname;
+- (id <DOMNode>)importNode:(id <DOMNode>)importedNode :(BOOL)deep error:(NSError **)error;
+- (id <DOMElement>)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName error:(NSError **)error;
+- (id <DOMAttr>)createAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName error:(NSError **)error;
+- (id <DOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
+- (id <DOMElement>)getElementById:(NSString *)elementId;
+// begin deprecated methods
+- (id<DOMElement>)createElement:(NSString *)tagName;
+- (id<DOMElement>)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName;
+- (id<DOMCDATASection>)createCDATASection:(NSString *)data;
+- (id<DOMProcessingInstruction>)createProcessingInstruction:(NSString *)target :(NSString *)data;
+- (id<DOMAttr>)createAttribute:(NSString *)name;
+- (id<DOMEntityReference>)createEntityReference:(NSString *)name;
+- (id<DOMNode>)importNode:(id<DOMNode>)importedNode :(BOOL)deep;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMCharacterData <DOMNode>
+- (NSString *)data;
+- (void)setData:(NSString *)data error:(NSError **)error;
+- (unsigned long)length;
+- (NSString *)substringData:(unsigned long)offset :(unsigned long)count error:(NSError **)error;
+- (void)appendData:(NSString *)arg error:(NSError **)error;
+- (void)insertData:(unsigned long)offset :(NSString *)arg error:(NSError **)error;
+- (void)deleteData:(unsigned long)offset :(unsigned long) count error:(NSError **)error;
+- (void)replaceData:(unsigned long)offset :(unsigned long)count :(NSString *)arg error:(NSError **)error;
+// begin deprecated methods
+- (void)setData: (NSString *)data;
+- (NSString *)substringData: (unsigned long)offset :(unsigned long)count;
+- (void)appendData:(NSString *)arg;
+- (void)insertData:(unsigned long)offset :(NSString *)arg;
+- (void)deleteData:(unsigned long)offset :(unsigned long)count;
+- (void)replaceData:(unsigned long)offset :(unsigned long)count :(NSString *)arg;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMAttr <DOMNode>
+- (NSString *)name;
+- (BOOL)specified;
+- (NSString *)value;
+- (void)setValue:(NSString *)value error:(NSError **)error;
+- (id <DOMElement>)ownerElement;
+// begin deprecated methods
+- (void)setValue:(NSString *)value;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMElement <DOMNode>
+- (NSString *)tagName;
+- (NSString *)getAttribute:(NSString *)name;
+- (void)setAttribute:(NSString *)name :(NSString *)value error:(NSError **)error;
+- (void)removeAttribute:(NSString *)name error:(NSError **)error;
+- (id <DOMAttr>)getAttributeNode:(NSString *)name;
+- (id <DOMAttr>)setAttributeNode:(id <DOMAttr>)newAttr error:(NSError **)error;
+- (id <DOMAttr>)removeAttributeNode:(id <DOMAttr>)oldAttr error:(NSError **)error;
+- (id <DOMNodeList>)getElementsByTagName:(NSString *)name;
+- (NSString *)getAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
+- (void)setAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName :(NSString *)value error:(NSError **)error;
+- (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName error:(NSError **)error;
+- (id <DOMAttr>)getAttributeNodeNS:(NSString *)namespaceURI :(NSString *)localName;
+- (id <DOMAttr>)setAttributeNodeNS:(id <DOMAttr>)newAttr error:(NSError **)error;
+- (id <DOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
+- (BOOL)hasAttribute:(NSString *)name;
+- (BOOL)hasAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
+// begin deprecated methods
+- (void)setAttribute:(NSString *)name :(NSString *)value;
+- (void)removeAttribute:(NSString *)name;
+- (id<DOMAttr>)setAttributeNode:(id<DOMAttr>)newAttr;
+- (id<DOMAttr>)removeAttributeNode:(id<DOMAttr>)oldAttr;
+- (void)setAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName :(NSString *)value;
+- (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
+- (id<DOMAttr>)setAttributeNodeNS:(id<DOMAttr>)newAttr;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMText <DOMCharacterData>
+- (id <DOMText>)splitText:(unsigned long)offset error:(NSError **)error;
+// begin deprecated methods
+- (id<DOMText>)splitText:(unsigned long)offset;
+// end deprecated methods
+ at end
+
+
+ at protocol DOMComment <DOMCharacterData>
+ at end
+
+
+ at protocol DOMCDATASection <DOMText>
+ at end
+
+
+ at protocol DOMDocumentType <DOMNode>
+- (NSString *)name;
+- (id <DOMNamedNodeMap>)entities;
+- (id <DOMNamedNodeMap>)notations;
+- (NSString *)publicId;
+- (NSString *)systemId;
+- (NSString *)internalSubset;
+ at end
+
+
+ at protocol DOMNotation <DOMNode>
+- (NSString *)publicId;
+- (NSString *)systemId;
+ at end
+
+
+ at protocol DOMEntity <DOMNode>
+- (NSString *)publicId;
+- (NSString *)systemId;
+- (NSString *)notationName;
+ at end
+
+
+ at protocol DOMEntityReference <DOMNode>
+ at end
+
+
+ at protocol DOMProcessingInstruction <DOMNode>
+- (NSString *)target;
+- (NSString *)data;
+- (void)setData:(NSString *)data error:(NSError **)error;
+// begin deprecated methods
+- (void)setData:(NSString *)data;
+// end deprecated methods
+ at end
+
+
+enum DOMCompareHow
+{
+    START_TO_START = 0,
+    START_TO_END   = 1,
+    END_TO_END     = 2,
+    END_TO_START   = 3,
+};
+
+ at protocol DOMRange <NSObject>
+- (id <DOMNode>)startContainer:(NSError **)error;
+- (long)startOffset:(NSError **)error;
+- (id <DOMNode>)endContainer:(NSError **)error;
+- (long)endOffset:(NSError **)error;
+- (BOOL)collapsed:(NSError **)error;
+- (id <DOMNode>)commonAncestorContainer:(NSError **)error;
+- (void)setStart:(id <DOMNode>)refNode :(long)offset error:(NSError **)error;
+- (void)setEnd:(id <DOMNode>)refNode :(long)offset error:(NSError **)error;
+- (void)setStartBefore:(id <DOMNode>)refNode error:(NSError **)error;
+- (void)setStartAfter:(id <DOMNode>)refNode error:(NSError **)error;
+- (void)setEndBefore:(id <DOMNode>)refNode error:(NSError **)error;
+- (void)setEndAfter:(id <DOMNode>)refNode error:(NSError **)error;
+- (void)collapse:(BOOL)toStart error:(NSError **)error;
+- (void)selectNode:(id <DOMNode>)refNode error:(NSError **)error;
+- (void)selectNodeContents:(id <DOMNode>)refNode error:(NSError **)error;
+- (short)compareBoundaryPoints:(unsigned short)how :(id <DOMRange>)sourceRange error:(NSError **)error;
+- (void)deleteContents:(NSError **)error;
+- (id <DOMDocumentFragment>)extractContents:(NSError **)error;
+- (id <DOMDocumentFragment>)cloneContents:(NSError **)error;
+- (void)insertNode:(id <DOMNode>)newNode error:(NSError **)error;
+- (void)surroundContents:(id <DOMNode>)newParent error:(NSError **)error;
+- (id <DOMRange>)cloneRange:(NSError **)error;
+- (NSString *)toString:(NSError **)error;
+- (void)detach:(NSError **)error;
+ at end
+
diff --git a/WebKit/DOM.subproj/WebDOMDocument.h b/WebKit/DOM.subproj/WebDOMDocument.h
index 14f6ad4..066db12 100644
--- a/WebKit/DOM.subproj/WebDOMDocument.h
+++ b/WebKit/DOM.subproj/WebDOMDocument.h
@@ -3,97 +3,6 @@
     Copyright 2002, Apple, Inc. All rights reserved.
 */
 
-#import <Foundation/Foundation.h>
+#import <WebKit/DOM.h>
+#import <WebKit/DOM-compat.h>
 
-#import <WebKit/WebDOMNode.h>
-
- at protocol WebDOMAttr;
- at protocol WebDOMComment;
- at protocol WebDOMCDATASection;
- at protocol WebDOMDocument;
- at protocol WebDOMElement;
- at protocol WebDOMEntityReference;
- at protocol WebDOMNamedNodeMap;
- at protocol WebDOMNode;
- at protocol WebDOMNodeList;
- at protocol WebDOMProcessingInstruction;
- at protocol WebDOMText;
-
-
- at protocol WebDOMDocumentType <WebDOMNode>
-
-- (NSString *)name;
-
-- (id<WebDOMNamedNodeMap>)entities;
-
-- (id<WebDOMNamedNodeMap>)notations;
-
-- (NSString *)publicId;
-
-- (NSString *)systemId;
-
-- (NSString *)internalSubset;
-
- at end
-
-
- at protocol WebDOMDocumentFragment <WebDOMNode>
-
- at end
-
-
- at protocol WebDOMImplementation
-
-- (BOOL)hasFeature:(NSString *)feature :(NSString *)version;
-
-- (id<WebDOMDocumentType>)createDocumentType:(NSString *)qualifiedName
-                                      :(NSString *)publicId
-                                      :(NSString *)systemId
-                                      :(int *)exceptionCode;
-
-- (id<WebDOMDocument>)createDocument:(NSString *)namespaceURI
-                              :(NSString *)qualifiedName
-                              :(id<WebDOMDocumentType>)doctype;
-
- at end
-
-
- at protocol WebDOMDocument <WebDOMNode>
-
-- (id<WebDOMDocumentType>)doctype;
-
-- (id<WebDOMImplementation>)implementation;
-
-- (id<WebDOMElement>)documentElement;
-
-- (id<WebDOMElement>)createElement:(NSString *)tagName;
-
-- (id<WebDOMElement>)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName;
-
-- (id<WebDOMDocumentFragment>)createDocumentFragment;
-
-- (id<WebDOMText>)createTextNode:(NSString *)data;
-
-- (id<WebDOMComment>)createComment:(NSString *)data;
-
-- (id<WebDOMCDATASection>)createCDATASection:(NSString *)data;
-
-- (id<WebDOMProcessingInstruction>)createProcessingInstruction:(NSString *)target :(NSString *)data;
-
-- (id<WebDOMAttr>)createAttribute:(NSString *)name;
-
-/*
-- (id<WebDOMAttr>)createAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName;
-*/
-
-- (id<WebDOMEntityReference>)createEntityReference:(NSString *)name;
-
-- (id<WebDOMElement>)getElementById:(NSString *)elementId;
-
-- (id<WebDOMNodeList>)getElementsByTagName:(NSString *)tagname;
-
-- (id<WebDOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
-
-- (id<WebDOMNode>)importNode:(id<WebDOMNode>)importedNode :(BOOL)deep;
-
- at end
diff --git a/WebKit/DOM.subproj/WebDOMDocument.m b/WebKit/DOM.subproj/WebDOMDocument.m
deleted file mode 100644
index e0614f8..0000000
--- a/WebKit/DOM.subproj/WebDOMDocument.m
+++ /dev/null
@@ -1,6 +0,0 @@
-/*	
-    WebDOMDocument.m
-    Copyright 2002, Apple, Inc. All rights reserved.
-*/
-#import <WebKit/WebDOMDocument.h>
-
diff --git a/WebKit/DOM.subproj/WebDOMElement.h b/WebKit/DOM.subproj/WebDOMElement.h
index 998b479..68f08b7 100644
--- a/WebKit/DOM.subproj/WebDOMElement.h
+++ b/WebKit/DOM.subproj/WebDOMElement.h
@@ -3,113 +3,5 @@
     Copyright 2002, Apple, Inc. All rights reserved.
 */
 
-#import <Foundation/Foundation.h>
-
- at protocol WebDOMElement;
- at protocol WebDOMNode;
- at protocol WebDOMNodeList;
-
-
- at protocol WebDOMAttr <NSObject>
-
-- (NSString *)name;
-
-- (BOOL)specified;
-
-- (NSString *)value;
-
-- (void)setValue:(NSString *)value;
-
-- (id<WebDOMElement>)ownerElement;
-
- at end
-
-
- at protocol WebDOMCharacterData <NSObject>
-
-- (NSString *)data;
-
-- (void)setData: (NSString *)data;
-
-- (unsigned long)length;
-
-- (NSString *)substringData: (unsigned long)offset :(unsigned long)count;
-
-- (void)appendData:(NSString *)arg;
-
-- (void)insertData:(unsigned long)offset :(NSString *)arg;
-
-- (void)deleteData:(unsigned long)offset :(unsigned long) count;
-
-- (void)replaceData:(unsigned long)offset :(unsigned long)count :(NSString *)arg;
- at end
-
-
- at protocol WebDOMComment <WebDOMCharacterData>
-
- at end
-
-
- at protocol WebDOMText <WebDOMCharacterData>
-
-- (id<WebDOMText>)splitText: (unsigned long)offset;
-
- at end
-
-
- at protocol WebDOMCDATASection <WebDOMText>
-
- at end
-
-
- at protocol WebDOMProcessingInstruction <WebDOMNode>
-
-- (NSString *)target;
-
-- (NSString *)data;
-
-- (void)setData:(NSString *)data;
-
- at end
-
-
- at protocol WebDOMEntityReference <WebDOMNode>
-
- at end
-
-
- at protocol WebDOMElement <NSObject>
-
-- (NSString *)tagName;
-
-- (NSString *)getAttribute: (NSString *)name;
-
-- (void)setAttribute:(NSString *)name :(NSString *)value;
-
-- (void)removeAttribute:(NSString *)name;
-
-- (id<WebDOMAttr>)getAttributeNode:(NSString *)name;
-
-- (id<WebDOMAttr>)setAttributeNode:(id<WebDOMAttr>)newAttr;
-
-- (id<WebDOMAttr>)removeAttributeNode:(id<WebDOMAttr>)oldAttr;
-
-- (id<WebDOMNodeList>)getElementsByTagName:(NSString *)name;
-
-- (id<WebDOMNodeList>)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
-
-- (NSString *)getAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
-
-- (void)setAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName :(NSString *)value;
-
-- (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
-
-- (id<WebDOMAttr>)getAttributeNodeNS:(NSString *)namespaceURI :(NSString *)localName;
-
-- (id<WebDOMAttr>)setAttributeNodeNS:(id<WebDOMAttr>)newAttr;
-
-- (BOOL)hasAttribute: (NSString *)name;
-
-- (BOOL)hasAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
-
- at end
+#import <WebKit/DOM.h>
+#import <WebKit/DOM-compat.h>
diff --git a/WebKit/DOM.subproj/WebDOMElement.m b/WebKit/DOM.subproj/WebDOMElement.m
deleted file mode 100644
index 1dc43a4..0000000
--- a/WebKit/DOM.subproj/WebDOMElement.m
+++ /dev/null
@@ -1,7 +0,0 @@
-/*	
-    WebDOMElement.h
-    Copyright 2002, Apple, Inc. All rights reserved.
-*/
-#import <WebKit/WebDOMElement.h>
-
-
diff --git a/WebKit/DOM.subproj/WebDOMNode.h b/WebKit/DOM.subproj/WebDOMNode.h
index 2b975c7..fc1df69 100644
--- a/WebKit/DOM.subproj/WebDOMNode.h
+++ b/WebKit/DOM.subproj/WebDOMNode.h
@@ -3,109 +3,5 @@
     Copyright 2002, Apple, Inc. All rights reserved.
 */
 
-#import <Foundation/Foundation.h>
-
- at protocol WebDOMDocument;
- at protocol WebDOMNamedNodeMap;
- at protocol WebDOMNodeList;
-
-enum WebNodeType {
-    ELEMENT_NODE = 1,
-    ATTRIBUTE_NODE = 2,
-    TEXT_NODE = 3,
-    CDATA_SECTION_NODE = 4,
-    ENTITY_REFERENCE_NODE = 5,
-    ENTITY_NODE = 6,
-    PROCESSING_INSTRUCTION_NODE = 7,
-    COMMENT_NODE = 8,
-    DOCUMENT_NODE = 9,
-    DOCUMENT_TYPE_NODE = 10,
-    DOCUMENT_FRAGMENT_NODE = 11,
-    NOTATION_NODE = 12
-};
-
- at protocol WebDOMNode <NSObject>
-
-- (NSString *)nodeName;
-
-- (NSString *)nodeValue;
-
-- (void)setNodeValue:(NSString *)string; 
-
-- (unsigned short)nodeType;
-
-- (id<WebDOMNode>)parentNode;
-
-- (id<WebDOMNodeList>)childNodes;
-
-- (id<WebDOMNode>)firstChild;
-
-- (id<WebDOMNode>)lastChild;
-
-- (id<WebDOMNode>)previousSibling;
-
-- (id<WebDOMNode>)nextSibling;
-
-- (id<WebDOMNamedNodeMap>)attributes;
-
-- (id<WebDOMDocument>)ownerDocument;
-
-- (id<WebDOMNode>)insert:(id<WebDOMNode>)newChild before:(id<WebDOMNode>)refChild;
-
-- (id<WebDOMNode>)replace:(id<WebDOMNode>)newChild child:(id<WebDOMNode>)oldChild;
-
-- (id<WebDOMNode>)removeChild:(id<WebDOMNode>)oldChild;
-
-- (id<WebDOMNode>)appendChild:(id<WebDOMNode>)newChild;
-
-- (BOOL)hasChildNodes;
-
-- (id<WebDOMNode>)cloneNode:(BOOL)deep;
-
-- (void)normalize;
-
-- (BOOL)isSupported:(NSString *)feature :(NSString *)version;
-
-- (NSString *)namespaceURI;
-
-- (NSString *)prefix;
-
-- (void)setPrefix:(NSString *)prefix;
-
-- (NSString *)localName;
-
-- (BOOL)hasAttributes;
-
-- (NSString *)HTMLString;
-
- at end
-
-
- at protocol WebDOMNamedNodeMap <NSObject>
-
-- (unsigned long) length;
-
-- (id<WebDOMNode>)getNamedItem:(NSString *)name;
-
-- (id<WebDOMNode>)setNamedItem:(id<WebDOMNode>)arg;
-
-- (id<WebDOMNode>)removeNamedItem:(NSString *)name;
-
-- (id<WebDOMNode>)item:(unsigned long) index;
-
-- (id<WebDOMNode>)getNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
-
-- (id<WebDOMNode>)setNamedItemNS:(id<WebDOMNode>)arg;
-
-- (id<WebDOMNode>)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
-
- at end
-
-
- at protocol WebDOMNodeList <NSObject>
-
-- (unsigned long)length;
-
-- (id<WebDOMNode>)item:(unsigned long)index;
-
- at end
+#import <WebKit/DOM.h>
+#import <WebKit/DOM-compat.h>
diff --git a/WebKit/DOM.subproj/WebDOMNode.m b/WebKit/DOM.subproj/WebDOMNode.m
deleted file mode 100644
index 8eb735f..0000000
--- a/WebKit/DOM.subproj/WebDOMNode.m
+++ /dev/null
@@ -1,6 +0,0 @@
-/*	
-    WebDOMNode.m
-    Copyright 2002, Apple, Inc. All rights reserved.
-*/
-
-#import <WebKit/WebDOMNode.h>
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 7c30700..fe1cd21 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -551,7 +551,7 @@
     [[self dataSource] _setIconURL:URL withType:type];
 }
 
-- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload onLoadEvent:(BOOL)onLoad target:(NSString *)target triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values
+- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload onLoadEvent:(BOOL)onLoad target:(NSString *)target triggeringEvent:(NSEvent *)event form:(NSObject <DOMElement> *)form formValues:(NSDictionary *)values
 {
     if ([target length] == 0) {
 	target = nil;
@@ -573,7 +573,7 @@
     }
 }
 
-- (void)postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values
+- (void)postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(NSObject <DOMElement> *)form formValues:(NSDictionary *)values
 {
     if ([target length] == 0) {
 	target = nil;
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 505fa46..f8f0f1d 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -137,6 +137,7 @@
 		};
 		0867D69CFE84028FC02AAC07 = {
 			buildPhases = (
+				BE91866405EE61A10081354D,
 				84AF355005C724FA00C5ACD9,
 				0867D69DFE84028FC02AAC07,
 				0867D69EFE84028FC02AAC07,
@@ -330,6 +331,8 @@
 				EDD1A5C805C83987008E3150,
 				84311A1405EAAAF00088EDA4,
 				84311AF205EAB12B0088EDA4,
+				BE91866005EE618F0081354D,
+				BE91866105EE618F0081354D,
 			);
 			isa = PBXHeadersBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -351,9 +354,6 @@
 		0867D69FFE84028FC02AAC07 = {
 			buildActionMask = 2147483647;
 			files = (
-				F57D1954034E734901A80180,
-				F57D1956034E734901A80180,
-				F57D195A034E734901A80180,
 				394460A8020F50ED0ECA1767,
 				394460A9020F50ED0ECA1767,
 				F5E0A77102B8FEE401C1A525,
@@ -3010,6 +3010,55 @@
 			settings = {
 			};
 		};
+		BE91865E05EE618F0081354D = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.c.h;
+			name = DOM.h;
+			path = DOM.subproj/DOM.h;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		BE91865F05EE618F0081354D = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.c.h;
+			name = "DOM-compat.h";
+			path = "DOM.subproj/DOM-compat.h";
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		BE91866005EE618F0081354D = {
+			fileRef = BE91865E05EE618F0081354D;
+			isa = PBXBuildFile;
+			settings = {
+				ATTRIBUTES = (
+					Private,
+				);
+			};
+		};
+		BE91866105EE618F0081354D = {
+			fileRef = BE91865F05EE618F0081354D;
+			isa = PBXBuildFile;
+			settings = {
+				ATTRIBUTES = (
+					Private,
+				);
+			};
+		};
+		BE91866405EE61A10081354D = {
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+			);
+			isa = PBXShellScriptBuildPhase;
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "if [ -f ./copy-webcore-files-to-webkit ]; then ./copy-webcore-files-to-webkit; fi";
+		};
 		BECD14290565830A005BB09C = {
 			fileEncoding = 4;
 			isa = PBXFileReference;
@@ -3498,12 +3547,11 @@
 		};
 		F57D194A034E732C01A80180 = {
 			children = (
+				BE91865E05EE618F0081354D,
+				BE91865F05EE618F0081354D,
 				F57D194B034E734901A80180,
-				F57D194C034E734901A80180,
 				F57D194D034E734901A80180,
-				F57D194E034E734901A80180,
 				F57D1951034E734901A80180,
-				F57D1952034E734901A80180,
 			);
 			isa = PBXGroup;
 			name = DOM;
@@ -3519,15 +3567,6 @@
 			refType = 2;
 			sourceTree = SOURCE_ROOT;
 		};
-		F57D194C034E734901A80180 = {
-			fileEncoding = 4;
-			isa = PBXFileReference;
-			lastKnownFileType = sourcecode.c.objc;
-			name = WebDOMDocument.m;
-			path = DOM.subproj/WebDOMDocument.m;
-			refType = 2;
-			sourceTree = SOURCE_ROOT;
-		};
 		F57D194D034E734901A80180 = {
 			fileEncoding = 4;
 			isa = PBXFileReference;
@@ -3537,15 +3576,6 @@
 			refType = 2;
 			sourceTree = SOURCE_ROOT;
 		};
-		F57D194E034E734901A80180 = {
-			fileEncoding = 4;
-			isa = PBXFileReference;
-			lastKnownFileType = sourcecode.c.objc;
-			name = WebDOMElement.m;
-			path = DOM.subproj/WebDOMElement.m;
-			refType = 2;
-			sourceTree = SOURCE_ROOT;
-		};
 		F57D1951034E734901A80180 = {
 			fileEncoding = 4;
 			isa = PBXFileReference;
@@ -3555,33 +3585,6 @@
 			refType = 2;
 			sourceTree = SOURCE_ROOT;
 		};
-		F57D1952034E734901A80180 = {
-			fileEncoding = 4;
-			isa = PBXFileReference;
-			lastKnownFileType = sourcecode.c.objc;
-			name = WebDOMNode.m;
-			path = DOM.subproj/WebDOMNode.m;
-			refType = 2;
-			sourceTree = SOURCE_ROOT;
-		};
-		F57D1954034E734901A80180 = {
-			fileRef = F57D194C034E734901A80180;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
-		F57D1956034E734901A80180 = {
-			fileRef = F57D194E034E734901A80180;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
-		F57D195A034E734901A80180 = {
-			fileRef = F57D1952034E734901A80180;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
 		F57FB8C4034E180101A80180 = {
 			fileEncoding = 4;
 			isa = PBXFileReference;
diff --git a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
index a6c3537..be1e757 100644
--- a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
@@ -2,11 +2,11 @@
       WebDefaultContextMenuDelegate.m
       Copyright 2002, Apple, Inc. All rights reserved.
 */
+#import <WebKit/DOM.h>
 #import <WebKit/WebBridge.h>
 #import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebDefaultContextMenuDelegate.h>
 #import <WebKit/WebDefaultUIDelegate.h>
-#import <WebKit/WebDOMNode.h>
 #import <WebKit/WebFramePrivate.h>
 #import <WebKit/WebLocalizableStrings.h>
 #import <WebKit/WebNSPasteboardExtras.h>
diff --git a/WebKit/WebView.subproj/WebFormDelegate.h b/WebKit/WebView.subproj/WebFormDelegate.h
index b897dd1..2d052ea 100644
--- a/WebKit/WebView.subproj/WebFormDelegate.h
+++ b/WebKit/WebView.subproj/WebFormDelegate.h
@@ -8,7 +8,7 @@
 #import <AppKit/AppKit.h>
 
 @class WebFrame;
- at protocol WebDOMElement;
+ at protocol DOMElement;
 
 
 /*!
@@ -43,7 +43,7 @@
 
 // Sent when a form is just about to be submitted (before the load is started)
 // listener must be sent continue when the delegate is done.
-- (void)frame:(WebFrame *)frame sourceFrame:(WebFrame *)sourceFrame willSubmitForm:(id <WebDOMElement>)form withValues:(NSDictionary *)values submissionListener:(id <WebFormSubmissionListener>)listener;
+- (void)frame:(WebFrame *)frame sourceFrame:(WebFrame *)sourceFrame willSubmitForm:(id <DOMElement>)form withValues:(NSDictionary *)values submissionListener:(id <WebFormSubmissionListener>)listener;
 @end
 
 /*!
diff --git a/WebKit/WebView.subproj/WebFormDelegate.m b/WebKit/WebView.subproj/WebFormDelegate.m
index bd7d689..6690e45 100644
--- a/WebKit/WebView.subproj/WebFormDelegate.m
+++ b/WebKit/WebView.subproj/WebFormDelegate.m
@@ -57,7 +57,7 @@ static WebFormDelegate *sharedDelegate = nil;
     return NO;
 }
 
-- (void)frame:(WebFrame *)frame sourceFrame:(WebFrame *)sourceFrame willSubmitForm:(id <WebDOMElement>)form withValues:(NSDictionary *)values submissionListener:(id <WebFormSubmissionListener>)listener
+- (void)frame:(WebFrame *)frame sourceFrame:(WebFrame *)sourceFrame willSubmitForm:(id <DOMElement>)form withValues:(NSDictionary *)values submissionListener:(id <WebFormSubmissionListener>)listener
 {
     [listener continue];
 }
diff --git a/WebKit/WebView.subproj/WebFrame.h b/WebKit/WebView.subproj/WebFrame.h
index eb9fd9d..f5615f9 100644
--- a/WebKit/WebView.subproj/WebFrame.h
+++ b/WebKit/WebView.subproj/WebFrame.h
@@ -131,6 +131,4 @@
 */
 - (NSArray *)childFrames;
 
-- (NSUndoManager *)undoManager;
-
 @end
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 2aa67f8..c0cfd63 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -111,12 +111,12 @@ NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey";
 // layers while doing a load.
 @interface WebFormState : NSObject
 {
-    NSObject <WebDOMElement> *_form;
+    NSObject <DOMElement> *_form;
     NSDictionary *_values;
     WebFrame *_sourceFrame;
 }
-- (id)initWithForm:(NSObject <WebDOMElement> *)form values:(NSDictionary *)values sourceFrame:(WebFrame *)sourceFrame;
-- (id <WebDOMElement>)form;
+- (id)initWithForm:(NSObject <DOMElement> *)form values:(NSDictionary *)values sourceFrame:(WebFrame *)sourceFrame;
+- (id <DOMElement>)form;
 - (NSDictionary *)values;
 - (WebFrame *)sourceFrame;
 @end
@@ -1733,7 +1733,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
 
 // main funnel for navigating via callback from WebCore (e.g., clicking a link, redirect)
-- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType target:(NSString *)target triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values
+- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType target:(NSString *)target triggeringEvent:(NSEvent *)event form:(NSObject <DOMElement> *)form formValues:(NSDictionary *)values
 {
     BOOL isFormSubmission = (values != nil);
 
@@ -1870,7 +1870,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [childFrame _loadURL:URL referrer:[[self _bridge] referrer] loadType:childLoadType target:nil triggeringEvent:nil form:nil formValues:nil];
 }
 
-- (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values
+- (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(NSObject <DOMElement> *)form formValues:(NSDictionary *)values
 {
     // When posting, use the NSURLRequestReloadIgnoringCacheData load flag.
     // This prevents a potential bug which may cause a page with a form that uses itself
@@ -2388,11 +2388,19 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
 }
 
+- (NSUndoManager *)undoManager
+{
+    if (!_private->undoManager) {
+        _private->undoManager = [[NSUndoManager alloc] init];
+    }
+    return _private->undoManager;
+}
+
 @end
 
 @implementation WebFormState : NSObject
 
-- (id)initWithForm:(NSObject <WebDOMElement> *)form values:(NSDictionary *)values sourceFrame:(WebFrame *)sourceFrame
+- (id)initWithForm:(NSObject <DOMElement> *)form values:(NSDictionary *)values sourceFrame:(WebFrame *)sourceFrame
 {
     [super init];
     _form = [form retain];
@@ -2409,7 +2417,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [super dealloc];
 }
 
-- (id <WebDOMElement>)form
+- (id <DOMElement>)form
 {
     return _form;
 }
@@ -2609,12 +2617,4 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     return [[_private->children copy] autorelease];
 }
 
-- (NSUndoManager *)undoManager
-{
-    if (!_private->undoManager) {
-        _private->undoManager = [[NSUndoManager alloc] init];
-    }
-    return _private->undoManager;
-}
-
 @end
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index d57f10a..45028df 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -19,7 +19,7 @@
 @class WebPolicyDecisionListener;
 @class WebView;
 
- at protocol WebDOMElement;
+ at protocol DOMElement;
 
 typedef enum {
     WebFrameStateProvisional,
@@ -149,9 +149,9 @@ extern NSString *WebPageCacheDocumentViewKey;
 - (void)_invalidatePendingPolicyDecisionCallingDefaultAction:(BOOL)call;
 
 - (void)_goToItem:(WebHistoryItem *)item withLoadType:(WebFrameLoadType)type;
-- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType target:(NSString *)target triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values;
+- (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType target:(NSString *)target triggeringEvent:(NSEvent *)event form:(NSObject <DOMElement> *)form formValues:(NSDictionary *)values;
 - (void)_loadURL:(NSURL *)URL intoChild:(WebFrame *)childFrame;
-- (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(NSObject <WebDOMElement> *)form formValues:(NSDictionary *)values;
+- (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(NSObject <DOMElement> *)form formValues:(NSDictionary *)values;
 
 - (void)_loadRequest:(NSURLRequest *)request inFrameNamed:(NSString *)frameName;
 
@@ -206,4 +206,6 @@ extern NSString *WebPageCacheDocumentViewKey;
 
 - (void)_reloadForPluginChanges;
 
+- (NSUndoManager *)undoManager;
+
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLRepresentation.h b/WebKit/WebView.subproj/WebHTMLRepresentation.h
index 2cbd267..a98a330 100644
--- a/WebKit/WebView.subproj/WebHTMLRepresentation.h
+++ b/WebKit/WebView.subproj/WebHTMLRepresentation.h
@@ -10,9 +10,9 @@
 
 @protocol WebDocumentRepresentation;
 @protocol WebDocumentSourceRepresentation;
- at protocol WebDOMDocument;
- at protocol WebDOMNode;
- at protocol WebDOMElement;
+ at protocol DOMDocument;
+ at protocol DOMNode;
+ at protocol DOMElement;
 
 /*!
     @class WebHTMLRepresentation
@@ -26,7 +26,7 @@
     @method DOMDocument
     @abstract return the DOM document for this data source.
 */
-- (id<WebDOMDocument>)DOMDocument;
+- (id<DOMDocument>)DOMDocument;
 
 /*!
     @method setSelectionFrom:startOffset:to:endOffset
@@ -36,7 +36,7 @@
     @param end The node that includes the ending selection point.
     @param endOffset The character offset into the text of the ending node.
 */
-- (void)setSelectionFrom:(id<WebDOMNode>)start startOffset:(int)startOffset to:(id<WebDOMNode>)end endOffset:(int)endOffset;
+- (void)setSelectionFrom:(id<DOMNode>)start startOffset:(int)startOffset to:(id<DOMNode>)end endOffset:(int)endOffset;
 
 //- (NSAttributedString *)selectedAttributedString;
 
@@ -47,17 +47,17 @@
 - (NSString *)reconstructedDocumentSource;
 
 
-- (NSAttributedString *)attributedStringFrom:(id<WebDOMNode>)startNode startOffset:(int)startOffset to:(id<WebDOMNode>)endNode endOffset:(int)endOffset;
+- (NSAttributedString *)attributedStringFrom:(id<DOMNode>)startNode startOffset:(int)startOffset to:(id<DOMNode>)endNode endOffset:(int)endOffset;
 
-- (id <WebDOMElement>)elementWithName:(NSString *)name inForm:(id <WebDOMElement>)form;
-- (id <WebDOMElement>)elementForView:(NSView *)view;
-- (BOOL)elementDoesAutoComplete:(id <WebDOMElement>)element;
-- (BOOL)elementIsPassword:(id <WebDOMElement>)element;
-- (id <WebDOMElement>)formForElement:(id <WebDOMElement>)element;
-- (id <WebDOMElement>)currentForm;
-- (NSArray *)controlsInForm:(id <WebDOMElement>)form;
-- (NSString *)searchForLabels:(NSArray *)labels beforeElement:(id <WebDOMElement>)element;
-- (NSString *)matchLabels:(NSArray *)labels againstElement:(id <WebDOMElement>)element;
+- (id <DOMElement>)elementWithName:(NSString *)name inForm:(id <DOMElement>)form;
+- (id <DOMElement>)elementForView:(NSView *)view;
+- (BOOL)elementDoesAutoComplete:(id <DOMElement>)element;
+- (BOOL)elementIsPassword:(id <DOMElement>)element;
+- (id <DOMElement>)formForElement:(id <DOMElement>)element;
+- (id <DOMElement>)currentForm;
+- (NSArray *)controlsInForm:(id <DOMElement>)form;
+- (NSString *)searchForLabels:(NSArray *)labels beforeElement:(id <DOMElement>)element;
+- (NSString *)matchLabels:(NSArray *)labels againstElement:(id <DOMElement>)element;
 
 - (NSString *)HTMLString;
 
diff --git a/WebKit/WebView.subproj/WebHTMLRepresentation.m b/WebKit/WebView.subproj/WebHTMLRepresentation.m
index 7d35d10..e3a6bf5 100644
--- a/WebKit/WebView.subproj/WebHTMLRepresentation.m
+++ b/WebKit/WebView.subproj/WebHTMLRepresentation.m
@@ -5,12 +5,12 @@
 
 #import <WebKit/WebHTMLRepresentation.h>
 
+#import <WebKit/DOM.h>
 #import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebBridge.h>
 #import <WebKit/WebKitStatisticsPrivate.h>
 #import <WebKit/WebFramePrivate.h>
 #import <WebKit/WebDocument.h>
-#import <WebKit/WebDOMElement.h>
 #import <Foundation/NSURLResponse.h>
 
 @interface WebHTMLRepresentationPrivate : NSObject
@@ -91,12 +91,12 @@
     return [_private->dataSource _title];
 }
 
-- (id<WebDOMDocument>)DOMDocument
+- (id<DOMDocument>)DOMDocument
 {
     return [_private->bridge DOMDocument];
 }
 
-- (void)setSelectionFrom:(id<WebDOMNode>)start startOffset:(int)startOffset to:(id<WebDOMNode>)end endOffset:(int) endOffset
+- (void)setSelectionFrom:(id<DOMNode>)start startOffset:(int)startOffset to:(id<DOMNode>)end endOffset:(int) endOffset
 {
 }
 
@@ -112,52 +112,52 @@
     return nil;
 }
 
-- (NSAttributedString *)attributedStringFrom: (id<WebDOMNode>)startNode startOffset: (int)startOffset to: (id<WebDOMNode>)endNode endOffset: (int)endOffset
+- (NSAttributedString *)attributedStringFrom: (id<DOMNode>)startNode startOffset: (int)startOffset to: (id<DOMNode>)endNode endOffset: (int)endOffset
 {
     return [_private->bridge attributedStringFrom: startNode startOffset: startOffset to: endNode endOffset: endOffset];
 }
 
-- (id <WebDOMElement>)elementWithName:(NSString *)name inForm:(id <WebDOMElement>)form
+- (id <DOMElement>)elementWithName:(NSString *)name inForm:(id <DOMElement>)form
 {
     return [_private->bridge elementWithName:name inForm:form];
 }
 
-- (id <WebDOMElement>)elementForView:(NSView *)view
+- (id <DOMElement>)elementForView:(NSView *)view
 {
     return [_private->bridge elementForView:view];
 }
 
-- (BOOL)elementDoesAutoComplete:(id <WebDOMElement>)element
+- (BOOL)elementDoesAutoComplete:(id <DOMElement>)element
 {
     return [_private->bridge elementDoesAutoComplete:element];
 }
 
-- (BOOL)elementIsPassword:(id <WebDOMElement>)element
+- (BOOL)elementIsPassword:(id <DOMElement>)element
 {
     return [_private->bridge elementIsPassword:element];
 }
 
-- (id <WebDOMElement>)formForElement:(id <WebDOMElement>)element
+- (id <DOMElement>)formForElement:(id <DOMElement>)element
 {
     return [_private->bridge formForElement:element];
 }
 
-- (id <WebDOMElement>)currentForm;
+- (id <DOMElement>)currentForm;
 {
     return [_private->bridge currentForm];
 }
 
-- (NSArray *)controlsInForm:(id <WebDOMElement>)form
+- (NSArray *)controlsInForm:(id <DOMElement>)form
 {
     return [_private->bridge controlsInForm:form];
 }
 
-- (NSString *)searchForLabels:(NSArray *)labels beforeElement:(id <WebDOMElement>)element
+- (NSString *)searchForLabels:(NSArray *)labels beforeElement:(id <DOMElement>)element
 {
     return [_private->bridge searchForLabels:labels beforeElement:element];
 }
 
-- (NSString *)matchLabels:(NSArray *)labels againstElement:(id <WebDOMElement>)element
+- (NSString *)matchLabels:(NSArray *)labels againstElement:(id <DOMElement>)element
 {
     return [_private->bridge matchLabels:labels againstElement:element];
 }
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 6756cfa..2331bb1 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -5,11 +5,11 @@
 
 #import <WebKit/WebHTMLView.h>
 
+#import <WebKit/DOM.h>
 #import <WebKit/WebBridge.h>
 #import <WebKit/WebClipView.h>
 #import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebDocumentInternal.h>
-#import <WebKit/WebDOMDocument.h>
 #import <WebKit/WebException.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebFramePrivate.h>
diff --git a/WebKit/copy-webcore-files-to-webkit b/WebKit/copy-webcore-files-to-webkit
new file mode 100755
index 0000000..f16a1f8
--- /dev/null
+++ b/WebKit/copy-webcore-files-to-webkit
@@ -0,0 +1,89 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Cwd;
+use File::Basename;
+
+my $ProgramName = 'copy-webcore-files-to-webkit';
+
+my %Files = (
+    'kwq/DOM.h' =>           # WebCore path
+    'DOM.subproj/DOM.h',     # WebKit path
+    'kwq/DOM-compat.h' =>           # WebCore path
+    'DOM.subproj/DOM-compat.h',     # WebKit path
+);
+
+my $WebCorePath = '';
+my $WebKitPath = '';
+
+AssertInWebKit();
+AssertWebCoreFound();
+CopyFilesIfNeeded();
+
+#=======================================================================================
+# subroutines
+
+sub Fail {
+    my ($say) = @_;
+    Say("*** $ProgramName: $say");
+    exit(-1);
+}
+
+sub Say {
+    my ($say) = @_;
+    print STDERR $say, "\n";
+}
+
+sub AssertInWebKit {
+	if (cwd() =~ /WebKit$/) {
+		# ok...we're in WebCore
+		$WebKitPath = cwd();
+	}
+	else {
+		Fail("not being run from WebKit directory. exiting...");
+	}
+}
+
+sub AssertWebCoreFound {
+	my $path = cwd();
+	$path = dirname($path) . '/WebCore';
+	if (-d $path) {
+		# ok...WebCore is where we expect it
+		$WebCorePath = $path;
+	}
+	else {
+		Fail("WebCore is not a sibling directory to WebKit. exiting...");
+	}
+}
+
+sub CopyFilesIfNeeded {
+	# Only copy files if the dest file does not exist
+	# or the source file is different than the dest file
+	my $blab = 0;
+	
+	for my $file (keys(%Files)) {
+		my $source = "$WebCorePath/$file";
+		my $dest = "$WebKitPath/$Files{$file}";
+		if (! -f $source) {
+			Fail("$source is not a plain file");	
+		}
+		if (-e $dest && ! -f $dest) {
+			Fail("$dest is not a plain file");	
+		}
+		if (! -e $dest || system("cmp $source $dest > /dev/null 2>&1")) {
+			Say("$ProgramName: copying files...") if $blab == 0;
+			$blab = 1;
+			ExecuteCommand("cp -f $source $dest");
+		}
+	}
+}
+
+sub ExecuteCommand {
+    my ($cmd) = @_;
+    Say($cmd);
+    my $result = system($cmd);
+    if ($result != 0) {
+        Fail("error: $result");
+        exit($result);
+    }
+}

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list