Chromium Code Reviews| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 SVGElement::InvalidationGuard invalidationGuard(this); | 51 SVGElement::InvalidationGuard invalidationGuard(this); |
| 52 | 52 |
| 53 if (renderer()) | 53 if (renderer()) |
| 54 markForLayoutAndParentResourceInvalidation(renderer()); | 54 markForLayoutAndParentResourceInvalidation(renderer()); |
| 55 return; | 55 return; |
| 56 } | 56 } |
| 57 | 57 |
| 58 SVGElement::svgAttributeChanged(attrName); | 58 SVGElement::svgAttributeChanged(attrName); |
| 59 } | 59 } |
| 60 | 60 |
| 61 RenderObject* SVGStopElement::createRenderer(RenderStyle*) | 61 RenderObject* SVGStopElement::createRenderer(const RenderStyle*) |
| 62 { | 62 { |
| 63 return new RenderSVGGradientStop(this); | 63 return new RenderSVGGradientStop(this); |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool SVGStopElement::rendererIsNeeded(const RenderStyle&) | 66 bool SVGStopElement::rendererIsNeeded(const RenderStyle&) |
| 67 { | 67 { |
| 68 return true; | 68 return true; |
| 69 } | 69 } |
| 70 | 70 |
| 71 Color SVGStopElement::stopColorIncludingOpacity() const | 71 Color SVGStopElement::stopColorIncludingOpacity() const |
| 72 { | 72 { |
| 73 RenderStyle* style = renderer() ? renderer()->style() : 0; | 73 const RenderStyle* style = renderer() ? renderer()->style() : 0; |
|
rune
2015/01/29 23:16:32
Does nullptr instead of 0 work here?
Julien - ping for review
2015/02/10 07:33:20
Done.
| |
| 74 // FIXME: This check for null style exists to address Bug WK 90814, a rare c rash condition in | 74 // FIXME: This check for null style exists to address Bug WK 90814, a rare c rash condition in |
| 75 // which the renderer or style is null. This entire class is scheduled for r emoval (Bug WK 86941) | 75 // which the renderer or style is null. This entire class is scheduled for r emoval (Bug WK 86941) |
| 76 // and we will tolerate this null check until then. | 76 // and we will tolerate this null check until then. |
| 77 if (!style) | 77 if (!style) |
| 78 return Color(Color::transparent); // Transparent black. | 78 return Color(Color::transparent); // Transparent black. |
| 79 | 79 |
| 80 const SVGRenderStyle& svgStyle = style->svgStyle(); | 80 const SVGRenderStyle& svgStyle = style->svgStyle(); |
| 81 return svgStyle.stopColor().combineWithAlpha(svgStyle.stopOpacity()); | 81 return svgStyle.stopColor().combineWithAlpha(svgStyle.stopOpacity()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace blink | 84 } // namespace blink |
| OLD | NEW |