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

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

Issue 361543002: Remove SVGPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Give SVGPaintType a new home Created 6 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
Index: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 3b91cb6a1a777a5ff7a20f110313673470461037..ae7a52149e92357773c12c246baaea9d61f53922 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -67,6 +67,7 @@
#include "core/css/Pair.h"
#include "core/css/Rect.h"
#include "core/css/RuntimeCSSEnabled.h"
+#include "core/css/parser/BisonCSSParser.h"
#include "core/css/parser/CSSParserIdioms.h"
#include "core/frame/UseCounter.h"
#include "core/html/parser/HTMLParserIdioms.h"
@@ -8208,26 +8209,30 @@ bool CSSPropertyParser::parseSVGValue(CSSPropertyID propId, bool important)
case CSSPropertyFill: // <paint> | inherit
case CSSPropertyStroke: // <paint> | inherit
{
- if (id == CSSValueNone) {
- parsedValue = SVGPaint::createNone();
- } else if (id == CSSValueCurrentcolor) {
- parsedValue = SVGPaint::createCurrentColor();
+ if (id == CSSValueNone || id == CSSValueCurrentcolor) {
+ parsedValue = cssValuePool().createIdentifierValue(id);
} else if (isSystemColor(id)) {
- parsedValue = SVGPaint::createColor(RenderTheme::theme().systemColor(id));
+ parsedValue = cssValuePool().createColorValue(RenderTheme::theme().systemColor(id).rgb());
} else if (value->unit == CSSPrimitiveValue::CSS_URI) {
RGBA32 c = Color::transparent;
if (m_valueList->next()) {
+ RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
+ values->append(CSSPrimitiveValue::create(value->string, CSSPrimitiveValue::CSS_URI));
if (parseColorFromValue(m_valueList->current(), c))
- parsedValue = SVGPaint::createURIAndColor(value->string, c);
+ parsedValue = cssValuePool().createColorValue(c);
else if (m_valueList->current()->id == CSSValueNone)
- parsedValue = SVGPaint::createURIAndNone(value->string);
+ parsedValue = cssValuePool().createIdentifierValue(m_valueList->current()->id);
else if (m_valueList->current()->id == CSSValueCurrentcolor)
krit 2014/07/01 06:01:55 You combine none and current color above, why not
- parsedValue = SVGPaint::createURIAndCurrentColor(value->string);
+ parsedValue = cssValuePool().createIdentifierValue(m_valueList->current()->id);
+ if (parsedValue) {
+ values->append(parsedValue);
+ parsedValue = values;
+ }
}
if (!parsedValue)
- parsedValue = SVGPaint::createURI(value->string);
+ parsedValue = CSSPrimitiveValue::create(value->string, CSSPrimitiveValue::CSS_URI);
} else {
- parsedValue = parseSVGPaint();
+ parsedValue = parseColor();
}
if (parsedValue)
@@ -8242,7 +8247,7 @@ bool CSSPropertyParser::parseSVGValue(CSSPropertyID propId, bool important)
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);
+ StyleColor styleColor = BisonCSSParser::colorFromRGBColorString(value->string);
ASSERT(!styleColor.isCurrentColor());
parsedValue = cssValuePool().createColorValue(styleColor.color().rgb());
} else if (id == CSSValueCurrentcolor) {
@@ -8369,14 +8374,6 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSVGStrokeDasharray()
return ret.release();
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSVGPaint()
-{
- RGBA32 c = Color::transparent;
- if (!parseColorFromValue(m_valueList->current(), c))
- return SVGPaint::createUnknown();
- return SVGPaint::createColor(Color(c));
-}
-
// normal | [ fill || stroke || markers ]
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parsePaintOrder() const
{

Powered by Google App Engine
This is Rietveld 408576698