OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 ASSERT_NOT_REACHED(); | 83 ASSERT_NOT_REACHED(); |
84 } | 84 } |
85 | 85 |
86 RenderObject* SVGStopElement::createRenderer(RenderStyle*) | 86 RenderObject* SVGStopElement::createRenderer(RenderStyle*) |
87 { | 87 { |
88 return new RenderSVGGradientStop(this); | 88 return new RenderSVGGradientStop(this); |
89 } | 89 } |
90 | 90 |
91 bool SVGStopElement::rendererIsNeeded(const RenderStyle&) | 91 bool SVGStopElement::rendererIsNeeded(const RenderStyle&) |
92 { | 92 { |
93 return true; | 93 return ((parentOrShadowHostElement() && parentOrShadowHostElement()->isSVGEl ement()) && isValid()); |
esprehn
2014/06/17 23:09:40
remove parens
| |
94 } | 94 } |
95 | 95 |
96 Color SVGStopElement::stopColorIncludingOpacity() const | 96 Color SVGStopElement::stopColorIncludingOpacity() const |
97 { | 97 { |
98 RenderStyle* style = renderer() ? renderer()->style() : 0; | 98 RenderStyle* style = renderer() ? renderer()->style() : 0; |
99 // FIXME: This check for null style exists to address Bug WK 90814, a rare c rash condition in | 99 // FIXME: This check for null style exists to address Bug WK 90814, a rare c rash condition in |
100 // which the renderer or style is null. This entire class is scheduled for r emoval (Bug WK 86941) | 100 // which the renderer or style is null. This entire class is scheduled for r emoval (Bug WK 86941) |
101 // and we will tolerate this null check until then. | 101 // and we will tolerate this null check until then. |
102 if (!style || !style->svgStyle()) | 102 if (!style || !style->svgStyle()) |
103 return Color(Color::transparent); // Transparent black. | 103 return Color(Color::transparent); // Transparent black. |
104 | 104 |
105 const SVGRenderStyle* svgStyle = style->svgStyle(); | 105 const SVGRenderStyle* svgStyle = style->svgStyle(); |
106 return svgStyle->stopColor().combineWithAlpha(svgStyle->stopOpacity()); | 106 return svgStyle->stopColor().combineWithAlpha(svgStyle->stopOpacity()); |
107 } | 107 } |
108 | 108 |
109 } | 109 } |
OLD | NEW |