diff options
Diffstat (limited to 'Source/WebCore/css/SVGCSSStyleSelector.cpp')
-rw-r--r-- | Source/WebCore/css/SVGCSSStyleSelector.cpp | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/Source/WebCore/css/SVGCSSStyleSelector.cpp b/Source/WebCore/css/SVGCSSStyleSelector.cpp index 64665d4..47e3fc3 100644 --- a/Source/WebCore/css/SVGCSSStyleSelector.cpp +++ b/Source/WebCore/css/SVGCSSStyleSelector.cpp @@ -231,17 +231,36 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value) // end of ident only properties case CSSPropertyFill: { - HANDLE_INHERIT_AND_INITIAL(fillPaint, FillPaint) - if (value->isSVGPaint()) - svgstyle->setFillPaint(static_cast<SVGPaint*>(value)); + if (isInherit) { + const SVGRenderStyle* svgParentStyle = m_parentStyle->svgStyle(); + svgstyle->setFillPaint(svgParentStyle->fillPaintType(), svgParentStyle->fillPaintColor(), svgParentStyle->fillPaintUri()); + return; + } + if (isInitial) { + svgstyle->setFillPaint(SVGRenderStyle::initialFillPaintType(), SVGRenderStyle::initialFillPaintColor(), SVGRenderStyle::initialFillPaintUri()); + return; + } + if (value->isSVGPaint()) { + SVGPaint* svgPaint = static_cast<SVGPaint*>(value); + svgstyle->setFillPaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, m_style->color()), svgPaint->uri()); + } break; } case CSSPropertyStroke: { - HANDLE_INHERIT_AND_INITIAL(strokePaint, StrokePaint) - if (value->isSVGPaint()) - svgstyle->setStrokePaint(static_cast<SVGPaint*>(value)); - + if (isInherit) { + const SVGRenderStyle* svgParentStyle = m_parentStyle->svgStyle(); + svgstyle->setStrokePaint(svgParentStyle->strokePaintType(), svgParentStyle->strokePaintColor(), svgParentStyle->strokePaintUri()); + return; + } + if (isInitial) { + svgstyle->setStrokePaint(SVGRenderStyle::initialStrokePaintType(), SVGRenderStyle::initialStrokePaintColor(), SVGRenderStyle::initialStrokePaintUri()); + return; + } + if (value->isSVGPaint()) { + SVGPaint* svgPaint = static_cast<SVGPaint*>(value); + svgstyle->setStrokePaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, m_style->color()), svgPaint->uri()); + } break; } case CSSPropertyStrokeWidth: |