diff options
Diffstat (limited to 'WebCore/rendering/style/SVGRenderStyleDefs.cpp')
-rw-r--r-- | WebCore/rendering/style/SVGRenderStyleDefs.cpp | 184 |
1 files changed, 88 insertions, 96 deletions
diff --git a/WebCore/rendering/style/SVGRenderStyleDefs.cpp b/WebCore/rendering/style/SVGRenderStyleDefs.cpp index 093f1f1..bf7624f 100644 --- a/WebCore/rendering/style/SVGRenderStyleDefs.cpp +++ b/WebCore/rendering/style/SVGRenderStyleDefs.cpp @@ -1,6 +1,7 @@ /* Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2007 Rob Buis <buis@kde.org> + Copyright (C) Research In Motion Limited 2010. All rights reserved. Based on khtml code by: Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) @@ -25,28 +26,29 @@ */ #include "config.h" + #if ENABLE(SVG) #include "SVGRenderStyleDefs.h" #include "RenderStyle.h" #include "SVGRenderStyle.h" -using namespace WebCore; +namespace WebCore { StyleFillData::StyleFillData() + : opacity(SVGRenderStyle::initialFillOpacity()) + , paint(SVGRenderStyle::initialFillPaint()) { - paint = SVGRenderStyle::initialFillPaint(); - opacity = SVGRenderStyle::initialFillOpacity(); } StyleFillData::StyleFillData(const StyleFillData& other) : RefCounted<StyleFillData>() + , opacity(other.opacity) + , paint(other.paint) { - paint = other.paint; - opacity = other.opacity; } -bool StyleFillData::operator==(const StyleFillData &other) const +bool StyleFillData::operator==(const StyleFillData& other) const { if (opacity != other.opacity) return false; @@ -67,64 +69,64 @@ bool StyleFillData::operator==(const StyleFillData &other) const } StyleStrokeData::StyleStrokeData() + : opacity(SVGRenderStyle::initialStrokeOpacity()) + , miterLimit(SVGRenderStyle::initialStrokeMiterLimit()) + , width(SVGRenderStyle::initialStrokeWidth()) + , dashOffset(SVGRenderStyle::initialStrokeDashOffset()) + , paint(SVGRenderStyle::initialStrokePaint()) + , dashArray(SVGRenderStyle::initialStrokeDashArray()) { - width = SVGRenderStyle::initialStrokeWidth(); - paint = SVGRenderStyle::initialStrokePaint(); - opacity = SVGRenderStyle::initialStrokeOpacity(); - miterLimit = SVGRenderStyle::initialStrokeMiterLimit(); - dashOffset = SVGRenderStyle::initialStrokeDashOffset(); - dashArray = SVGRenderStyle::initialStrokeDashArray(); } StyleStrokeData::StyleStrokeData(const StyleStrokeData& other) : RefCounted<StyleStrokeData>() + , opacity(other.opacity) + , miterLimit(other.miterLimit) + , width(other.width) + , dashOffset(other.dashOffset) + , paint(other.paint) + , dashArray(other.dashArray) { - width = other.width; - paint = other.paint; - opacity = other.opacity; - miterLimit = other.miterLimit; - dashOffset = other.dashOffset; - dashArray = other.dashArray; } -bool StyleStrokeData::operator==(const StyleStrokeData &other) const +bool StyleStrokeData::operator==(const StyleStrokeData& other) const { - return (paint == other.paint) && - (width == other.width) && - (opacity == other.opacity) && - (miterLimit == other.miterLimit) && - (dashOffset == other.dashOffset) && - (dashArray == other.dashArray); + return paint == other.paint + && width == other.width + && opacity == other.opacity + && miterLimit == other.miterLimit + && dashOffset == other.dashOffset + && dashArray == other.dashArray; } StyleStopData::StyleStopData() + : opacity(SVGRenderStyle::initialStopOpacity()) + , color(SVGRenderStyle::initialStopColor()) { - color = SVGRenderStyle::initialStopColor(); - opacity = SVGRenderStyle::initialStopOpacity(); } StyleStopData::StyleStopData(const StyleStopData& other) : RefCounted<StyleStopData>() + , opacity(other.opacity) + , color(other.color) { - color = other.color; - opacity = other.opacity; } -bool StyleStopData::operator==(const StyleStopData &other) const +bool StyleStopData::operator==(const StyleStopData& other) const { - return (color == other.color) && - (opacity == other.opacity); + return color == other.color + && opacity == other.opacity; } StyleTextData::StyleTextData() + : kerning(SVGRenderStyle::initialKerning()) { - kerning = SVGRenderStyle::initialKerning(); } StyleTextData::StyleTextData(const StyleTextData& other) : RefCounted<StyleTextData>() + , kerning(other.kerning) { - kerning = other.kerning; } bool StyleTextData::operator==(const StyleTextData& other) const @@ -132,104 +134,94 @@ bool StyleTextData::operator==(const StyleTextData& other) const return kerning == other.kerning; } -StyleClipData::StyleClipData() -{ - clipPath = SVGRenderStyle::initialClipPath(); -} - -StyleClipData::StyleClipData(const StyleClipData& other) - : RefCounted<StyleClipData>() -{ - clipPath = other.clipPath; -} - -bool StyleClipData::operator==(const StyleClipData &other) const +StyleMiscData::StyleMiscData() + : floodColor(SVGRenderStyle::initialFloodColor()) + , floodOpacity(SVGRenderStyle::initialFloodOpacity()) + , lightingColor(SVGRenderStyle::initialLightingColor()) + , baselineShiftValue(SVGRenderStyle::initialBaselineShiftValue()) { - return (clipPath == other.clipPath); } -StyleMaskData::StyleMaskData() +StyleMiscData::StyleMiscData(const StyleMiscData& other) + : RefCounted<StyleMiscData>() + , floodColor(other.floodColor) + , floodOpacity(other.floodOpacity) + , lightingColor(other.lightingColor) + , baselineShiftValue(other.baselineShiftValue) { - maskElement = SVGRenderStyle::initialMaskElement(); } -StyleMaskData::StyleMaskData(const StyleMaskData& other) - : RefCounted<StyleMaskData>() +bool StyleMiscData::operator==(const StyleMiscData& other) const { - maskElement = other.maskElement; + return floodOpacity == other.floodOpacity + && floodColor == other.floodColor + && lightingColor == other.lightingColor + && baselineShiftValue == other.baselineShiftValue; } -bool StyleMaskData::operator==(const StyleMaskData &other) const +StyleShadowSVGData::StyleShadowSVGData() { - return (maskElement == other.maskElement); } -StyleMarkerData::StyleMarkerData() +StyleShadowSVGData::StyleShadowSVGData(const StyleShadowSVGData& other) + : RefCounted<StyleShadowSVGData>() + , shadow(other.shadow ? new ShadowData(*other.shadow) : 0) { - startMarker = SVGRenderStyle::initialStartMarker(); - midMarker = SVGRenderStyle::initialMidMarker(); - endMarker = SVGRenderStyle::initialEndMarker(); } -StyleMarkerData::StyleMarkerData(const StyleMarkerData& other) - : RefCounted<StyleMarkerData>() +bool StyleShadowSVGData::operator==(const StyleShadowSVGData& other) const { - startMarker = other.startMarker; - midMarker = other.midMarker; - endMarker = other.endMarker; + if ((!shadow && other.shadow) || (shadow && !other.shadow)) + return false; + if (shadow && other.shadow && (*shadow != *other.shadow)) + return false; + return true; } -bool StyleMarkerData::operator==(const StyleMarkerData &other) const +StyleResourceData::StyleResourceData() + : clipper(SVGRenderStyle::initialClipperResource()) + , filter(SVGRenderStyle::initialFilterResource()) + , masker(SVGRenderStyle::initialMaskerResource()) { - return (startMarker == other.startMarker && midMarker == other.midMarker && endMarker == other.endMarker); } -StyleMiscData::StyleMiscData() +StyleResourceData::StyleResourceData(const StyleResourceData& other) + : RefCounted<StyleResourceData>() + , clipper(other.clipper) + , filter(other.filter) + , masker(other.masker) { - floodColor = SVGRenderStyle::initialFloodColor(); - floodOpacity = SVGRenderStyle::initialFloodOpacity(); - lightingColor = SVGRenderStyle::initialLightingColor(); - baselineShiftValue = SVGRenderStyle::initialBaselineShiftValue(); } -StyleMiscData::StyleMiscData(const StyleMiscData& other) - : RefCounted<StyleMiscData>() +bool StyleResourceData::operator==(const StyleResourceData& other) const { - filter = other.filter; - floodColor = other.floodColor; - floodOpacity = other.floodOpacity; - lightingColor = other.lightingColor; - baselineShiftValue = other.baselineShiftValue; + return clipper == other.clipper + && filter == other.filter + && masker == other.masker; } -bool StyleMiscData::operator==(const StyleMiscData &other) const +StyleInheritedResourceData::StyleInheritedResourceData() + : markerStart(SVGRenderStyle::initialMarkerStartResource()) + , markerMid(SVGRenderStyle::initialMarkerMidResource()) + , markerEnd(SVGRenderStyle::initialMarkerEndResource()) { - return filter == other.filter - && floodOpacity == other.floodOpacity - && floodColor == other.floodColor - && lightingColor == other.lightingColor - && baselineShiftValue == other.baselineShiftValue; } -StyleShadowSVGData::StyleShadowSVGData() +StyleInheritedResourceData::StyleInheritedResourceData(const StyleInheritedResourceData& other) + : RefCounted<StyleInheritedResourceData>() + , markerStart(other.markerStart) + , markerMid(other.markerMid) + , markerEnd(other.markerEnd) { } -StyleShadowSVGData::StyleShadowSVGData(const StyleShadowSVGData& other) - : RefCounted<StyleShadowSVGData>() - , shadow(other.shadow ? new ShadowData(*other.shadow) : 0) +bool StyleInheritedResourceData::operator==(const StyleInheritedResourceData& other) const { + return markerStart == other.markerStart + && markerMid == other.markerMid + && markerEnd == other.markerEnd; } -bool StyleShadowSVGData::operator==(const StyleShadowSVGData& other) const -{ - if ((!shadow && other.shadow) || (shadow && !other.shadow)) - return false; - if (shadow && other.shadow && (*shadow != *other.shadow)) - return false; - return true; } #endif // ENABLE(SVG) - -// vim:ts=4:noet |