Reviewed by Darin.
authorrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2006 19:28:37 +0000 (19:28 +0000)
committerrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2006 19:28:37 +0000 (19:28 +0000)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=10230
        SVGDOMImplementation should die (and be rolled into DOMImplementation)

        Delete SVGDOMImplementation and references to it. The
        svg specific functionality is now in DOMImplementation.

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

36 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/custom/svg-features-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/svg-features.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/dom/DOMImplementation.cpp
WebCore/dom/DOMImplementation.h
WebCore/ksvg2/bindings/idl/svg/SVGDOMImplementation.idl [deleted file]
WebCore/ksvg2/svg/SVGColor.cpp
WebCore/ksvg2/svg/SVGComponentTransferFunctionElement.cpp
WebCore/ksvg2/svg/SVGDocument.cpp
WebCore/ksvg2/svg/SVGDocument.h
WebCore/ksvg2/svg/SVGElement.cpp
WebCore/ksvg2/svg/SVGFEBlendElement.cpp
WebCore/ksvg2/svg/SVGFEColorMatrixElement.cpp
WebCore/ksvg2/svg/SVGFEComponentTransferElement.cpp
WebCore/ksvg2/svg/SVGFECompositeElement.cpp
WebCore/ksvg2/svg/SVGFEDiffuseLightingElement.cpp
WebCore/ksvg2/svg/SVGFEDisplacementMapElement.cpp
WebCore/ksvg2/svg/SVGFEFloodElement.cpp
WebCore/ksvg2/svg/SVGFEGaussianBlurElement.cpp
WebCore/ksvg2/svg/SVGFELightElement.cpp
WebCore/ksvg2/svg/SVGFEMergeElement.cpp
WebCore/ksvg2/svg/SVGFEOffsetElement.cpp
WebCore/ksvg2/svg/SVGFESpecularLightingElement.cpp
WebCore/ksvg2/svg/SVGFETileElement.cpp
WebCore/ksvg2/svg/SVGFETurbulenceElement.cpp
WebCore/ksvg2/svg/SVGGradientElement.cpp
WebCore/ksvg2/svg/SVGPatternElement.cpp
WebCore/ksvg2/svg/SVGPolyElement.cpp
WebCore/ksvg2/svg/SVGStopElement.cpp
WebCore/ksvg2/svg/SVGStyledElement.cpp
WebCore/ksvg2/svg/SVGStyledTransformableElement.cpp
WebCore/ksvg2/svg/SVGTests.cpp
WebCore/ksvg2/svg/SVGTransformable.cpp
WebCore/page/Frame.cpp

index d441da9..5b60b2e 100644 (file)
@@ -1,3 +1,14 @@
+2006-08-08  Rob Buis  <buis@kde.org>
+
+        Reviewed by Darin.
+
+        Test case for
+        <http://bugzilla.opendarwin.org/show_bug.cgi?id=10230>
+        SVGDOMImplementation should die (and be rolled into DOMImplementation)
+
+        * svg/custom/svg-features-expected.txt: Added.
+        * svg/custom/svg-features.html: Added.
+
 2006-08-05  Darin Adler  <darin@apple.com>
 
         Reviewed by Hyatt.
diff --git a/LayoutTests/svg/custom/svg-features-expected.txt b/LayoutTests/svg/custom/svg-features-expected.txt
new file mode 100644 (file)
index 0000000..12d38d9
--- /dev/null
@@ -0,0 +1,57 @@
+"org.w3c.svg", "1.0": true, true
+"org.w3c.svg.static", "1.0": true, true
+"org.w3c.svg.animation", "1.0": false, false
+"org.w3c.svg.dynamic", "1.0": false, false
+"org.w3c.dom", "1.0": true, true
+"org.w3c.dom.svg", "1.0": true, true
+"org.w3c.dom.svg.static", "1.0": true, true
+"org.w3c.dom.svg.animation", "1.0": false, false
+"org.w3c.dom.svg.dynamic", "1.0": false, false
+"org.w3c.svg.all", "1.0": false, false
+"org.w3c.dom.svg.all", "1.0": false, false
+"http://www.w3.org/TR/SVG11/feature#SVG", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#SVGDOM", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#SVG-static", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#SVGDOM-static", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#SVG-animation", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#SVGDOM-animation", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#SVG-dynamic", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#SVGDOM-dynamic", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#CoreAttribute", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#Structure", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#ContainerAttribute", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#ConditionalProcessing", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#Image", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#Style", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#ViewportAttribute", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#Shape", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#Text", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#BasicText", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#PaintAttribute", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#BasicPaintAttribute", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#OpacityAttribute", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#GraphicsAttribute", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#BaseGraphicsAttribute", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#Marker", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#ColorProfile", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#Gradient", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#Pattern", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#Clip", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#BasicClip", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#Mask", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#Filter", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#BasicFilter", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#DocumentEventsAttribute", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#GraphicalEventsAttribute", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#AnimationEventsAttribute", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#Cursor", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#Hyperlinking", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#XlinkAttribute", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#ExternalResourcesRequired", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#View", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#Script", "1.1": true, true
+"http://www.w3.org/TR/SVG11/feature#Animation", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#Font", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#BasicFont", "1.1": false, false
+"http://www.w3.org/TR/SVG11/feature#Extensibility", "1.1": true, true
diff --git a/LayoutTests/svg/custom/svg-features.html b/LayoutTests/svg/custom/svg-features.html
new file mode 100644 (file)
index 0000000..49f9d6d
--- /dev/null
@@ -0,0 +1,97 @@
+<script>
+
+function test() {
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var undefined;
+
+    var features = [
+        ["org.w3c.svg", "1.0"],
+        ["org.w3c.svg.static", "1.0"],
+        ["org.w3c.svg.animation", "1.0"],
+        ["org.w3c.svg.dynamic", "1.0"],
+        ["org.w3c.dom", "1.0"],
+        ["org.w3c.dom.svg", "1.0"],
+        ["org.w3c.dom.svg.static", "1.0"],
+        ["org.w3c.dom.svg.animation", "1.0"],
+        ["org.w3c.dom.svg.dynamic", "1.0"],
+        ["org.w3c.svg.all", "1.0"],
+        ["org.w3c.dom.svg.all", "1.0"],
+
+        ["http://www.w3.org/TR/SVG11/feature#SVG", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#SVGDOM", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#SVG-static", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#SVGDOM-static", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#SVG-animation", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#SVGDOM-animation", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#SVG-dynamic", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#SVGDOM-dynamic", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#CoreAttribute", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Structure", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#ContainerAttribute", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#ConditionalProcessing", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Image", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Style", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#ViewportAttribute", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Shape", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Text", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#BasicText", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#PaintAttribute", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#BasicPaintAttribute", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#OpacityAttribute", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#GraphicsAttribute", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#BaseGraphicsAttribute", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Marker", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#ColorProfile", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Gradient", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Pattern", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Clip", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#BasicClip", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Mask", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Filter", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#BasicFilter", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#DocumentEventsAttribute", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#GraphicalEventsAttribute", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#AnimationEventsAttribute", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Cursor", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Hyperlinking", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#XlinkAttribute", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#ExternalResourcesRequired", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#View", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Script", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Animation", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Font", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#BasicFont", "1.1"],
+        ["http://www.w3.org/TR/SVG11/feature#Extensibility", "1.1"]]
+
+    for (var i = 0; i < features.length; ++i)
+    {
+        var item = features[i];
+        if (item[1] == "omitted") {
+            var hasFeature = document.implementation.hasFeature(item[0]);
+            var isSupported = document.body.isSupported(item[0]);
+        } else {
+            var hasFeature = document.implementation.hasFeature(item[0], item[1]);
+            var isSupported = document.body.isSupported(item[0], item[1]);
+        }
+
+        var item0String = item[0];
+        if (typeof item0String == "string")
+            item0String = '"' + item0String + '"';
+        var item1String = item[1];
+        if (typeof item1String == "string" && item[1] != "omitted")
+            item1String = '"' + item1String + '"';
+        var message = item0String + ', ' + item1String + ': ' + hasFeature + ', ' + isSupported;
+
+        var div = document.createElement('div');
+        div.innerHTML = message;
+        document.body.appendChild(div);
+    }
+}
+
+</script>
+
+<body onload="test()">
+</body>
index f817346..a4a168d 100644 (file)
@@ -1,3 +1,55 @@
+2006-08-08  Rob Buis  <buis@kde.org>
+
+        Reviewed by Darin.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10230
+        SVGDOMImplementation should die (and be rolled into DOMImplementation)
+
+        Delete SVGDOMImplementation and references to it. The
+        svg specific functionality is now in DOMImplementation.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/DOMImplementation.cpp:
+        (WebCore::svgFeatureSet):
+        (WebCore::DOMImplementation::hasFeature):
+        (WebCore::DOMImplementation::createDocument):
+        (WebCore::DOMImplementation::createSVGDocument):
+        * dom/DOMImplementation.h:
+        * ksvg2/bindings/idl/svg/SVGDOMImplementation.idl: Removed.
+        * ksvg2/misc/KSVGTimeScheduler.cpp:
+        * ksvg2/svg/SVGColor.cpp:
+        * ksvg2/svg/SVGComponentTransferFunctionElement.cpp:
+        * ksvg2/svg/SVGDocument.cpp:
+        (WebCore::SVGDocument::SVGDocument):
+        * ksvg2/svg/SVGDocument.h:
+        * ksvg2/svg/SVGElement.cpp:
+        (WebCore::SVGElement::isSupported):
+        * ksvg2/svg/SVGFEBlendElement.cpp:
+        * ksvg2/svg/SVGFEColorMatrixElement.cpp:
+        * ksvg2/svg/SVGFEComponentTransferElement.cpp:
+        * ksvg2/svg/SVGFECompositeElement.cpp:
+        * ksvg2/svg/SVGFEDiffuseLightingElement.cpp:
+        * ksvg2/svg/SVGFEDisplacementMapElement.cpp:
+        * ksvg2/svg/SVGFEFloodElement.cpp:
+        * ksvg2/svg/SVGFEGaussianBlurElement.cpp:
+        * ksvg2/svg/SVGFELightElement.cpp:
+        * ksvg2/svg/SVGFEMergeElement.cpp:
+        * ksvg2/svg/SVGFEOffsetElement.cpp:
+        * ksvg2/svg/SVGFESpecularLightingElement.cpp:
+        * ksvg2/svg/SVGFETileElement.cpp:
+        * ksvg2/svg/SVGFETurbulenceElement.cpp:
+        * ksvg2/svg/SVGGradientElement.cpp:
+        * ksvg2/svg/SVGPatternElement.cpp:
+        * ksvg2/svg/SVGPolyElement.cpp:
+        * ksvg2/svg/SVGStopElement.cpp:
+        * ksvg2/svg/SVGStyledElement.cpp:
+        * ksvg2/svg/SVGStyledTransformableElement.cpp:
+        * ksvg2/svg/SVGTests.cpp:
+        (WebCore::SVGTests::isValid):
+        * ksvg2/svg/SVGTransformable.cpp:
+        * page/Frame.cpp:
+        (WebCore::Frame::begin):
+
 2006-08-07  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Anders and John
index 8165bce..989baf2 100644 (file)
                A88AD44A095248F0001DD196 /* SVGDescElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F836089701F300BA5114 /* SVGDescElement.h */; };
                A88AD44B095248F0001DD196 /* SVGDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F837089701F300BA5114 /* SVGDocument.cpp */; };
                A88AD44C095248F0001DD196 /* SVGDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F838089701F300BA5114 /* SVGDocument.h */; };
-               A88AD44D095248F0001DD196 /* SVGDOMImplementation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F839089701F300BA5114 /* SVGDOMImplementation.cpp */; };
-               A88AD44E095248F0001DD196 /* SVGDOMImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F83A089701F300BA5114 /* SVGDOMImplementation.h */; };
                A88AD44F095248F0001DD196 /* SVGElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F83B089701F300BA5114 /* SVGElement.cpp */; };
                A88AD450095248F0001DD196 /* SVGElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F83C089701F300BA5114 /* SVGElement.h */; };
                A88AD452095248F0001DD196 /* SVGElementInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F83E089701F300BA5114 /* SVGElementInstance.h */; };
                A8C0F836089701F300BA5114 /* SVGDescElement.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGDescElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0F837089701F300BA5114 /* SVGDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGDocument.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0F838089701F300BA5114 /* SVGDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGDocument.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0F839089701F300BA5114 /* SVGDOMImplementation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGDOMImplementation.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0F83A089701F300BA5114 /* SVGDOMImplementation.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGDOMImplementation.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0F83B089701F300BA5114 /* SVGElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGElement.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0F83C089701F300BA5114 /* SVGElement.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0F83D089701F300BA5114 /* SVGElementInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGElementInstance.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                A8C0F837089701F300BA5114 /* SVGDocument.cpp */,
                                A8C0F838089701F300BA5114 /* SVGDocument.h */,
                                A833B9930A2B77D500D57664 /* SVGDocument.idl */,
-                               A8C0F839089701F300BA5114 /* SVGDOMImplementation.cpp */,
-                               A8C0F83A089701F300BA5114 /* SVGDOMImplementation.h */,
                                A8C0F83B089701F300BA5114 /* SVGElement.cpp */,
                                A8C0F83C089701F300BA5114 /* SVGElement.h */,
                                A833C5E70A2CCBA400D57664 /* SVGElement.idl */,
                                A88AD448095248F0001DD196 /* SVGDefsElement.h in Headers */,
                                A88AD44A095248F0001DD196 /* SVGDescElement.h in Headers */,
                                A88AD44C095248F0001DD196 /* SVGDocument.h in Headers */,
-                               A88AD44E095248F0001DD196 /* SVGDOMImplementation.h in Headers */,
                                A88AD450095248F0001DD196 /* SVGElement.h in Headers */,
                                A88AD452095248F0001DD196 /* SVGElementInstance.h in Headers */,
                                A88AD454095248F0001DD196 /* SVGElementInstanceList.h in Headers */,
                                A88AD447095248F0001DD196 /* SVGDefsElement.cpp in Sources */,
                                A88AD449095248F0001DD196 /* SVGDescElement.cpp in Sources */,
                                A88AD44B095248F0001DD196 /* SVGDocument.cpp in Sources */,
-                               A88AD44D095248F0001DD196 /* SVGDOMImplementation.cpp in Sources */,
                                A88AD44F095248F0001DD196 /* SVGElement.cpp in Sources */,
                                A88AD455095248F0001DD196 /* SVGEllipseElement.cpp in Sources */,
                                A88AD457095248F0001DD196 /* SVGExternalResourcesRequired.cpp in Sources */,
index 77a2283..07c50aa 100644 (file)
 #include "RegularExpression.h"
 #include "TextDocument.h"
 
+#ifdef SVG_SUPPORT
+#include "SVGNames.h"
+#include "SVGDocument.h"
+#endif
+
 namespace WebCore {
 
 // FIXME: An implementation of this is still waiting for me to understand the distinction between
@@ -46,6 +51,95 @@ static bool qualifiedNameIsMalformed(const String&)
     return false;
 }
 
+#ifdef SVG_SUPPORT
+
+#define SVGFEATURE2(name, value) AtomicString SVGFEATURE_##name(#value); \
+                            svgFeatures.add(SVGFEATURE_##name.impl());
+#define SVGFEATURE(feature) AtomicString SVGFEATURE_##feature(#feature); \
+                            svgFeatures.add(SVGFEATURE_##feature.impl());
+
+bool isSVG10Feature(const String &feature)
+{
+    static bool initialized = false;
+    static HashSet<StringImpl*, CaseInsensitiveHash> svgFeatures;
+    if (!initialized) {
+        // TODO: features need to be uncommented when we implement them
+        // 1.0 features
+        SVGFEATURE2(SVG, svg)
+        SVGFEATURE2(SVG_STATIC, svg.static)
+//      SVGFEATURE2(SVG_ANIMATION, svg.animation)
+//      SVGFEATURE2(SVG_DYNAMIC, svg.dynamic)
+//      SVGFEATURE2(DOM_SVG_ANIMATION, svg.dom.animation)
+//      SVGFEATURE2(DOM_SVG_DYNAMIC, svg.dom.dynamic)
+        SVGFEATURE2(DOM, dom)
+        SVGFEATURE2(DOM_SVG, dom.svg)
+        SVGFEATURE2(DOM_SVG_STATIC, dom.svg.static)
+//      SVGFEATURE2(SVG_ALL, svg.all)
+//      SVGFEATURE2(DOM_SVG_ALL, dom.svg.all)
+        initialized = true;
+    }
+    return svgFeatures.contains(feature.impl());
+}
+
+bool isSVG11Feature(const String &feature)
+{
+    static bool initialized = false;
+    static HashSet<StringImpl*, CaseInsensitiveHash> svgFeatures;
+    if (!initialized) {
+        // TODO: features need to be uncommented when we implement them
+        // 1.1 features
+        SVGFEATURE(SVG)
+        SVGFEATURE(SVGDOM)
+        SVGFEATURE2(SVG_STATIC, SVG-static)
+        SVGFEATURE2(SVGDOM_STATIC, SVGDOM-static)
+//      SVGFEATURE2(SVG_ANIMATION, SVG-animation)
+//      SVGFEATURE2(SVGDOM_ANIMATION, SVGDOM-animation)
+//      SVGFEATURE2(SVG_DYNAMIC, SVG-dynamic)
+//      SVGFEATURE2(SVGDOM_DYNAMIC, SVGDOM-dynamic)
+        SVGFEATURE(CoreAttribute)
+        SVGFEATURE(Structure)
+        SVGFEATURE(BasicStructure)
+        SVGFEATURE(ContainerAttribute)
+        SVGFEATURE(ConditionalProcessing)
+        SVGFEATURE(Image)
+        SVGFEATURE(Style)
+        SVGFEATURE(ViewportAttribute)
+        SVGFEATURE(Shape)
+//      SVGFEATURE(Text)
+//      SVGFEATURE(BasicText)
+        SVGFEATURE(PaintAttribute)
+        SVGFEATURE(BasicPaintAttribute)
+        SVGFEATURE(OpacityAttribute)
+        SVGFEATURE(GraphicsAttribute)
+        SVGFEATURE(BaseGraphicsAttribute)
+        SVGFEATURE(Marker)
+//      SVGFEATURE(ColorProfile)
+        SVGFEATURE(Gradient)
+        SVGFEATURE(Pattern)
+        SVGFEATURE(Clip)
+        SVGFEATURE(BasicClip)
+        SVGFEATURE(Mask)
+//      SVGFEATURE(Filter)
+//      SVGFEATURE(BasicFilter)
+        SVGFEATURE(DocumentEventsAttribute)
+        SVGFEATURE(GraphicalEventsAttribute)
+        SVGFEATURE(AnimationEventsAttribute)
+//      SVGFEATURE(Cursor)
+        SVGFEATURE(Hyperlinking)
+        SVGFEATURE(XlinkAttribute)
+//      SVGFEATURE(ExternalResourcesRequired)
+//      SVGFEATURE(View)
+        SVGFEATURE(Script)
+//      SVGFEATURE(Animation)
+//      SVGFEATURE(Font)
+//      SVGFEATURE(BasicFont)
+        SVGFEATURE(Extensibility)
+        initialized = true;
+    }
+    return svgFeatures.contains(feature.impl());
+}
+#endif
+
 DOMImplementation::~DOMImplementation()
 {
 }
@@ -69,6 +163,18 @@ bool DOMImplementation::hasFeature (const String& feature, const String& version
         return version.isEmpty() || version == "2.0";
     if (lower == "xpath")
         return version.isEmpty() || version == "3.0";
+
+#ifdef SVG_SUPPORT
+    if ((version.isEmpty() || version == "1.1") && feature.startsWith("http://www.w3.org/tr/svg11/feature#", false)) {
+        if (isSVG11Feature(feature.right(feature.length() - 35)))
+            return true;
+    }
+
+    if ((version.isEmpty() || version == "1.0") && feature.startsWith("org.w3c.", false)) {
+        if (isSVG10Feature(feature.right(feature.length() - 8)))
+            return true;
+    }
+#endif
     
     return false;
 }
@@ -132,6 +238,9 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& namespaceUR
         if (qualifiedNameIsMalformed(qualifiedName) ||
             (colonpos >= 0 && namespaceURI.isNull()) ||
             (colonpos == 3 && qualifiedName[0] == 'x' && qualifiedName[1] == 'm' && qualifiedName[2] == 'l' &&
+#ifdef SVG_SUPPORT
+             namespaceURI != SVGNames::svgNamespaceURI &&
+#endif
              namespaceURI != "http://www.w3.org/XML/1998/namespace")) {
 
             ec = NAMESPACE_ERR;
@@ -146,7 +255,13 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& namespaceUR
         return 0;
     }
 
-    RefPtr<Document> doc = new Document(this, 0);
+    RefPtr<Document> doc;
+#ifdef SVG_SUPPORT
+    if (namespaceURI == SVGNames::svgNamespaceURI)
+        doc = new SVGDocument(this, 0);
+    else
+#endif
+        doc = new Document(this, 0);
 
     // now get the interesting parts of the doctype
     if (doctype)
@@ -214,4 +329,11 @@ PassRefPtr<HTMLDocument> DOMImplementation::createHTMLDocument(const String& tit
     return d.release();
 }
 
+#ifdef SVG_SUPPORT
+PassRefPtr<SVGDocument> DOMImplementation::createSVGDocument(FrameView* v)
+{
+    return new SVGDocument(this, v);
+}
+#endif
+
 }
index d645741..10a2bbc 100644 (file)
@@ -36,6 +36,9 @@ class Document;
 class DocumentType;
 class FrameView;
 class HTMLDocument;
+#ifdef SVG_SUPPORT
+class SVGDocument;
+#endif
 class String;
 class TextDocument;
 
@@ -61,6 +64,9 @@ public:
     // Other methods (not part of DOM)
     PassRefPtr<Document> createDocument(FrameView* = 0);
     PassRefPtr<HTMLDocument> createHTMLDocument(FrameView* = 0);
+#ifdef SVG_SUPPORT
+    PassRefPtr<SVGDocument> createSVGDocument(FrameView* = 0);
+#endif
 
     // Returns the static instance of this class - only one instance of this class should
     // ever be present, and is used as a factory method for creating Document objects
diff --git a/WebCore/ksvg2/bindings/idl/svg/SVGDOMImplementation.idl b/WebCore/ksvg2/bindings/idl/svg/SVGDOMImplementation.idl
deleted file mode 100644 (file)
index c574e9a..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-module svg
-{
-       interface [nodptr, Conditional=SVG] SVGDOMImplementation : core::DOMImplementation {
-               boolean hasFeature(in core::DOMString feature,
-                                                  in core::DOMString version);
-
-               // Introduced in DOM Level 2:
-               core::DocumentType createDocumentType(in core::DOMString qualifiedName,
-                                                                               in core::DOMString publicId,
-                                                                               in core::DOMString systemId)
-                                                                               raises(core::DOMException);
-
-               // Introduced in DOM Level 2:
-               core::Document createDocument(in core::DOMString namespaceURI,
-                                                               in core::DOMString qualifiedName,
-                                                               in core::DocumentType doctype)
-                                                               raises(core::DOMException);
-
-               // Introduced in DOM Level 2: [specified in seperated DOMImplementationCSS]
-               css::CSSStyleSheet createCSSStyleSheet(in core::DOMString title,
-                                                                                 in core::DOMString media) raises(core::DOMException);
-       };
-};
index dcdb490..6aa033f 100644 (file)
@@ -25,7 +25,6 @@
 #include "SVGColor.h"
 
 #include "DeprecatedStringList.h"
-#include "SVGDOMImplementation.h"
 #include "ksvg.h"
 
 namespace WebCore {
index bcec8bc..7a28125 100644 (file)
@@ -34,7 +34,6 @@
 #include "SVGAnimatedNumber.h"
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedNumberList.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index 01087b5..1c8c9a3 100644 (file)
 
 #include "EventNames.h"
 #include "ExceptionCode.h"
-#include "SVGDOMImplementation.h"
 #include "SVGElement.h"
 #include "SVGSVGElement.h"
 #include "SVGZoomEvent.h"
 
 namespace WebCore {
 
-SVGDocument::SVGDocument(SVGDOMImplementation *i, FrameView *view) : Document(i, view)
+SVGDocument::SVGDocument(DOMImplementation *i, FrameView *view) : Document(i, view)
 {
 }
 
index c649dff..4be0047 100644 (file)
@@ -30,11 +30,11 @@ namespace WebCore {
 
     class SVGElement;
     class SVGSVGElement;
-    class SVGDOMImplementation;
+    class DOMImplementation;
 
     class SVGDocument : public Document {
     public:
-        SVGDocument(SVGDOMImplementation *i, FrameView *view);
+        SVGDocument(DOMImplementation *i, FrameView *view);
         virtual ~SVGDocument();
         
         virtual bool isSVGDocument() const { return true; }
index 59ca439..40940ad 100644 (file)
 
 #include "Attr.h"
 #include "Document.h"
+#include "DOMImplementation.h"
 #include "EventListener.h"
 #include "EventNames.h"
 #include "HTMLNames.h"
 #include "PlatformString.h"
-#include "SVGDOMImplementation.h"
 #include "SVGDocumentExtensions.h"
 #include "SVGNames.h"
 #include "SVGSVGElement.h"
@@ -54,7 +54,7 @@ SVGElement::~SVGElement()
 
 bool SVGElement::isSupported(StringImpl* feature, StringImpl* version) const
 {
-    if (SVGDOMImplementation::instance()->hasFeature(feature, version))
+    if (DOMImplementation::instance()->hasFeature(feature, version))
         return true;
 
     return DOMImplementation::instance()->hasFeature(feature, version);
index 5c8185d..01eeb58 100644 (file)
@@ -35,7 +35,6 @@
 #include "SVGFEBlendElement.h"
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedString.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index ea348f4..6031062 100644 (file)
@@ -39,7 +39,6 @@
 #include "SVGAnimatedString.h"
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedNumberList.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index 7dbb3bf..dd1bdca 100644 (file)
@@ -41,7 +41,6 @@
 #include "SVGAnimatedString.h"
 #include "SVGAnimatedNumber.h"
 #include "SVGAnimatedEnumeration.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index f21ebc7..674e770 100644 (file)
@@ -39,7 +39,6 @@
 #include "SVGAnimatedNumber.h"
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedString.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index fa8bbd8..e65d5ee 100644 (file)
@@ -34,7 +34,6 @@
 #include "SVGAnimatedNumber.h"
 #include "SVGAnimatedString.h"
 #include "SVGFELightElement.h"
-#include "SVGDOMImplementation.h"
 #include "SVGFEDiffuseLightingElement.h"
 
 namespace WebCore {
index cd405ab..4b52958 100644 (file)
@@ -34,7 +34,6 @@
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedString.h"
 #include "SVGAnimatedNumber.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index 934a479..cd143d3 100644 (file)
@@ -28,7 +28,6 @@
 #include "DeprecatedStringList.h"
 #include "RenderView.h"
 #include "SVGAnimatedString.h"
-#include "SVGDOMImplementation.h"
 #include "SVGHelper.h"
 #include "SVGNames.h"
 #include "SVGRenderStyle.h"
index 63af76b..9f6ab1e 100644 (file)
@@ -37,7 +37,6 @@
 #include "SVGFEGaussianBlurElement.h"
 #include "SVGAnimatedNumber.h"
 #include "SVGAnimatedString.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index 17c142c..e6f2fa6 100644 (file)
@@ -36,7 +36,6 @@
 #include "SVGAnimatedString.h"
 #include "SVGAnimatedNumber.h"
 #include "SVGAnimatedEnumeration.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index 75ba05d..0f53113 100644 (file)
@@ -36,7 +36,6 @@
 #include "SVGFEMergeNodeElement.h"
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedString.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index 4858d72..db1888f 100644 (file)
@@ -36,7 +36,6 @@
 #include "SVGFEOffsetElement.h"
 #include "SVGAnimatedNumber.h"
 #include "SVGAnimatedString.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index 7699512..5bddf89 100644 (file)
@@ -35,7 +35,6 @@
 #include "SVGAnimatedNumber.h"
 #include "SVGAnimatedString.h"
 #include "SVGFELightElement.h"
-#include "SVGDOMImplementation.h"
 #include "SVGFESpecularLightingElement.h"
 
 
index 9167a21..a4347fc 100644 (file)
@@ -33,7 +33,6 @@
 #include "SVGRenderStyle.h"
 #include "SVGFETileElement.h"
 #include "SVGAnimatedString.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index e5b5a50..f27c3bd 100644 (file)
@@ -38,7 +38,6 @@
 #include "SVGAnimatedNumber.h"
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedInteger.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index 0fe264b..a3ac51e 100644 (file)
@@ -30,7 +30,6 @@
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedNumber.h"
 #include "SVGAnimatedTransformList.h"
-#include "SVGDOMImplementation.h"
 #include "SVGHelper.h"
 #include "SVGNames.h"
 #include "SVGRenderStyle.h"
index 2cd01a3..0e73d27 100644 (file)
@@ -38,7 +38,6 @@
 #include "SVGAnimatedLength.h"
 #include "SVGAnimatedString.h"
 #include "SVGAnimatedTransformList.h"
-#include "SVGDOMImplementation.h"
 #include "SVGHelper.h"
 #include "SVGMatrix.h"
 #include "SVGNames.h"
index 51a3af6..cd5fa3b 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "Attr.h"
 #include "Document.h"
-#include "SVGDOMImplementation.h"
 #include "SVGHelper.h"
 #include "SVGNames.h"
 #include "SVGPointList.h"
index 50e0839..ea670e0 100644 (file)
@@ -32,7 +32,6 @@
 #include "SVGRenderStyle.h"
 #include "SVGStopElement.h"
 #include "SVGAnimatedNumber.h"
-#include "SVGDOMImplementation.h"
 
 using namespace WebCore;
 
index 5d100bb..a14588c 100644 (file)
@@ -33,7 +33,6 @@
 #include "RenderView.h"
 #include "RenderPath.h"
 #include "SVGAnimatedString.h"
-#include "SVGDOMImplementation.h"
 #include "SVGElement.h"
 #include "SVGHelper.h"
 #include "SVGMatrix.h"
index 7d97430..12ead2f 100644 (file)
@@ -34,7 +34,6 @@
 #include "SVGDocument.h"
 #include "SVGStyledTransformableElement.h"
 #include "SVGStyledElement.h"
-#include "SVGDOMImplementation.h"
 #include "SVGAnimatedTransformList.h"
 
 using namespace WebCore;
index adefbc1..e5aa4bb 100644 (file)
 #include "SVGTests.h"
 
 #include "Language.h"
-#include "SVGDOMImplementation.h"
 #include "SVGElement.h"
 #include "SVGHelper.h"
 #include "SVGNames.h"
 #include "SVGStringList.h"
 #include "Attr.h"
+#include "DOMImplementation.h"
 
 namespace WebCore {
 
@@ -68,7 +68,7 @@ bool SVGTests::isValid() const
     for(unsigned long i = 0;i < list->numberOfItems();i++)
     {
         String value = String(list->getItem(i));
-        if(value.isEmpty() || !SVGDOMImplementation::instance()->hasFeature(value.impl(), 0))
+        if(value.isEmpty() || !DOMImplementation::instance()->hasFeature(value, String()))
             return false;
     }
 
index 2c44c1c..7248aa9 100644 (file)
@@ -35,7 +35,6 @@
 #include "SVGMatrix.h"
 #include "SVGTransformable.h"
 #include "SVGStyledElement.h"
-#include "SVGDOMImplementation.h"
 #include "SVGAnimatedTransformList.h"
 #include "ksvg.h"
 
index e7a22de..e93835e 100644 (file)
@@ -89,8 +89,8 @@
 #include "SVGNames.h"
 #include "XLinkNames.h"
 #include "XMLNames.h"
+#include "SVGDocument.h"
 #include "SVGDocumentExtensions.h"
-#include "SVGDOMImplementation.h"
 #endif
 
 using namespace std;
@@ -583,7 +583,7 @@ void Frame::begin(const KURL& url)
 
 #if SVG_SUPPORT
   if (d->m_request.m_responseMIMEType == "image/svg+xml")
-    d->m_doc = SVGDOMImplementation::instance()->createDocument(d->m_view.get());
+    d->m_doc = DOMImplementation::instance()->createSVGDocument(d->m_view.get());
   else
 #endif
   if (DOMImplementation::isXMLMIMEType(d->m_request.m_responseMIMEType))