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 19 matching lines...) Expand all Loading... |
30 namespace WebCore { | 30 namespace WebCore { |
31 | 31 |
32 // Animated property definitions | 32 // Animated property definitions |
33 DEFINE_ANIMATED_NUMBER(SVGStopElement, SVGNames::offsetAttr, Offset, offset) | 33 DEFINE_ANIMATED_NUMBER(SVGStopElement, SVGNames::offsetAttr, Offset, offset) |
34 | 34 |
35 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGStopElement) | 35 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGStopElement) |
36 REGISTER_LOCAL_ANIMATED_PROPERTY(offset) | 36 REGISTER_LOCAL_ANIMATED_PROPERTY(offset) |
37 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) | 37 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) |
38 END_REGISTER_ANIMATED_PROPERTIES | 38 END_REGISTER_ANIMATED_PROPERTIES |
39 | 39 |
40 inline SVGStopElement::SVGStopElement(const QualifiedName& tagName, Document* do
cument) | 40 inline SVGStopElement::SVGStopElement(const QualifiedName& tagName, Document& do
cument) |
41 : SVGElement(tagName, document) | 41 : SVGElement(tagName, document) |
42 , m_offset(0) | 42 , m_offset(0) |
43 { | 43 { |
44 ASSERT(hasTagName(SVGNames::stopTag)); | 44 ASSERT(hasTagName(SVGNames::stopTag)); |
45 ScriptWrappable::init(this); | 45 ScriptWrappable::init(this); |
46 registerAnimatedPropertiesForSVGStopElement(); | 46 registerAnimatedPropertiesForSVGStopElement(); |
47 } | 47 } |
48 | 48 |
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<SVGAttributeHashTranslator>(attrName); | 59 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
(...skipping 54 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); // Transparent black. | 117 return Color(Color::transparent); // 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 |