2006-05-15 Eric Seidel <eseidel@apple.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 May 2006 23:53:33 +0000 (23:53 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 May 2006 23:53:33 +0000 (23:53 +0000)
        Reviewed by ggaren.

        Split dom_xmlimpl.* into separate files (one per class).

        * WebCore.xcodeproj/project.pbxproj:
        * dom/Entity.cpp: Added.
        (WebCore::Entity::Entity):
        * dom/Entity.h: Added.
        * dom/EntityReference.cpp: Added.
        (WebCore::EntityReference::EntityReference):
        * dom/EntityReference.h: Added.
        * dom/Notation.cpp: Added.
        (WebCore::Notation::Notation):
        * dom/Notation.h: Added.
        * dom/ProcessingInstruction.cpp: Added.
        (WebCore::ProcessingInstruction::ProcessingInstruction):
        * dom/ProcessingInstruction.h: Added.
        * dom/dom_xmlimpl.cpp: Removed.
        * dom/dom_xmlimpl.h: Removed.

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

19 files changed:
WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/kjs_dom.cpp
WebCore/bindings/objc/DOM.mm
WebCore/bindings/objc/DOMCSS.mm
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/dom/Document.cpp
WebCore/dom/Entity.cpp [new file with mode: 0644]
WebCore/dom/Entity.h [new file with mode: 0644]
WebCore/dom/EntityReference.cpp [new file with mode: 0644]
WebCore/dom/EntityReference.h [new file with mode: 0644]
WebCore/dom/Notation.cpp [new file with mode: 0644]
WebCore/dom/Notation.h [new file with mode: 0644]
WebCore/dom/ProcessingInstruction.cpp [moved from WebCore/dom/dom_xmlimpl.cpp with 58% similarity]
WebCore/dom/ProcessingInstruction.h [moved from WebCore/dom/dom_xmlimpl.h with 53% similarity]
WebCore/dom/Range.cpp
WebCore/dom/xml_tokenizer.cpp
WebCore/editing/markup.cpp

index e5d10f2630b597e63f6ce28c41c3d0c3a762b611..f7b32b8d1767fcc6b90478025a1a2f8ac53516fd 100644 (file)
@@ -1,3 +1,25 @@
+2006-05-15  Eric Seidel  <eseidel@apple.com>
+
+        Reviewed by ggaren.
+
+        Split dom_xmlimpl.* into separate files (one per class).
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/Entity.cpp: Added.
+        (WebCore::Entity::Entity):
+        * dom/Entity.h: Added.
+        * dom/EntityReference.cpp: Added.
+        (WebCore::EntityReference::EntityReference):
+        * dom/EntityReference.h: Added.
+        * dom/Notation.cpp: Added.
+        (WebCore::Notation::Notation):
+        * dom/Notation.h: Added.
+        * dom/ProcessingInstruction.cpp: Added.
+        (WebCore::ProcessingInstruction::ProcessingInstruction):
+        * dom/ProcessingInstruction.h: Added.
+        * dom/dom_xmlimpl.cpp: Removed.
+        * dom/dom_xmlimpl.h: Removed.
+
 2006-05-15  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by Tim Hatcher.
index ba5a4730aa7b6ae3737716b22fdb80351784af97..03dda9615e53b606689bc2b6eb0e44da5349f179 100644 (file)
                        <File\r
                                RelativePath="..\..\dom\dom2_traversalimpl.h"\r
                                >\r
+                       </File> \r
+                       <File\r
+                               RelativePath="..\..\dom\EntityReference.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\dom\EntityReference.h"\r
+                               >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\dom\dom_xmlimpl.cpp"\r
+                               RelativePath="..\..\dom\Entity.cpp"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\dom\dom_xmlimpl.h"\r
+                               RelativePath="..\..\dom\Entity.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\dom\Notation.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\dom\Notation.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\dom\ProcessingInstruction.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\dom\ProcessingInstruction.h"\r
                                >\r
                        </File>\r
                        <File\r
                                RelativePath="..\..\html\HTMLDivElement.h"\r
                                >\r
                        </File>\r
-\r
                        <File\r
                                RelativePath="..\..\html\HTMLMapElement.cpp"\r
                                >\r
index 973783176a5c9a9bfd9392c0d8d5aed0dcf72eef..372e1ae4f6fb4059826ecf15711491ffce2b791d 100644 (file)
                93F1991708245E59001E9ABC /* dom2_eventsimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30202DE4476018635CA /* dom2_eventsimpl.h */; };
                93F1991808245E59001E9ABC /* Range.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30402DE4476018635CA /* Range.h */; };
                93F1991908245E59001E9ABC /* dom2_traversalimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30602DE4476018635CA /* dom2_traversalimpl.h */; };
-               93F1992008245E59001E9ABC /* dom_xmlimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30002DE4476018635CA /* dom_xmlimpl.h */; };
                93F1992108245E59001E9ABC /* xml_tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30A02DE4476018635CA /* xml_tokenizer.h */; };
                93F1992908245E59001E9ABC /* KWQCString.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868302DE3B8601EA4122 /* KWQCString.h */; };
                93F1992E08245E59001E9ABC /* KWQComboBox.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868202DE3B8601EA4122 /* KWQComboBox.h */; };
                93F19A9B08245E59001E9ABC /* HTMLParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D25002DE4396018635CA /* HTMLParser.cpp */; };
                93F19A9C08245E59001E9ABC /* HTMLTokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D25202DE4396018635CA /* HTMLTokenizer.cpp */; };
                93F19A9D08245E59001E9ABC /* Decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D27802DE43D7018635CA /* Decoder.cpp */; };
-               93F19AB708245E59001E9ABC /* dom_xmlimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D2FF02DE4476018635CA /* dom_xmlimpl.cpp */; };
                93F19AB808245E59001E9ABC /* dom2_eventsimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30102DE4476018635CA /* dom2_eventsimpl.cpp */; };
                93F19AB908245E59001E9ABC /* Range.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30302DE4476018635CA /* Range.cpp */; };
                93F19ABA08245E59001E9ABC /* dom2_traversalimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30502DE4476018635CA /* dom2_traversalimpl.cpp */; };
                A8EA7D300A19385500A8EF5F /* HTMLImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7D280A19385500A8EF5F /* HTMLImageLoader.cpp */; };
                A8EA7D310A19385500A8EF5F /* HTMLImageElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7D290A19385500A8EF5F /* HTMLImageElement.cpp */; };
                A8EA7D320A19385500A8EF5F /* HTMLMapElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7D2A0A19385500A8EF5F /* HTMLMapElement.cpp */; };
+               A8EA7EBC0A1945D000A8EF5F /* ProcessingInstruction.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7EB40A1945D000A8EF5F /* ProcessingInstruction.h */; };
+               A8EA7EBD0A1945D000A8EF5F /* ProcessingInstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7EB50A1945D000A8EF5F /* ProcessingInstruction.cpp */; };
+               A8EA7EBE0A1945D000A8EF5F /* Notation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7EB60A1945D000A8EF5F /* Notation.h */; };
+               A8EA7EBF0A1945D000A8EF5F /* Notation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7EB70A1945D000A8EF5F /* Notation.cpp */; };
+               A8EA7EC00A1945D000A8EF5F /* EntityReference.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7EB80A1945D000A8EF5F /* EntityReference.h */; };
+               A8EA7EC10A1945D000A8EF5F /* EntityReference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7EB90A1945D000A8EF5F /* EntityReference.cpp */; };
+               A8EA7EC20A1945D000A8EF5F /* Entity.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7EBA0A1945D000A8EF5F /* Entity.h */; };
+               A8EA7EC30A1945D000A8EF5F /* Entity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7EBB0A1945D000A8EF5F /* Entity.cpp */; };
                A8FD8B86087CB44C00DC3707 /* KWQWMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A85D7A8C0879EC64006A9172 /* KWQWMatrix.cpp */; };
                A8FD8B87087CB45700DC3707 /* KWQWMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = A85D7A8D0879EC64006A9172 /* KWQWMatrix.h */; };
                A8FEFB0A0979F472005839FD /* RenderForeignObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FEFB080979F472005839FD /* RenderForeignObject.h */; };
                A8EA7D280A19385500A8EF5F /* HTMLImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLImageLoader.cpp; sourceTree = "<group>"; };
                A8EA7D290A19385500A8EF5F /* HTMLImageElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLImageElement.cpp; sourceTree = "<group>"; };
                A8EA7D2A0A19385500A8EF5F /* HTMLMapElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLMapElement.cpp; sourceTree = "<group>"; };
+               A8EA7EB40A1945D000A8EF5F /* ProcessingInstruction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProcessingInstruction.h; sourceTree = "<group>"; };
+               A8EA7EB50A1945D000A8EF5F /* ProcessingInstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessingInstruction.cpp; sourceTree = "<group>"; };
+               A8EA7EB60A1945D000A8EF5F /* Notation.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Notation.h; sourceTree = "<group>"; };
+               A8EA7EB70A1945D000A8EF5F /* Notation.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Notation.cpp; sourceTree = "<group>"; };
+               A8EA7EB80A1945D000A8EF5F /* EntityReference.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EntityReference.h; sourceTree = "<group>"; };
+               A8EA7EB90A1945D000A8EF5F /* EntityReference.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = EntityReference.cpp; sourceTree = "<group>"; };
+               A8EA7EBA0A1945D000A8EF5F /* Entity.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Entity.h; sourceTree = "<group>"; };
+               A8EA7EBB0A1945D000A8EF5F /* Entity.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Entity.cpp; sourceTree = "<group>"; };
                A8FEFB080979F472005839FD /* RenderForeignObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderForeignObject.h; sourceTree = "<group>"; };
                A8FEFB090979F472005839FD /* RenderForeignObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderForeignObject.cpp; sourceTree = "<group>"; };
                A8FEFB2F0979F4F6005839FD /* SVGForeignObjectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGForeignObjectElement.cpp; sourceTree = "<group>"; };
                F523D25302DE4396018635CA /* HTMLTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTokenizer.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D27802DE43D7018635CA /* Decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Decoder.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D27902DE43D7018635CA /* Decoder.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Decoder.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F523D2FF02DE4476018635CA /* dom_xmlimpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dom_xmlimpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F523D30002DE4476018635CA /* dom_xmlimpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = dom_xmlimpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D30102DE4476018635CA /* dom2_eventsimpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dom2_eventsimpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D30202DE4476018635CA /* dom2_eventsimpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = dom2_eventsimpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D30302DE4476018635CA /* Range.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Range.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                6548E24809E1E04D00AF8020 /* Document.idl */,
                                A8185F3709765765005826D9 /* DocumentFragment.cpp */,
                                A8185F3509765765005826D9 /* DocumentFragment.h */,
+                               1A494ED50A123F1A00FDAFC1 /* DocumentFragment.idl */,
                                ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */,
                                A8185F3209765765005826D9 /* DocumentType.cpp */,
                                A8185F3109765765005826D9 /* DocumentType.h */,
                                F523D30202DE4476018635CA /* dom2_eventsimpl.h */,
                                F523D30502DE4476018635CA /* dom2_traversalimpl.cpp */,
                                F523D30602DE4476018635CA /* dom2_traversalimpl.h */,
-                               F523D2FF02DE4476018635CA /* dom_xmlimpl.cpp */,
-                               F523D30002DE4476018635CA /* dom_xmlimpl.h */,
                                A8185F3609765765005826D9 /* DOMImplementation.cpp */,
                                A8185F3309765765005826D9 /* DOMImplementation.h */,
                                93EEC1E909C2877700C515D1 /* DOMImplementation.idl */,
                                A8C4A7F609D563270003AC8D /* Element.cpp */,
                                A8C4A7F509D563270003AC8D /* Element.h */,
                                93EEC1EA09C2877700C515D1 /* Element.idl */,
+                               A8EA7EBB0A1945D000A8EF5F /* Entity.cpp */,
+                               A8EA7EBA0A1945D000A8EF5F /* Entity.h */,
                                93EEC1EB09C2877700C515D1 /* Entity.idl */,
+                               A8EA7EB90A1945D000A8EF5F /* EntityReference.cpp */,
+                               A8EA7EB80A1945D000A8EF5F /* EntityReference.h */,
+                               14E836D209F8512000B85AE4 /* Event.idl */,
                                935FBC4409BA00B900E230B1 /* EventListener.h */,
                                939885C108B7E3D100E707C4 /* EventNames.cpp */,
                                939885C208B7E3D100E707C4 /* EventNames.h */,
                                A81872130977D3C0005826D9 /* NameNodeList.h */,
                                A8C4A7EE09D563270003AC8D /* Node.cpp */,
                                14115B5109F84B7100CA4FC1 /* Node.h */,
+                               14DC0D0B09FECFA4007B0235 /* Node.idl */,
                                14115AF909F847D600CA4FC1 /* NodeFilter.idl */,
                                A81872160977D3C0005826D9 /* NodeList.cpp */,
                                A81872100977D3C0005826D9 /* NodeList.h */,
+                               A8EA7EB70A1945D000A8EF5F /* Notation.cpp */,
+                               A8EA7EB60A1945D000A8EF5F /* Notation.h */,
                                93EEC1F409C2877700C515D1 /* Notation.idl */,
                                BE91FC8C06133666005E3790 /* Position.cpp */,
                                BE91FC8B06133666005E3790 /* Position.h */,
+                               A8EA7EB50A1945D000A8EF5F /* ProcessingInstruction.cpp */,
+                               A8EA7EB40A1945D000A8EF5F /* ProcessingInstruction.h */,
                                93EEC1F509C2877700C515D1 /* ProcessingInstruction.idl */,
                                550A0BC7085F6039007353D6 /* QualifiedName.cpp */,
                                550A0BC8085F6039007353D6 /* QualifiedName.h */,
                                93EEC1F709C2877700C515D1 /* WheelEvent.idl */,
                                F523D30902DE4476018635CA /* xml_tokenizer.cpp */,
                                F523D30A02DE4476018635CA /* xml_tokenizer.h */,
-                               14E836D209F8512000B85AE4 /* Event.idl */,
-                               14DC0D0B09FECFA4007B0235 /* Node.idl */,
-                               1A494ED50A123F1A00FDAFC1 /* DocumentFragment.idl */,
                        );
                        path = dom;
                        sourceTree = "<group>";
                                93F1991708245E59001E9ABC /* dom2_eventsimpl.h in Headers */,
                                93F1991808245E59001E9ABC /* Range.h in Headers */,
                                93F1991908245E59001E9ABC /* dom2_traversalimpl.h in Headers */,
-                               93F1992008245E59001E9ABC /* dom_xmlimpl.h in Headers */,
                                93F1992108245E59001E9ABC /* xml_tokenizer.h in Headers */,
                                93F1992908245E59001E9ABC /* KWQCString.h in Headers */,
                                93F1992E08245E59001E9ABC /* KWQComboBox.h in Headers */,
                                A8EA7D2C0A19385500A8EF5F /* HTMLMapElement.h in Headers */,
                                A8EA7D2D0A19385500A8EF5F /* HTMLImageElement.h in Headers */,
                                A8EA7D2E0A19385500A8EF5F /* HTMLAreaElement.h in Headers */,
+                               A8EA7EBC0A1945D000A8EF5F /* ProcessingInstruction.h in Headers */,
+                               A8EA7EBE0A1945D000A8EF5F /* Notation.h in Headers */,
+                               A8EA7EC00A1945D000A8EF5F /* EntityReference.h in Headers */,
+                               A8EA7EC20A1945D000A8EF5F /* Entity.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                93F19A9B08245E59001E9ABC /* HTMLParser.cpp in Sources */,
                                93F19A9C08245E59001E9ABC /* HTMLTokenizer.cpp in Sources */,
                                93F19A9D08245E59001E9ABC /* Decoder.cpp in Sources */,
-                               93F19AB708245E59001E9ABC /* dom_xmlimpl.cpp in Sources */,
                                93F19AB808245E59001E9ABC /* dom2_eventsimpl.cpp in Sources */,
                                93F19AB908245E59001E9ABC /* Range.cpp in Sources */,
                                93F19ABA08245E59001E9ABC /* dom2_traversalimpl.cpp in Sources */,
                                A8EA7D300A19385500A8EF5F /* HTMLImageLoader.cpp in Sources */,
                                A8EA7D310A19385500A8EF5F /* HTMLImageElement.cpp in Sources */,
                                A8EA7D320A19385500A8EF5F /* HTMLMapElement.cpp in Sources */,
+                               A8EA7EBD0A1945D000A8EF5F /* ProcessingInstruction.cpp in Sources */,
+                               A8EA7EBF0A1945D000A8EF5F /* Notation.cpp in Sources */,
+                               A8EA7EC10A1945D000A8EF5F /* EntityReference.cpp in Sources */,
+                               A8EA7EC30A1945D000A8EF5F /* Entity.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 940e044bbf9b966932bbcd869a68821374f9e9c9..aa4c277b38df7028ff2a5404b79a97466e891a06 100644 (file)
 #include "DocumentFragment.h"
 #include "DocumentType.h"
 #include "Element.h"
-#include "ExceptionCode.h"
+#include "Entity.h"
 #include "EventNames.h"
+#include "ExceptionCode.h"
 #include "Frame.h"
+#include "HTMLDocument.h"
+#include "HTMLNames.h"
 #include "HTMLPlugInElement.h"
 #include "JSAttr.h"
-#include "JSElement.h"
 #include "JSCharacterData.h"
 #include "JSDOMImplementation.h"
 #include "JSDocumentFragment.h"
 #include "JSDocumentType.h"
+#include "JSElement.h"
 #include "JSEntity.h"
 #include "JSHTMLDocument.h"
+#include "JSHTMLElementWrapperFactory.h"
 #include "JSNode.h"
 #include "JSNotation.h"
 #include "JSProcessingInstruction.h"
 #include "JSRange.h"
 #include "JSText.h"
+#include "KWQKHTMLSettings.h"
 #include "NamedNodeMap.h"
+#include "Notation.h"
+#include "ProcessingInstruction.h"
+#include "Range.h"
+#include "RenderCanvas.h"
 #include "css_ruleimpl.h"
 #include "css_stylesheetimpl.h"
 #include "dom2_eventsimpl.h"
-#include "Range.h"
-#include "dom_xmlimpl.h"
-#include "HTMLDocument.h"
-#include "JSHTMLElementWrapperFactory.h"
-#include "HTMLNames.h"
-#include "KWQKHTMLSettings.h"
 #include "kjs_css.h"
 #include "kjs_events.h"
 #include "kjs_traversal.h"
 #include "kjs_window.h"
-#include "RenderCanvas.h"
+
 
 #if __APPLE__
 #include <JavaScriptCore/runtime_object.h>
@@ -334,14 +337,14 @@ EventTargetNode *toEventTargetNode(JSValue *val)
 {
     if (!val || !val->isObject(&DOMEventTargetNode::info))
         return 0;
-    return static_cast<EventTargetNode*>(static_cast<DOMEventTargetNode *>(val)->impl());
+    return static_cast<EventTargetNode*>(static_cast<DOMEventTargetNode*>(val)->impl());
 }
 
 WebCore::Node* toNode(JSValue* val)
 {
     if (!val || !val->isObject(&DOMNode::info))
         return 0;
-    return static_cast<DOMNode *>(val)->impl();
+    return static_cast<DOMNode*>(val)->impl();
 }
 
 // -------------------------------------------------------------------------
@@ -725,13 +728,13 @@ JSValue *DOMNodeList::getValueProperty(ExecState *exec, int token) const
 
 JSValue *DOMNodeList::indexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
-  DOMNodeList *thisObj = static_cast<DOMNodeList *>(slot.slotBase());
+  DOMNodeList *thisObj = static_cast<DOMNodeList*>(slot.slotBase());
   return toJS(exec, thisObj->m_impl->item(slot.index()));
 }
 
 JSValue *DOMNodeList::nameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
-  DOMNodeList *thisObj = static_cast<DOMNodeList *>(slot.slotBase());
+  DOMNodeList *thisObj = static_cast<DOMNodeList*>(slot.slotBase());
   return toJS(exec, thisObj->m_impl->itemById(propertyName));
 }
 
@@ -781,7 +784,7 @@ JSValue *DOMNodeListFunc::callAsFunction(ExecState *exec, JSObject *thisObj, con
 {
   if (!thisObj->inherits(&KJS::DOMNodeList::info))
     return throwError(exec, TypeError);
-  WebCore::NodeList &list = *static_cast<DOMNodeList *>(thisObj)->impl();
+  WebCore::NodeList &list = *static_cast<DOMNodeList*>(thisObj)->impl();
 
   if (id == DOMNodeList::Item)
     return toJS(exec, list.item(args[0]->toInt32(exec)));
@@ -797,21 +800,21 @@ Attr* toAttr(JSValue* val, bool& ok)
     }
 
     ok = true;
-    return static_cast<Attr *>(static_cast<DOMNode *>(val)->impl());
+    return static_cast<Attr*>(static_cast<DOMNode*>(val)->impl());
 }
 
 Element *toElement(JSValue *val)
 {
     if (!val || !val->isObject(&JSElement::info))
         return 0;
-    return static_cast<Element *>(static_cast<JSElement *>(val)->impl());
+    return static_cast<Element*>(static_cast<JSElement*>(val)->impl());
 }
 
 DocumentType *toDocumentType(JSValue *val)
 {
     if (!val || !val->isObject(&JSDocumentType::info))
         return 0;
-    return static_cast<DocumentType *>(static_cast<DOMNode *>(val)->impl());
+    return static_cast<DocumentType*>(static_cast<DOMNode*>(val)->impl());
 }
 
 // -------------------------------------------------------------------------
@@ -871,7 +874,7 @@ bool DOMNamedNodeMap::getOwnPropertySlot(ExecState* exec, const Identifier& prop
   } else {
     // Look in the prototype (for functions) before assuming it's an item's name
     JSValue *proto = prototype();
-    if (proto->isObject() && static_cast<JSObject *>(proto)->hasProperty(exec, propertyName))
+    if (proto->isObject() && static_cast<JSObject*>(proto)->hasProperty(exec, propertyName))
       return false;
 
     // name or index ?
@@ -924,13 +927,13 @@ JSValue* toJS(ExecState *exec, Document *n)
     return jsNull();
 
   JSDocument *ret = 0;
-  ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
+  ScriptInterpreter* interp = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter());
 
-  if ((ret = static_cast<JSDocument *>(interp->getDOMObject(n))))
+  if ((ret = static_cast<JSDocument*>(interp->getDOMObject(n))))
     return ret;
 
   if (n->isHTMLDocument())
-    ret = new WebCore::JSHTMLDocument(exec, static_cast<HTMLDocument *>(n));
+    ret = new WebCore::JSHTMLDocument(exec, static_cast<HTMLDocument*>(n));
   else
     ret = new JSDocument(exec, n);
 
@@ -960,7 +963,7 @@ JSValue* toJS(ExecState *exec, PassRefPtr<WebCore::Node> node)
   DOMNode *ret = 0;
   if (!n)
     return jsNull();
-  ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
+  ScriptInterpreter* interp = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter());
   Document *doc = n->document();
 
   if ((ret = interp->getDOMNodeForDocument(doc, n)))
@@ -971,32 +974,32 @@ JSValue* toJS(ExecState *exec, PassRefPtr<WebCore::Node> node)
       if (n->isHTMLElement())
         ret = createJSWrapper(exec, static_pointer_cast<WebCore::HTMLElement>(node));
       else
-        ret = new JSElement(exec, static_cast<Element *>(n));
+        ret = new JSElement(exec, static_cast<Element*>(n));
       break;
     case WebCore::Node::ATTRIBUTE_NODE:
-      ret = new JSAttr(exec, static_cast<Attr *>(n));
+      ret = new JSAttr(exec, static_cast<Attr*>(n));
       break;
     case WebCore::Node::TEXT_NODE:
     case WebCore::Node::CDATA_SECTION_NODE:
-      ret = new JSText(exec, static_cast<Text *>(n));
+      ret = new JSText(exec, static_cast<Text*>(n));
       break;
     case WebCore::Node::ENTITY_NODE:
-      ret = new JSEntity(exec, static_cast<Entity *>(n));
+      ret = new JSEntity(exec, static_cast<Entity*>(n));
       break;
     case WebCore::Node::PROCESSING_INSTRUCTION_NODE:
-      ret = new JSProcessingInstruction(exec, static_cast<ProcessingInstruction *>(n));
+      ret = new JSProcessingInstruction(exec, static_cast<ProcessingInstruction*>(n));
       break;
     case WebCore::Node::COMMENT_NODE:
-      ret = new JSCharacterData(exec, static_cast<CharacterData *>(n));
+      ret = new JSCharacterData(exec, static_cast<CharacterData*>(n));
       break;
     case WebCore::Node::DOCUMENT_NODE:
       // we don't want to cache the document itself in the per-document dictionary
-      return toJS(exec, static_cast<Document *>(n));
+      return toJS(exec, static_cast<Document*>(n));
     case WebCore::Node::DOCUMENT_TYPE_NODE:
-      ret = new JSDocumentType(exec, static_cast<DocumentType *>(n));
+      ret = new JSDocumentType(exec, static_cast<DocumentType*>(n));
       break;
     case WebCore::Node::NOTATION_NODE:
-      ret = new JSNotation(exec, static_cast<Notation *>(n));
+      ret = new JSNotation(exec, static_cast<Notation*>(n));
       break;
     case WebCore::Node::DOCUMENT_FRAGMENT_NODE:
       ret = new JSDocumentFragment(exec, static_cast<DocumentFragment*>(n));
@@ -1091,13 +1094,13 @@ DOMNamedNodesCollection::DOMNamedNodesCollection(ExecState *, const DeprecatedVa
 
 JSValue *DOMNamedNodesCollection::lengthGetter(ExecState* exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
-  DOMNamedNodesCollection *thisObj = static_cast<DOMNamedNodesCollection *>(slot.slotBase());
+  DOMNamedNodesCollection *thisObj = static_cast<DOMNamedNodesCollection*>(slot.slotBase());
   return jsNumber(thisObj->m_nodes.count());
 }
 
 JSValue *DOMNamedNodesCollection::indexGetter(ExecState* exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
-  DOMNamedNodesCollection *thisObj = static_cast<DOMNamedNodesCollection *>(slot.slotBase());
+  DOMNamedNodesCollection *thisObj = static_cast<DOMNamedNodesCollection*>(slot.slotBase());
   return toJS(exec, thisObj->m_nodes[slot.index()].get());
 }
 
index 657082a48b7c361cf86871427270ce7951b4053c..0ee061fbe0b688a9df22699a1725a2055848e87a 100644 (file)
 #import "DocumentFragment.h"
 #import "Document.h"
 #import "DocumentType.h"
+#import "Entity.h"
+#import "EntityReference.h"
 #import "EventListener.h"
 #import "FoundationExtras.h"
 #import "FrameMac.h"
 #import "NodeList.h"
+#import "Notation.h"
+#import "ProcessingInstruction.h"
 #import "css_stylesheetimpl.h"
 #import "csshelper.h"
 #import "Range.h"
-#import "dom_xmlimpl.h"
 #import "HTMLNames.h"
 #import "QualifiedName.h"
 #import "RenderImage.h"
index c2c251711a0549e854896671ba9b888095df6fcd..388a57d0452220fe89a1dd2dee446302f6f9b82f 100644 (file)
@@ -32,9 +32,9 @@
 #import "FoundationExtras.h"
 #import "HTMLLinkElement.h"
 #import "HTMLStyleElement.h"
+#import "ProcessingInstruction.h"
 #import "css_ruleimpl.h"
 #import "css_stylesheetimpl.h"
-#import "dom_xmlimpl.h"
 #import <objc/objc-class.h>
 
 using namespace WebCore;
index 321e03d6ed3e2e662060445ee3b0e34c80665639..e529bfb8b26d42a7010862b0c8c070627ac4074e 100644 (file)
@@ -146,30 +146,7 @@ sub AddIncludesForType
   # When we're finished with the one-file-per-class 
   # reorganization, we don't need these special cases.
   
-  if ($type eq "Attr" or
-      $type eq "CDATASection" or
-      $type eq "CanvasPattern" or
-      $type eq "CharacterData" or
-      $type eq "Comment" or
-      $type eq "DOMException" or
-      $type eq "DOMImplementation" or
-      $type eq "DOMWindow" or
-      $type eq "Document" or
-      $type eq "DocumentFragment" or
-      $type eq "DocumentType" or 
-      $type eq "Element" or
-      $type eq "HTMLCanvasElement" or
-      $type eq "HTMLElement" or 
-      $type eq "Node" or
-      $type eq "NodeList" or 
-      $type eq "Range" or 
-      $type eq "Text" or
-      $type eq "XPathEvaluator" or
-      $type eq "XPathExpression" or
-      $type eq "XPathNSResolver" or
-      $type eq "XPathResult") {
-    $implIncludes{"${type}.h"} = 1;
-  } elsif ($type eq "CSSStyleSheet" or $type eq "StyleSheet") {
+  if ($type eq "CSSStyleSheet" or $type eq "StyleSheet") {
     $implIncludes{"css_stylesheetimpl.h"} = 1;
   } elsif ($type eq "CSSRuleList" or
            $type eq "CSSRule") {
@@ -195,11 +172,6 @@ sub AddIncludesForType
            $type eq "NodeFilter" or
           $type eq "TreeWalker") {
     $implIncludes{"dom2_traversalimpl.h"} = 1;
-  } elsif ($type eq "ProcessingInstruction" or
-           $type eq "Entity" or
-          $type eq "EntityReference" or
-           $type eq "Notation") {
-    $implIncludes{"dom_xmlimpl.h"} = 1;
   } elsif ($type eq "CanvasRenderingContext2D") {
     $implIncludes{"CanvasGradient.h"} = 1;
     $implIncludes{"CanvasPattern.h"} = 1;
@@ -210,9 +182,9 @@ sub AddIncludesForType
     $implIncludes{"PlatformString.h"} = 1;
   } elsif ($codeGenerator->IsPrimitiveType($type) or
            $type eq "DOMString" or $type eq "DOMObject") {
-    # Do nothing
   } else {
-    die "Don't know what to include for interface $type";
+    # default, include the same named file
+    $implIncludes{"${type}.h"} = 1;
   }
 }
 
index 09163ebb2c1887d7ec8671c0d4f132774b4023ce..7ee6059dc3b251d35918a55a1e19819668a2337e 100644 (file)
@@ -34,6 +34,7 @@
 #include "DocumentFragment.h"
 #include "DocumentType.h"
 #include "EditingText.h"
+#include "EntityReference.h"
 #include "EventListener.h"
 #include "EventNames.h"
 #include "ExceptionCode.h"
@@ -54,6 +55,7 @@
 #include "MouseEventWithHitTestResults.h"
 #include "NameNodeList.h"
 #include "PlatformKeyboardEvent.h"
+#include "ProcessingInstruction.h"
 #include "RegularExpression.h"
 #include "RenderArena.h"
 #include "RenderCanvas.h"
@@ -67,7 +69,6 @@
 #include "csshelper.h"
 #include "cssstyleselector.h"
 #include "dom2_eventsimpl.h"
-#include "dom_xmlimpl.h"
 #include "kjs_binding.h"
 #include "kjs_proxy.h"
 #include "xml_tokenizer.h"
diff --git a/WebCore/dom/Entity.cpp b/WebCore/dom/Entity.cpp
new file mode 100644 (file)
index 0000000..c2557d1
--- /dev/null
@@ -0,0 +1,110 @@
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 2000 Peter Kelly (pmk@post.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 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.
+ */
+#include "config.h"
+#include "Entity.h"
+
+namespace WebCore {
+
+Entity::Entity(Document* doc)
+    : ContainerNode(doc)
+{
+}
+
+Entity::Entity(Document* doc, const String& name)
+    : ContainerNode(doc)
+    , m_name(name.impl())
+{
+}
+
+Entity::Entity(Document* doc, const String& publicId, const String& systemId, const String& notationName)
+    : ContainerNode(doc)
+    , m_publicId(publicId.impl())
+    , m_systemId(systemId.impl())
+    , m_notationName(notationName.impl())
+{
+}
+
+String Entity::nodeName() const
+{
+    return m_name.get();
+}
+
+Node::NodeType Entity::nodeType() const
+{
+    return ENTITY_NODE;
+}
+
+PassRefPtr<Node> Entity::cloneNode(bool /*deep*/)
+{
+    // Spec says cloning Entity nodes is "implementation dependent". We do not support it.
+    return 0;
+}
+
+// DOM Section 1.1.1
+bool Entity::childTypeAllowed(NodeType type)
+{
+    switch (type) {
+        case ELEMENT_NODE:
+        case PROCESSING_INSTRUCTION_NODE:
+        case COMMENT_NODE:
+        case TEXT_NODE:
+        case CDATA_SECTION_NODE:
+        case ENTITY_REFERENCE_NODE:
+            return true;
+            break;
+        default:
+            return false;
+    }
+}
+
+String Entity::toString() const
+{
+    String result = "<!ENTITY' ";
+
+    if (m_name && m_name->length()) {
+        result += " ";
+        result += m_name.get();
+    }
+
+    if (m_publicId && m_publicId->length()) {
+        result += " PUBLIC \"";
+        result += m_publicId.get();
+        result += "\" \"";
+        result += m_systemId.get();
+        result += "\"";
+    } else if (m_systemId && m_systemId->length()) {
+        result += " SYSTEM \"";
+        result += m_systemId.get();
+        result += "\"";
+    }
+
+    if (m_notationName && m_notationName->length()) {
+        result += " NDATA ";
+        result += m_notationName.get();
+    }
+
+    result += ">";
+
+    return result;
+}
+
+} // namespace
diff --git a/WebCore/dom/Entity.h b/WebCore/dom/Entity.h
new file mode 100644 (file)
index 0000000..0bf30b7
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 2000 Peter Kelly (pmk@post.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 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.
+ *
+ */
+
+#ifndef Entity_H
+#define Entity_H
+
+#include "ContainerNode.h"
+
+namespace WebCore {
+
+class Entity : public ContainerNode
+{
+public:
+    Entity(Document*);
+    Entity(Document*, const String& name);
+    Entity(Document*, const String& publicId, const String& systemId, const String& notationName);
+
+    // DOM methods & attributes for Entity
+    String publicId() const { return m_publicId.get(); }
+    String systemId() const { return m_systemId.get(); }
+    String notationName() const { return m_notationName.get(); }
+
+    virtual String nodeName() const;
+    virtual NodeType nodeType() const;
+    virtual PassRefPtr<Node> cloneNode(bool deep);
+    virtual bool childTypeAllowed(NodeType);
+    virtual String toString() const;
+
+private:
+    RefPtr<StringImpl> m_publicId;
+    RefPtr<StringImpl> m_systemId;
+    RefPtr<StringImpl> m_notationName;
+    RefPtr<StringImpl> m_name;
+};
+
+} //namespace
+
+#endif
diff --git a/WebCore/dom/EntityReference.cpp b/WebCore/dom/EntityReference.cpp
new file mode 100644 (file)
index 0000000..ceaff0a
--- /dev/null
@@ -0,0 +1,84 @@
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 2000 Peter Kelly (pmk@post.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 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.
+ */
+#include "config.h"
+#include "EntityReference.h"
+
+namespace WebCore {
+
+EntityReference::EntityReference(Document* doc)
+    : ContainerNode(doc)
+{
+}
+
+EntityReference::EntityReference(Document* doc, StringImpl* entityName)
+    : ContainerNode(doc)
+    , m_entityName(entityName)
+{
+}
+
+String EntityReference::nodeName() const
+{
+    return m_entityName.get();
+}
+
+Node::NodeType EntityReference::nodeType() const
+{
+    return ENTITY_REFERENCE_NODE;
+}
+
+PassRefPtr<Node> EntityReference::cloneNode(bool deep)
+{
+    RefPtr<EntityReference> clone = new EntityReference(document(), m_entityName.get());
+    // ### make sure children are readonly
+    // ### since we are a reference, should we clone children anyway (even if not deep?)
+    if (deep)
+        cloneChildNodes(clone.get());
+    return clone.release();
+}
+
+// DOM Section 1.1.1
+bool EntityReference::childTypeAllowed(NodeType type)
+{
+    switch (type) {
+        case ELEMENT_NODE:
+        case PROCESSING_INSTRUCTION_NODE:
+        case COMMENT_NODE:
+        case TEXT_NODE:
+        case CDATA_SECTION_NODE:
+        case ENTITY_REFERENCE_NODE:
+            return true;
+            break;
+        default:
+            return false;
+    }
+}
+
+String EntityReference::toString() const
+{
+    String result = "&";
+    result += m_entityName.get();
+    result += ";";
+
+    return result;
+}
+
+} // namespace
diff --git a/WebCore/dom/EntityReference.h b/WebCore/dom/EntityReference.h
new file mode 100644 (file)
index 0000000..b9b9d48
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 2000 Peter Kelly (pmk@post.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 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.
+ *
+ */
+
+#ifndef EntityReference_H
+#define EntityReference_H
+
+#include "ContainerNode.h"
+
+namespace WebCore {
+
+class EntityReference : public ContainerNode
+{
+public:
+    EntityReference(Document*);
+    EntityReference(Document*, StringImpl* entityName);
+
+    virtual String nodeName() const;
+    virtual NodeType nodeType() const;
+    virtual PassRefPtr<Node> cloneNode(bool deep);
+    virtual bool childTypeAllowed(NodeType);
+    virtual String toString() const;
+
+private:
+    RefPtr<StringImpl> m_entityName;
+};
+
+} //namespace
+
+#endif
diff --git a/WebCore/dom/Notation.cpp b/WebCore/dom/Notation.cpp
new file mode 100644 (file)
index 0000000..27df85b
--- /dev/null
@@ -0,0 +1,61 @@
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 2000 Peter Kelly (pmk@post.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 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.
+ */
+#include "config.h"
+#include "Notation.h"
+
+namespace WebCore {
+
+Notation::Notation(Document* doc) : ContainerNode(doc)
+{
+}
+
+Notation::Notation(Document* doc, const String& name, const String& publicId, const String& systemId)
+    : ContainerNode(doc)
+    , m_name(name.impl())
+    , m_publicId(publicId.impl())
+    , m_systemId(systemId.impl())
+{
+}
+
+String Notation::nodeName() const
+{
+    return m_name.get();
+}
+
+Node::NodeType Notation::nodeType() const
+{
+    return NOTATION_NODE;
+}
+
+PassRefPtr<Node> Notation::cloneNode(bool /*deep*/)
+{
+    // Spec says cloning Notation nodes is "implementation dependent". We do not support it.
+    return 0;
+}
+
+// DOM Section 1.1.1
+bool Notation::childTypeAllowed(NodeType)
+{
+    return false;
+}
+
+} // namespace
diff --git a/WebCore/dom/Notation.h b/WebCore/dom/Notation.h
new file mode 100644 (file)
index 0000000..22dc1c3
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 2000 Peter Kelly (pmk@post.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 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.
+ *
+ */
+
+#ifndef Notation_H
+#define Notation_H
+
+#include "CachedObjectClient.h"
+#include "ContainerNode.h"
+
+namespace WebCore {
+
+class Notation : public ContainerNode
+{
+public:
+    Notation(Document*);
+    Notation(Document*, const String& name, const String& publicId, const String& systemId);
+
+    // DOM methods & attributes for Notation
+    String publicId() const { return m_publicId.get(); }
+    String systemId() const { return m_systemId. get(); }
+
+    virtual String nodeName() const;
+    virtual NodeType nodeType() const;
+    virtual PassRefPtr<Node> cloneNode(bool deep);
+    virtual bool childTypeAllowed(NodeType);
+
+private:
+    RefPtr<StringImpl> m_name;
+    RefPtr<StringImpl> m_publicId;
+    RefPtr<StringImpl> m_systemId;
+};
+
+} //namespace
+
+#endif
similarity index 58%
rename from WebCore/dom/dom_xmlimpl.cpp
rename to WebCore/dom/ProcessingInstruction.cpp
index 2b23878b1a9d3e35a6c4e1b2acf1b4a9144cbb70..fd4d67be9ef666d35e7edd1800699a621367d304 100644 (file)
  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
-
 #include "config.h"
-#include "dom_xmlimpl.h"
+#include "ProcessingInstruction.h"
 
 #include "CachedCSSStyleSheet.h"
 #include "CachedXSLStyleSheet.h"
-#include "DocLoader.h"
 #include "Document.h"
+#include "DocLoader.h"
 #include "ExceptionCode.h"
-#include "xml_tokenizer.h"
-
-#if KHTML_XSLT
 #include "XSLStyleSheet.h"
-#endif
+#include "xml_tokenizer.h" // for parseAttributes()
 
 namespace WebCore {
 
-Entity::Entity(Document* doc) : ContainerNode(doc)
-{
-}
-
-Entity::Entity(Document* doc, const String& name) : ContainerNode(doc), m_name(name.impl())
-{
-}
-
-Entity::Entity(Document* doc, const String& publicId, const String& systemId, const String& notationName)
-    : ContainerNode(doc), m_publicId(publicId.impl()), m_systemId(systemId.impl()), m_notationName(notationName.impl())
-{
-}
-
-String Entity::nodeName() const
-{
-    return m_name.get();
-}
-
-Node::NodeType Entity::nodeType() const
-{
-    return ENTITY_NODE;
-}
-
-PassRefPtr<Node> Entity::cloneNode(bool /*deep*/)
-{
-    // Spec says cloning Entity nodes is "implementation dependent". We do not support it.
-    return 0;
-}
-
-// DOM Section 1.1.1
-bool Entity::childTypeAllowed(NodeType type)
-{
-    switch (type) {
-        case ELEMENT_NODE:
-        case PROCESSING_INSTRUCTION_NODE:
-        case COMMENT_NODE:
-        case TEXT_NODE:
-        case CDATA_SECTION_NODE:
-        case ENTITY_REFERENCE_NODE:
-            return true;
-            break;
-        default:
-            return false;
-    }
-}
-
-String Entity::toString() const
-{
-    String result = "<!ENTITY' ";
-
-    if (m_name && m_name->length()) {
-        result += " ";
-        result += m_name.get();
-    }
-
-    if (m_publicId && m_publicId->length()) {
-        result += " PUBLIC \"";
-        result += m_publicId.get();
-        result += "\" \"";
-        result += m_systemId.get();
-        result += "\"";
-    } else if (m_systemId && m_systemId->length()) {
-        result += " SYSTEM \"";
-        result += m_systemId.get();
-        result += "\"";
-    }
-
-    if (m_notationName && m_notationName->length()) {
-        result += " NDATA ";
-        result += m_notationName.get();
-    }
-
-    result += ">";
-
-    return result;
-}
-
-// -------------------------------------------------------------------------
-
-EntityReference::EntityReference(Document* doc) : ContainerNode(doc)
-{
-}
-
-EntityReference::EntityReference(Document* doc, StringImpl* entityName)
-    : ContainerNode(doc), m_entityName(entityName)
-{
-}
-
-String EntityReference::nodeName() const
-{
-    return m_entityName.get();
-}
-
-Node::NodeType EntityReference::nodeType() const
-{
-    return ENTITY_REFERENCE_NODE;
-}
-
-PassRefPtr<Node> EntityReference::cloneNode(bool deep)
-{
-    RefPtr<EntityReference> clone = new EntityReference(document(), m_entityName.get());
-    // ### make sure children are readonly
-    // ### since we are a reference, should we clone children anyway (even if not deep?)
-    if (deep)
-        cloneChildNodes(clone.get());
-    return clone.release();
-}
-
-// DOM Section 1.1.1
-bool EntityReference::childTypeAllowed(NodeType type)
-{
-    switch (type) {
-        case ELEMENT_NODE:
-        case PROCESSING_INSTRUCTION_NODE:
-        case COMMENT_NODE:
-        case TEXT_NODE:
-        case CDATA_SECTION_NODE:
-        case ENTITY_REFERENCE_NODE:
-            return true;
-            break;
-        default:
-            return false;
-    }
-}
-
-String EntityReference::toString() const
-{
-    String result = "&";
-    result += m_entityName.get();
-    result += ";";
-
-    return result;
-}
-
-// -------------------------------------------------------------------------
-
-Notation::Notation(Document* doc) : ContainerNode(doc)
-{
-}
-
-Notation::Notation(Document* doc, const String& name, const String& publicId, const String& systemId)
-    : ContainerNode(doc), m_name(name.impl()), m_publicId(publicId.impl()), m_systemId(systemId.impl())
-{
-}
-
-String Notation::nodeName() const
-{
-    return m_name.get();
-}
-
-Node::NodeType Notation::nodeType() const
-{
-    return NOTATION_NODE;
-}
-
-PassRefPtr<Node> Notation::cloneNode(bool /*deep*/)
-{
-    // Spec says cloning Notation nodes is "implementation dependent". We do not support it.
-    return 0;
-}
-
-// DOM Section 1.1.1
-bool Notation::childTypeAllowed(NodeType)
-{
-    return false;
-}
-
-// -------------------------------------------------------------------------
-
-// ### need a way of updating these properly whenever child nodes of the processing instruction
-// change or are added/removed
-
 ProcessingInstruction::ProcessingInstruction(Document* doc)
-    : ContainerNode(doc), m_cachedSheet(0), m_loading(false)
-{
+    : ContainerNode(doc)
+    , m_cachedSheet(0)
+    , m_loading(false)
 #if KHTML_XSLT
-    m_isXSL = false;
+    , m_isXSL(false)
 #endif
+{
 }
 
 ProcessingInstruction::ProcessingInstruction(Document* doc, const String& target, const String& data)
-    : ContainerNode(doc), m_target(target.impl()), m_data(data.impl()), m_cachedSheet(0), m_loading(false)
-{
+    : ContainerNode(doc)
+    , m_target(target.impl())
+    , m_data(data.impl())
+    , m_cachedSheet(0)
+    , m_loading(false)
 #if KHTML_XSLT
-    m_isXSL = false;
+    , m_isXSL(false)
 #endif
+{
 }
 
 ProcessingInstruction::~ProcessingInstruction()
similarity index 53%
rename from WebCore/dom/dom_xmlimpl.h
rename to WebCore/dom/ProcessingInstruction.h
index 7733b2c1cbf320283dea00a35255fe6c56fdce05..c07291e842bc62a947ef549da64569e326390071 100644 (file)
  *
  */
 
-#ifndef DOM_XmlImpl_h_
-#define DOM_XmlImpl_h_
+#ifndef ProcessingInstruction_H
+#define ProcessingInstruction_H
 
 #include "CachedObjectClient.h"
 #include "ContainerNode.h"
 
 namespace WebCore {
-    class CachedCSSStyleSheet;
-}
 
-namespace WebCore {
-
-class Document;
-class String;
-class ProcessingInstruction;
 class StyleSheet;
 
-class Entity : public ContainerNode
-{
-public:
-    Entity(Document*);
-    Entity(Document*, const String& name);
-    Entity(Document*, const String& publicId, const String& systemId, const String& notationName);
-
-    // DOM methods & attributes for Entity
-    String publicId() const { return m_publicId.get(); }
-    String systemId() const { return m_systemId.get(); }
-    String notationName() const { return m_notationName.get(); }
-
-    virtual String nodeName() const;
-    virtual NodeType nodeType() const;
-    virtual PassRefPtr<Node> cloneNode(bool deep);
-    virtual bool childTypeAllowed(NodeType);
-    virtual String toString() const;
-
-private:
-    RefPtr<StringImpl> m_publicId;
-    RefPtr<StringImpl> m_systemId;
-    RefPtr<StringImpl> m_notationName;
-    RefPtr<StringImpl> m_name;
-};
-
-class EntityReference : public ContainerNode
-{
-public:
-    EntityReference(Document*);
-    EntityReference(Document*, StringImpl* entityName);
-
-    virtual String nodeName() const;
-    virtual NodeType nodeType() const;
-    virtual PassRefPtr<Node> cloneNode(bool deep);
-    virtual bool childTypeAllowed(NodeType);
-    virtual String toString() const;
-
-private:
-    RefPtr<StringImpl> m_entityName;
-};
-
-class Notation : public ContainerNode
-{
-public:
-    Notation(Document*);
-    Notation(Document*, const String& name, const String& publicId, const String& systemId);
-
-    // DOM methods & attributes for Notation
-    String publicId() const { return m_publicId.get(); }
-    String systemId() const { return m_systemId. get(); }
-
-    virtual String nodeName() const;
-    virtual NodeType nodeType() const;
-    virtual PassRefPtr<Node> cloneNode(bool deep);
-    virtual bool childTypeAllowed(NodeType);
-
-private:
-    RefPtr<StringImpl> m_name;
-    RefPtr<StringImpl> m_publicId;
-    RefPtr<StringImpl> m_systemId;
-};
-
-
 class ProcessingInstruction : public ContainerNode, private CachedObjectClient
 {
 public:
@@ -111,12 +41,12 @@ public:
     // DOM methods & attributes for Notation
     String target() const { return m_target.get(); }
     String data() const { return m_data.get(); }
-    void setData(const String &data, ExceptionCode&);
+    void setData(const String&, ExceptionCode&);
 
     virtual String nodeName() const;
     virtual NodeType nodeType() const;
     virtual String nodeValue() const;
-    virtual void setNodeValue(const String& nodeValue, ExceptionCode&);
+    virtual void setNodeValue(const String&, ExceptionCode&);
     virtual PassRefPtr<Node> cloneNode(bool deep);
     virtual bool childTypeAllowed(NodeType);
     virtual bool offsetInCharacters() const;
index b030701d13ffebd44035a9fde075334f6dfbb681..755f8085b9ecaa712964e13c92833ef907d2a05f 100644 (file)
@@ -30,9 +30,9 @@
 #include "DocumentFragment.h"
 #include "ExceptionCode.h"
 #include "HTMLElement.h"
+#include "ProcessingInstruction.h"
 #include "RenderBlock.h"
 #include "TextIterator.h"
-#include "dom_xmlimpl.h"
 #include "markup.h"
 #include "visible_units.h"
 
@@ -40,8 +40,10 @@ namespace WebCore {
 
 Range::Range(Document* ownerDocument)
     : m_ownerDocument(ownerDocument)
-    , m_startContainer(ownerDocument), m_startOffset(0)
-    , m_endContainer(ownerDocument), m_endOffset(0)
+    , m_startContainer(ownerDocument)
+    , m_startOffset(0)
+    , m_endContainer(ownerDocument)
+    , m_endOffset(0)
     , m_detached(false)
 {
 }
@@ -50,8 +52,10 @@ Range::Range(Document* ownerDocument,
               Node* startContainer, int startOffset,
               Node* endContainer, int endOffset)
     : m_ownerDocument(ownerDocument)
-    , m_startContainer(startContainer), m_startOffset(startOffset)
-    , m_endContainer(endContainer), m_endOffset(endOffset)
+    , m_startContainer(startContainer)
+    , m_startOffset(startOffset)
+    , m_endContainer(endContainer)
+    , m_endOffset(endOffset)
     , m_detached(false)
 {
 }
index 69cf36278772ea6827adadeb9c836a826d6166f3..c122f5dff96fba4f3b07db0668c6e6d392071f9d 100644 (file)
@@ -37,8 +37,8 @@
 #include "HTMLTableSectionElement.h"
 #include "HTMLScriptElement.h"
 #include "KWQLoader.h"
-#include "dom_xmlimpl.h"
 #include "HTMLTokenizer.h"
+#include "ProcessingInstruction.h"
 #include <libxml/parser.h>
 #include <libxml/parserInternals.h>
 
index 02253b5f6828f1101bb0be4be62d4f5e297775f2..66ed1bd45e6ad405dfbbfa6999253a40fb365192 100644 (file)
@@ -35,8 +35,8 @@
 #include "HTMLNames.h"
 #include "InlineTextBox.h"
 #include "Logging.h"
+#include "ProcessingInstruction.h"
 #include "Range.h"
-#include "dom_xmlimpl.h"
 #include "htmlediting.h"
 #include "visible_units.h"
 
@@ -97,7 +97,7 @@ static DeprecatedString renderedText(const Node *node, const Range *range)
     DeprecatedString result = "";
 
     ExceptionCode ec;
-    const Text *textNode = static_cast<const Text *>(node);
+    const Text *textNode = static_cast<const Text*>(node);
     unsigned startOffset = 0;
     unsigned endOffset = textNode->length();
 
@@ -106,7 +106,7 @@ static DeprecatedString renderedText(const Node *node, const Range *range)
     if (range && node == range->endContainer(ec))
         endOffset = range->endOffset(ec);
     
-    RenderText *textRenderer = static_cast<RenderText *>(r);
+    RenderText *textRenderer = static_cast<RenderText*>(r);
     DeprecatedString str = node->nodeValue().deprecatedString();
     for (InlineTextBox *box = textRenderer->firstTextBox(); box; box = box->nextTextBox()) {
         unsigned start = box->m_start;
@@ -176,7 +176,7 @@ static DeprecatedString startMarkup(const Node *node, const Range *range, EAnnot
             return annotate ? convertHTMLTextToInterchangeFormat(markup) : markup;
         }
         case Node::COMMENT_NODE:
-            return static_cast<const Comment *>(node)->toString().deprecatedString();
+            return static_cast<const Comment*>(node)->toString().deprecatedString();
         case Node::DOCUMENT_NODE: {
             // Documents do not normally contain a docType as a child node, force it to print here instead.
             const DocumentType* docType = static_cast<const Document*>(node)->doctype();
@@ -189,17 +189,17 @@ static DeprecatedString startMarkup(const Node *node, const Range *range, EAnnot
         case Node::DOCUMENT_TYPE_NODE:
             return static_cast<const DocumentType*>(node)->toString().deprecatedString();
         case Node::PROCESSING_INSTRUCTION_NODE:
-            return static_cast<const ProcessingInstruction *>(node)->toString().deprecatedString();
+            return static_cast<const ProcessingInstruction*>(node)->toString().deprecatedString();
         case Node::ELEMENT_NODE: {
             DeprecatedString markup = QChar('<') + node->nodeName().deprecatedString();
             const Element* el = static_cast<const Element*>(node);
             String additionalStyle;
             if (defaultStyle && el->isHTMLElement()) {
-                RefPtr<CSSComputedStyleDeclaration> computedStyle = Position(const_cast<Element *>(el), 0).computedStyle();
+                RefPtr<CSSComputedStyleDeclaration> computedStyle = Position(const_cast<Element*>(el), 0).computedStyle();
                 RefPtr<CSSMutableStyleDeclaration> style = computedStyle->copyInheritableProperties();
                 defaultStyle->diff(style.get());
                 if (style->length() > 0) {
-                    CSSMutableStyleDeclaration *inlineStyleDecl = static_cast<const HTMLElement *>(el)->inlineStyleDecl();
+                    CSSMutableStyleDeclaration *inlineStyleDecl = static_cast<const HTMLElement*>(el)->inlineStyleDecl();
                     if (inlineStyleDecl)
                         inlineStyleDecl->diff(style.get());
                     additionalStyle = style->cssText();
@@ -306,7 +306,7 @@ static void completeURLs(Node *node, const DeprecatedString &baseURL)
     Node *end = node->traverseNextSibling();
     for (Node *n = node; n != end; n = n->traverseNextNode()) {
         if (n->isElementNode()) {
-            Element *e = static_cast<Element *>(n);
+            Element *e = static_cast<Element*>(n);
             NamedAttrMap *attrs = e->attributes();
             unsigned length = attrs->length();
             for (unsigned i = 0; i < length; i++) {
@@ -476,7 +476,7 @@ PassRefPtr<DocumentFragment> createFragmentFromMarkup(Document* document, const
 {
     ASSERT(document->documentElement()->isHTMLElement());
     // FIXME: What if the document element is not an HTML element?
-    HTMLElement *element = static_cast<HTMLElement *>(document->documentElement());
+    HTMLElement *element = static_cast<HTMLElement*>(document->documentElement());
 
     RefPtr<DocumentFragment> fragment = element->createContextualFragment(markup);
     ASSERT(fragment);