OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 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 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 30 matching lines...) Expand all Loading... |
41 DEFINE_ANIMATED_LENGTH(SVGLinearGradientElement, SVGNames::y2Attr, Y2, y2) | 41 DEFINE_ANIMATED_LENGTH(SVGLinearGradientElement, SVGNames::y2Attr, Y2, y2) |
42 | 42 |
43 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGLinearGradientElement) | 43 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGLinearGradientElement) |
44 REGISTER_LOCAL_ANIMATED_PROPERTY(x1) | 44 REGISTER_LOCAL_ANIMATED_PROPERTY(x1) |
45 REGISTER_LOCAL_ANIMATED_PROPERTY(y1) | 45 REGISTER_LOCAL_ANIMATED_PROPERTY(y1) |
46 REGISTER_LOCAL_ANIMATED_PROPERTY(x2) | 46 REGISTER_LOCAL_ANIMATED_PROPERTY(x2) |
47 REGISTER_LOCAL_ANIMATED_PROPERTY(y2) | 47 REGISTER_LOCAL_ANIMATED_PROPERTY(y2) |
48 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGradientElement) | 48 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGradientElement) |
49 END_REGISTER_ANIMATED_PROPERTIES | 49 END_REGISTER_ANIMATED_PROPERTIES |
50 | 50 |
51 inline SVGLinearGradientElement::SVGLinearGradientElement(const QualifiedName& t
agName, Document& document) | 51 inline SVGLinearGradientElement::SVGLinearGradientElement(Document& document) |
52 : SVGGradientElement(tagName, document) | 52 : SVGGradientElement(SVGNames::linearGradientTag, document) |
53 , m_x1(LengthModeWidth) | 53 , m_x1(LengthModeWidth) |
54 , m_y1(LengthModeHeight) | 54 , m_y1(LengthModeHeight) |
55 , m_x2(LengthModeWidth, "100%") | 55 , m_x2(LengthModeWidth, "100%") |
56 , m_y2(LengthModeHeight) | 56 , m_y2(LengthModeHeight) |
57 { | 57 { |
58 // Spec: If the x2 attribute is not specified, the effect is as if a value o
f "100%" were specified. | 58 // Spec: If the x2 attribute is not specified, the effect is as if a value o
f "100%" were specified. |
59 ASSERT(hasTagName(SVGNames::linearGradientTag)); | |
60 ScriptWrappable::init(this); | 59 ScriptWrappable::init(this); |
61 registerAnimatedPropertiesForSVGLinearGradientElement(); | 60 registerAnimatedPropertiesForSVGLinearGradientElement(); |
62 } | 61 } |
63 | 62 |
64 PassRefPtr<SVGLinearGradientElement> SVGLinearGradientElement::create(const Qual
ifiedName& tagName, Document& document) | 63 PassRefPtr<SVGLinearGradientElement> SVGLinearGradientElement::create(Document&
document) |
65 { | 64 { |
66 return adoptRef(new SVGLinearGradientElement(tagName, document)); | 65 return adoptRef(new SVGLinearGradientElement(document)); |
67 } | 66 } |
68 | 67 |
69 bool SVGLinearGradientElement::isSupportedAttribute(const QualifiedName& attrNam
e) | 68 bool SVGLinearGradientElement::isSupportedAttribute(const QualifiedName& attrNam
e) |
70 { | 69 { |
71 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 70 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
72 if (supportedAttributes.isEmpty()) { | 71 if (supportedAttributes.isEmpty()) { |
73 supportedAttributes.add(SVGNames::x1Attr); | 72 supportedAttributes.add(SVGNames::x1Attr); |
74 supportedAttributes.add(SVGNames::x2Attr); | 73 supportedAttributes.add(SVGNames::x2Attr); |
75 supportedAttributes.add(SVGNames::y1Attr); | 74 supportedAttributes.add(SVGNames::y1Attr); |
76 supportedAttributes.add(SVGNames::y2Attr); | 75 supportedAttributes.add(SVGNames::y2Attr); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 186 |
188 bool SVGLinearGradientElement::selfHasRelativeLengths() const | 187 bool SVGLinearGradientElement::selfHasRelativeLengths() const |
189 { | 188 { |
190 return x1CurrentValue().isRelative() | 189 return x1CurrentValue().isRelative() |
191 || y1CurrentValue().isRelative() | 190 || y1CurrentValue().isRelative() |
192 || x2CurrentValue().isRelative() | 191 || x2CurrentValue().isRelative() |
193 || y2CurrentValue().isRelative(); | 192 || y2CurrentValue().isRelative(); |
194 } | 193 } |
195 | 194 |
196 } | 195 } |
OLD | NEW |