2006-08-11 Anders Carlsson <acarlsson@apple.com>
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Aug 2006 16:32:34 +0000 (16:32 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Aug 2006 16:32:34 +0000 (16:32 +0000)
        Reviewed by Darin.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=10353
        XMLSerializer and DOMParser should have real implementations

        Make real implementation files for DOMParser and XMLSerializer and wrap them
        using our bindings generation.

        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMParser.cpp: Removed.
        * bindings/js/JSDOMParser.h: Removed.
        * bindings/js/JSXMLSerializer.cpp: Removed.
        * bindings/js/JSXMLSerializer.h: Removed.
        * bindings/js/kjs_window.cpp:
        (KJS::Window::getValueProperty):
        * bindings/js/kjs_window.h:
        (KJS::Window::):
        * page/DOMWindow.idl:
        * xml/DOMParser.cpp: Added.
        (WebCore::DOMParser::parseFromString):
        * xml/DOMParser.h: Added.
        * xml/DOMParser.idl: Added.
        * xml/XMLSerializer.cpp: Added.
        (WebCore::XMLSerializer::serializeToString):
        * xml/XMLSerializer.h: Added.
        * xml/XMLSerializer.idl: Added.

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

15 files changed:
WebCore/ChangeLog
WebCore/DerivedSources.make
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/JSDOMParser.cpp [deleted file]
WebCore/bindings/js/JSDOMParser.h [deleted file]
WebCore/bindings/js/JSXMLSerializer.cpp [deleted file]
WebCore/bindings/js/kjs_window.cpp
WebCore/bindings/js/kjs_window.h
WebCore/page/DOMWindow.idl
WebCore/xml/DOMParser.cpp [new file with mode: 0644]
WebCore/xml/DOMParser.h [new file with mode: 0644]
WebCore/xml/DOMParser.idl [new file with mode: 0644]
WebCore/xml/XMLSerializer.cpp [moved from WebCore/bindings/js/JSXMLSerializer.h with 51% similarity]
WebCore/xml/XMLSerializer.h [new file with mode: 0644]
WebCore/xml/XMLSerializer.idl [new file with mode: 0644]

index 2906c0874cedc4f62f84182a518738ad70304f9b..bab6b161c41b26c182129f6f38ef139260f2ed8f 100644 (file)
@@ -1,3 +1,33 @@
+2006-08-11  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Darin.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10353
+        XMLSerializer and DOMParser should have real implementations
+        
+        Make real implementation files for DOMParser and XMLSerializer and wrap them
+        using our bindings generation.
+        
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMParser.cpp: Removed.
+        * bindings/js/JSDOMParser.h: Removed.
+        * bindings/js/JSXMLSerializer.cpp: Removed.
+        * bindings/js/JSXMLSerializer.h: Removed.
+        * bindings/js/kjs_window.cpp:
+        (KJS::Window::getValueProperty):
+        * bindings/js/kjs_window.h:
+        (KJS::Window::):
+        * page/DOMWindow.idl:
+        * xml/DOMParser.cpp: Added.
+        (WebCore::DOMParser::parseFromString):
+        * xml/DOMParser.h: Added.
+        * xml/DOMParser.idl: Added.
+        * xml/XMLSerializer.cpp: Added.
+        (WebCore::XMLSerializer::serializeToString):
+        * xml/XMLSerializer.h: Added.
+        * xml/XMLSerializer.idl: Added.
+
 2006-08-14  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Brady.
@@ -20,6 +50,7 @@
         * bindings/js/kjs_events.cpp:
         (KJS::JSLazyEventListener::parseCode):
 
+>>>>>>> .r15854
 2006-08-12  Eric Seidel  <eric@eseidel.com>
 
         Reviewed by hyatt and mjs.
 
         * dom/DOMImplementation.cpp:
 
+>>>>>>> .r15841
 2006-08-12  Oliver  <ojh16@student.canterbury.ac.nz>
 
         Rubber stamped by tim
index 1150ffddee71902b330369ce365d157e526a9ac9..06a94f36ac445458ea89980075c8e98ff73f0af2 100644 (file)
@@ -58,7 +58,7 @@ all : \
     JSCounter.h \
     JSCSSStyleDeclaration.h \
     JSDOMImplementation.h \
-    JSDOMParser.lut.h \
+    JSDOMParser.h \
     JSDOMWindow.h \
     JSDocument.h \
     JSDocumentFragment.h \
@@ -141,7 +141,7 @@ all : \
     JSXPathResult.h \
     JSWheelEvent.h \
     JSXMLHttpRequest.lut.h \
-    JSXMLSerializer.lut.h \
+    JSXMLSerializer.h \
     JSXSLTProcessor.lut.h \
     SVGElementFactory.cpp \
     SVGNames.cpp \
index 17201c7a5d281c7ab42f98ab87c87a01ae56a798..1a15b04939616a41a88a5657a75b1e98481e9fb7 100644 (file)
                1AB7FC880A8B92EC00D9D37B /* XPathVariableReference.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC670A8B92EC00D9D37B /* XPathVariableReference.h */; };
                1AC694C70A3B1676003F5049 /* PluginDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC694C50A3B1676003F5049 /* PluginDocument.cpp */; };
                1AC694C80A3B1676003F5049 /* PluginDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC694C60A3B1676003F5049 /* PluginDocument.h */; };
+               1ACE53DF0A8D18810022947D /* JSDOMParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACE53DD0A8D18810022947D /* JSDOMParser.cpp */; };
+               1ACE53E00A8D18810022947D /* JSDOMParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACE53DE0A8D18810022947D /* JSDOMParser.h */; };
+               1ACE53E70A8D18E70022947D /* DOMParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACE53E10A8D18E70022947D /* DOMParser.cpp */; };
+               1ACE53E80A8D18E70022947D /* DOMParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACE53E20A8D18E70022947D /* DOMParser.h */; };
+               1ACE53EA0A8D18E70022947D /* XMLSerializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACE53E40A8D18E70022947D /* XMLSerializer.cpp */; };
+               1ACE53EB0A8D18E70022947D /* XMLSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACE53E50A8D18E70022947D /* XMLSerializer.h */; };
+               1ACE53F60A8D19470022947D /* JSXMLSerializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACE53F40A8D19470022947D /* JSXMLSerializer.cpp */; };
+               1ACE53F70A8D19470022947D /* JSXMLSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACE53F50A8D19470022947D /* JSXMLSerializer.h */; };
                1AE2AA1E0A1CDAB400B42B25 /* JSHTMLAreaElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE2AA0A0A1CDAB300B42B25 /* JSHTMLAreaElement.cpp */; };
                1AE2AA1F0A1CDAB400B42B25 /* JSHTMLAreaElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE2AA0B0A1CDAB300B42B25 /* JSHTMLAreaElement.h */; };
                1AE2AA200A1CDAB400B42B25 /* JSHTMLBaseFontElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE2AA0C0A1CDAB300B42B25 /* JSHTMLBaseFontElement.cpp */; };
                656580F409D12B20000E61D7 /* CSSPropertyNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 656580EF09D12B20000E61D7 /* CSSPropertyNames.h */; };
                6565815109D13043000E61D7 /* CSSValueKeywords.h in Headers */ = {isa = PBXBuildFile; fileRef = 6565814809D13043000E61D7 /* CSSValueKeywords.h */; };
                656581B209D14EE6000E61D7 /* UserAgentStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581AE09D14EE6000E61D7 /* UserAgentStyleSheets.h */; };
-               656581ED09D1508D000E61D7 /* JSDOMParser.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581D609D1508D000E61D7 /* JSDOMParser.lut.h */; };
                656581EE09D1508D000E61D7 /* JSXMLHttpRequest.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581D709D1508D000E61D7 /* JSXMLHttpRequest.lut.h */; };
-               656581EF09D1508D000E61D7 /* JSXMLSerializer.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581D809D1508D000E61D7 /* JSXMLSerializer.lut.h */; };
                656581F009D1508D000E61D7 /* JSXSLTProcessor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581D909D1508D000E61D7 /* JSXSLTProcessor.lut.h */; };
                656581F109D1508D000E61D7 /* kjs_css.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DA09D1508D000E61D7 /* kjs_css.lut.h */; };
                656581F209D1508D000E61D7 /* kjs_dom.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DB09D1508D000E61D7 /* kjs_dom.lut.h */; };
                93A1EAA80A563508006960A0 /* ImageDocumentMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 93A1EAA70A563508006960A0 /* ImageDocumentMac.h */; };
                93B0FD8A0A759BED0080AD44 /* StringImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93B0FD880A759BED0080AD44 /* StringImplMac.mm */; };
                93B0FD8B0A759BED0080AD44 /* StringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93B0FD890A759BED0080AD44 /* StringMac.mm */; };
-               93B70D5B09EB0C7C009D8468 /* JSDOMParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D3F09EB0C7C009D8468 /* JSDOMParser.cpp */; };
-               93B70D5C09EB0C7C009D8468 /* JSDOMParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D4009EB0C7C009D8468 /* JSDOMParser.h */; };
                93B70D5D09EB0C7C009D8468 /* JSXMLHttpRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4109EB0C7C009D8468 /* JSXMLHttpRequest.cpp */; };
                93B70D5E09EB0C7C009D8468 /* JSXMLHttpRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D4209EB0C7C009D8468 /* JSXMLHttpRequest.h */; };
-               93B70D5F09EB0C7C009D8468 /* JSXMLSerializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4309EB0C7C009D8468 /* JSXMLSerializer.cpp */; };
-               93B70D6009EB0C7C009D8468 /* JSXMLSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D4409EB0C7C009D8468 /* JSXMLSerializer.h */; };
                93B70D6109EB0C7C009D8468 /* JSXSLTProcessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4509EB0C7C009D8468 /* JSXSLTProcessor.cpp */; };
                93B70D6209EB0C7C009D8468 /* JSXSLTProcessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D4609EB0C7C009D8468 /* JSXSLTProcessor.h */; };
                93B70D6309EB0C7C009D8468 /* kjs_binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4709EB0C7C009D8468 /* kjs_binding.cpp */; };
                1AB7FC670A8B92EC00D9D37B /* XPathVariableReference.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = XPathVariableReference.h; sourceTree = "<group>"; };
                1AC694C50A3B1676003F5049 /* PluginDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PluginDocument.cpp; sourceTree = "<group>"; };
                1AC694C60A3B1676003F5049 /* PluginDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PluginDocument.h; sourceTree = "<group>"; };
+               1ACE53DD0A8D18810022947D /* JSDOMParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMParser.cpp; sourceTree = "<group>"; };
+               1ACE53DE0A8D18810022947D /* JSDOMParser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMParser.h; sourceTree = "<group>"; };
+               1ACE53E10A8D18E70022947D /* DOMParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DOMParser.cpp; sourceTree = "<group>"; };
+               1ACE53E20A8D18E70022947D /* DOMParser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMParser.h; sourceTree = "<group>"; };
+               1ACE53E30A8D18E70022947D /* DOMParser.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = DOMParser.idl; sourceTree = "<group>"; };
+               1ACE53E40A8D18E70022947D /* XMLSerializer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = XMLSerializer.cpp; sourceTree = "<group>"; };
+               1ACE53E50A8D18E70022947D /* XMLSerializer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = XMLSerializer.h; sourceTree = "<group>"; };
+               1ACE53E60A8D18E70022947D /* XMLSerializer.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = XMLSerializer.idl; sourceTree = "<group>"; };
+               1ACE53F40A8D19470022947D /* JSXMLSerializer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLSerializer.cpp; sourceTree = "<group>"; };
+               1ACE53F50A8D19470022947D /* JSXMLSerializer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLSerializer.h; sourceTree = "<group>"; };
                1AE2A9F00A1CDA5700B42B25 /* HTMLAreaElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLAreaElement.idl; sourceTree = "<group>"; };
                1AE2A9F10A1CDA5700B42B25 /* HTMLBaseFontElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLBaseFontElement.idl; sourceTree = "<group>"; };
                1AE2A9F20A1CDA5700B42B25 /* HTMLBodyElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLBodyElement.idl; sourceTree = "<group>"; };
                656581AD09D14EE6000E61D7 /* ColorData.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ColorData.c; sourceTree = "<group>"; };
                656581AE09D14EE6000E61D7 /* UserAgentStyleSheets.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UserAgentStyleSheets.h; sourceTree = "<group>"; };
                656581AF09D14EE6000E61D7 /* UserAgentStyleSheetsData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = UserAgentStyleSheetsData.cpp; sourceTree = "<group>"; };
-               656581D609D1508D000E61D7 /* JSDOMParser.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMParser.lut.h; sourceTree = "<group>"; };
                656581D709D1508D000E61D7 /* JSXMLHttpRequest.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLHttpRequest.lut.h; sourceTree = "<group>"; };
-               656581D809D1508D000E61D7 /* JSXMLSerializer.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLSerializer.lut.h; sourceTree = "<group>"; };
                656581D909D1508D000E61D7 /* JSXSLTProcessor.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXSLTProcessor.lut.h; sourceTree = "<group>"; };
                656581DA09D1508D000E61D7 /* kjs_css.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_css.lut.h; sourceTree = "<group>"; };
                656581DB09D1508D000E61D7 /* kjs_dom.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_dom.lut.h; sourceTree = "<group>"; };
                93B0FD890A759BED0080AD44 /* StringMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = StringMac.mm; sourceTree = "<group>"; };
                93B641F106E28C5C0055F610 /* FormDataMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FormDataMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93B641F206E28C5C0055F610 /* FormDataMac.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = FormDataMac.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               93B70D3F09EB0C7C009D8468 /* JSDOMParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMParser.cpp; sourceTree = "<group>"; };
-               93B70D4009EB0C7C009D8468 /* JSDOMParser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMParser.h; sourceTree = "<group>"; };
                93B70D4109EB0C7C009D8468 /* JSXMLHttpRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLHttpRequest.cpp; sourceTree = "<group>"; };
                93B70D4209EB0C7C009D8468 /* JSXMLHttpRequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLHttpRequest.h; sourceTree = "<group>"; };
-               93B70D4309EB0C7C009D8468 /* JSXMLSerializer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLSerializer.cpp; sourceTree = "<group>"; };
-               93B70D4409EB0C7C009D8468 /* JSXMLSerializer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLSerializer.h; sourceTree = "<group>"; };
                93B70D4509EB0C7C009D8468 /* JSXSLTProcessor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXSLTProcessor.cpp; sourceTree = "<group>"; };
                93B70D4609EB0C7C009D8468 /* JSXSLTProcessor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXSLTProcessor.h; sourceTree = "<group>"; };
                93B70D4709EB0C7C009D8468 /* kjs_binding.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = kjs_binding.cpp; sourceTree = "<group>"; };
                                65DF31E209D1CC60000BE325 /* JSDocumentType.h */,
                                65DF31E309D1CC60000BE325 /* JSDOMImplementation.cpp */,
                                65DF31E409D1CC60000BE325 /* JSDOMImplementation.h */,
-                               656581D609D1508D000E61D7 /* JSDOMParser.lut.h */,
+                               1ACE53DD0A8D18810022947D /* JSDOMParser.cpp */,
+                               1ACE53DE0A8D18810022947D /* JSDOMParser.h */,
                                1403BA0B09EB18C700797C7F /* JSDOMWindow.cpp */,
                                1403BA0E09EB18F800797C7F /* JSDOMWindow.h */,
                                65DF31E509D1CC60000BE325 /* JSElement.cpp */,
                                65DF31F109D1CC60000BE325 /* JSWheelEvent.cpp */,
                                65DF31F209D1CC60000BE325 /* JSWheelEvent.h */,
                                656581D709D1508D000E61D7 /* JSXMLHttpRequest.lut.h */,
-                               656581D809D1508D000E61D7 /* JSXMLSerializer.lut.h */,
+                               1ACE53F40A8D19470022947D /* JSXMLSerializer.cpp */,
+                               1ACE53F50A8D19470022947D /* JSXMLSerializer.h */,
                                1A762C6B0A074F2600989F5B /* JSXPathEvaluator.cpp */,
                                1A762C6C0A074F2600989F5B /* JSXPathEvaluator.h */,
                                1A762C6D0A074F2600989F5B /* JSXPathExpression.cpp */,
                                14DFB33F0A7DF7630018F769 /* Derived Sources */,
                                93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */,
                                1A9EF4560A1B957D00332B63 /* JSCanvasRenderingContext2DCustom.cpp */,
-                               93B70D3F09EB0C7C009D8468 /* JSDOMParser.cpp */,
-                               93B70D4009EB0C7C009D8468 /* JSDOMParser.h */,
                                938E65F609F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp */,
                                938E65F009F09840008A48EC /* JSHTMLElementWrapperFactory.h */,
                                A8D065AD0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp */,
                                448AD27A0A4813790023D179 /* JSHTMLOptionsCollectionCustom.cpp */,
                                93B70D4109EB0C7C009D8468 /* JSXMLHttpRequest.cpp */,
                                93B70D4209EB0C7C009D8468 /* JSXMLHttpRequest.h */,
-                               93B70D4309EB0C7C009D8468 /* JSXMLSerializer.cpp */,
-                               93B70D4409EB0C7C009D8468 /* JSXMLSerializer.h */,
                                93B70D4509EB0C7C009D8468 /* JSXSLTProcessor.cpp */,
                                93B70D4609EB0C7C009D8468 /* JSXSLTProcessor.h */,
                                93B70D4709EB0C7C009D8468 /* kjs_binding.cpp */,
                E1F0424309839389006694EA /* xml */ = {
                        isa = PBXGroup;
                        children = (
+                               1ACE53E10A8D18E70022947D /* DOMParser.cpp */,
+                               1ACE53E20A8D18E70022947D /* DOMParser.h */,
+                               1ACE53E30A8D18E70022947D /* DOMParser.idl */,
+                               1ACE53E40A8D18E70022947D /* XMLSerializer.cpp */,
+                               1ACE53E50A8D18E70022947D /* XMLSerializer.h */,
+                               1ACE53E60A8D18E70022947D /* XMLSerializer.idl */,
                                1AB7FC470A8B92EC00D9D37B /* XPathEvaluator.cpp */,
                                1AB7FC480A8B92EC00D9D37B /* XPathEvaluator.h */,
                                1AB7FC490A8B92EC00D9D37B /* XPathEvaluator.idl */,
                                656580F409D12B20000E61D7 /* CSSPropertyNames.h in Headers */,
                                6565815109D13043000E61D7 /* CSSValueKeywords.h in Headers */,
                                656581B209D14EE6000E61D7 /* UserAgentStyleSheets.h in Headers */,
-                               656581ED09D1508D000E61D7 /* JSDOMParser.lut.h in Headers */,
                                656581EE09D1508D000E61D7 /* JSXMLHttpRequest.lut.h in Headers */,
-                               656581EF09D1508D000E61D7 /* JSXMLSerializer.lut.h in Headers */,
                                656581F009D1508D000E61D7 /* JSXSLTProcessor.lut.h in Headers */,
                                656581F109D1508D000E61D7 /* kjs_css.lut.h in Headers */,
                                656581F209D1508D000E61D7 /* kjs_dom.lut.h in Headers */,
                                659DDC8309E198BA001BF3C6 /* JSDocument.h in Headers */,
                                930705DA09E0C9BF00B17FE4 /* JSCounter.h in Headers */,
                                930705EB09E0C9F600B17FE4 /* JSCSSPrimitiveValue.h in Headers */,
-                               93B70D5C09EB0C7C009D8468 /* JSDOMParser.h in Headers */,
                                93B70D5E09EB0C7C009D8468 /* JSXMLHttpRequest.h in Headers */,
-                               93B70D6009EB0C7C009D8468 /* JSXMLSerializer.h in Headers */,
                                93B70D6209EB0C7C009D8468 /* JSXSLTProcessor.h in Headers */,
                                93B70D6409EB0C7C009D8468 /* kjs_binding.h in Headers */,
                                93B70D6609EB0C7C009D8468 /* kjs_css.h in Headers */,
                                1AB7FC840A8B92EC00D9D37B /* XPathUtil.h in Headers */,
                                1AB7FC860A8B92EC00D9D37B /* XPathValue.h in Headers */,
                                1AB7FC880A8B92EC00D9D37B /* XPathVariableReference.h in Headers */,
+                               1ACE53E00A8D18810022947D /* JSDOMParser.h in Headers */,
+                               1ACE53E80A8D18E70022947D /* DOMParser.h in Headers */,
+                               1ACE53EB0A8D18E70022947D /* XMLSerializer.h in Headers */,
+                               1ACE53F70A8D19470022947D /* JSXMLSerializer.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                930705D809E0C9B700B17FE4 /* JSCounter.cpp in Sources */,
                                930705E909E0C9F000B17FE4 /* JSCSSPrimitiveValue.cpp in Sources */,
                                93EB355F09E37FD600F43799 /* MouseEventWithHitTestResults.cpp in Sources */,
-                               93B70D5B09EB0C7C009D8468 /* JSDOMParser.cpp in Sources */,
                                93B70D5D09EB0C7C009D8468 /* JSXMLHttpRequest.cpp in Sources */,
-                               93B70D5F09EB0C7C009D8468 /* JSXMLSerializer.cpp in Sources */,
                                93B70D6109EB0C7C009D8468 /* JSXSLTProcessor.cpp in Sources */,
                                93B70D6309EB0C7C009D8468 /* kjs_binding.cpp in Sources */,
                                93B70D6509EB0C7C009D8468 /* kjs_css.cpp in Sources */,
                                1AB7FC830A8B92EC00D9D37B /* XPathUtil.cpp in Sources */,
                                1AB7FC850A8B92EC00D9D37B /* XPathValue.cpp in Sources */,
                                1AB7FC870A8B92EC00D9D37B /* XPathVariableReference.cpp in Sources */,
+                               1ACE53DF0A8D18810022947D /* JSDOMParser.cpp in Sources */,
+                               1ACE53E70A8D18E70022947D /* DOMParser.cpp in Sources */,
+                               1ACE53EA0A8D18E70022947D /* XMLSerializer.cpp in Sources */,
+                               1ACE53F60A8D19470022947D /* JSXMLSerializer.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/WebCore/bindings/js/JSDOMParser.cpp b/WebCore/bindings/js/JSDOMParser.cpp
deleted file mode 100644 (file)
index d753345..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-// -*- c-basic-offset: 2 -*-
-/*
- *  This file is part of the KDE libraries
- *  Copyright (C) 2005 Anders Carlsson (andersca@mac.com)
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include "config.h"
-#include "JSDOMParser.h"
-#include "JSDOMParser.lut.h"
-
-#include "HTMLDocument.h"
-#include "DOMImplementation.h"
-
-using namespace WebCore;
-
-////////////////////// JSDOMParser Object ////////////////////////
-
-/* Source for DOMParserProtoTable.
-@begin DOMParserProtoTable 1
-  parseFromString JSDOMParser::ParseFromString DontDelete|Function 2
-@end
-*/
-namespace KJS {
-
-KJS_DEFINE_PROTOTYPE(DOMParserProto)
-KJS_IMPLEMENT_PROTOFUNC(DOMParserProtoFunc)
-KJS_IMPLEMENT_PROTOTYPE("DOMParser",DOMParserProto,DOMParserProtoFunc)
-
-DOMParserConstructorImp::DOMParserConstructorImp(ExecState *exec, Document *d)
-    : doc(d)
-{
-    setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
-    putDirect(prototypePropertyName, DOMParserProto::self(exec), None);
-}
-
-bool DOMParserConstructorImp::implementsConstruct() const
-{
-  return true;
-}
-
-JSObject *DOMParserConstructorImp::construct(ExecState *exec, const List &)
-{
-  return new JSDOMParser(exec, doc.get());
-}
-
-const ClassInfo JSDOMParser::info = { "DOMParser", 0, &DOMParserTable, 0 };
-
-/* Source for DOMParserTable
-@begin DOMParserTable 0
-@end
-*/
-
-JSDOMParser::JSDOMParser(ExecState *exec, Document *d)
-  : doc(d)
-{
-  setPrototype(DOMParserProto::self(exec));
-}
-
-
-JSValue *DOMParserProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
-{
-  if (!thisObj->inherits(&JSDOMParser::info))
-    return throwError(exec, TypeError);
-  
-  JSDOMParser *parser = static_cast<JSDOMParser *>(thisObj);
-
-  switch (id) {
-  case JSDOMParser::ParseFromString:
-    {
-        if (args.size() != 2)
-            return jsUndefined();
-
-      DeprecatedString str = args[0]->toString(exec);
-      DeprecatedString contentType = DeprecatedString(args[1]->toString(exec)).stripWhiteSpace();
-
-      if (DOMImplementation::isXMLMIMEType(contentType)) {
-        RefPtr<Document> doc = parser->doc->implementation()->createDocument();
-
-        doc->open();
-        doc->write(str);
-        doc->finishParsing();
-        doc->close();
-
-        return toJS(exec, doc.get());
-      }
-    }
-  }
-
-  return jsUndefined();
-}
-
-} // end namespace
-
-
diff --git a/WebCore/bindings/js/JSDOMParser.h b/WebCore/bindings/js/JSDOMParser.h
deleted file mode 100644 (file)
index def6e14..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// -*- c-basic-offset: 2 -*-
-/*
- *  This file is part of the KDE libraries
- *  Copyright (C) 2005 Anders Carlsson (andersca@mac.com)
- *  Copyright (C) 2006 Apple Computer, Inc.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef DOMPARSER_H
-#define DOMPARSER_H_
-
-#include "kjs_dom.h"
-
-namespace KJS {
-
-  class DOMParserConstructorImp : public DOMObject {
-  public:
-    DOMParserConstructorImp(ExecState*, WebCore::Document*);
-    virtual bool implementsConstruct() const;
-    virtual JSObject* construct(ExecState*, const List &args);
-  private:
-    RefPtr<WebCore::Document> doc;
-  };
-
-  class JSDOMParser : public DOMObject {
-  public:
-    JSDOMParser(ExecState*, WebCore::Document*);
-    virtual bool toBoolean(ExecState*) const { return true; }
-    virtual const ClassInfo* classInfo() const { return &info; }
-    static const ClassInfo info;
-    enum { ParseFromString };
-
-  private:
-    RefPtr<WebCore::Document> doc;
-    friend class DOMParserProtoFunc;
-  };
-
-} // namespace
-
-#endif
diff --git a/WebCore/bindings/js/JSXMLSerializer.cpp b/WebCore/bindings/js/JSXMLSerializer.cpp
deleted file mode 100644 (file)
index e56aaff..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-// -*- c-basic-offset: 2 -*-
-/*
- *  This file is part of the KDE libraries
- *  Copyright (C) 2003 Apple Computer, Inc.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include "config.h"
-#include "JSXMLSerializer.h"
-#include "JSXMLSerializer.lut.h"
-
-#include "DeprecatedString.h"
-#include "PlatformString.h"
-#include "kjs_dom.h"
-#include "markup.h"
-
-using namespace KJS;
-
-namespace WebCore {
-
-/* Source for JSXMLSerializerProtoTable.
-@begin JSXMLSerializerProtoTable 1
-  serializeToString WebCore::JSXMLSerializer::SerializeToString DontDelete|Function 1
-@end
-*/
-
-KJS_DEFINE_PROTOTYPE(JSXMLSerializerProto)
-KJS_IMPLEMENT_PROTOFUNC(JSXMLSerializerProtoFunc)
-KJS_IMPLEMENT_PROTOTYPE("XMLSerializer", JSXMLSerializerProto, JSXMLSerializerProtoFunc)
-
-JSXMLSerializerConstructorImp::JSXMLSerializerConstructorImp(ExecState* exec)
-{
-    setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
-    putDirect(prototypePropertyName, JSXMLSerializerProto::self(exec), None);
-}
-
-bool JSXMLSerializerConstructorImp::implementsConstruct() const
-{
-    return true;
-}
-
-JSObject* JSXMLSerializerConstructorImp::construct(ExecState* exec, const List&)
-{
-    return new JSXMLSerializer(exec);
-}
-
-const ClassInfo JSXMLSerializer::info = { "XMLSerializer", 0, &JSXMLSerializerTable, 0 };
-
-/* Source for JSXMLSerializerTable.
-@begin JSXMLSerializerTable 0
-@end
-*/
-
-JSXMLSerializer::JSXMLSerializer(ExecState* exec)
-{
-    setPrototype(JSXMLSerializerProto::self(exec));
-}
-
-JSValue* JSXMLSerializerProtoFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
-{
-    if (!thisObj->inherits(&JSXMLSerializer::info))
-        return throwError(exec, TypeError);
-
-    if (id == JSXMLSerializer::SerializeToString) {
-        if (args.size() != 1)
-            return jsUndefined();
-
-        if (!args[0]->toObject(exec)->inherits(&DOMNode::info))
-            return jsUndefined();
-
-        Node* node = static_cast<Node*>(static_cast<DOMNode*>(args[0]->toObject(exec))->impl());
-        return jsStringOrNull(createMarkup(node));
-    }
-
-    return jsUndefined();
-}
-
-} // end namespace
index 57f4cbc0649bc5cc72ec6cee775e48587e586853..70dcd09fa2ca9a08979282090e8d0056c14c82a9 100644 (file)
@@ -33,7 +33,6 @@
 #include "HTMLDocument.h"
 #include "JSCSSRule.h"
 #include "JSCSSValue.h"
-#include "JSDOMParser.h"
 #include "JSDOMWindow.h"
 #include "JSEvent.h"
 #include "JSHTMLOptionElementConstructor.h"
@@ -42,7 +41,6 @@
 #include "JSNodeFilter.h"
 #include "JSRange.h"
 #include "JSXMLHttpRequest.h"
-#include "JSXMLSerializer.h"
 #include "Settings.h"
 #include "Logging.h"
 #include "Page.h"
@@ -255,8 +253,6 @@ const ClassInfo Window::info = { "Window", 0, &WindowTable, 0 };
   Image         Window::Image           DontDelete
   Option        Window::Option          DontDelete
   XMLHttpRequest        Window::XMLHttpRequest  DontDelete
-  XMLSerializer Window::XMLSerializer   DontDelete
-  DOMParser     Window::DOMParser_      DontDelete
   XSLTProcessor Window::XSLTProcessor_  DontDelete
   alert         Window::Alert           DontDelete|Function 1
   confirm       Window::Confirm         DontDelete|Function 1
@@ -792,10 +788,6 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
       return new JSHTMLOptionElementConstructor(exec, m_frame->document());
     case XMLHttpRequest:
       return new JSXMLHttpRequestConstructorImp(exec, m_frame->document());
-    case XMLSerializer:
-      return new JSXMLSerializerConstructorImp(exec);
-    case DOMParser_:
-      return new DOMParserConstructorImp(exec, m_frame->document());
 #ifdef KHTML_XSLT
     case XSLTProcessor_:
       return new XSLTProcessorConstructorImp(exec);
index f816cbb3e0437fe034db2c7ba8f4e7532006dbc6..2fe204de53e114c57846d6eab3136cd6840ba7c7 100644 (file)
@@ -164,7 +164,7 @@ namespace KJS {
            Image, Option, Alert, Confirm, Prompt, Open, Print, SetTimeout, ClearTimeout,
            Focus, GetSelection, Blur, Close, SetInterval, ClearInterval, CaptureEvents, 
            ReleaseEvents, AddEventListener, RemoveEventListener,
-           XMLHttpRequest, XMLSerializer, DOMParser_, XSLTProcessor_,
+           XMLHttpRequest, XSLTProcessor_,
            Onabort, Onblur, Onchange, Onclick, Ondblclick, Ondragdrop, Onerror, 
            Onfocus, Onkeydown, Onkeypress, Onkeyup, Onload, Onmousedown, Onmousemove,
            Onmouseout, Onmouseover, Onmouseup, OnWindowMouseWheel, Onmove, Onreset, Onresize, Onscroll, Onsearch,
index 24a7daa90f1db5ccace02bfc1db7ce9a092cfe67..be8f681a41e380c5b0ab7eae3df2b71eadab3ea9 100644 (file)
@@ -48,6 +48,7 @@ module window {
         attribute CSSValueConstructor CSSValue;
         attribute DocumentConstructor Document;
         attribute DocumentFragmentConstructor DocumentFragment;
+        attribute DOMParserConstructor DOMParser;
         attribute ElementConstructor Element;
         attribute EventConstructor Event;
         attribute HTMLElementConstructor HTMLElement;
@@ -61,6 +62,8 @@ module window {
         // We just use Document for this.
         attribute DocumentConstructor XMLDocument;
         
+        attribute XMLSerializerConstructor XMLSerializer;
+        
 #ifdef XPATH_SUPPORT
         attribute XPathEvaluatorConstructor XPathEvaluator;
         attribute XPathResultConstructor XPathResult;
diff --git a/WebCore/xml/DOMParser.cpp b/WebCore/xml/DOMParser.cpp
new file mode 100644 (file)
index 0000000..33c57da
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (C) 2003, 2006 Apple Computer, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "config.h"
+#include "DOMParser.h"
+
+#include "DOMImplementation.h"
+#include "String.h"
+
+namespace WebCore {
+    
+PassRefPtr<Document> DOMParser::parseFromString(const String& str, const String& contentType)
+{
+    if (!DOMImplementation::isXMLMIMEType(contentType))
+        return 0;
+    
+    RefPtr<Document> doc = DOMImplementation::instance()->createDocument();
+        
+    doc->open();
+    doc->write(str);
+    doc->finishParsing();
+    doc->close();
+        
+    return doc.release();
+}
+
+}
diff --git a/WebCore/xml/DOMParser.h b/WebCore/xml/DOMParser.h
new file mode 100644 (file)
index 0000000..1740047
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (C) 2003, 2006 Apple Computer, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef DOMParser_H
+#define DOMParser_H
+
+#include "Shared.h"
+#include "Document.h"
+
+namespace WebCore {
+    class String;
+    
+    class DOMParser : public Shared<DOMParser> {
+    public:
+        PassRefPtr<Document> parseFromString(const String& str, const String& contentType);
+    };
+}
+
+#endif // XMLSerializer.h
diff --git a/WebCore/xml/DOMParser.idl b/WebCore/xml/DOMParser.idl
new file mode 100644 (file)
index 0000000..4a80454
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module xpath {
+    interface [GenerateConstructor, CanBeConstructed] DOMParser {
+        Document parseFromString(in DOMString str, in DOMString contentType);
+    };
+}
similarity index 51%
rename from WebCore/bindings/js/JSXMLSerializer.h
rename to WebCore/xml/XMLSerializer.cpp
index 8c3f0805368a2ca456e8955f91bb2b6deda85855..26970de0e3bf1382fdfdc2bcdad517eb97f6d88a 100644 (file)
@@ -1,7 +1,6 @@
-// -*- c-basic-offset: 2 -*-
 /*
  *  This file is part of the KDE libraries
- *  Copyright (C) 2003 Apple Computer, Inc.
+ *  Copyright (C) 2003, 2006 Apple Computer, Inc.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#ifndef JSXMLSerializer_H
-#define JSXMLSerializer_H
+#include "config.h"
+#include "XMLSerializer.h"
 
-#include "kjs_binding.h"
-
-namespace KJS {
-    class JSEventListener;
-}
+#include "Document.h"
+#include "DeprecatedString.h"
+#include "markup.h"
 
 namespace WebCore {
 
-  class JSXMLSerializerConstructorImp : public KJS::DOMObject {
-  public:
-    JSXMLSerializerConstructorImp(KJS::ExecState*);
-    virtual bool implementsConstruct() const;
-    virtual KJS::JSObject* construct(KJS::ExecState*, const KJS::List& args);
-  };
-
-  class JSXMLSerializer : public KJS::DOMObject {
-  public:
-    JSXMLSerializer(KJS::ExecState*);
-    virtual bool toBoolean(KJS::ExecState*) const { return true; }
-    virtual const KJS::ClassInfo* classInfo() const { return &info; }
-    static const KJS::ClassInfo info;
-    enum { SerializeToString };
-  };
-
-} // namespace
+String XMLSerializer::serializeToString(Node* node)
+{
+    if (!node)
+        return String();
+    
+    return createMarkup(node);
+}
 
-#endif
+}
diff --git a/WebCore/xml/XMLSerializer.h b/WebCore/xml/XMLSerializer.h
new file mode 100644 (file)
index 0000000..7771fa6
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (C) 2003, 2006 Apple Computer, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef XMLSerializer_H
+#define XMLSerializer_H
+
+#include "Shared.h"
+#include "PlatformString.h"
+
+namespace WebCore {
+    class Node;
+    
+    class XMLSerializer : public Shared<XMLSerializer> {
+    public:
+        String serializeToString(Node*);
+    };
+}
+
+#endif // XMLSerializer.h
diff --git a/WebCore/xml/XMLSerializer.idl b/WebCore/xml/XMLSerializer.idl
new file mode 100644 (file)
index 0000000..8bed5ff
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module xpath {
+    interface [GenerateConstructor, CanBeConstructed] XMLSerializer {
+        DOMString serializeToString(in Node node);
+    };
+}