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(const QualifiedName& t
agName, Document& document) |
52 : SVGGradientElement(tagName, document) | 52 : SVGGradientElement(tagName, 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)); | 59 ASSERT(hasTagName(SVGNames::linearGradientTag)); |
60 ScriptWrappable::init(this); | 60 ScriptWrappable::init(this); |
61 registerAnimatedPropertiesForSVGLinearGradientElement(); | 61 registerAnimatedPropertiesForSVGLinearGradientElement(); |
62 } | 62 } |
63 | 63 |
64 PassRefPtr<SVGLinearGradientElement> SVGLinearGradientElement::create(const Qual
ifiedName& tagName, Document* document) | 64 PassRefPtr<SVGLinearGradientElement> SVGLinearGradientElement::create(const Qual
ifiedName& tagName, Document& document) |
65 { | 65 { |
66 return adoptRef(new SVGLinearGradientElement(tagName, document)); | 66 return adoptRef(new SVGLinearGradientElement(tagName, document)); |
67 } | 67 } |
68 | 68 |
69 bool SVGLinearGradientElement::isSupportedAttribute(const QualifiedName& attrNam
e) | 69 bool SVGLinearGradientElement::isSupportedAttribute(const QualifiedName& attrNam
e) |
70 { | 70 { |
71 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 71 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
72 if (supportedAttributes.isEmpty()) { | 72 if (supportedAttributes.isEmpty()) { |
73 supportedAttributes.add(SVGNames::x1Attr); | 73 supportedAttributes.add(SVGNames::x1Attr); |
74 supportedAttributes.add(SVGNames::x2Attr); | 74 supportedAttributes.add(SVGNames::x2Attr); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 186 |
187 bool SVGLinearGradientElement::selfHasRelativeLengths() const | 187 bool SVGLinearGradientElement::selfHasRelativeLengths() const |
188 { | 188 { |
189 return x1CurrentValue().isRelative() | 189 return x1CurrentValue().isRelative() |
190 || y1CurrentValue().isRelative() | 190 || y1CurrentValue().isRelative() |
191 || x2CurrentValue().isRelative() | 191 || x2CurrentValue().isRelative() |
192 || y2CurrentValue().isRelative(); | 192 || y2CurrentValue().isRelative(); |
193 } | 193 } |
194 | 194 |
195 } | 195 } |
OLD | NEW |