Commit 7f91527a authored by eseidel's avatar eseidel

2007-01-19 Eric Seidel <eric@webkit.org>

        Reviewed by rwlbuis.

        Add support for SVGMPathElement parsing.

        No test cases possible (SVGAnimateMotion doesn't work yet)

        * WebCore.xcodeproj/project.pbxproj:
        * ksvg2/svg/SVGAnimateMotionElement.cpp:
        (WebCore::SVGAnimateMotionElement::animationPath):
        * ksvg2/svg/SVGMPathElement.cpp: Added.
        (WebCore::SVGMPathElement::SVGMPathElement):
        (WebCore::SVGMPathElement::~SVGMPathElement):
        (WebCore::SVGMPathElement::parseMappedAttribute):
        (WebCore::SVGMPathElement::pathElement):
        * ksvg2/svg/SVGMPathElement.h: Added.
        * ksvg2/svg/SVGNumberList.cpp:
        (WebCore::SVGNumberList::parse): fix typo in comment
        * ksvg2/svg/svgtags.in: add back mpath


git-svn-id: svn://svn.chromium.org/blink/trunk@18978 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e82086df
2007-01-19 Eric Seidel <eric@webkit.org>
Reviewed by rwlbuis.
Add support for SVGMPathElement parsing.
No test cases possible (SVGAnimateMotion doesn't work yet)
* WebCore.xcodeproj/project.pbxproj:
* ksvg2/svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::animationPath):
* ksvg2/svg/SVGMPathElement.cpp: Added.
(WebCore::SVGMPathElement::SVGMPathElement):
(WebCore::SVGMPathElement::~SVGMPathElement):
(WebCore::SVGMPathElement::parseMappedAttribute):
(WebCore::SVGMPathElement::pathElement):
* ksvg2/svg/SVGMPathElement.h: Added.
* ksvg2/svg/SVGNumberList.cpp:
(WebCore::SVGNumberList::parse): fix typo in comment
* ksvg2/svg/svgtags.in: add back mpath
2007-01-19 Eric Seidel <eric@webkit.org> 2007-01-19 Eric Seidel <eric@webkit.org>
Reviewed by rwlbuis. Reviewed by rwlbuis.
......
...@@ -1643,6 +1643,8 @@ ...@@ -1643,6 +1643,8 @@
A7352C1A0B1BB89D00A986D0 /* RenderSVGBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = A7352C180B1BB89D00A986D0 /* RenderSVGBlock.h */; }; A7352C1A0B1BB89D00A986D0 /* RenderSVGBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = A7352C180B1BB89D00A986D0 /* RenderSVGBlock.h */; };
A7638A970995965D0007E14F /* SVGFEDisplacementMapElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A7638A950995965D0007E14F /* SVGFEDisplacementMapElement.h */; }; A7638A970995965D0007E14F /* SVGFEDisplacementMapElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A7638A950995965D0007E14F /* SVGFEDisplacementMapElement.h */; };
A7638A980995965D0007E14F /* SVGFEDisplacementMapElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7638A960995965D0007E14F /* SVGFEDisplacementMapElement.cpp */; }; A7638A980995965D0007E14F /* SVGFEDisplacementMapElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7638A960995965D0007E14F /* SVGFEDisplacementMapElement.cpp */; };
A80CEBAC0B60FC49007637C1 /* SVGMPathElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A80CEBAA0B60FC49007637C1 /* SVGMPathElement.h */; };
A80CEBAD0B60FC49007637C1 /* SVGMPathElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80CEBAB0B60FC49007637C1 /* SVGMPathElement.cpp */; };
A80E6CE40A1989CA007FB8C5 /* CSSValueList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E6CBA0A1989CA007FB8C5 /* CSSValueList.cpp */; }; A80E6CE40A1989CA007FB8C5 /* CSSValueList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E6CBA0A1989CA007FB8C5 /* CSSValueList.cpp */; };
A80E6CE50A1989CA007FB8C5 /* CSSBorderImageValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E6CBB0A1989CA007FB8C5 /* CSSBorderImageValue.cpp */; }; A80E6CE50A1989CA007FB8C5 /* CSSBorderImageValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E6CBB0A1989CA007FB8C5 /* CSSBorderImageValue.cpp */; };
A80E6CE60A1989CA007FB8C5 /* CSSPrimitiveValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CBC0A1989CA007FB8C5 /* CSSPrimitiveValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; A80E6CE60A1989CA007FB8C5 /* CSSPrimitiveValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CBC0A1989CA007FB8C5 /* CSSPrimitiveValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
...@@ -4608,6 +4610,8 @@ ...@@ -4608,6 +4610,8 @@
A7352C180B1BB89D00A986D0 /* RenderSVGBlock.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderSVGBlock.h; sourceTree = "<group>"; }; A7352C180B1BB89D00A986D0 /* RenderSVGBlock.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderSVGBlock.h; sourceTree = "<group>"; };
A7638A950995965D0007E14F /* SVGFEDisplacementMapElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFEDisplacementMapElement.h; sourceTree = "<group>"; }; A7638A950995965D0007E14F /* SVGFEDisplacementMapElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFEDisplacementMapElement.h; sourceTree = "<group>"; };
A7638A960995965D0007E14F /* SVGFEDisplacementMapElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEDisplacementMapElement.cpp; sourceTree = "<group>"; }; A7638A960995965D0007E14F /* SVGFEDisplacementMapElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEDisplacementMapElement.cpp; sourceTree = "<group>"; };
A80CEBAA0B60FC49007637C1 /* SVGMPathElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMPathElement.h; sourceTree = "<group>"; };
A80CEBAB0B60FC49007637C1 /* SVGMPathElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGMPathElement.cpp; sourceTree = "<group>"; };
A80E6CBA0A1989CA007FB8C5 /* CSSValueList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSValueList.cpp; sourceTree = "<group>"; }; A80E6CBA0A1989CA007FB8C5 /* CSSValueList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSValueList.cpp; sourceTree = "<group>"; };
A80E6CBB0A1989CA007FB8C5 /* CSSBorderImageValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSBorderImageValue.cpp; sourceTree = "<group>"; }; A80E6CBB0A1989CA007FB8C5 /* CSSBorderImageValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSBorderImageValue.cpp; sourceTree = "<group>"; };
A80E6CBC0A1989CA007FB8C5 /* CSSPrimitiveValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSPrimitiveValue.h; sourceTree = "<group>"; }; A80E6CBC0A1989CA007FB8C5 /* CSSPrimitiveValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSPrimitiveValue.h; sourceTree = "<group>"; };
...@@ -8108,8 +8112,6 @@ ...@@ -8108,8 +8112,6 @@
B25AE55D0B49D6630074C726 /* LinearGradientAttributes.h */, B25AE55D0B49D6630074C726 /* LinearGradientAttributes.h */,
B2DDF0640B4829FA0064A4B1 /* PatternAttributes.h */, B2DDF0640B4829FA0064A4B1 /* PatternAttributes.h */,
B25AE55E0B49D6630074C726 /* RadialGradientAttributes.h */, B25AE55E0B49D6630074C726 /* RadialGradientAttributes.h */,
AACF7C4C0B42EE6000080BD8 /* SVGParserUtilities.h */,
AACF7C4D0B42EE6000080BD8 /* SVGParserUtilities.cpp */,
A8C0F7FF089701F300BA5114 /* SVGAElement.cpp */, A8C0F7FF089701F300BA5114 /* SVGAElement.cpp */,
A8C0F800089701F300BA5114 /* SVGAElement.h */, A8C0F800089701F300BA5114 /* SVGAElement.h */,
B2CB41010AB758E6004D9C45 /* SVGAElement.idl */, B2CB41010AB758E6004D9C45 /* SVGAElement.idl */,
...@@ -8306,6 +8308,8 @@ ...@@ -8306,6 +8308,8 @@
AAC8DAAF0AA1002000DC0907 /* SVGMetadataElement.cpp */, AAC8DAAF0AA1002000DC0907 /* SVGMetadataElement.cpp */,
AAC8DAB00AA1002000DC0907 /* SVGMetadataElement.h */, AAC8DAB00AA1002000DC0907 /* SVGMetadataElement.h */,
B2E954770AB5FBA30076DE37 /* SVGMetadataElement.idl */, B2E954770AB5FBA30076DE37 /* SVGMetadataElement.idl */,
A80CEBAB0B60FC49007637C1 /* SVGMPathElement.cpp */,
A80CEBAA0B60FC49007637C1 /* SVGMPathElement.h */,
A833BEA20A2C329300D57664 /* SVGNumber.idl */, A833BEA20A2C329300D57664 /* SVGNumber.idl */,
A8C0F888089701F300BA5114 /* SVGNumberList.cpp */, A8C0F888089701F300BA5114 /* SVGNumberList.cpp */,
A8C0F889089701F300BA5114 /* SVGNumberList.h */, A8C0F889089701F300BA5114 /* SVGNumberList.h */,
...@@ -8314,6 +8318,7 @@ ...@@ -8314,6 +8318,7 @@
A8C0F88B089701F300BA5114 /* SVGPaint.h */, A8C0F88B089701F300BA5114 /* SVGPaint.h */,
B2CB41450AB75904004D9C45 /* SVGPaint.idl */, B2CB41450AB75904004D9C45 /* SVGPaint.idl */,
AACF7C4D0B42EE6000080BD8 /* SVGParserUtilities.cpp */, AACF7C4D0B42EE6000080BD8 /* SVGParserUtilities.cpp */,
AACF7C4D0B42EE6000080BD8 /* SVGParserUtilities.cpp */,
AACF7C4C0B42EE6000080BD8 /* SVGParserUtilities.h */, AACF7C4C0B42EE6000080BD8 /* SVGParserUtilities.h */,
A8C0F88C089701F300BA5114 /* SVGPathElement.cpp */, A8C0F88C089701F300BA5114 /* SVGPathElement.cpp */,
A8C0F88D089701F300BA5114 /* SVGPathElement.h */, A8C0F88D089701F300BA5114 /* SVGPathElement.h */,
...@@ -8467,6 +8472,7 @@ ...@@ -8467,6 +8472,7 @@
A8C0F8EB089701F400BA5114 /* SVGZoomAndPan.cpp */, A8C0F8EB089701F400BA5114 /* SVGZoomAndPan.cpp */,
A8C0F8EC089701F400BA5114 /* SVGZoomAndPan.h */, A8C0F8EC089701F400BA5114 /* SVGZoomAndPan.h */,
B2CB41640AB75904004D9C45 /* SVGZoomAndPan.idl */, B2CB41640AB75904004D9C45 /* SVGZoomAndPan.idl */,
AACF7C4C0B42EE6000080BD8 /* SVGParserUtilities.h */,
); );
path = svg; path = svg;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -10952,6 +10958,7 @@ ...@@ -10952,6 +10958,7 @@
510F73620B56C08800A3002A /* Credential.h in Headers */, 510F73620B56C08800A3002A /* Credential.h in Headers */,
510F73640B56C08800A3002A /* ProtectionSpace.h in Headers */, 510F73640B56C08800A3002A /* ProtectionSpace.h in Headers */,
1A2A68240B5BEDE70002A480 /* ProgressTracker.h in Headers */, 1A2A68240B5BEDE70002A480 /* ProgressTracker.h in Headers */,
A80CEBAC0B60FC49007637C1 /* SVGMPathElement.h in Headers */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -10989,7 +10996,6 @@ ...@@ -10989,7 +10996,6 @@
0867D690FE84028FC02AAC07 /* Project object */ = { 0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject; isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1; hasScannedForEncodings = 1;
knownRegions = ( knownRegions = (
English, English,
...@@ -11004,7 +11010,6 @@ ...@@ -11004,7 +11010,6 @@
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
shouldCheckCompatibility = 1;
targets = ( targets = (
93F198A508245E59001E9ABC /* WebCore */, 93F198A508245E59001E9ABC /* WebCore */,
DD041FBE09D9DDBE0010AF2A /* Derived Sources */, DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
...@@ -12285,6 +12290,7 @@ ...@@ -12285,6 +12290,7 @@
510F73610B56C08800A3002A /* Credential.cpp in Sources */, 510F73610B56C08800A3002A /* Credential.cpp in Sources */,
510F73630B56C08800A3002A /* ProtectionSpace.cpp in Sources */, 510F73630B56C08800A3002A /* ProtectionSpace.cpp in Sources */,
1A2A68230B5BEDE70002A480 /* ProgressTracker.cpp in Sources */, 1A2A68230B5BEDE70002A480 /* ProgressTracker.cpp in Sources */,
A80CEBAD0B60FC49007637C1 /* SVGMPathElement.cpp in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#ifdef SVG_SUPPORT #ifdef SVG_SUPPORT
#include "SVGAnimateMotionElement.h" #include "SVGAnimateMotionElement.h"
#include "SVGMPathElement.h"
#include "SVGPathElement.h" #include "SVGPathElement.h"
#include "SVGTransformList.h" #include "SVGTransformList.h"
...@@ -73,12 +74,15 @@ void SVGAnimateMotionElement::parseMappedAttribute(MappedAttribute* attr) ...@@ -73,12 +74,15 @@ void SVGAnimateMotionElement::parseMappedAttribute(MappedAttribute* attr)
Path SVGAnimateMotionElement::animationPath() Path SVGAnimateMotionElement::animationPath()
{ {
#if 0 // disabled until SVGMPathElement is added
for (Node* child = firstChild(); child; child->nextSibling()) { for (Node* child = firstChild(); child; child->nextSibling()) {
if (child->hasName(SVGNames::mPathTag)) if (child->hasTagName(SVGNames::mpathTag)) {
return static_cast<SVGMPathElement*>(child)->toPathData(); SVGMPathElement* mPath = static_cast<SVGMPathElement*>(child);
SVGPathElement* pathElement = mPath->pathElement();
if (pathElement)
return pathElement->toPathData();
// The spec would probably have us throw up an error here, but instead we try to fall back to the d value
}
} }
#endif
if (hasAttribute(SVGNames::dAttr)) if (hasAttribute(SVGNames::dAttr))
return m_path; return m_path;
return Path(); return Path();
......
/*
Copyright (C) 2007 Eric Seidel <eric@webkit.org>
This file is part of the WebKit 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"
#include "SVGMPathElement.h"
#include "SVGPathElement.h"
namespace WebCore {
SVGMPathElement::SVGMPathElement(const QualifiedName& qname, Document* doc)
: SVGElement(qname, doc)
{
}
SVGMPathElement::~SVGMPathElement()
{
}
void SVGMPathElement::parseMappedAttribute(MappedAttribute* attr)
{
if (SVGURIReference::parseMappedAttribute(attr))
return;
SVGElement::parseMappedAttribute(attr);
}
SVGPathElement* SVGMPathElement::pathElement()
{
Element* target = document()->getElementById(getTarget(SVGURIReference::href()));
if (target && target->hasTagName(SVGNames::pathTag))
return static_cast<SVGPathElement*>(target);
return 0;
}
} // namespace WebCore
/*
Copyright (C) 2007 Eric Seidel <eric@webkit.org>
This file is part of the WebKit 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 SVGMPathElement_h
#define SVGMPathElement_h
#ifdef SVG_SUPPORT
#include "SVGURIReference.h"
#include "SVGExternalResourcesRequired.h"
namespace WebCore {
class SVGPathElement;
class SVGMPathElement : public SVGElement,
SVGURIReference,
SVGExternalResourcesRequired
{
public:
SVGMPathElement(const QualifiedName&, Document*);
virtual ~SVGMPathElement();
virtual void parseMappedAttribute(MappedAttribute*);
SVGPathElement* pathElement();
protected:
virtual const SVGElement* contextElement() const { return this; }
};
} // namespace WebCore
#endif // SVG_SUPPORT
#endif // SVGMPathElement_h
// vim:ts=4:noet
...@@ -46,7 +46,7 @@ void SVGNumberList::parse(const String& value) ...@@ -46,7 +46,7 @@ void SVGNumberList::parse(const String& value)
const UChar* ptr = value.characters(); const UChar* ptr = value.characters();
const UChar* end = ptr + value.length(); const UChar* end = ptr + value.length();
// The spec strangely doesn't allow leading whitespace. We might chose to violate that intentionally. (section 4.1) // The spec strangely doesn't allow leading whitespace. We might choose to violate that intentionally. (section 4.1)
while (ptr < end) { while (ptr < end) {
if (!parseNumber(ptr, end, number)) if (!parseNumber(ptr, end, number))
return; return;
......
...@@ -57,7 +57,7 @@ marker ...@@ -57,7 +57,7 @@ marker
mask mask
metadata metadata
#missing_glyph #missing_glyph
#mpath mpath
path path
pattern pattern
polygon polygon
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment