Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(827)

Unified Diff: Source/core/svg/SVGAnimatedType.cpp

Issue 112003003: [SVG] SVGLength{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert aggressive svgAttributeChanged, add NeedsRebaseline Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/SVGAnimatedType.h ('k') | Source/core/svg/SVGAnimatorFactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGAnimatedType.cpp
diff --git a/Source/core/svg/SVGAnimatedType.cpp b/Source/core/svg/SVGAnimatedType.cpp
index 592e7e7e1b3229cbc1b15fc669d30166b6d2ee7d..cdaf271b1dcf2a75020d2b51553babb77f0f2e18 100644
--- a/Source/core/svg/SVGAnimatedType.cpp
+++ b/Source/core/svg/SVGAnimatedType.cpp
@@ -52,12 +52,6 @@ SVGAnimatedType::~SVGAnimatedType()
case AnimatedIntegerOptionalInteger:
delete m_data.integerOptionalInteger;
break;
- case AnimatedLength:
- delete m_data.length;
- break;
- case AnimatedLengthList:
- delete m_data.lengthList;
- break;
case AnimatedNumber:
delete m_data.number;
break;
@@ -85,6 +79,10 @@ SVGAnimatedType::~SVGAnimatedType()
case AnimatedTransformList:
delete m_data.transformList;
break;
+ case AnimatedLength:
+ case AnimatedLengthList:
+ // handled by RefPtr
+ break;
case AnimatedUnknown:
ASSERT_NOT_REACHED();
break;
@@ -139,22 +137,6 @@ PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createIntegerOptionalInteger(pair<i
return animatedType.release();
}
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createLength(SVGLength* length)
-{
- ASSERT(length);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedLength));
- animatedType->m_data.length = length;
- return animatedType.release();
-}
-
-PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createLengthList(SVGLengthList* lengthList)
-{
- ASSERT(lengthList);
- OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedLengthList));
- animatedType->m_data.lengthList = lengthList;
- return animatedType.release();
-}
-
PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createNumber(float* number)
{
ASSERT(number);
@@ -241,12 +223,6 @@ String SVGAnimatedType::valueAsString()
case AnimatedColor:
ASSERT(m_data.color);
return m_data.color->serializedAsCSSComponentValue();
- case AnimatedLength:
- ASSERT(m_data.length);
- return m_data.length->valueAsString();
- case AnimatedLengthList:
- ASSERT(m_data.lengthList);
- return m_data.lengthList->valueAsString();
case AnimatedNumber:
ASSERT(m_data.number);
return String::number(*m_data.number);
@@ -258,6 +234,11 @@ String SVGAnimatedType::valueAsString()
ASSERT(m_data.string);
return *m_data.string;
+ // Below properties have migrated to new property implementation.
+ case AnimatedLength:
+ case AnimatedLengthList:
+ return m_newProperty->valueAsString();
+
// These types don't appear in the table in SVGElement::cssPropertyToTypeMap() and thus don't need valueAsString() support.
case AnimatedAngle:
case AnimatedBoolean:
@@ -286,16 +267,6 @@ bool SVGAnimatedType::setValueAsString(const QualifiedName& attrName, const Stri
ASSERT(m_data.color);
*m_data.color = value.isEmpty() ? Color() : SVGColor::colorFromRGBColorString(value);
break;
- case AnimatedLength: {
- ASSERT(m_data.length);
- TrackExceptionState exceptionState;
- m_data.length->setValueAsString(value, SVGLength::lengthModeForAnimatedLengthAttribute(attrName), exceptionState);
- return !exceptionState.hadException();
- }
- case AnimatedLengthList:
- ASSERT(m_data.lengthList);
- m_data.lengthList->parse(value, SVGLength::lengthModeForAnimatedLengthAttribute(attrName));
- break;
case AnimatedNumber:
ASSERT(m_data.number);
parseNumberFromString(value, *m_data.number);
@@ -309,6 +280,12 @@ bool SVGAnimatedType::setValueAsString(const QualifiedName& attrName, const Stri
*m_data.string = value;
break;
+ // Below properties have migrated to new property implementation.
+ case AnimatedLength:
+ case AnimatedLengthList:
+ // Always use createForAnimation call path for these implementations.
+ return false;
+
// These types don't appear in the table in SVGElement::cssPropertyToTypeMap() and thus don't need setValueAsString() support.
case AnimatedAngle:
case AnimatedBoolean:
« no previous file with comments | « Source/core/svg/SVGAnimatedType.h ('k') | Source/core/svg/SVGAnimatorFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698