diff options
Diffstat (limited to 'Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp')
-rw-r--r-- | Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp b/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp index fb23e14..c30ae6d 100644 --- a/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp +++ b/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp @@ -37,27 +37,35 @@ namespace WebCore { StyleFillData::StyleFillData() : opacity(SVGRenderStyle::initialFillOpacity()) - , paintType(SVGRenderStyle::initialFillPaintType()) - , paintColor(SVGRenderStyle::initialFillPaintColor()) - , paintUri(SVGRenderStyle::initialFillPaintUri()) + , paint(SVGRenderStyle::initialFillPaint()) { } StyleFillData::StyleFillData(const StyleFillData& other) : RefCounted<StyleFillData>() , opacity(other.opacity) - , paintType(other.paintType) - , paintColor(other.paintColor) - , paintUri(other.paintUri) + , paint(other.paint) { } bool StyleFillData::operator==(const StyleFillData& other) const { - return opacity == other.opacity - && paintType == other.paintType - && paintColor == other.paintColor - && paintUri == other.paintUri; + if (opacity != other.opacity) + return false; + + if (!paint || !other.paint) + return paint == other.paint; + + if (paint->paintType() != other.paint->paintType()) + return false; + + if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_URI) + return paint->uri() == other.paint->uri(); + + if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_RGBCOLOR) + return paint->color() == other.paint->color(); + + return paint == other.paint; } StyleStrokeData::StyleStrokeData() @@ -66,9 +74,7 @@ StyleStrokeData::StyleStrokeData() , width(SVGRenderStyle::initialStrokeWidth()) , dashOffset(SVGRenderStyle::initialStrokeDashOffset()) , dashArray(SVGRenderStyle::initialStrokeDashArray()) - , paintType(SVGRenderStyle::initialStrokePaintType()) - , paintColor(SVGRenderStyle::initialStrokePaintColor()) - , paintUri(SVGRenderStyle::initialStrokePaintUri()) + , paint(SVGRenderStyle::initialStrokePaint()) { } @@ -79,22 +85,18 @@ StyleStrokeData::StyleStrokeData(const StyleStrokeData& other) , width(other.width) , dashOffset(other.dashOffset) , dashArray(other.dashArray) - , paintType(other.paintType) - , paintColor(other.paintColor) - , paintUri(other.paintUri) + , paint(other.paint) { } bool StyleStrokeData::operator==(const StyleStrokeData& other) const { - return width == other.width + return paint == other.paint + && width == other.width && opacity == other.opacity && miterLimit == other.miterLimit && dashOffset == other.dashOffset - && dashArray == other.dashArray - && paintType == other.paintType - && paintColor == other.paintColor - && paintUri == other.paintUri; + && dashArray == other.dashArray; } StyleStopData::StyleStopData() |