Reviewed by Eric.
authorrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Aug 2006 22:45:36 +0000 (22:45 +0000)
committerrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Aug 2006 22:45:36 +0000 (22:45 +0000)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=10558
        SVG should have support for <metadata> element

        Add support for metadata tag.

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

13 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/custom/create-metadata-element-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/create-metadata-element-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/create-metadata-element-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/create-metadata-element.svg [new file with mode: 0644]
WebCore/ChangeLog
WebCore/DerivedSources.make
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/ksvg2/bindings/js/JSSVGElementWrapperFactory.cpp
WebCore/ksvg2/svg/SVGMetadataElement.cpp [new file with mode: 0644]
WebCore/ksvg2/svg/SVGMetadataElement.h [new file with mode: 0644]
WebCore/ksvg2/svg/SVGMetadataElement.idl [new file with mode: 0644]
WebCore/ksvg2/svg/svgtags.in

index b5986cf..078788a 100644 (file)
@@ -1,3 +1,16 @@
+2006-08-27  Rob Buis  <buis@kde.org>
+
+        Reviewed by Eric.
+
+        Testcase for:
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10558
+        SVG should have support for <metadata> element
+
+        * svg/custom/create-metadata-element-expected.checksum: Added.
+        * svg/custom/create-metadata-element-expected.png: Added.
+        * svg/custom/create-metadata-element-expected.txt: Added.
+        * svg/custom/create-metadata-element.svg: Added.
+
 2006-08-25  Adele Peterson  <adele@apple.com>
 
         Updated results for addition of -webkit-text-security.
diff --git a/LayoutTests/svg/custom/create-metadata-element-expected.checksum b/LayoutTests/svg/custom/create-metadata-element-expected.checksum
new file mode 100644 (file)
index 0000000..049ddb6
--- /dev/null
@@ -0,0 +1 @@
+16310588467cfc20d551635abc59b784
diff --git a/LayoutTests/svg/custom/create-metadata-element-expected.png b/LayoutTests/svg/custom/create-metadata-element-expected.png
new file mode 100644 (file)
index 0000000..3db2634
Binary files /dev/null and b/LayoutTests/svg/custom/create-metadata-element-expected.png differ
diff --git a/LayoutTests/svg/custom/create-metadata-element-expected.txt b/LayoutTests/svg/custom/create-metadata-element-expected.txt
new file mode 100644 (file)
index 0000000..f139a27
--- /dev/null
@@ -0,0 +1,4 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    KCanvasContainer {svg} at (0,0) size 100x100
+      KCanvasItem {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
diff --git a/LayoutTests/svg/custom/create-metadata-element.svg b/LayoutTests/svg/custom/create-metadata-element.svg
new file mode 100644 (file)
index 0000000..c89905e
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
+<svg version="1.1" baseProfile="basic" id="svg-root" width="100%" height="100%"
+     xmlns:xlink="http://www.w3.org/1999/xlink"
+     xmlns="http://www.w3.org/2000/svg" onload="myfunc()">
+     <script>
+         function myfunc() {
+             var meta = document.createElementNS("http://www.w3.org/2000/svg", "metadata");
+             if([meta] == "[object SVGMetadataElement]") {
+                 document.getElementById("rect").setAttributeNS(null, "display", "visible");}
+         }
+     </script>
+     <rect id="rect" width="100" height="100" fill="green" display="none"/>
+</svg>
index e9ae238..9e4e546 100644 (file)
@@ -1,3 +1,22 @@
+2006-08-27  Rob Buis  <buis@kde.org>
+
+        Reviewed by Eric.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10558
+        SVG should have support for <metadata> element
+
+        Add support for metadata tag.
+
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * ksvg2/bindings/js/JSSVGElementWrapperFactory.cpp:
+        * ksvg2/svg/SVGMetadataElement.cpp: Added.
+        (SVGMetadataElement::SVGMetadataElement):
+        (SVGMetadataElement::~SVGMetadataElement):
+        * ksvg2/svg/SVGMetadataElement.h: Added.
+        * ksvg2/svg/SVGMetadataElement.idl: Added.
+        * ksvg2/svg/svgtags.in:
+
 2006-08-26  Nikolas Zimmermann  <zimmermann@kde.org>
 
         Reviewed by Eric.
index 31a738d..209b789 100644 (file)
@@ -130,6 +130,7 @@ all : \
     JSSVGElement.h \
     JSSVGLength.h \
     JSSVGMatrix.h \
+    JSSVGMetadataElement.h \
     JSSVGPointTable.cpp \
     JSSVGRectTable.cpp \
     JSSVGSVGElement.h \
index 78c515c..bed6d58 100644 (file)
                A8FEFB0B0979F472005839FD /* RenderForeignObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8FEFB090979F472005839FD /* RenderForeignObject.cpp */; };
                A8FEFB310979F4F6005839FD /* SVGForeignObjectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8FEFB2F0979F4F6005839FD /* SVGForeignObjectElement.cpp */; };
                A8FEFB320979F4F6005839FD /* SVGForeignObjectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FEFB300979F4F6005839FD /* SVGForeignObjectElement.h */; };
+               AA84FC850AA0FE08007699AF /* JSSVGMetadataElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA84FC830AA0FE08007699AF /* JSSVGMetadataElement.cpp */; };
+               AA84FC860AA0FE08007699AF /* JSSVGMetadataElement.h in Headers */ = {isa = PBXBuildFile; fileRef = AA84FC840AA0FE08007699AF /* JSSVGMetadataElement.h */; };
+               AAC8DAB10AA1002000DC0907 /* SVGMetadataElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAC8DAAF0AA1002000DC0907 /* SVGMetadataElement.cpp */; };
+               AAC8DAB20AA1002000DC0907 /* SVGMetadataElement.h in Headers */ = {isa = PBXBuildFile; fileRef = AAC8DAB00AA1002000DC0907 /* SVGMetadataElement.h */; };
                AB23A31209BBA7760067CC53 /* HTMLTextFieldInnerElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB23A31009BBA7760067CC53 /* HTMLTextFieldInnerElement.cpp */; };
                AB23A31309BBA7760067CC53 /* HTMLTextFieldInnerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = AB23A31109BBA7760067CC53 /* HTMLTextFieldInnerElement.h */; };
                AB23A32709BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */; };
                FAE04190097596C9000540BE /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE0418E097596C9000540BE /* SVGImageLoader.h */; };
 /* End PBXBuildFile section */
 
-/* Begin PBXBuildStyle section */
-               BC57BF170AA0243000A43CF1 /* Development */ = {
-                       isa = PBXBuildStyle;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = NO;
-                       };
-                       name = Development;
-               };
-               BC57BF180AA0243000A43CF1 /* Deployment */ = {
-                       isa = PBXBuildStyle;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                       };
-                       name = Deployment;
-               };
-/* End PBXBuildStyle section */
-
 /* Begin PBXContainerItemProxy section */
                DD041FF009D9E3250010AF2A /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                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>"; };
                A8FEFB300979F4F6005839FD /* SVGForeignObjectElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGForeignObjectElement.h; sourceTree = "<group>"; };
+               AA84FC830AA0FE08007699AF /* JSSVGMetadataElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGMetadataElement.cpp; sourceTree = "<group>"; };
+               AA84FC840AA0FE08007699AF /* JSSVGMetadataElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGMetadataElement.h; sourceTree = "<group>"; };
+               AAC8DAAF0AA1002000DC0907 /* SVGMetadataElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGMetadataElement.cpp; sourceTree = "<group>"; };
+               AAC8DAB00AA1002000DC0907 /* SVGMetadataElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGMetadataElement.h; sourceTree = "<group>"; };
                AB23A31009BBA7760067CC53 /* HTMLTextFieldInnerElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTextFieldInnerElement.cpp; sourceTree = "<group>"; };
                AB23A31109BBA7760067CC53 /* HTMLTextFieldInnerElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLTextFieldInnerElement.h; sourceTree = "<group>"; };
                AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BeforeTextInsertedEvent.cpp; sourceTree = "<group>"; };
                14DFB33F0A7DF7630018F769 /* Derived Sources */ = {
                        isa = PBXGroup;
                        children = (
+                               AA84FC830AA0FE08007699AF /* JSSVGMetadataElement.cpp */,
+                               AA84FC840AA0FE08007699AF /* JSSVGMetadataElement.h */,
                                65DF31D809D1C122000BE325 /* JSAttr.cpp */,
                                65DF31D909D1C123000BE325 /* JSAttr.h */,
                                65DF323309D1DE65000BE325 /* JSCanvasGradient.cpp */,
                A8C0F7FC089701F300BA5114 /* svg */ = {
                        isa = PBXGroup;
                        children = (
+                               AAC8DAAF0AA1002000DC0907 /* SVGMetadataElement.cpp */,
+                               AAC8DAB00AA1002000DC0907 /* SVGMetadataElement.h */,
                                A884283D09308C1C00B6D461 /* DOMList.h */,
                                A8C0F7FF089701F300BA5114 /* SVGAElement.cpp */,
                                A8C0F800089701F300BA5114 /* SVGAElement.h */,
                                657429190A9C2D0B00C52C97 /* SQLTransaction.h in Headers */,
                                BC837C7C0A9D0D1A006B186A /* PDFDocumentImage.h in Headers */,
                                BC837CB60A9D10FE006B186A /* GraphicsContextPlatformPrivate.h in Headers */,
+                               AA84FC860AA0FE08007699AF /* JSSVGMetadataElement.h in Headers */,
+                               AAC8DAB20AA1002000DC0907 /* SVGMetadataElement.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
-                       buildSettings = {
-                       };
-                       buildStyles = (
-                               BC57BF170AA0243000A43CF1 /* Development */,
-                               BC57BF180AA0243000A43CF1 /* Deployment */,
-                       );
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                                BC837C790A9D0D1A006B186A /* IntRectCG.cpp in Sources */,
                                BC837C7A0A9D0D1A006B186A /* IntSizeCG.cpp in Sources */,
                                BC837C7B0A9D0D1A006B186A /* PDFDocumentImage.cpp in Sources */,
+                               AA84FC850AA0FE08007699AF /* JSSVGMetadataElement.cpp in Sources */,
+                               AAC8DAB10AA1002000DC0907 /* SVGMetadataElement.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index be8a244..036550c 100644 (file)
 #include "JSSVGElementWrapperFactory.h"
 
 #include "JSSVGSVGElement.h"
+#include "JSSVGMetadataElement.h"
 
 #include "SVGNames.h"
 
 #include "SVGSVGElement.h"
+#include "SVGMetadataElement.h"
 
 using namespace KJS;
 
@@ -40,6 +42,7 @@ typedef DOMNode* (*CreateSVGElementWrapperFunction)(ExecState*, PassRefPtr<SVGEl
 
 #define FOR_EACH_TAG(macro) \
     macro(svg, SVG) \
+    macro(metadata, Metadata) \
     // end of macro
 
 #define CREATE_WRAPPER_FUNCTION(tag, name) \
diff --git a/WebCore/ksvg2/svg/SVGMetadataElement.cpp b/WebCore/ksvg2/svg/SVGMetadataElement.cpp
new file mode 100644 (file)
index 0000000..d4298cb
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
+                  2004, 2005 Rob Buis <buis@kde.org>
+
+    This file is part of the KDE project
+
+    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"
+#ifdef SVG_SUPPORT
+#include "SVGMetadataElement.h"
+
+using namespace WebCore;
+
+SVGMetadataElement::SVGMetadataElement(const QualifiedName& tagName, Document *doc)
+: SVGElement(tagName, doc)
+{
+}
+
+SVGMetadataElement::~SVGMetadataElement()
+{
+}
+
+#endif // SVG_SUPPORT
diff --git a/WebCore/ksvg2/svg/SVGMetadataElement.h b/WebCore/ksvg2/svg/SVGMetadataElement.h
new file mode 100644 (file)
index 0000000..4b1f3f8
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
+                  2004, 2005 Rob Buis <buis@kde.org>
+
+    This file is part of the KDE project
+
+    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 KSVG_SVGMetadataElementImpl_H
+#define KSVG_SVGMetadataElementImpl_H
+#ifdef SVG_SUPPORT
+
+#include "SVGElement.h"
+
+namespace WebCore
+{
+    class SVGMetadataElement : public SVGElement
+    {
+    public:
+        SVGMetadataElement(const QualifiedName&, Document*);
+        virtual ~SVGMetadataElement();
+    };
+
+} // namespace WebCore
+
+#endif // SVG_SUPPORT
+#endif
+
+// vim:ts=4:noet
diff --git a/WebCore/ksvg2/svg/SVGMetadataElement.idl b/WebCore/ksvg2/svg/SVGMetadataElement.idl
new file mode 100644 (file)
index 0000000..5c69028
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
+                  2004, 2005 Rob Buis <buis@kde.org>
+    Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+
+    This file is part of the KDE project
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+    Boston, MA 02111-1307, USA.
+*/
+
+module svg
+{
+    interface [Conditional=SVG] SVGMetadataElement : 
+                SVGElement {
+    };
+};
index 77fde8d..74f2f7e 100644 (file)
@@ -55,7 +55,7 @@ line
 linearGradient
 marker
 mask
-#metadata
+metadata
 #missing_glyph
 #mpath
 path