| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 PassRefPtr<SVGStopElement> SVGStopElement::create(const QualifiedName& tagName,
Document* document) | 49 PassRefPtr<SVGStopElement> SVGStopElement::create(const QualifiedName& tagName,
Document* document) |
| 50 { | 50 { |
| 51 return adoptRef(new SVGStopElement(tagName, document)); | 51 return adoptRef(new SVGStopElement(tagName, document)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool SVGStopElement::isSupportedAttribute(const QualifiedName& attrName) | 54 bool SVGStopElement::isSupportedAttribute(const QualifiedName& attrName) |
| 55 { | 55 { |
| 56 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 56 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 57 if (supportedAttributes.isEmpty()) | 57 if (supportedAttributes.isEmpty()) |
| 58 supportedAttributes.add(SVGNames::offsetAttr); | 58 supportedAttributes.add(SVGNames::offsetAttr); |
| 59 return supportedAttributes.contains<QualifiedName, SVGAttributeHashTranslato
r>(attrName); | 59 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void SVGStopElement::parseAttribute(const QualifiedName& name, const AtomicStrin
g& value) | 62 void SVGStopElement::parseAttribute(const QualifiedName& name, const AtomicStrin
g& value) |
| 63 { | 63 { |
| 64 if (!isSupportedAttribute(name)) { | 64 if (!isSupportedAttribute(name)) { |
| 65 SVGStyledElement::parseAttribute(name, value); | 65 SVGStyledElement::parseAttribute(name, value); |
| 66 return; | 66 return; |
| 67 } | 67 } |
| 68 | 68 |
| 69 if (name == SVGNames::offsetAttr) { | 69 if (name == SVGNames::offsetAttr) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // which the renderer or style is null. This entire class is scheduled for r
emoval (Bug WK 86941) | 114 // which the renderer or style is null. This entire class is scheduled for r
emoval (Bug WK 86941) |
| 115 // and we will tolerate this null check until then. | 115 // and we will tolerate this null check until then. |
| 116 if (!style || !style->svgStyle()) | 116 if (!style || !style->svgStyle()) |
| 117 return Color(Color::transparent, true); // Transparent black. | 117 return Color(Color::transparent, true); // Transparent black. |
| 118 | 118 |
| 119 const SVGRenderStyle* svgStyle = style->svgStyle(); | 119 const SVGRenderStyle* svgStyle = style->svgStyle(); |
| 120 return colorWithOverrideAlpha(svgStyle->stopColor().rgb(), svgStyle->stopOpa
city()); | 120 return colorWithOverrideAlpha(svgStyle->stopColor().rgb(), svgStyle->stopOpa
city()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } | 123 } |
| OLD | NEW |