Index: Source/core/svg/SVGString.h |
diff --git a/Source/core/svg/SVGBoolean.h b/Source/core/svg/SVGString.h |
similarity index 66% |
copy from Source/core/svg/SVGBoolean.h |
copy to Source/core/svg/SVGString.h |
index 0c0da5b0bd536ec0915e8181e035b04eadeb8e82..31bc758cd65b313baf00c7d2b5d94e466f729c14 100644 |
--- a/Source/core/svg/SVGBoolean.h |
+++ b/Source/core/svg/SVGString.h |
@@ -28,59 +28,69 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef SVGBoolean_h |
-#define SVGBoolean_h |
+#ifndef SVGString_h |
+#define SVGString_h |
#include "core/svg/properties/NewSVGProperty.h" |
namespace WebCore { |
-class SVGBoolean : public NewSVGPropertyBase { |
+class SVGString : public NewSVGPropertyBase { |
public: |
- // SVGBoolean does not have a tear-off type. |
+ // SVGString does not have a tear-off type. |
typedef void TearOffType; |
- typedef bool PrimitiveType; |
+ typedef String PrimitiveType; |
- static PassRefPtr<SVGBoolean> create(bool value = false) |
+ static PassRefPtr<SVGString> create() |
{ |
- return adoptRef(new SVGBoolean(value)); |
+ return adoptRef(new SVGString()); |
} |
- PassRefPtr<SVGBoolean> clone() const { return create(m_value); } |
- virtual PassRefPtr<NewSVGPropertyBase> cloneForAnimation(const String&) const OVERRIDE; |
+ static PassRefPtr<SVGString> create(const String& value) |
+ { |
+ return adoptRef(new SVGString(value)); |
+ } |
+ |
+ PassRefPtr<SVGString> clone() const { return create(m_value); } |
+ virtual PassRefPtr<NewSVGPropertyBase> cloneForAnimation(const String& value) const OVERRIDE |
+ { |
+ return create(value); |
+ } |
- virtual String valueAsString() const OVERRIDE; |
- void setValueAsString(const String&, ExceptionState&); |
+ virtual String valueAsString() const OVERRIDE { return m_value; } |
+ void setValueAsString(const String& value, ExceptionState&) { m_value = value; } |
virtual void add(PassRefPtr<NewSVGPropertyBase>, SVGElement*) OVERRIDE; |
virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtr<NewSVGPropertyBase> from, PassRefPtr<NewSVGPropertyBase> to, PassRefPtr<NewSVGPropertyBase> toAtEndOfDurationValue, SVGElement*) OVERRIDE; |
virtual float calculateDistance(PassRefPtr<NewSVGPropertyBase> to, SVGElement*) OVERRIDE; |
- bool operator==(const SVGBoolean& other) const { return m_value == other.m_value; } |
- bool operator!=(const SVGBoolean& other) const { return !operator==(other); } |
+ const String& value() const { return m_value; } |
+ void setValue(const String& value) { m_value = value; } |
- bool value() const { return m_value; } |
- void setValue(bool value) { m_value = value; } |
- |
- static AnimatedPropertyType classType() { return AnimatedBoolean; } |
+ static AnimatedPropertyType classType() { return AnimatedString; } |
private: |
- SVGBoolean(bool value) |
+ SVGString() |
+ : NewSVGPropertyBase(classType()) |
+ { |
+ } |
+ |
+ explicit SVGString(const String& value) |
: NewSVGPropertyBase(classType()) |
, m_value(value) |
{ |
} |
- bool m_value; |
+ String m_value; |
}; |
-inline PassRefPtr<SVGBoolean> toSVGBoolean(PassRefPtr<NewSVGPropertyBase> passBase) |
+inline PassRefPtr<SVGString> toSVGString(PassRefPtr<NewSVGPropertyBase> passBase) |
{ |
RefPtr<NewSVGPropertyBase> base = passBase; |
- ASSERT(base->type() == SVGBoolean::classType()); |
- return static_pointer_cast<SVGBoolean>(base.release()); |
+ ASSERT(base->type() == SVGString::classType()); |
+ return static_pointer_cast<SVGString>(base.release()); |
} |
} // namespace WebCore |
-#endif // SVGBoolean_h |
+#endif // SVGString_h |