[webkit-changes] cvs commit: SVGSupport/ksvg2/svg
SVGLocatableImpl.cpp SVGURIReferenceImpl.cpp svgattrs.in svgtags.in
Eric
eseidel at opensource.apple.com
Wed Nov 30 03:49:42 PST 2005
eseidel 05/11/30 03:49:41
Modified: . ChangeLog
WebCore.xcodeproj project.pbxproj
khtml khtml_part.cpp
khtml/xml dom_elementimpl.cpp
ksvg2/scripts make_names.pl
ksvg2/svg SVGLocatableImpl.cpp SVGURIReferenceImpl.cpp
svgattrs.in svgtags.in
Added: WebCore+SVG XLinkNamesWrapper.cpp
ksvg2/misc xlinkattrs.in
Log:
Bug #: 5887
Submitted by: eseidel
Reviewed by: mjs
No functionality change, no tests needed.
Make make_names.pl namespace agnostic and add XLinkNames.* for SVG
* WebCore+SVG/XLinkNamesWrapper.cpp: Added.
* WebCore.xcodeproj/project.pbxproj: added files, build rule.
* khtml/khtml_part.cpp:
(KHTMLPart::init): init XLinkNames
* khtml/xml/dom_elementimpl.cpp:
(ElementImpl::rendererIsNeeded): remove foreignObjectTag (temp.)
* ksvg2/misc/xlinkattrs.in: Added.
* ksvg2/scripts/make_names.pl: make namespace agnostic
* ksvg2/svg/SVGLocatableImpl.cpp: remove foreignObjectTag (temp.)
(SVGLocatableImpl::nearestViewportElement):
(SVGLocatableImpl::farthestViewportElement):
* ksvg2/svg/SVGURIReferenceImpl.cpp: use XLinkNames
(SVGURIReferenceImpl::parseMappedAttribute):
* ksvg2/svg/svgattrs.in: remove href
* ksvg2/svg/svgtags.in: comment out unused tags
Revision Changes Path
1.441 +24 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.440
retrieving revision 1.441
diff -u -r1.440 -r1.441
--- ChangeLog 30 Nov 2005 09:21:05 -0000 1.440
+++ ChangeLog 30 Nov 2005 11:49:30 -0000 1.441
@@ -1,3 +1,27 @@
+2005-11-30 Eric Seidel <eseidel at apple.com>
+
+ Reviewed by mjs.
+
+ No functionality change, no tests needed.
+
+ Make make_names.pl namespace agnostic and add XLinkNames.* for SVG
+
+ * WebCore+SVG/XLinkNamesWrapper.cpp: Added.
+ * WebCore.xcodeproj/project.pbxproj: added files, build rule.
+ * khtml/khtml_part.cpp:
+ (KHTMLPart::init): init XLinkNames
+ * khtml/xml/dom_elementimpl.cpp:
+ (ElementImpl::rendererIsNeeded): remove foreignObjectTag (temp.)
+ * ksvg2/misc/xlinkattrs.in: Added.
+ * ksvg2/scripts/make_names.pl: make namespace agnostic
+ * ksvg2/svg/SVGLocatableImpl.cpp: remove foreignObjectTag (temp.)
+ (SVGLocatableImpl::nearestViewportElement):
+ (SVGLocatableImpl::farthestViewportElement):
+ * ksvg2/svg/SVGURIReferenceImpl.cpp: use XLinkNames
+ (SVGURIReferenceImpl::parseMappedAttribute):
+ * ksvg2/svg/svgattrs.in: remove href
+ * ksvg2/svg/svgtags.in: comment out unused tags
+
2005-11-30 Rob Buis <rwlbuis at xs4all.nl>
Reviewed by eseidel.
1.1 SVGSupport/WebCore+SVG/XLinkNamesWrapper.cpp
Index: XLinkNamesWrapper.cpp
===================================================================
#include "XLinkNames.cpp"
1.48 +26 -5 WebCore/WebCore.xcodeproj/project.pbxproj
Index: project.pbxproj
===================================================================
RCS file: /cvs/root/WebCore/WebCore.xcodeproj/project.pbxproj,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- project.pbxproj 28 Nov 2005 23:33:55 -0000 1.47
+++ project.pbxproj 30 Nov 2005 11:49:35 -0000 1.48
@@ -1282,7 +1282,6 @@
A8C0FBB1089701F900BA5114 /* SVGRenderStyleDefs.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F702089701F100BA5114 /* SVGRenderStyleDefs.h */; };
A8C0FC9F089701F900BA5114 /* SVGZoomEventImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F7F5089701F300BA5114 /* SVGZoomEventImpl.cpp */; };
A8C0FCA0089701F900BA5114 /* SVGZoomEventImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F7F6089701F300BA5114 /* SVGZoomEventImpl.h */; };
- A8C0FCA1089701F900BA5114 /* ksvgevents.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F7F7089701F300BA5114 /* ksvgevents.h */; };
A8C0FCA8089701F900BA5114 /* SVGAElementImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F7FF089701F300BA5114 /* SVGAElementImpl.cpp */; };
A8C0FCA9089701F900BA5114 /* SVGAElementImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F800089701F300BA5114 /* SVGAElementImpl.h */; };
A8C0FCAA089701F900BA5114 /* SVGAngleImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F801089701F300BA5114 /* SVGAngleImpl.cpp */; };
@@ -1576,6 +1575,7 @@
A8C32971093BB7B2000B9CAC /* SVGFESpecularLightingElementImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C32965093BB7B2000B9CAC /* SVGFESpecularLightingElementImpl.cpp */; };
A8C32972093BB7B2000B9CAC /* SVGFEPointLightElementImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C32966093BB7B2000B9CAC /* SVGFEPointLightElementImpl.h */; };
A8C32973093BB7B2000B9CAC /* SVGFEPointLightElementImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C32967093BB7B2000B9CAC /* SVGFEPointLightElementImpl.cpp */; };
+ A8C32D97093D8EA4000B9CAC /* XLinkNamesWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C32D96093D8EA4000B9CAC /* XLinkNamesWrapper.cpp */; };
A8FD8B86087CB44C00DC3707 /* KWQWMatrix.mm in Sources */ = {isa = PBXBuildFile; fileRef = A85D7A8C0879EC64006A9172 /* KWQWMatrix.mm */; };
A8FD8B87087CB45700DC3707 /* KWQWMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = A85D7A8D0879EC64006A9172 /* KWQWMatrix.h */; };
BC179892088D975F006068A5 /* render_theme_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC17988F088D975F006068A5 /* render_theme_mac.mm */; };
@@ -2253,7 +2253,6 @@
A8C0F7F0089701F300BA5114 /* SVGLookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLookup.h; sourceTree = "<group>"; };
A8C0F7F5089701F300BA5114 /* SVGZoomEventImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGZoomEventImpl.cpp; sourceTree = "<group>"; };
A8C0F7F6089701F300BA5114 /* SVGZoomEventImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGZoomEventImpl.h; sourceTree = "<group>"; };
- A8C0F7F7089701F300BA5114 /* ksvgevents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ksvgevents.h; sourceTree = "<group>"; };
A8C0F7FF089701F300BA5114 /* SVGAElementImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAElementImpl.cpp; sourceTree = "<group>"; };
A8C0F800089701F300BA5114 /* SVGAElementImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAElementImpl.h; sourceTree = "<group>"; };
A8C0F801089701F300BA5114 /* SVGAngleImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAngleImpl.cpp; sourceTree = "<group>"; };
@@ -2569,6 +2568,8 @@
A8C32965093BB7B2000B9CAC /* SVGFESpecularLightingElementImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFESpecularLightingElementImpl.cpp; sourceTree = "<group>"; };
A8C32966093BB7B2000B9CAC /* SVGFEPointLightElementImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFEPointLightElementImpl.h; sourceTree = "<group>"; };
A8C32967093BB7B2000B9CAC /* SVGFEPointLightElementImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEPointLightElementImpl.cpp; sourceTree = "<group>"; };
+ A8C32D89093D8BFA000B9CAC /* xlinkattrs.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = xlinkattrs.in; sourceTree = "<group>"; };
+ A8C32D96093D8EA4000B9CAC /* XLinkNamesWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XLinkNamesWrapper.cpp; sourceTree = "<group>"; };
A8DC63EB08E0DD2A004507F7 /* EcmaInterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EcmaInterface.cpp; path = ksvg2/ecma/EcmaInterface.cpp; sourceTree = DERIVED_FILE_DIR; };
BC06F24906D18A7E004A6FA3 /* xsl_stylesheetimpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = xsl_stylesheetimpl.cpp; path = xsl/xsl_stylesheetimpl.cpp; sourceTree = "<group>"; };
BC06F24A06D18A7E004A6FA3 /* xsl_stylesheetimpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = xsl_stylesheetimpl.h; path = xsl/xsl_stylesheetimpl.h; sourceTree = "<group>"; };
@@ -3571,6 +3572,7 @@
A884284209308C1C00B6D461 /* KDOMStubClasses.h */,
A884284609308C1C00B6D461 /* KDOMHeaders.h */,
A884283809308C1C00B6D461 /* SVGNamesWrapper.cpp */,
+ A8C32D96093D8EA4000B9CAC /* XLinkNamesWrapper.cpp */,
A884283909308C1C00B6D461 /* SVGElementFactoryWrapper.cpp */,
A884283E09308C1C00B6D461 /* RGBColorImpl.h */,
A884283F09308C1C00B6D461 /* RGBColorImpl.cpp */,
@@ -3631,6 +3633,7 @@
A8C0F6EC089701F100BA5114 /* KCanvasRenderingStyle.h */,
A8C0F6EF089701F100BA5114 /* KSVGTimeScheduler.cpp */,
A8C0F6F0089701F100BA5114 /* KSVGTimeScheduler.h */,
+ A8C32D89093D8BFA000B9CAC /* xlinkattrs.in */,
);
path = misc;
sourceTree = "<group>";
@@ -3669,7 +3672,6 @@
A8C0F7F1089701F300BA5114 /* events */ = {
isa = PBXGroup;
children = (
- A8C0F7F7089701F300BA5114 /* ksvgevents.h */,
A8C0F7F5089701F300BA5114 /* SVGZoomEventImpl.cpp */,
A8C0F7F6089701F300BA5114 /* SVGZoomEventImpl.h */,
);
@@ -5498,7 +5500,6 @@
A8C0FBAF089701F900BA5114 /* SVGRenderStyle.h in Headers */,
A8C0FBB1089701F900BA5114 /* SVGRenderStyleDefs.h in Headers */,
A8C0FCA0089701F900BA5114 /* SVGZoomEventImpl.h in Headers */,
- A8C0FCA1089701F900BA5114 /* ksvgevents.h in Headers */,
A8C0FCA9089701F900BA5114 /* SVGAElementImpl.h in Headers */,
A8C0FCAB089701F900BA5114 /* SVGAngleImpl.h in Headers */,
A8C0FCAD089701F900BA5114 /* SVGAnimateColorElementImpl.h in Headers */,
@@ -5811,6 +5812,7 @@
A83C86850911AA9D009BF4A7 /* XSLTProcessor.lut.h */,
A8212A8508794A2300677359 /* domparser.lut.h */,
A890EA0A0931A92D00513F88 /* SVG Names & ElementFactory */,
+ A8C32DA8093D8F3F000B9CAC /* XLinkNames */,
A837AEF108B6991100EBFFDC /* ksvgcssproperties.c/h */,
A837AEF308B6992C00EBFFDC /* ksvgcssvalues.c/h */,
A8212A8608794A2300677359 /* Headers */,
@@ -6744,7 +6746,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "ksvg2/scripts/make_names.pl --tags ksvg2/svg/svgtags.in --attrs ksvg2/svg/svgattrs.in --output \"$DERIVED_FILE_DIR\"";
+ shellScript = "ksvg2/scripts/make_names.pl --tags ksvg2/svg/svgtags.in --attrs ksvg2/svg/svgattrs.in \\\n --namespace SVG --cppNamespace KSVG --namespaceURI \"http://www.w3.org/2000/svg\" \\\n --factory --attrsNullNamespace --output \"$DERIVED_FILE_DIR\"";
};
A8AA619B089CDABF00666825 /* WebCore+SVG.exp */ = {
isa = PBXShellScriptBuildPhase;
@@ -6763,6 +6765,24 @@
shellPath = /bin/sh;
shellScript = "if gcc -dumpversion | grep -q '^3\\.'\nthen\n cat WebCore.exp WebCore-svg.exp | grep -v '^__ZTI' > \"$DERIVED_FILE_DIR/WebCore+SVG.exp\"\nelse\n cat WebCore.exp WebCore-svg.exp > \"$DERIVED_FILE_DIR/WebCore+SVG.exp\"\nfi";
};
+ A8C32DA8093D8F3F000B9CAC /* XLinkNames */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(SRCROOT)/ksvg2/misc/xlinkattrs.in",
+ "$(SRCROOT)/ksvg2/scripts/make_names.pl",
+ );
+ name = XLinkNames;
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/XLinkNames.h",
+ "$(DERIVED_FILE_DIR)/XLinkNames.cpp",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "ksvg2/scripts/make_names.pl --attrs ksvg2/misc/xlinkattrs.in --namespace XLink --cppNamespace DOM --namespaceURI \"http://www.w3.org/1999/xlink\" --output \"$DERIVED_FILE_DIR\"";
+ };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -7466,6 +7486,7 @@
A8C3296F093BB7B2000B9CAC /* SVGFESpotLightElementImpl.cpp in Sources */,
A8C32971093BB7B2000B9CAC /* SVGFESpecularLightingElementImpl.cpp in Sources */,
A8C32973093BB7B2000B9CAC /* SVGFEPointLightElementImpl.cpp in Sources */,
+ A8C32D97093D8EA4000B9CAC /* XLinkNamesWrapper.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1.360 +2 -0 WebCore/khtml/khtml_part.cpp
Index: khtml_part.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtml_part.cpp,v
retrieving revision 1.359
retrieving revision 1.360
diff -u -r1.359 -r1.360
--- khtml_part.cpp 21 Nov 2005 04:01:51 -0000 1.359
+++ khtml_part.cpp 30 Nov 2005 11:49:38 -0000 1.360
@@ -60,6 +60,7 @@
#include "xml/xml_tokenizer.h"
#if SVG_SUPPORT
#include "SVGNames.h"
+#include "XLinkNames.h"
#endif
using namespace DOM;
@@ -200,6 +201,7 @@
HTMLNames::init(); // FIXME: We should make this happen only when HTML is used.
#if SVG_SUPPORT
KSVG::SVGNames::init();
+ XLinkNames::init();
#endif
if ( prof == DefaultGUI )
setXMLFile( "khtml.rc" );
1.94 +1 -1 WebCore/khtml/xml/dom_elementimpl.cpp
Index: dom_elementimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_elementimpl.cpp,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- dom_elementimpl.cpp 21 Nov 2005 04:01:58 -0000 1.93
+++ dom_elementimpl.cpp 30 Nov 2005 11:49:39 -0000 1.94
@@ -525,7 +525,7 @@
bool ElementImpl::rendererIsNeeded(khtml::RenderStyle *)
{
// SVG ignores arbitrary xml elements in its render tree contrary to the normal CSS/XML behavior.
- if ((KSVG::SVGNames::svgNamespaceURI == parentNode()->namespaceURI()) && !parentNode()->hasTagName(KSVG::SVGNames::foreignObjectTag))
+ if ((KSVG::SVGNames::svgNamespaceURI == parentNode()->namespaceURI())) // FIXME: && !parentNode()->hasTagName(KSVG::SVGNames::foreignObjectTag)
return false;
return true;
}
1.1 SVGSupport/ksvg2/misc/xlinkattrs.in
Index: xlinkattrs.in
===================================================================
actuate
arcrole
href
role
show
title
type
1.4 +155 -165 SVGSupport/ksvg2/scripts/make_names.pl
Index: make_names.pl
===================================================================
RCS file: /cvs/root/SVGSupport/ksvg2/scripts/make_names.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- make_names.pl 28 Nov 2005 23:34:05 -0000 1.3
+++ make_names.pl 30 Nov 2005 11:49:40 -0000 1.4
@@ -4,27 +4,35 @@
use Getopt::Long;
use File::Path;
-
-my $namesHeader = 0;
-my $namesCpp = 0;
-my $factoryHeader = 0;
-my $factoryCpp = 0;
-
-my $wrapperNamespace = "KSVG";
-my $namespace = "SVG";
-my $tagsFile = "ksvg2/svg/tagnames.in";
-my $attrsFile = "ksvg2/svg/attrnames.in";
-
+my $printFactory = 0;
+my $cppNamespace = "";
+my $namespace = "";
+my $namespaceURI = "";
+my $tagsFile = "";
+my $attrsFile = "";
my $outputDir = ".";
+my @tags = ();
+my @attrs = ();
+my $tagsNullNamespace = 0;
+my $attrsNullNamespace = 0;
GetOptions('tags=s' => \$tagsFile,
'attrs=s' => \$attrsFile,
'outputDir=s' => \$outputDir,
- 'namespace=s' => \$namespace);
+ 'namespace=s' => \$namespace,
+ 'namespaceURI=s' => \$namespaceURI,
+ 'cppNamespace=s' => \$cppNamespace,
+ 'factory' => \$printFactory,
+ 'tagsNullNamespace' => \$tagsNullNamespace,
+ 'attrsNullNamespace' => \$attrsNullNamespace,);
+
+die "You must specify a namespace (e.g. SVG) for <namespace>Names.h" unless $namespace;
+die "You must specify a namespaceURI (e.g. http://www.w3.org/2000/svg)" unless $namespaceURI;
+die "You must specify a cppNamespace (e.g. DOM) used for <cppNamespace>::<namespace>Names::fooTag" unless $cppNamespace;
+die "You must specify at least one of --tags <file> or --attrs <file>" unless (length($tagsFile) || length($attrsFile));
-my @tags = readNames($tagsFile);
-my @attrs = readNames($attrsFile);
-my @elements = elementsForTags(@tags);
+ at tags = readNames($tagsFile) if length($tagsFile);
+ at attrs = readNames($attrsFile) if length($attrsFile);
mkpath($outputDir);
my $namesBasePath = "$outputDir/${namespace}Names";
@@ -32,9 +40,13 @@
printNamesHeaderFile("$namesBasePath.h");
printNamesCppFile("$namesBasePath.cpp");
-printFactoryCppFile("$factoryBasePath.cpp");
-printFactoryHeaderFile("$factoryBasePath.h");
+if ($printFactory) {
+ printFactoryCppFile("$factoryBasePath.cpp");
+ printFactoryHeaderFile("$factoryBasePath.h");
+}
+
+## Support routines
sub readNames
{
@@ -43,16 +55,18 @@
die "Failed to open file: $namesFile" unless open(NAMES, "<", $namesFile);
my @names = ();
while (<NAMES>) {
+ next if (m/#/);
s/-/_/g;
chomp $_;
push @names, $_;
}
close(NAMES);
+ die "Failed to read names from file: $namesFile" unless (scalar(@names));
+
return @names
}
-
sub printMacros
{
my @names = @_;
@@ -82,107 +96,67 @@
}
}
-sub upperCaseName
+sub svgCapitalizationHacks
{
my $name = shift;
- $name = camelCaseName($name);
- $name =~ s/svg/SVG/;
-
if ($name =~ /^fe(.+)$/) {
- return "FE" . ucfirst $1;
+ $name = "FE" . ucfirst $1;
}
- return ucfirst $name;
-}
-
-sub camelCaseName
-{
- my $name = shift;
- $name =~ s/gradient/Gradient/;
- $name =~ s/color/Color/;
- $name =~ s/animate/Animate/;
- $name =~ s/matrix/Matrix/;
- $name =~ s/node/Node/;
- $name =~ s/turb/Turb/;
- $name =~ s/merge/Merge/;
- $name =~ s/gaus/Gaus/;
- $name =~ s/blur/Blur/;
- $name =~ s/span/Span/;
- $name =~ s/path/Path/;
- $name =~ s/image/Image/;
- $name =~ s/comp/Comp/;
- $name =~ s/off/Off/;
- $name =~ s/flood/Flood/;
- $name =~ s/blend/Blend/;
- $name =~ s/trans/Trans/;
- $name =~ s/glyph/Glyph/;
- $name =~ s/item/Item/;
- $name =~ s/face/Face/;
- $name =~ s/uri/URI/;
- $name =~ s/src/Src/;
- $name =~ s/format/Format/;
- $name =~ s/ref/Ref/;
- $name =~ s/profile/Profile/;
- $name =~ s/spot/Spot/;
- $name =~ s/name/Name/;
- $name =~ s/object/Object/;
- $name =~ s/motion/Motion/;
- $name =~ s/motion/Light/;
$name =~ s/kern/Kern/;
- $name =~ s/map/Map/;
- $name =~ s/func(.)$/"Func". uc $1/e;
- return lcfirst $name;
+ $name =~ s/mpath/MPath/;
+ $name =~ s/svg/SVG/;
+ $name =~ s/tref/TRef/;
+ $name =~ s/tspan/TSpan/;
+ $name =~ s/uri/URI/;
+
+ return $name;
}
-sub elementsForTags
+sub upperCaseName
{
- my @names = @_;
- my @filtered = ();
- for (@names) {
- next if /_/;
- next if /font/i;
- next if /glyph/i;
- next if /kern/i;
- next if /motion/i;
- next if /mask/i;
- next if /meta/i;
- next if /mpath/i;
- next if /tref/i;
- next if /textpath/i;
- next if /foreign/i;
- next if /convolve/i;
- next if /map/i;
- next if /morph/i;
- push(@filtered, $_);
+ my $name = shift;
+
+ $name = svgCapitalizationHacks($name) if ($namespace eq "SVG");
+
+ while ($name =~ /^(.*?)_(.*)/) {
+ $name = $1 . ucfirst $2;
}
- return @filtered;
+
+ return ucfirst $name;
}
-
sub printLicenseHeader
{
print "/*
- * This file is part of the $namespace DOM implementation for KDE.
- *
- * Copyright (C) 2005 Apple Computer, Inc.
+ * THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT.
*
- * 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.
+ * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
*
- * 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.
+ * 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.
*/
+
";
}
@@ -196,37 +170,42 @@
print "#define DOM_${namespace}NAMES_H\n\n";
print "#include \"dom_qname.h\"\n\n";
- print "namespace $wrapperNamespace { namespace ${namespace}Names {\n\n";
+ print "namespace $cppNamespace { namespace ${namespace}Names {\n\n";
- print"#define DOM_${namespace}NAMES_FOR_EACH_TAG(macro) \\\n";
- printMacros(@tags);
- print"// end of macro\n\n";
- print "#define DOM_${namespace}NAMES_FOR_EACH_ATTR(macro) \\\n";
- printMacros(@attrs);
- print "// end of macro\n\n";
+ if (scalar(@tags)) {
+ print"#define DOM_${namespace}NAMES_FOR_EACH_TAG(macro) \\\n";
+ printMacros(@tags);
+ print"// end of macro\n\n";
+ }
+ if (scalar(@attrs)) {
+ print "#define DOM_${namespace}NAMES_FOR_EACH_ATTR(macro) \\\n";
+ printMacros(@attrs);
+ print "// end of macro\n\n";
+ }
my $lowerNamespace = lc($namespace);
- print"#if !DOM_${namespace}NAMES_HIDE_GLOBALS
- // Namespace
- extern const DOM::AtomicString ${lowerNamespace}NamespaceURI;
-
- // Tags
- #define DOM_NAMES_DEFINE_TAG_GLOBAL(name) extern const DOM::QualifiedName name##Tag;
- DOM_${namespace}NAMES_FOR_EACH_TAG(DOM_NAMES_DEFINE_TAG_GLOBAL)
- #undef DOM_NAMES_DEFINE_TAG_GLOBAL
-
- // Attributes
- #define DOM_NAMES_DEFINE_ATTR_GLOBAL(name) extern const DOM::QualifiedName name##Attr;
- DOM_${namespace}NAMES_FOR_EACH_ATTR(DOM_NAMES_DEFINE_ATTR_GLOBAL)
- #undef DOM_NAMES_DEFINE_ATTR_GLOBAL
-#endif
-
- void init();
-} }
-
-#endif
-
-";
+ print "#if !DOM_${namespace}NAMES_HIDE_GLOBALS\n";
+ print "// Namespace\n";
+ print "extern const DOM::AtomicString ${lowerNamespace}NamespaceURI;\n\n";
+
+ if (scalar(@tags)) {
+ print "// Tags\n";
+ print "#define DOM_NAMES_DEFINE_TAG_GLOBAL(name) extern const DOM::QualifiedName name##Tag;\n";
+ print "DOM_${namespace}NAMES_FOR_EACH_TAG(DOM_NAMES_DEFINE_TAG_GLOBAL)\n";
+ print "#undef DOM_NAMES_DEFINE_TAG_GLOBAL\n\n";
+ }
+
+ if (scalar(@attrs)) {
+ print "// Attributes\n";
+ print "#define DOM_NAMES_DEFINE_ATTR_GLOBAL(name) extern const DOM::QualifiedName name##Attr;\n";
+ print "DOM_${namespace}NAMES_FOR_EACH_ATTR(DOM_NAMES_DEFINE_ATTR_GLOBAL)\n";
+ print "#undef DOM_NAMES_DEFINE_ATTR_GLOBAL\n\n";
+ }
+ print "#endif\n\n";
+ print "void init();\n\n";
+ print "} }\n\n";
+ print "#endif\n\n";
+
restoreSTDOUT();
}
@@ -236,13 +215,15 @@
redirectSTDOUT($cppPath);
printLicenseHeader();
+
+ my $lowerNamespace = lc($namespace);
print "#define DOM_${namespace}NAMES_HIDE_GLOBALS 1\n\n";
print "#include \"config.h\"\n";
print "#include \"${namespace}Names.h\"\n\n";
-print "namespace $wrapperNamespace { namespace ${namespace}Names {
+print "namespace $cppNamespace { namespace ${namespace}Names {
using namespace KDOM;
@@ -251,15 +232,20 @@
#define DEFINE_UNINITIALIZED_GLOBAL(type, name) void *name[(sizeof(type) + sizeof(void *) - 1) / sizeof(void *)];
-DEFINE_UNINITIALIZED_GLOBAL(DOM::AtomicString, svgNamespaceURI)
+DEFINE_UNINITIALIZED_GLOBAL(AtomicString, ${lowerNamespace}NamespaceURI)
+";
-#define DEFINE_TAG_GLOBAL(name) DEFINE_UNINITIALIZED_GLOBAL(DOM::QualifiedName, name##Tag)
-DOM_${namespace}NAMES_FOR_EACH_TAG(DEFINE_TAG_GLOBAL)
+ if (scalar(@tags)) {
+ print "#define DEFINE_TAG_GLOBAL(name) DEFINE_UNINITIALIZED_GLOBAL(QualifiedName, name##Tag)\n";
+ print "DOM_${namespace}NAMES_FOR_EACH_TAG(DEFINE_TAG_GLOBAL)\n\n";
+ }
-#define DEFINE_ATTR_GLOBAL(name) DEFINE_UNINITIALIZED_GLOBAL(DOM::QualifiedName, name##Attr)
-DOM_${namespace}NAMES_FOR_EACH_ATTR(DEFINE_ATTR_GLOBAL)
+ if (scalar(@attrs)) {
+ print "#define DEFINE_ATTR_GLOBAL(name) DEFINE_UNINITIALIZED_GLOBAL(QualifiedName, name##Attr)\n";
+ print "DOM_${namespace}NAMES_FOR_EACH_ATTR(DEFINE_ATTR_GLOBAL)\n\n";
+ }
-void init()
+print "void init()
{
static bool initialized = false;
if (initialized)
@@ -268,15 +254,19 @@
// Use placement new to initialize the globals.
";
-
- my $lowerNamespace = lc($namespace);
- print(" DOM::AtomicString svgNS(\"http://www.w3.org/2000/svg\");\n\n");
+ print(" AtomicString ${lowerNamespace}NS(\"$namespaceURI\");\n\n");
print(" // Namespace\n");
- print(" new (&${lowerNamespace}NamespaceURI) DOM::AtomicString(${lowerNamespace}NS);\n");
- printDefinitions(\@tags, "tags", "${lowerNamespace}NS");
- printDefinitions(\@attrs, "attributes", "nullAtom");
+ print(" new (&${lowerNamespace}NamespaceURI) AtomicString(${lowerNamespace}NS);\n\n");
+ if (scalar(@tags)) {
+ my $tagsNamespace = $tagsNullNamespace ? "nullAtom" : "${lowerNamespace}NS";
+ printDefinitions(\@tags, "tags", $tagsNamespace);
+ }
+ if (scalar(@attrs)) {
+ my $attrsNamespace = $attrsNullNamespace ? "nullAtom" : "${lowerNamespace}NS";
+ printDefinitions(\@attrs, "attributes", $attrsNamespace);
+ }
print "}\n\n} }";
restoreSTDOUT();
@@ -305,11 +295,11 @@
for my $name (@$namesRef) {
if ($name =~ /_/) {
my $realName = $name;
- $realName =~ s/_/-/;
+ $realName =~ s/_/-/g;
print " ${name}${shortCamelType}String = \"$realName\";\n";
}
}
- print "\n #define INITIALIZE_${shortUpperType}_GLOBAL(name) new (&name##${shortCamelType}) DOM::QualifiedName(nullAtom, name##${shortCamelType}String, $namespaceURI);\n";
+ print "\n #define INITIALIZE_${shortUpperType}_GLOBAL(name) new (&name##${shortCamelType}) QualifiedName(nullAtom, name##${shortCamelType}String, $namespaceURI);\n";
print " DOM_${namespace}NAMES_FOR_EACH_${shortUpperType}(INITIALIZE_${shortUpperType}_GLOBAL)\n\n";
}
@@ -336,24 +326,24 @@
printLicenseHeader();
print "#include \"config.h\"\n\n";
-print "#include \"SVGElementFactory.h\"\n";
+print "#include \"${namespace}ElementFactory.h\"\n";
print "#include \"${namespace}Names.h\"\n\n";
-printElementIncludes(@elements);
+printElementIncludes(@tags);
print "\n\n#include <kxmlcore/HashMap.h>\n\n";
print "using namespace KDOM;\n";
-print "using namespace ${wrapperNamespace}::${namespace}Names;\n\n";
+print "using namespace ${cppNamespace}::${namespace}Names;\n\n";
print "typedef KXMLCore::HashMap<DOMStringImpl *, void *, KXMLCore::PointerHash<DOMStringImpl *> > FunctionMap;\n";
print "static FunctionMap *gFunctionMap = 0;\n\n";
-print "namespace ${wrapperNamespace}\n{\n\n";
+print "namespace ${cppNamespace}\n{\n\n";
print "typedef ${namespace}ElementImpl *(*ConstructorFunc)(DocumentImpl *doc, bool createdByParser);\n\n";
-printConstructors(@elements);
+printConstructors(@tags);
print "
static inline void createFunctionMapIfNecessary()
@@ -366,7 +356,7 @@
// Populate it with constructor functions.
";
-printFunctionInits(@elements);
+printFunctionInits(@tags);
print "}\n";
@@ -404,24 +394,24 @@
print "
namespace KDOM {
- class ElementImpl;
- class DocumentImpl;
- class QualifiedName;
- class AtomicString;
-}
-
-namespace ${wrapperNamespace}
-{
- class ${namespace}ElementImpl;
-
- // The idea behind this class is that there will eventually be a mapping from namespace URIs to ElementFactories that can dispense
- // elements. In a compound document world, the generic createElement function (will end up being virtual) will be called.
- class ${namespace}ElementFactory
- {
- public:
- KDOM::ElementImpl *createElement(const KDOM::QualifiedName& qName, KDOM::DocumentImpl *doc, bool createdByParser = true);
- static ${namespace}ElementImpl *create${namespace}Element(const KDOM::QualifiedName& qName, KDOM::DocumentImpl *doc, bool createdByParser = true);
- };
+ class ElementImpl;
+ class DocumentImpl;
+ class QualifiedName;
+ class AtomicString;
+}
+
+namespace ${cppNamespace}
+{
+ class ${namespace}ElementImpl;
+
+ // The idea behind this class is that there will eventually be a mapping from namespace URIs to ElementFactories that can dispense
+ // elements. In a compound document world, the generic createElement function (will end up being virtual) will be called.
+ class ${namespace}ElementFactory
+ {
+ public:
+ KDOM::ElementImpl *createElement(const KDOM::QualifiedName& qName, KDOM::DocumentImpl *doc, bool createdByParser = true);
+ static ${namespace}ElementImpl *create${namespace}Element(const KDOM::QualifiedName& qName, KDOM::DocumentImpl *doc, bool createdByParser = true);
+ };
}
#endif
1.10 +6 -10 SVGSupport/ksvg2/svg/SVGLocatableImpl.cpp
Index: SVGLocatableImpl.cpp
===================================================================
RCS file: /cvs/root/SVGSupport/ksvg2/svg/SVGLocatableImpl.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- SVGLocatableImpl.cpp 26 Nov 2005 22:35:47 -0000 1.9
+++ SVGLocatableImpl.cpp 30 Nov 2005 11:49:40 -0000 1.10
@@ -43,11 +43,9 @@
SVGElementImpl *SVGLocatableImpl::nearestViewportElement(const SVGStyledElementImpl *e)
{
KDOM::NodeImpl *n = e->parentNode();
- while(n && n->isDocumentNode())
- {
- if(n->isElementNode() &&
- (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::symbolTag) ||
- n->hasTagName(SVGNames::foreignObjectTag) || n->hasTagName(SVGNames::imageTag)))
+ while (n && !n->isDocumentNode()) {
+ if (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::symbolTag) ||
+ n->hasTagName(SVGNames::imageTag)) // FIXME: || n->hasTagName(SVGNames::foreignObjectTag)
return static_cast<SVGElementImpl *>(n);
n = n->parentNode();
@@ -64,11 +62,9 @@
// used instead. This depends on cdf demands though(Rob.)
SVGElementImpl *farthest = 0;
KDOM::NodeImpl *n = e->parentNode();
- while(n && !n->isDocumentNode())
- {
- if(n->isElementNode() &&
- (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::symbolTag) ||
- n->hasTagName(SVGNames::foreignObjectTag) || n->hasTagName(SVGNames::imageTag)))
+ while (n && !n->isDocumentNode()) {
+ if (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::symbolTag) ||
+ n->hasTagName(SVGNames::imageTag)) // FIXME: || n->hasTagName(SVGNames::foreignObjectTag)
farthest = static_cast<SVGElementImpl *>(n);
n = n->parentNode();
1.10 +2 -2 SVGSupport/ksvg2/svg/SVGURIReferenceImpl.cpp
Index: SVGURIReferenceImpl.cpp
===================================================================
RCS file: /cvs/root/SVGSupport/ksvg2/svg/SVGURIReferenceImpl.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- SVGURIReferenceImpl.cpp 26 Nov 2005 22:19:18 -0000 1.9
+++ SVGURIReferenceImpl.cpp 30 Nov 2005 11:49:40 -0000 1.10
@@ -25,6 +25,7 @@
#include <kdom/core/AttrImpl.h>
#include "SVGNames.h"
+#include "XLinkNames.h"
#include "SVGHelper.h"
#include "SVGURIReferenceImpl.h"
#include "SVGStyledElementImpl.h"
@@ -48,8 +49,7 @@
bool SVGURIReferenceImpl::parseMappedAttribute(KDOM::MappedAttributeImpl *attr)
{
- if (attr->name() == SVGNames::hrefAttr || attr->name().localName() == "href") // || attr->name() == XLinkNames::hrefAttr)
- {
+ if (attr->name().matches(KDOM::XLinkNames::hrefAttr)) {
href()->setBaseVal(attr->value().impl());
return true;
}
1.2 +0 -1 SVGSupport/ksvg2/svg/svgattrs.in
Index: svgattrs.in
===================================================================
RCS file: /cvs/root/SVGSupport/ksvg2/svg/svgattrs.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- svgattrs.in 9 Jul 2005 06:55:43 -0000 1.1
+++ svgattrs.in 30 Nov 2005 11:49:40 -0000 1.2
@@ -86,7 +86,6 @@
horiz-adv-x
horiz-origin-x
horiz-origin-y
-href
ideographic
image-rendering
in
1.2 +26 -26 SVGSupport/ksvg2/svg/svgtags.in
Index: svgtags.in
===================================================================
RCS file: /cvs/root/SVGSupport/ksvg2/svg/svgtags.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- svgtags.in 9 Jul 2005 06:55:43 -0000 1.1
+++ svgtags.in 30 Nov 2005 11:49:40 -0000 1.2
@@ -1,16 +1,16 @@
a
-altGlyph
-altGlyphDef
-altGlyphItem
+#altGlyph
+#altGlyphDef
+#altGlyphItem
animate
animateColor
-animateMotion
+#animateMotion
animateTransform
circle
clipPath
-color_profile
+#color_profile
cursor
-definition_src
+#definition_src
defs
desc
ellipse
@@ -18,9 +18,9 @@
feColorMatrix
feComponentTransfer
feComposite
-feConvolveMatrix
+#feConvolveMatrix
feDiffuseLighting
-feDisplacementMap
+#feDisplacementMap
feDistantLight
feFlood
feFuncA
@@ -31,7 +31,7 @@
feImage
feMerge
feMergeNode
-feMorphology
+#feMorphology
feOffset
fePointLight
feSpecularLighting
@@ -39,25 +39,25 @@
feTile
feTurbulence
filter
-font
-font_face
-font_face_format
-font_face_name
-font_face_src
-font_face_uri
-foreignObject
+#font
+#font_face
+#font_face_format
+#font_face_name
+#font_face_src
+#font_face_uri
+#foreignObject
g
-glyph
-glyphRef
-hkern
+#glyph
+#glyphRef
+#hkern
image
line
linearGradient
marker
-mask
-metadata
-missing_glyph
-mpath
+#mask
+#metadata
+#missing_glyph
+#mpath
path
pattern
polygon
@@ -72,10 +72,10 @@
switch
symbol
text
-textPath
+#textPath
title
-tref
+#tref
tspan
use
view
-vkern
+#vkern
More information about the webkit-changes
mailing list