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

Unified Diff: Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl

Issue 361543002: Remove SVGPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address issues 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/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
diff --git a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
index e0dba7d86c8e76e0ba1c65298cf9f59f2d6f1d3b..407f06d36a407dc095a82d0f06b637a37aa8917a 100644
--- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -613,19 +613,40 @@ static bool lengthTypeAndValueMatch(const BorderImageLengthBox& borderImageLengt
{{declare_value_function(property_id)}}
{
- if (value->isSVGPaint()) {
- SVGPaint* svgPaint = toSVGPaint(value);
-
- Color color;
- if (svgPaint->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR
- || svgPaint->paintType() == SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR)
- color = state.style()->color();
- else
- color = svgPaint->color();
-
- {{set_value(property)}}(svgPaint->paintType(),
- color,
- svgPaint->uri(),
+ String url;
+ if (value->isValueList()) {
+ CSSValueList* list = toCSSValueList(value);
+ ASSERT(list->length() > 1);
+
+ if (!list->item(0)->isPrimitiveValue())
+ return;
+
+ CSSPrimitiveValue* pValue = toCSSPrimitiveValue(list->item(0));
+ if (!pValue->isURI())
+ return;
+
+ url = pValue->getStringValue();
+ value = list->item(1);
+ }
+ if (value->isPrimitiveValue()) {
+ CSSPrimitiveValue* pValue = toCSSPrimitiveValue(value);
+ Color c;
+ SVGPaintType ptype = SVG_PAINTTYPE_RGBCOLOR;
+ if (pValue->isRGBColor()) {
+ c = pValue->getRGBA32Value();
+ ptype = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_RGBCOLOR;
+ } else if (pValue->getValueID() == CSSValueCurrentcolor) {
+ c = state.style()->color();
+ ptype = url.isEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR : SVG_PAINTTYPE_URI_CURRENTCOLOR;
+ } else if (pValue->getValueID() == CSSValueNone) {
+ ptype = url.isEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE;
+ } else if (pValue->isURI()) {
+ ptype = SVG_PAINTTYPE_URI;
+ url = pValue->getStringValue();
+ } else {
+ return;
+ }
+ {{set_value(property)}}(ptype, c, url,
state.applyPropertyToRegularStyle(),
state.applyPropertyToVisitedLinkStyle());
}

Powered by Google App Engine
This is Rietveld 408576698