2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005, 2007 Rob Buis <buis@kde.org>
4 Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 Based on khtml code by:
7 Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
8 Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
9 Copyright (C) 2002-2003 Dirk Mueller (mueller@kde.org)
10 Copyright (C) 2002 Apple Computer, Inc.
12 This library is free software; you can redistribute it and/or
13 modify it under the terms of the GNU Library General Public
14 License as published by the Free Software Foundation; either
15 version 2 of the License, or (at your option) any later version.
17 This library is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Library General Public License for more details.
22 You should have received a copy of the GNU Library General Public License
23 along with this library; see the file COPYING.LIB. If not, write to
24 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 Boston, MA 02110-1301, USA.
31 #include "SVGRenderStyleDefs.h"
33 #include "RenderStyle.h"
34 #include "SVGRenderStyle.h"
38 StyleFillData::StyleFillData()
39 : opacity(SVGRenderStyle::initialFillOpacity())
40 , paintType(SVGRenderStyle::initialFillPaintType())
41 , paintColor(SVGRenderStyle::initialFillPaintColor())
42 , paintUri(SVGRenderStyle::initialFillPaintUri())
46 StyleFillData::StyleFillData(const StyleFillData& other)
47 : RefCounted<StyleFillData>()
48 , opacity(other.opacity)
49 , paintType(other.paintType)
50 , paintColor(other.paintColor)
51 , paintUri(other.paintUri)
55 bool StyleFillData::operator==(const StyleFillData& other) const
57 return opacity == other.opacity
58 && paintType == other.paintType
59 && paintColor == other.paintColor
60 && paintUri == other.paintUri;
63 StyleStrokeData::StyleStrokeData()
64 : opacity(SVGRenderStyle::initialStrokeOpacity())
65 , miterLimit(SVGRenderStyle::initialStrokeMiterLimit())
66 , width(SVGRenderStyle::initialStrokeWidth())
67 , dashOffset(SVGRenderStyle::initialStrokeDashOffset())
68 , dashArray(SVGRenderStyle::initialStrokeDashArray())
69 , paintType(SVGRenderStyle::initialStrokePaintType())
70 , paintColor(SVGRenderStyle::initialStrokePaintColor())
71 , paintUri(SVGRenderStyle::initialStrokePaintUri())
75 StyleStrokeData::StyleStrokeData(const StyleStrokeData& other)
76 : RefCounted<StyleStrokeData>()
77 , opacity(other.opacity)
78 , miterLimit(other.miterLimit)
80 , dashOffset(other.dashOffset)
81 , dashArray(other.dashArray)
82 , paintType(other.paintType)
83 , paintColor(other.paintColor)
84 , paintUri(other.paintUri)
88 bool StyleStrokeData::operator==(const StyleStrokeData& other) const
90 return width == other.width
91 && opacity == other.opacity
92 && miterLimit == other.miterLimit
93 && dashOffset == other.dashOffset
94 && dashArray == other.dashArray
95 && paintType == other.paintType
96 && paintColor == other.paintColor
97 && paintUri == other.paintUri;
100 StyleStopData::StyleStopData()
101 : opacity(SVGRenderStyle::initialStopOpacity())
102 , color(SVGRenderStyle::initialStopColor())
106 StyleStopData::StyleStopData(const StyleStopData& other)
107 : RefCounted<StyleStopData>()
108 , opacity(other.opacity)
113 bool StyleStopData::operator==(const StyleStopData& other) const
115 return color == other.color
116 && opacity == other.opacity;
119 StyleTextData::StyleTextData()
120 : kerning(SVGRenderStyle::initialKerning())
124 StyleTextData::StyleTextData(const StyleTextData& other)
125 : RefCounted<StyleTextData>()
126 , kerning(other.kerning)
130 bool StyleTextData::operator==(const StyleTextData& other) const
132 return kerning == other.kerning;
135 StyleMiscData::StyleMiscData()
136 : floodColor(SVGRenderStyle::initialFloodColor())
137 , floodOpacity(SVGRenderStyle::initialFloodOpacity())
138 , lightingColor(SVGRenderStyle::initialLightingColor())
139 , baselineShiftValue(SVGRenderStyle::initialBaselineShiftValue())
143 StyleMiscData::StyleMiscData(const StyleMiscData& other)
144 : RefCounted<StyleMiscData>()
145 , floodColor(other.floodColor)
146 , floodOpacity(other.floodOpacity)
147 , lightingColor(other.lightingColor)
148 , baselineShiftValue(other.baselineShiftValue)
152 bool StyleMiscData::operator==(const StyleMiscData& other) const
154 return floodOpacity == other.floodOpacity
155 && floodColor == other.floodColor
156 && lightingColor == other.lightingColor
157 && baselineShiftValue == other.baselineShiftValue;
160 StyleShadowSVGData::StyleShadowSVGData()
164 StyleShadowSVGData::StyleShadowSVGData(const StyleShadowSVGData& other)
165 : RefCounted<StyleShadowSVGData>()
166 , shadow(other.shadow ? adoptPtr(new ShadowData(*other.shadow)) : nullptr)
170 bool StyleShadowSVGData::operator==(const StyleShadowSVGData& other) const
172 if ((!shadow && other.shadow) || (shadow && !other.shadow))
174 if (shadow && other.shadow && (*shadow != *other.shadow))
179 StyleResourceData::StyleResourceData()
180 : clipper(SVGRenderStyle::initialClipperResource())
181 , filter(SVGRenderStyle::initialFilterResource())
182 , masker(SVGRenderStyle::initialMaskerResource())
186 StyleResourceData::StyleResourceData(const StyleResourceData& other)
187 : RefCounted<StyleResourceData>()
188 , clipper(other.clipper)
189 , filter(other.filter)
190 , masker(other.masker)
194 bool StyleResourceData::operator==(const StyleResourceData& other) const
196 return clipper == other.clipper
197 && filter == other.filter
198 && masker == other.masker;
201 StyleInheritedResourceData::StyleInheritedResourceData()
202 : markerStart(SVGRenderStyle::initialMarkerStartResource())
203 , markerMid(SVGRenderStyle::initialMarkerMidResource())
204 , markerEnd(SVGRenderStyle::initialMarkerEndResource())
208 StyleInheritedResourceData::StyleInheritedResourceData(const StyleInheritedResourceData& other)
209 : RefCounted<StyleInheritedResourceData>()
210 , markerStart(other.markerStart)
211 , markerMid(other.markerMid)
212 , markerEnd(other.markerEnd)
216 bool StyleInheritedResourceData::operator==(const StyleInheritedResourceData& other) const
218 return markerStart == other.markerStart
219 && markerMid == other.markerMid
220 && markerEnd == other.markerEnd;
225 #endif // ENABLE(SVG)