Index: Source/core/svg/SVGAngle.cpp |
diff --git a/Source/core/svg/SVGAngle.cpp b/Source/core/svg/SVGAngle.cpp |
index 6e9b816819f8db8049f2b6e65674865cb1c1b4a9..b772f01c5513a33bf8485d229d35796fc3f4004d 100644 |
--- a/Source/core/svg/SVGAngle.cpp |
+++ b/Source/core/svg/SVGAngle.cpp |
@@ -38,10 +38,16 @@ template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGMarkerOr |
if (entries.isEmpty()) { |
entries.append(std::make_pair(SVGMarkerOrientAuto, "auto")); |
entries.append(std::make_pair(SVGMarkerOrientAngle, "angle")); |
+ entries.append(std::make_pair(SVGMarkerOrientAutoStartReverse, "auto-start-reverse")); |
} |
return entries; |
} |
+template<> unsigned short getMaxExposedEnumValue<SVGMarkerOrientType>() |
+{ |
+ return SVGMarkerOrientAngle; |
+} |
+ |
SVGMarkerOrientEnumeration::SVGMarkerOrientEnumeration(SVGAngle* angle) |
: SVGEnumeration<SVGMarkerOrientType>(SVGMarkerOrientAngle) |
, m_angle(angle) |
@@ -231,6 +237,11 @@ void SVGAngle::setValueAsString(const String& value, ExceptionState& exceptionSt |
m_orientType->setEnumValue(SVGMarkerOrientAuto); |
return; |
} |
+ if (value == "auto-start-reverse") { |
+ newValueSpecifiedUnits(SVG_ANGLETYPE_UNSPECIFIED, 0); |
+ m_orientType->setEnumValue(SVGMarkerOrientAutoStartReverse); |
+ return; |
+ } |
float valueInSpecifiedUnits = 0; |
SVGAngleType unitType = SVG_ANGLETYPE_UNKNOWN; |
@@ -373,27 +384,34 @@ void SVGAngle::calculateAnimatedValue(SVGAnimationElement* animationElement, flo |
SVGMarkerOrientType toOrientType = toAngle->orientType()->enumValue(); |
if (fromOrientType != toOrientType) { |
- // Animating from eg. auto to 90deg, or auto to 90deg. |
+ // Animating from eg. 90deg to auto. |
if (fromOrientType == SVGMarkerOrientAngle) { |
// Animating from an angle value to eg. 'auto' - this disabled additive as 'auto' is a keyword.. |
- if (toOrientType == SVGMarkerOrientAuto) { |
+ if (toOrientType == SVGMarkerOrientAuto || toOrientType == SVGMarkerOrientAutoStartReverse) { |
if (percentage < 0.5f) { |
newValueSpecifiedUnits(fromAngle->unitType(), fromAngle->valueInSpecifiedUnits()); |
return; |
} |
- orientType()->setEnumValue(SVGMarkerOrientAuto); |
+ orientType()->setEnumValue(toOrientType); |
return; |
} |
m_valueInSpecifiedUnits = 0; |
orientType()->setEnumValue(SVGMarkerOrientUnknown); |
return; |
+ } else if (toOrientType == SVGMarkerOrientAuto || toOrientType == SVGMarkerOrientAutoStartReverse) { |
+ // Animating from e.g 'auto' to 'auto-start-reverse' |
+ if (percentage >= 0.5f) { |
+ m_valueInSpecifiedUnits = 0; |
+ orientType()->setEnumValue(toOrientType); |
+ return; |
+ } |
} |
} |
- // From 'auto' to 'auto'. |
- if (fromOrientType == SVGMarkerOrientAuto) { |
+ // From 'auto' to 'auto', or 'auto-start-reverse' to 'auto-start-reverse' |
+ if (fromOrientType == SVGMarkerOrientAuto || fromOrientType == SVGMarkerOrientAutoStartReverse) { |
m_valueInSpecifiedUnits = 0; |
- orientType()->setEnumValue(SVGMarkerOrientAuto); |
+ orientType()->setEnumValue(fromOrientType); |
return; |
} |
@@ -418,7 +436,7 @@ float SVGAngle::calculateDistance(PassRefPtr<SVGPropertyBase> other, SVGElement* |
void SVGAngle::orientTypeChanged() |
{ |
- if (orientType()->enumValue() == SVGMarkerOrientAuto) { |
+ if (orientType()->enumValue() == SVGMarkerOrientAuto || orientType()->enumValue() == SVGMarkerOrientAutoStartReverse) { |
m_unitType = SVG_ANGLETYPE_UNSPECIFIED; |
m_valueInSpecifiedUnits = 0; |
} |