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

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

Issue 189913012: Merge SVGColor into SVGPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix system color test Created 6 years, 9 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/StyleBuilderCustom.cpp » ('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 ff359c5beb9a3c272b96e794bcc8b790ed8e72fb..2581a1f4f28f0a73b6e78d071e29bd84386a2798 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -8257,15 +8257,18 @@ bool CSSPropertyParser::parseSVGValue(CSSPropertyID propId, bool important)
case CSSPropertyStopColor: // TODO : icccolor
case CSSPropertyFloodColor:
case CSSPropertyLightingColor:
- if (isSystemColor(id))
- parsedValue = SVGColor::createFromColor(RenderTheme::theme().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();
- else // TODO : svgcolor (iccColor)
- parsedValue = parseSVGColor();
+ if (isSystemColor(id)) {
+ parsedValue = cssValuePool().createColorValue(RenderTheme::theme().systemColor(id).rgb());
+ } else if ((id >= CSSValueAqua && id <= CSSValueTransparent)
+ || (id >= CSSValueAliceblue && id <= CSSValueYellowgreen) || id == CSSValueGrey) {
+ StyleColor styleColor = SVGPaint::colorFromRGBColorString(value->string);
+ ASSERT(!styleColor.isCurrentColor());
+ parsedValue = cssValuePool().createColorValue(styleColor.color().rgb());
+ } else if (id == CSSValueCurrentcolor) {
+ parsedValue = cssValuePool().createIdentifierValue(id);
+ } else { // TODO : svgcolor (iccColor)
+ parsedValue = parseColor();
+ }
if (parsedValue)
m_valueList->next();
@@ -8403,14 +8406,6 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSVGPaint()
return SVGPaint::createColor(Color(c));
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSVGColor()
-{
- RGBA32 c = Color::transparent;
- if (!parseColorFromValue(m_valueList->current(), c))
- return nullptr;
- return SVGColor::createFromColor(Color(c));
-}
-
// normal | [ fill || stroke || markers ]
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parsePaintOrder() const
{
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.h ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698