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()); |
} |