Index: Source/core/css/SVGCSSParser.cpp |
diff --git a/Source/core/css/SVGCSSParser.cpp b/Source/core/css/SVGCSSParser.cpp |
index e6e115e3424075e57f5b1aa0de91853cb5509bdb..5c2320372da75654d84fe085cd0b13ad63c78fc7 100644 |
--- a/Source/core/css/SVGCSSParser.cpp |
+++ b/Source/core/css/SVGCSSParser.cpp |
@@ -36,6 +36,11 @@ using namespace std; |
namespace WebCore { |
+static bool isSystemColor(int id) |
+{ |
+ return (id >= CSSValueActiveborder && id <= CSSValueWindowtext) || id == CSSValueMenu; |
+} |
+ |
bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important) |
{ |
CSSParserValue* value = m_valueList->current(); |
@@ -185,7 +190,7 @@ bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important) |
parsedValue = SVGPaint::createNone(); |
else if (id == CSSValueCurrentcolor) |
parsedValue = SVGPaint::createCurrentColor(); |
- else if ((id >= CSSValueActiveborder && id <= CSSValueWindowtext) || id == CSSValueMenu) |
+ else if (isSystemColor(id)) |
parsedValue = SVGPaint::createColor(RenderTheme::defaultTheme()->systemColor(id)); |
else if (value->unit == CSSPrimitiveValue::CSS_URI) { |
RGBA32 c = Color::transparent; |
@@ -208,8 +213,10 @@ bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important) |
case CSSPropertyStopColor: // TODO : icccolor |
case CSSPropertyFloodColor: |
case CSSPropertyLightingColor: |
- if ((id >= CSSValueAqua && id <= CSSValueWindowtext) || |
- (id >= CSSValueAliceblue && id <= CSSValueYellowgreen)) |
+ if (isSystemColor(id)) |
+ parsedValue = SVGColor::createFromColor(RenderTheme::defaultTheme()->systemColor(id)); |
+ else if ((id >= CSSValueAqua && id <= CSSValueTransparent) || |
+ (id >= CSSValueAliceblue && id <= CSSValueYellowgreen) || id == CSSValueGrey) |
parsedValue = SVGColor::createFromString(value->string); |
else if (id == CSSValueCurrentcolor) |
parsedValue = SVGColor::createCurrentColor(); |