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

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

Issue 20061003: Move isValid/isCurrentColor from Color to StyleColor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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
Index: Source/core/svg/SVGAnimatedColor.cpp
diff --git a/Source/core/svg/SVGAnimatedColor.cpp b/Source/core/svg/SVGAnimatedColor.cpp
index ad478afa9aff9d42834122a742f886417dd08851..9f48b7f54f26f88e694cb330bd749c3587e8e990 100644
--- a/Source/core/svg/SVGAnimatedColor.cpp
+++ b/Source/core/svg/SVGAnimatedColor.cpp
@@ -52,7 +52,7 @@ static inline void adjustForCurrentColor(SVGElement* targetElement, Color& color
ASSERT(targetElement);
if (RenderObject* targetRenderer = targetElement->renderer())
- color = targetRenderer->style()->visitedDependentColor(CSSPropertyColor);
+ color = targetRenderer->resolveColor(CSSPropertyColor);
else
color = Color();
}
@@ -100,11 +100,11 @@ void SVGAnimatedColorAnimator::calculateAnimatedValue(float percentage, unsigned
float SVGAnimatedColorAnimator::calculateDistance(const String& fromString, const String& toString)
{
ASSERT(m_contextElement);
- Color from = SVGColor::colorFromRGBColorString(fromString);
- if (!from.isValid())
+ Color from;
+ if (!SVGColor::colorFromRGBColorString(fromString, from))
return -1;
- Color to = SVGColor::colorFromRGBColorString(toString);
- if (!to.isValid())
+ Color to;
+ if (!SVGColor::colorFromRGBColorString(toString, to))
return -1;
return ColorDistance(from, to).distance();
}

Powered by Google App Engine
This is Rietveld 408576698