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

Unified Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 1219153003: Unify handling of <color> for SVG/non-SVG properties (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 6 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/css/parser/CSSPropertyParser.h ('k') | Source/core/css/resolver/StyleBuilderConverter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index fe36ecb0c7b3ed2217e47b46665943e6f3aaaad7..8ae8434c21d5ac327e14d11bfeef0fab094bb469 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -2370,20 +2370,6 @@ PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseDeprecatedGrad
return parseGradientStopColor(value);
}
-// Used to parse <color> for SVG properties.
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseSVGColor(const CSSParserValue* value)
-{
- CSSValueID id = value->id;
- if (id == CSSValueCurrentcolor)
- return cssValuePool().createIdentifierValue(id);
- if ((id >= CSSValueActiveborder && id <= CSSValueWindowtext) || id == CSSValueMenu)
- return cssValuePool().createColorValue(LayoutTheme::theme().systemColor(id).rgb());
- RGBA32 c = Color::transparent;
- if (!parseColorFromValue(value, c))
- return nullptr;
- return cssValuePool().createColorValue(c);
-}
-
bool CSSPropertyParser::parseFillImage(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& value)
{
if (valueList->current()->id == CSSValueNone) {
@@ -7850,7 +7836,7 @@ bool CSSPropertyParser::parseSVGValue(CSSPropertyID propId, bool important)
if (m_valueList->current()->id == CSSValueNone)
parsedValue = cssValuePool().createIdentifierValue(m_valueList->current()->id);
else
- parsedValue = parseSVGColor(m_valueList->current());
+ parsedValue = parseColor(m_valueList->current());
if (parsedValue) {
values->append(parsedValue);
parsedValue = values;
@@ -7859,7 +7845,7 @@ bool CSSPropertyParser::parseSVGValue(CSSPropertyID propId, bool important)
if (!parsedValue)
parsedValue = CSSPrimitiveValue::create(value->string, CSSPrimitiveValue::CSS_URI);
} else {
- parsedValue = parseSVGColor(m_valueList->current());
+ parsedValue = parseColor(m_valueList->current());
}
if (parsedValue)
@@ -7870,7 +7856,7 @@ bool CSSPropertyParser::parseSVGValue(CSSPropertyID propId, bool important)
case CSSPropertyStopColor: // TODO : icccolor
case CSSPropertyFloodColor:
case CSSPropertyLightingColor:
- parsedValue = parseSVGColor(m_valueList->current());
+ parsedValue = parseColor(m_valueList->current());
if (parsedValue)
m_valueList->next();
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.h ('k') | Source/core/css/resolver/StyleBuilderConverter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698