diff options
author | Ben Murdoch <benm@google.com> | 2011-05-05 14:36:32 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-10 15:38:30 +0100 |
commit | f05b935882198ccf7d81675736e3aeb089c5113a (patch) | |
tree | 4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /WebCore/svg/properties/SVGPropertyTraits.h | |
parent | 60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff) | |
download | external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2 |
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'WebCore/svg/properties/SVGPropertyTraits.h')
-rw-r--r-- | WebCore/svg/properties/SVGPropertyTraits.h | 81 |
1 files changed, 1 insertions, 80 deletions
diff --git a/WebCore/svg/properties/SVGPropertyTraits.h b/WebCore/svg/properties/SVGPropertyTraits.h index 5364853..0ed9339 100644 --- a/WebCore/svg/properties/SVGPropertyTraits.h +++ b/WebCore/svg/properties/SVGPropertyTraits.h @@ -22,16 +22,7 @@ #define SVGPropertyTraits_h #if ENABLE(SVG) -#include "FloatRect.h" -#include "SVGAngle.h" -#include "SVGLength.h" -#include "SVGLengthList.h" -#include "SVGNumberList.h" -#include "SVGPointList.h" -#include "SVGPreserveAspectRatio.h" -#include "SVGStringList.h" -#include "SVGTransformList.h" -#include <wtf/text/StringBuilder.h> +#include <wtf/text/WTFString.h> namespace WebCore { @@ -39,12 +30,6 @@ template<typename PropertyType> struct SVGPropertyTraits { }; template<> -struct SVGPropertyTraits<SVGAngle> { - static SVGAngle initialValue() { return SVGAngle(); } - static String toString(const SVGAngle& type) { return type.valueAsString(); } -}; - -template<> struct SVGPropertyTraits<bool> { static bool initialValue() { return false; } static String toString(bool type) { return type ? "true" : "false"; } @@ -63,81 +48,17 @@ struct SVGPropertyTraits<long> { }; template<> -struct SVGPropertyTraits<SVGLength> { - static SVGLength initialValue() { return SVGLength(); } - static String toString(const SVGLength& type) { return type.valueAsString(); } -}; - -template<> -struct SVGPropertyTraits<SVGLengthList> { - typedef SVGLength ListItemType; - - static SVGLengthList initialValue() { return SVGLengthList(); } - static String toString(const SVGLengthList& type) { return type.valueAsString(); } -}; - -template<> struct SVGPropertyTraits<float> { static float initialValue() { return 0; } static String toString(float type) { return String::number(type); } }; template<> -struct SVGPropertyTraits<SVGNumberList> { - typedef float ListItemType; - - static SVGNumberList initialValue() { return SVGNumberList(); } - static String toString(const SVGNumberList& type) { return type.valueAsString(); } -}; - -template<> -struct SVGPropertyTraits<SVGPreserveAspectRatio> { - static SVGPreserveAspectRatio initialValue() { return SVGPreserveAspectRatio(); } - static String toString(const SVGPreserveAspectRatio& type) { return type.valueAsString(); } -}; - -template<> -struct SVGPropertyTraits<FloatRect> { - static FloatRect initialValue() { return FloatRect(); } - static String toString(const FloatRect& type) - { - StringBuilder builder; - builder.append(String::number(type.x())); - builder.append(' '); - builder.append(String::number(type.y())); - builder.append(' '); - builder.append(String::number(type.width())); - builder.append(' '); - builder.append(String::number(type.height())); - builder.append(' '); - return builder.toString(); - } -}; - -template<> struct SVGPropertyTraits<String> { static String initialValue() { return String(); } static String toString(const String& type) { return type; } }; -template<> -struct SVGPropertyTraits<SVGStringList> { - typedef String ListItemType; -}; - -template<> -struct SVGPropertyTraits<SVGPointList> { - static SVGPointList initialValue() { return SVGPointList(); } - typedef FloatPoint ListItemType; -}; - -template<> -struct SVGPropertyTraits<SVGTransformList> { - static SVGTransformList initialValue() { return SVGTransformList(); } - static String toString(const SVGTransformList& type) { return type.valueAsString(); } - typedef SVGTransform ListItemType; -}; - } #endif |