Index: Source/core/svg/SVGAngleTearOff.h |
diff --git a/Source/core/svg/SVGAngleTearOff.h b/Source/core/svg/SVGAngleTearOff.h |
index 8d6d52084b908acc61113efec7c7ae437ba1a538..bec02c1bf3ecbb00d5082c3ac42e8cb28712fd84 100644 |
--- a/Source/core/svg/SVGAngleTearOff.h |
+++ b/Source/core/svg/SVGAngleTearOff.h |
@@ -54,7 +54,7 @@ public: |
virtual ~SVGAngleTearOff(); |
- unsigned short unitType() { return target()->unitType(); } |
+ unsigned short unitType() { return isValidAngle() ? target()->unitType() : SVGAngle::SVG_ANGLETYPE_UNKNOWN; } |
void setValue(float, ExceptionState&); |
float value() { return target()->value(); } |
@@ -65,9 +65,11 @@ public: |
void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits, ExceptionState&); |
void convertToSpecifiedUnits(unsigned short unitType, ExceptionState&); |
- String valueAsString() { return target()->valueAsString(); } |
+ String valueAsString() { return isValidAngle() ? target()->valueAsString() : String::number(0); } |
krit
2014/06/10 11:45:48
Exposing more unit types is one thing. Do we need
Erik Dahlström (inactive)
2014/06/10 16:57:42
Not necessarily, only if we want to preserve exist
|
void setValueAsString(const String&, ExceptionState&); |
+ bool isValidAngle() { return target()->unitType() <= SVGAngle::SVG_ANGLETYPE_GRAD; } |
fs
2014/06/10 11:13:30
Nit: isValidAngleType / isValidAngleUnit ?
(Could
Erik Dahlström (inactive)
2014/06/10 16:57:42
Private yes, const no, the target() method is non-
fs
2014/06/11 07:29:07
Ok.
|
+ |
private: |
SVGAngleTearOff(PassRefPtr<SVGAngle>, SVGElement*, PropertyIsAnimValType, const QualifiedName&); |
}; |