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())
43
, visitedLinkPaintType(SVGRenderStyle::initialStrokePaintType())
44
, visitedLinkPaintColor(SVGRenderStyle::initialFillPaintColor())
45
, visitedLinkPaintUri(SVGRenderStyle::initialFillPaintUri())
49
StyleFillData::StyleFillData(const StyleFillData& other)
50
: RefCounted<StyleFillData>()
51
, opacity(other.opacity)
52
, paintType(other.paintType)
53
, paintColor(other.paintColor)
54
, paintUri(other.paintUri)
55
, visitedLinkPaintType(other.visitedLinkPaintType)
56
, visitedLinkPaintColor(other.visitedLinkPaintColor)
57
, visitedLinkPaintUri(other.visitedLinkPaintUri)
61
bool StyleFillData::operator==(const StyleFillData& other) const
63
return opacity == other.opacity
64
&& paintType == other.paintType
65
&& paintColor == other.paintColor
66
&& paintUri == other.paintUri
67
&& visitedLinkPaintType == other.visitedLinkPaintType
68
&& visitedLinkPaintColor == other.visitedLinkPaintColor
69
&& visitedLinkPaintUri == other.visitedLinkPaintUri;
72
StyleStrokeData::StyleStrokeData()
73
: opacity(SVGRenderStyle::initialStrokeOpacity())
74
, miterLimit(SVGRenderStyle::initialStrokeMiterLimit())
75
, width(SVGRenderStyle::initialStrokeWidth())
76
, dashOffset(SVGRenderStyle::initialStrokeDashOffset())
77
, dashArray(SVGRenderStyle::initialStrokeDashArray())
78
, paintType(SVGRenderStyle::initialStrokePaintType())
79
, paintColor(SVGRenderStyle::initialStrokePaintColor())
80
, paintUri(SVGRenderStyle::initialStrokePaintUri())
81
, visitedLinkPaintType(SVGRenderStyle::initialStrokePaintType())
82
, visitedLinkPaintColor(SVGRenderStyle::initialStrokePaintColor())
83
, visitedLinkPaintUri(SVGRenderStyle::initialStrokePaintUri())
87
StyleStrokeData::StyleStrokeData(const StyleStrokeData& other)
88
: RefCounted<StyleStrokeData>()
89
, opacity(other.opacity)
90
, miterLimit(other.miterLimit)
92
, dashOffset(other.dashOffset)
93
, dashArray(other.dashArray)
94
, paintType(other.paintType)
95
, paintColor(other.paintColor)
96
, paintUri(other.paintUri)
97
, visitedLinkPaintType(other.visitedLinkPaintType)
98
, visitedLinkPaintColor(other.visitedLinkPaintColor)
99
, visitedLinkPaintUri(other.visitedLinkPaintUri)
103
bool StyleStrokeData::operator==(const StyleStrokeData& other) const
105
return width == other.width
106
&& opacity == other.opacity
107
&& miterLimit == other.miterLimit
108
&& dashOffset == other.dashOffset
109
&& dashArray == other.dashArray
110
&& paintType == other.paintType
111
&& paintColor == other.paintColor
112
&& paintUri == other.paintUri
113
&& visitedLinkPaintType == other.visitedLinkPaintType
114
&& visitedLinkPaintColor == other.visitedLinkPaintColor
115
&& visitedLinkPaintUri == other.visitedLinkPaintUri;
118
StyleStopData::StyleStopData()
119
: opacity(SVGRenderStyle::initialStopOpacity())
120
, color(SVGRenderStyle::initialStopColor())
124
StyleStopData::StyleStopData(const StyleStopData& other)
125
: RefCounted<StyleStopData>()
126
, opacity(other.opacity)
131
bool StyleStopData::operator==(const StyleStopData& other) const
133
return color == other.color
134
&& opacity == other.opacity;
137
StyleTextData::StyleTextData()
138
: kerning(SVGRenderStyle::initialKerning())
142
StyleTextData::StyleTextData(const StyleTextData& other)
143
: RefCounted<StyleTextData>()
144
, kerning(other.kerning)
148
bool StyleTextData::operator==(const StyleTextData& other) const
150
return kerning == other.kerning;
153
StyleMiscData::StyleMiscData()
154
: floodColor(SVGRenderStyle::initialFloodColor())
155
, floodOpacity(SVGRenderStyle::initialFloodOpacity())
156
, lightingColor(SVGRenderStyle::initialLightingColor())
157
, baselineShiftValue(SVGRenderStyle::initialBaselineShiftValue())
161
StyleMiscData::StyleMiscData(const StyleMiscData& other)
162
: RefCounted<StyleMiscData>()
163
, floodColor(other.floodColor)
164
, floodOpacity(other.floodOpacity)
165
, lightingColor(other.lightingColor)
166
, baselineShiftValue(other.baselineShiftValue)
170
bool StyleMiscData::operator==(const StyleMiscData& other) const
172
return floodOpacity == other.floodOpacity
173
&& floodColor == other.floodColor
174
&& lightingColor == other.lightingColor
175
&& baselineShiftValue == other.baselineShiftValue;
178
StyleShadowSVGData::StyleShadowSVGData()
182
StyleShadowSVGData::StyleShadowSVGData(const StyleShadowSVGData& other)
183
: RefCounted<StyleShadowSVGData>()
184
, shadow(other.shadow ? adoptPtr(new ShadowData(*other.shadow)) : nullptr)
188
bool StyleShadowSVGData::operator==(const StyleShadowSVGData& other) const
190
if ((!shadow && other.shadow) || (shadow && !other.shadow))
192
if (shadow && other.shadow && (*shadow != *other.shadow))
197
StyleResourceData::StyleResourceData()
198
: clipper(SVGRenderStyle::initialClipperResource())
199
, filter(SVGRenderStyle::initialFilterResource())
200
, masker(SVGRenderStyle::initialMaskerResource())
204
StyleResourceData::StyleResourceData(const StyleResourceData& other)
205
: RefCounted<StyleResourceData>()
206
, clipper(other.clipper)
207
, filter(other.filter)
208
, masker(other.masker)
212
bool StyleResourceData::operator==(const StyleResourceData& other) const
214
return clipper == other.clipper
215
&& filter == other.filter
216
&& masker == other.masker;
219
StyleInheritedResourceData::StyleInheritedResourceData()
220
: markerStart(SVGRenderStyle::initialMarkerStartResource())
221
, markerMid(SVGRenderStyle::initialMarkerMidResource())
222
, markerEnd(SVGRenderStyle::initialMarkerEndResource())
226
StyleInheritedResourceData::StyleInheritedResourceData(const StyleInheritedResourceData& other)
227
: RefCounted<StyleInheritedResourceData>()
228
, markerStart(other.markerStart)
229
, markerMid(other.markerMid)
230
, markerEnd(other.markerEnd)
234
bool StyleInheritedResourceData::operator==(const StyleInheritedResourceData& other) const
236
return markerStart == other.markerStart
237
&& markerMid == other.markerMid
238
&& markerEnd == other.markerEnd;
243
#endif // ENABLE(SVG)