~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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.
 
5
 
 
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.
 
11
 
 
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.
 
16
 
 
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.
 
21
 
 
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.
 
26
*/
 
27
 
 
28
#include "config.h"
 
29
 
 
30
#if ENABLE(SVG)
 
31
#include "SVGRenderStyleDefs.h"
 
32
 
 
33
#include "RenderStyle.h"
 
34
#include "SVGRenderStyle.h"
 
35
 
 
36
namespace WebCore {
 
37
 
 
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())
 
46
{
 
47
}
 
48
 
 
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)
 
58
{
 
59
}
 
60
 
 
61
bool StyleFillData::operator==(const StyleFillData& other) const
 
62
{
 
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;
 
70
}
 
71
 
 
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())
 
84
{
 
85
}
 
86
 
 
87
StyleStrokeData::StyleStrokeData(const StyleStrokeData& other)
 
88
    : RefCounted<StyleStrokeData>()
 
89
    , opacity(other.opacity)
 
90
    , miterLimit(other.miterLimit)
 
91
    , width(other.width)
 
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)
 
100
{
 
101
}
 
102
 
 
103
bool StyleStrokeData::operator==(const StyleStrokeData& other) const
 
104
{
 
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;
 
116
}
 
117
 
 
118
StyleStopData::StyleStopData()
 
119
    : opacity(SVGRenderStyle::initialStopOpacity())
 
120
    , color(SVGRenderStyle::initialStopColor())
 
121
{
 
122
}
 
123
 
 
124
StyleStopData::StyleStopData(const StyleStopData& other)
 
125
    : RefCounted<StyleStopData>()
 
126
    , opacity(other.opacity)
 
127
    , color(other.color)
 
128
{
 
129
}
 
130
 
 
131
bool StyleStopData::operator==(const StyleStopData& other) const
 
132
{
 
133
    return color == other.color
 
134
        && opacity == other.opacity;
 
135
}
 
136
 
 
137
StyleTextData::StyleTextData()
 
138
    : kerning(SVGRenderStyle::initialKerning())
 
139
{
 
140
}
 
141
 
 
142
StyleTextData::StyleTextData(const StyleTextData& other)
 
143
    : RefCounted<StyleTextData>()
 
144
    , kerning(other.kerning)
 
145
{
 
146
}
 
147
 
 
148
bool StyleTextData::operator==(const StyleTextData& other) const
 
149
{
 
150
    return kerning == other.kerning;
 
151
}
 
152
 
 
153
StyleMiscData::StyleMiscData()
 
154
    : floodColor(SVGRenderStyle::initialFloodColor())
 
155
    , floodOpacity(SVGRenderStyle::initialFloodOpacity())
 
156
    , lightingColor(SVGRenderStyle::initialLightingColor())
 
157
    , baselineShiftValue(SVGRenderStyle::initialBaselineShiftValue())
 
158
{
 
159
}
 
160
 
 
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)
 
167
{
 
168
}
 
169
 
 
170
bool StyleMiscData::operator==(const StyleMiscData& other) const
 
171
{
 
172
    return floodOpacity == other.floodOpacity
 
173
        && floodColor == other.floodColor
 
174
        && lightingColor == other.lightingColor
 
175
        && baselineShiftValue == other.baselineShiftValue;
 
176
}
 
177
 
 
178
StyleShadowSVGData::StyleShadowSVGData()
 
179
{
 
180
}
 
181
 
 
182
StyleShadowSVGData::StyleShadowSVGData(const StyleShadowSVGData& other)
 
183
    : RefCounted<StyleShadowSVGData>()
 
184
    , shadow(other.shadow ? adoptPtr(new ShadowData(*other.shadow)) : nullptr)
 
185
{
 
186
}
 
187
 
 
188
bool StyleShadowSVGData::operator==(const StyleShadowSVGData& other) const
 
189
{
 
190
    if ((!shadow && other.shadow) || (shadow && !other.shadow))
 
191
        return false;
 
192
    if (shadow && other.shadow && (*shadow != *other.shadow))
 
193
        return false;
 
194
    return true;
 
195
}
 
196
 
 
197
StyleResourceData::StyleResourceData()
 
198
    : clipper(SVGRenderStyle::initialClipperResource())
 
199
    , filter(SVGRenderStyle::initialFilterResource())
 
200
    , masker(SVGRenderStyle::initialMaskerResource())
 
201
{
 
202
}
 
203
 
 
204
StyleResourceData::StyleResourceData(const StyleResourceData& other)
 
205
    : RefCounted<StyleResourceData>()
 
206
    , clipper(other.clipper)
 
207
    , filter(other.filter)
 
208
    , masker(other.masker)
 
209
{
 
210
}
 
211
 
 
212
bool StyleResourceData::operator==(const StyleResourceData& other) const
 
213
{
 
214
    return clipper == other.clipper
 
215
        && filter == other.filter
 
216
        && masker == other.masker;
 
217
}
 
218
 
 
219
StyleInheritedResourceData::StyleInheritedResourceData()
 
220
    : markerStart(SVGRenderStyle::initialMarkerStartResource())
 
221
    , markerMid(SVGRenderStyle::initialMarkerMidResource())
 
222
    , markerEnd(SVGRenderStyle::initialMarkerEndResource())
 
223
{
 
224
}
 
225
 
 
226
StyleInheritedResourceData::StyleInheritedResourceData(const StyleInheritedResourceData& other)
 
227
    : RefCounted<StyleInheritedResourceData>()
 
228
    , markerStart(other.markerStart)
 
229
    , markerMid(other.markerMid)
 
230
    , markerEnd(other.markerEnd)
 
231
{
 
232
}
 
233
 
 
234
bool StyleInheritedResourceData::operator==(const StyleInheritedResourceData& other) const
 
235
{
 
236
    return markerStart == other.markerStart
 
237
        && markerMid == other.markerMid
 
238
        && markerEnd == other.markerEnd;
 
239
}
 
240
 
 
241
}
 
242
 
 
243
#endif // ENABLE(SVG)