Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp

Issue 7002001: Revert 79985 - 2011-03-01 Nikolas Zimmermann <nzimmermann@rim.com> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005, 2007 Rob Buis <buis@kde.org> 3 2004, 2005, 2007 Rob Buis <buis@kde.org>
4 Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 5
6 Based on khtml code by: 6 Based on khtml code by:
7 Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 7 Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
8 Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) 8 Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
9 Copyright (C) 2002-2003 Dirk Mueller (mueller@kde.org) 9 Copyright (C) 2002-2003 Dirk Mueller (mueller@kde.org)
10 Copyright (C) 2002 Apple Computer, Inc. 10 Copyright (C) 2002 Apple Computer, Inc.
(...skipping 19 matching lines...) Expand all
30 #if ENABLE(SVG) 30 #if ENABLE(SVG)
31 #include "SVGRenderStyleDefs.h" 31 #include "SVGRenderStyleDefs.h"
32 32
33 #include "RenderStyle.h" 33 #include "RenderStyle.h"
34 #include "SVGRenderStyle.h" 34 #include "SVGRenderStyle.h"
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 StyleFillData::StyleFillData() 38 StyleFillData::StyleFillData()
39 : opacity(SVGRenderStyle::initialFillOpacity()) 39 : opacity(SVGRenderStyle::initialFillOpacity())
40 , paintType(SVGRenderStyle::initialFillPaintType()) 40 , paint(SVGRenderStyle::initialFillPaint())
41 , paintColor(SVGRenderStyle::initialFillPaintColor())
42 , paintUri(SVGRenderStyle::initialFillPaintUri())
43 { 41 {
44 } 42 }
45 43
46 StyleFillData::StyleFillData(const StyleFillData& other) 44 StyleFillData::StyleFillData(const StyleFillData& other)
47 : RefCounted<StyleFillData>() 45 : RefCounted<StyleFillData>()
48 , opacity(other.opacity) 46 , opacity(other.opacity)
49 , paintType(other.paintType) 47 , paint(other.paint)
50 , paintColor(other.paintColor)
51 , paintUri(other.paintUri)
52 { 48 {
53 } 49 }
54 50
55 bool StyleFillData::operator==(const StyleFillData& other) const 51 bool StyleFillData::operator==(const StyleFillData& other) const
56 { 52 {
57 return opacity == other.opacity 53 if (opacity != other.opacity)
58 && paintType == other.paintType 54 return false;
59 && paintColor == other.paintColor 55
60 && paintUri == other.paintUri; 56 if (!paint || !other.paint)
57 return paint == other.paint;
58
59 if (paint->paintType() != other.paint->paintType())
60 return false;
61
62 if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_URI)
63 return paint->uri() == other.paint->uri();
64
65 if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_RGBCOLOR)
66 return paint->color() == other.paint->color();
67
68 return paint == other.paint;
61 } 69 }
62 70
63 StyleStrokeData::StyleStrokeData() 71 StyleStrokeData::StyleStrokeData()
64 : opacity(SVGRenderStyle::initialStrokeOpacity()) 72 : opacity(SVGRenderStyle::initialStrokeOpacity())
65 , miterLimit(SVGRenderStyle::initialStrokeMiterLimit()) 73 , miterLimit(SVGRenderStyle::initialStrokeMiterLimit())
66 , width(SVGRenderStyle::initialStrokeWidth()) 74 , width(SVGRenderStyle::initialStrokeWidth())
67 , dashOffset(SVGRenderStyle::initialStrokeDashOffset()) 75 , dashOffset(SVGRenderStyle::initialStrokeDashOffset())
68 , dashArray(SVGRenderStyle::initialStrokeDashArray()) 76 , dashArray(SVGRenderStyle::initialStrokeDashArray())
69 , paintType(SVGRenderStyle::initialStrokePaintType()) 77 , paint(SVGRenderStyle::initialStrokePaint())
70 , paintColor(SVGRenderStyle::initialStrokePaintColor())
71 , paintUri(SVGRenderStyle::initialStrokePaintUri())
72 { 78 {
73 } 79 }
74 80
75 StyleStrokeData::StyleStrokeData(const StyleStrokeData& other) 81 StyleStrokeData::StyleStrokeData(const StyleStrokeData& other)
76 : RefCounted<StyleStrokeData>() 82 : RefCounted<StyleStrokeData>()
77 , opacity(other.opacity) 83 , opacity(other.opacity)
78 , miterLimit(other.miterLimit) 84 , miterLimit(other.miterLimit)
79 , width(other.width) 85 , width(other.width)
80 , dashOffset(other.dashOffset) 86 , dashOffset(other.dashOffset)
81 , dashArray(other.dashArray) 87 , dashArray(other.dashArray)
82 , paintType(other.paintType) 88 , paint(other.paint)
83 , paintColor(other.paintColor)
84 , paintUri(other.paintUri)
85 { 89 {
86 } 90 }
87 91
88 bool StyleStrokeData::operator==(const StyleStrokeData& other) const 92 bool StyleStrokeData::operator==(const StyleStrokeData& other) const
89 { 93 {
90 return width == other.width 94 return paint == other.paint
95 && width == other.width
91 && opacity == other.opacity 96 && opacity == other.opacity
92 && miterLimit == other.miterLimit 97 && miterLimit == other.miterLimit
93 && dashOffset == other.dashOffset 98 && dashOffset == other.dashOffset
94 && dashArray == other.dashArray 99 && dashArray == other.dashArray;
95 && paintType == other.paintType
96 && paintColor == other.paintColor
97 && paintUri == other.paintUri;
98 } 100 }
99 101
100 StyleStopData::StyleStopData() 102 StyleStopData::StyleStopData()
101 : opacity(SVGRenderStyle::initialStopOpacity()) 103 : opacity(SVGRenderStyle::initialStopOpacity())
102 , color(SVGRenderStyle::initialStopColor()) 104 , color(SVGRenderStyle::initialStopColor())
103 { 105 {
104 } 106 }
105 107
106 StyleStopData::StyleStopData(const StyleStopData& other) 108 StyleStopData::StyleStopData(const StyleStopData& other)
107 : RefCounted<StyleStopData>() 109 : RefCounted<StyleStopData>()
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 bool StyleInheritedResourceData::operator==(const StyleInheritedResourceData& ot her) const 218 bool StyleInheritedResourceData::operator==(const StyleInheritedResourceData& ot her) const
217 { 219 {
218 return markerStart == other.markerStart 220 return markerStart == other.markerStart
219 && markerMid == other.markerMid 221 && markerMid == other.markerMid
220 && markerEnd == other.markerEnd; 222 && markerEnd == other.markerEnd;
221 } 223 }
222 224
223 } 225 }
224 226
225 #endif // ENABLE(SVG) 227 #endif // ENABLE(SVG)
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/style/SVGRenderStyleDefs.h ('k') | Source/WebCore/rendering/svg/RenderSVGResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698