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#include "core/rendering/style/SVGRenderStyleDefs.h" 31 32#include "core/rendering/style/SVGRenderStyle.h" 33 34namespace WebCore { 35 36StyleFillData::StyleFillData() 37 : opacity(SVGRenderStyle::initialFillOpacity()) 38 , paintType(SVGRenderStyle::initialFillPaintType()) 39 , paintColor(SVGRenderStyle::initialFillPaintColor()) 40 , paintUri(SVGRenderStyle::initialFillPaintUri()) 41 , visitedLinkPaintType(SVGRenderStyle::initialStrokePaintType()) 42 , visitedLinkPaintColor(SVGRenderStyle::initialFillPaintColor()) 43 , visitedLinkPaintUri(SVGRenderStyle::initialFillPaintUri()) 44{ 45} 46 47StyleFillData::StyleFillData(const StyleFillData& other) 48 : RefCounted<StyleFillData>() 49 , opacity(other.opacity) 50 , paintType(other.paintType) 51 , paintColor(other.paintColor) 52 , paintUri(other.paintUri) 53 , visitedLinkPaintType(other.visitedLinkPaintType) 54 , visitedLinkPaintColor(other.visitedLinkPaintColor) 55 , visitedLinkPaintUri(other.visitedLinkPaintUri) 56{ 57} 58 59bool StyleFillData::operator==(const StyleFillData& other) const 60{ 61 return opacity == other.opacity 62 && paintType == other.paintType 63 && paintColor == other.paintColor 64 && paintUri == other.paintUri 65 && visitedLinkPaintType == other.visitedLinkPaintType 66 && visitedLinkPaintColor == other.visitedLinkPaintColor 67 && visitedLinkPaintUri == other.visitedLinkPaintUri; 68} 69 70StyleStrokeData::StyleStrokeData() 71 : opacity(SVGRenderStyle::initialStrokeOpacity()) 72 , miterLimit(SVGRenderStyle::initialStrokeMiterLimit()) 73 , width(SVGRenderStyle::initialStrokeWidth()) 74 , dashOffset(SVGRenderStyle::initialStrokeDashOffset()) 75 , dashArray(SVGRenderStyle::initialStrokeDashArray()) 76 , paintType(SVGRenderStyle::initialStrokePaintType()) 77 , paintColor(SVGRenderStyle::initialStrokePaintColor()) 78 , paintUri(SVGRenderStyle::initialStrokePaintUri()) 79 , visitedLinkPaintType(SVGRenderStyle::initialStrokePaintType()) 80 , visitedLinkPaintColor(SVGRenderStyle::initialStrokePaintColor()) 81 , visitedLinkPaintUri(SVGRenderStyle::initialStrokePaintUri()) 82{ 83} 84 85StyleStrokeData::StyleStrokeData(const StyleStrokeData& other) 86 : RefCounted<StyleStrokeData>() 87 , opacity(other.opacity) 88 , miterLimit(other.miterLimit) 89 , width(other.width) 90 , dashOffset(other.dashOffset) 91 , dashArray(other.dashArray) 92 , paintType(other.paintType) 93 , paintColor(other.paintColor) 94 , paintUri(other.paintUri) 95 , visitedLinkPaintType(other.visitedLinkPaintType) 96 , visitedLinkPaintColor(other.visitedLinkPaintColor) 97 , visitedLinkPaintUri(other.visitedLinkPaintUri) 98{ 99} 100 101bool StyleStrokeData::operator==(const StyleStrokeData& other) const 102{ 103 return width == other.width 104 && opacity == other.opacity 105 && miterLimit == other.miterLimit 106 && dashOffset == other.dashOffset 107 && dashArray == other.dashArray 108 && paintType == other.paintType 109 && paintColor == other.paintColor 110 && paintUri == other.paintUri 111 && visitedLinkPaintType == other.visitedLinkPaintType 112 && visitedLinkPaintColor == other.visitedLinkPaintColor 113 && visitedLinkPaintUri == other.visitedLinkPaintUri; 114} 115 116StyleStopData::StyleStopData() 117 : opacity(SVGRenderStyle::initialStopOpacity()) 118 , color(SVGRenderStyle::initialStopColor()) 119{ 120} 121 122StyleStopData::StyleStopData(const StyleStopData& other) 123 : RefCounted<StyleStopData>() 124 , opacity(other.opacity) 125 , color(other.color) 126{ 127} 128 129bool StyleStopData::operator==(const StyleStopData& other) const 130{ 131 return color == other.color 132 && opacity == other.opacity; 133} 134 135StyleTextData::StyleTextData() 136 : kerning(SVGRenderStyle::initialKerning()) 137{ 138} 139 140StyleTextData::StyleTextData(const StyleTextData& other) 141 : RefCounted<StyleTextData>() 142 , kerning(other.kerning) 143{ 144} 145 146bool StyleTextData::operator==(const StyleTextData& other) const 147{ 148 return kerning == other.kerning; 149} 150 151StyleMiscData::StyleMiscData() 152 : floodColor(SVGRenderStyle::initialFloodColor()) 153 , floodOpacity(SVGRenderStyle::initialFloodOpacity()) 154 , lightingColor(SVGRenderStyle::initialLightingColor()) 155 , baselineShiftValue(SVGRenderStyle::initialBaselineShiftValue()) 156{ 157} 158 159StyleMiscData::StyleMiscData(const StyleMiscData& other) 160 : RefCounted<StyleMiscData>() 161 , floodColor(other.floodColor) 162 , floodOpacity(other.floodOpacity) 163 , lightingColor(other.lightingColor) 164 , baselineShiftValue(other.baselineShiftValue) 165{ 166} 167 168bool StyleMiscData::operator==(const StyleMiscData& other) const 169{ 170 return floodOpacity == other.floodOpacity 171 && floodColor == other.floodColor 172 && lightingColor == other.lightingColor 173 && baselineShiftValue == other.baselineShiftValue; 174} 175 176StyleResourceData::StyleResourceData() 177 : clipper(SVGRenderStyle::initialClipperResource()) 178 , filter(SVGRenderStyle::initialFilterResource()) 179 , masker(SVGRenderStyle::initialMaskerResource()) 180{ 181} 182 183StyleResourceData::StyleResourceData(const StyleResourceData& other) 184 : RefCounted<StyleResourceData>() 185 , clipper(other.clipper) 186 , filter(other.filter) 187 , masker(other.masker) 188{ 189} 190 191bool StyleResourceData::operator==(const StyleResourceData& other) const 192{ 193 return clipper == other.clipper 194 && filter == other.filter 195 && masker == other.masker; 196} 197 198StyleInheritedResourceData::StyleInheritedResourceData() 199 : markerStart(SVGRenderStyle::initialMarkerStartResource()) 200 , markerMid(SVGRenderStyle::initialMarkerMidResource()) 201 , markerEnd(SVGRenderStyle::initialMarkerEndResource()) 202{ 203} 204 205StyleInheritedResourceData::StyleInheritedResourceData(const StyleInheritedResourceData& other) 206 : RefCounted<StyleInheritedResourceData>() 207 , markerStart(other.markerStart) 208 , markerMid(other.markerMid) 209 , markerEnd(other.markerEnd) 210{ 211} 212 213bool StyleInheritedResourceData::operator==(const StyleInheritedResourceData& other) const 214{ 215 return markerStart == other.markerStart 216 && markerMid == other.markerMid 217 && markerEnd == other.markerEnd; 218} 219 220} 221