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

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: Patch for landing Created 6 years, 5 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 4e4f8dfbe31d586016239acddbd3d8d84a86fd30..97b552a043173e8f05fc3bbce1e2e5ef2814ec96 100644
--- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -607,19 +607,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());
}
« no previous file with comments | « LayoutTests/svg/css/svg-attribute-parser-mode-expected.txt ('k') | Source/core/animation/animatable/AnimatableSVGPaint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698