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

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

Issue 1224223003: Fold CSSParser::colorFromRGBColorString into only user (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/core/svg/SVGAnimatedColor.h ('k') | Source/core/svg/SVGAnimatedTypeAnimator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGAnimatedColor.cpp
diff --git a/Source/core/svg/SVGAnimatedColor.cpp b/Source/core/svg/SVGAnimatedColor.cpp
index 033ceef0eef0dc6acadc015cee0bb2a46783428f..68e547a557b381685798242e4df8aa333ffe129b 100644
--- a/Source/core/svg/SVGAnimatedColor.cpp
+++ b/Source/core/svg/SVGAnimatedColor.cpp
@@ -18,15 +18,24 @@
*/
#include "config.h"
-
#include "core/svg/SVGAnimatedColor.h"
+#include "core/css/parser/CSSParser.h"
#include "core/layout/LayoutObject.h"
#include "core/svg/ColorDistance.h"
#include "core/svg/SVGAnimateElement.h"
namespace blink {
+SVGColorProperty::SVGColorProperty(const String& colorString)
+ : SVGPropertyBase(classType())
+ , m_styleColor(StyleColor::currentColor())
+{
+ RGBA32 color;
+ if (CSSParser::parseColor(color, colorString.stripWhiteSpace()))
+ m_styleColor = StyleColor(color);
+}
+
String SVGColorProperty::valueAsString() const
{
return m_styleColor.isCurrentColor() ? "currentColor" : m_styleColor.color().serializedAsCSSComponentValue();
« no previous file with comments | « Source/core/svg/SVGAnimatedColor.h ('k') | Source/core/svg/SVGAnimatedTypeAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698