| 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 5672e52a1fb427b10f968bed4e57ea09fbb7b019..cecae75ead56bc6e74cf1e52674943cb03be4b1b 100644
|
| --- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
|
| +++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
|
| @@ -596,19 +596,39 @@ 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);
|
| + if (list->length() < 2)
|
| + return;
|
| +
|
| + 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;
|
| + SVGPaint::SVGPaintType ptype = SVGPaint::SVG_PAINTTYPE_RGBCOLOR;
|
| + if (pValue->isRGBColor()) {
|
| + c = pValue->getRGBA32Value();
|
| + ptype = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_RGBCOLOR : SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR;
|
| + } else if (pValue->getValueID() == CSSValueCurrentcolor) {
|
| + c = state.style()->color();
|
| + ptype = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR : SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR;
|
| + } else if (pValue->getValueID() == CSSValueNone)
|
| + ptype = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_NONE : SVGPaint::SVG_PAINTTYPE_URI_NONE;
|
| + else if (pValue->isURI()) {
|
| + ptype = SVGPaint::SVG_PAINTTYPE_URI;
|
| + url = pValue->getStringValue();
|
| + }
|
| + {{set_value(property)}}(ptype, c, url,
|
| state.applyPropertyToRegularStyle(),
|
| state.applyPropertyToVisitedLinkStyle());
|
| }
|
|
|