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) 2005 Alexander Kellett <lypanov@kde.org> | 4 * Copyright (C) 2005 Alexander Kellett <lypanov@kde.org> |
5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
6 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2009-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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 REGISTER_LOCAL_ANIMATED_PROPERTY(maskContentUnits) | 46 REGISTER_LOCAL_ANIMATED_PROPERTY(maskContentUnits) |
47 REGISTER_LOCAL_ANIMATED_PROPERTY(x) | 47 REGISTER_LOCAL_ANIMATED_PROPERTY(x) |
48 REGISTER_LOCAL_ANIMATED_PROPERTY(y) | 48 REGISTER_LOCAL_ANIMATED_PROPERTY(y) |
49 REGISTER_LOCAL_ANIMATED_PROPERTY(width) | 49 REGISTER_LOCAL_ANIMATED_PROPERTY(width) |
50 REGISTER_LOCAL_ANIMATED_PROPERTY(height) | 50 REGISTER_LOCAL_ANIMATED_PROPERTY(height) |
51 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | 51 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) |
52 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) | 52 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) |
53 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) | 53 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) |
54 END_REGISTER_ANIMATED_PROPERTIES | 54 END_REGISTER_ANIMATED_PROPERTIES |
55 | 55 |
56 inline SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document& do
cument) | 56 inline SVGMaskElement::SVGMaskElement(Document& document) |
57 : SVGElement(tagName, document) | 57 : SVGElement(SVGNames::maskTag, document) |
58 , m_maskUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) | 58 , m_maskUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) |
59 , m_maskContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) | 59 , m_maskContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) |
60 , m_x(LengthModeWidth, "-10%") | 60 , m_x(LengthModeWidth, "-10%") |
61 , m_y(LengthModeHeight, "-10%") | 61 , m_y(LengthModeHeight, "-10%") |
62 , m_width(LengthModeWidth, "120%") | 62 , m_width(LengthModeWidth, "120%") |
63 , m_height(LengthModeHeight, "120%") | 63 , m_height(LengthModeHeight, "120%") |
64 { | 64 { |
65 // Spec: If the x/y attribute is not specified, the effect is as if a value
of "-10%" were specified. | 65 // Spec: If the x/y attribute is not specified, the effect is as if a value
of "-10%" were specified. |
66 // Spec: If the width/height attribute is not specified, the effect is as if
a value of "120%" were specified. | 66 // Spec: If the width/height attribute is not specified, the effect is as if
a value of "120%" were specified. |
67 ASSERT(hasTagName(SVGNames::maskTag)); | |
68 ScriptWrappable::init(this); | 67 ScriptWrappable::init(this); |
69 registerAnimatedPropertiesForSVGMaskElement(); | 68 registerAnimatedPropertiesForSVGMaskElement(); |
70 } | 69 } |
71 | 70 |
72 PassRefPtr<SVGMaskElement> SVGMaskElement::create(const QualifiedName& tagName,
Document& document) | 71 PassRefPtr<SVGMaskElement> SVGMaskElement::create(Document& document) |
73 { | 72 { |
74 return adoptRef(new SVGMaskElement(tagName, document)); | 73 return adoptRef(new SVGMaskElement(document)); |
75 } | 74 } |
76 | 75 |
77 bool SVGMaskElement::isSupportedAttribute(const QualifiedName& attrName) | 76 bool SVGMaskElement::isSupportedAttribute(const QualifiedName& attrName) |
78 { | 77 { |
79 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 78 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
80 if (supportedAttributes.isEmpty()) { | 79 if (supportedAttributes.isEmpty()) { |
81 SVGTests::addSupportedAttributes(supportedAttributes); | 80 SVGTests::addSupportedAttributes(supportedAttributes); |
82 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | 81 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); |
83 supportedAttributes.add(SVGNames::maskUnitsAttr); | 82 supportedAttributes.add(SVGNames::maskUnitsAttr); |
84 supportedAttributes.add(SVGNames::maskContentUnitsAttr); | 83 supportedAttributes.add(SVGNames::maskContentUnitsAttr); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 159 |
161 bool SVGMaskElement::selfHasRelativeLengths() const | 160 bool SVGMaskElement::selfHasRelativeLengths() const |
162 { | 161 { |
163 return xCurrentValue().isRelative() | 162 return xCurrentValue().isRelative() |
164 || yCurrentValue().isRelative() | 163 || yCurrentValue().isRelative() |
165 || widthCurrentValue().isRelative() | 164 || widthCurrentValue().isRelative() |
166 || heightCurrentValue().isRelative(); | 165 || heightCurrentValue().isRelative(); |
167 } | 166 } |
168 | 167 |
169 } | 168 } |
OLD | NEW |