OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 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 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 // Animated property definitions | 36 // Animated property definitions |
37 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::xAttr, X, x) | 37 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::xAttr, X, x) |
38 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::yAttr, Y, y) | 38 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::yAttr, Y, y) |
39 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::widthAttr, Width, width) | 39 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::widthAttr, Width, width) |
40 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::heightAttr, Height, height) | 40 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::heightAttr, Height, height) |
41 DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternUnitsAttr, Patte
rnUnits, patternUnits, SVGUnitTypes::SVGUnitType) | 41 DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternUnitsAttr, Patte
rnUnits, patternUnits, SVGUnitTypes::SVGUnitType) |
42 DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternContentUnitsAttr
, PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType) | 42 DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternContentUnitsAttr
, PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType) |
43 DEFINE_ANIMATED_TRANSFORM_LIST(SVGPatternElement, SVGNames::patternTransformAttr
, PatternTransform, patternTransform) | 43 DEFINE_ANIMATED_TRANSFORM_LIST(SVGPatternElement, SVGNames::patternTransformAttr
, PatternTransform, patternTransform) |
44 DEFINE_ANIMATED_STRING(SVGPatternElement, XLinkNames::hrefAttr, Href, href) | 44 DEFINE_ANIMATED_STRING(SVGPatternElement, XLinkNames::hrefAttr, Href, href) |
45 DEFINE_ANIMATED_BOOLEAN(SVGPatternElement, SVGNames::externalResourcesRequiredAt
tr, ExternalResourcesRequired, externalResourcesRequired) | |
46 DEFINE_ANIMATED_RECT(SVGPatternElement, SVGNames::viewBoxAttr, ViewBox, viewBox) | 45 DEFINE_ANIMATED_RECT(SVGPatternElement, SVGNames::viewBoxAttr, ViewBox, viewBox) |
47 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGPatternElement, SVGNames::preserveAspectR
atioAttr, PreserveAspectRatio, preserveAspectRatio) | 46 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGPatternElement, SVGNames::preserveAspectR
atioAttr, PreserveAspectRatio, preserveAspectRatio) |
48 | 47 |
49 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPatternElement) | 48 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPatternElement) |
50 REGISTER_LOCAL_ANIMATED_PROPERTY(x) | 49 REGISTER_LOCAL_ANIMATED_PROPERTY(x) |
51 REGISTER_LOCAL_ANIMATED_PROPERTY(y) | 50 REGISTER_LOCAL_ANIMATED_PROPERTY(y) |
52 REGISTER_LOCAL_ANIMATED_PROPERTY(width) | 51 REGISTER_LOCAL_ANIMATED_PROPERTY(width) |
53 REGISTER_LOCAL_ANIMATED_PROPERTY(height) | 52 REGISTER_LOCAL_ANIMATED_PROPERTY(height) |
54 REGISTER_LOCAL_ANIMATED_PROPERTY(patternUnits) | 53 REGISTER_LOCAL_ANIMATED_PROPERTY(patternUnits) |
55 REGISTER_LOCAL_ANIMATED_PROPERTY(patternContentUnits) | 54 REGISTER_LOCAL_ANIMATED_PROPERTY(patternContentUnits) |
56 REGISTER_LOCAL_ANIMATED_PROPERTY(patternTransform) | 55 REGISTER_LOCAL_ANIMATED_PROPERTY(patternTransform) |
57 REGISTER_LOCAL_ANIMATED_PROPERTY(href) | 56 REGISTER_LOCAL_ANIMATED_PROPERTY(href) |
58 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | |
59 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) | 57 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) |
60 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) | 58 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) |
61 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) | 59 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) |
62 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) | 60 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) |
63 END_REGISTER_ANIMATED_PROPERTIES | 61 END_REGISTER_ANIMATED_PROPERTIES |
64 | 62 |
65 inline SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Docume
nt& document) | 63 inline SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Docume
nt& document) |
66 : SVGElement(tagName, document) | 64 : SVGElement(tagName, document) |
67 , m_x(LengthModeWidth) | 65 , m_x(LengthModeWidth) |
68 , m_y(LengthModeHeight) | 66 , m_y(LengthModeHeight) |
(...skipping 11 matching lines...) Expand all Loading... |
80 { | 78 { |
81 return adoptRef(new SVGPatternElement(tagName, document)); | 79 return adoptRef(new SVGPatternElement(tagName, document)); |
82 } | 80 } |
83 | 81 |
84 bool SVGPatternElement::isSupportedAttribute(const QualifiedName& attrName) | 82 bool SVGPatternElement::isSupportedAttribute(const QualifiedName& attrName) |
85 { | 83 { |
86 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 84 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
87 if (supportedAttributes.isEmpty()) { | 85 if (supportedAttributes.isEmpty()) { |
88 SVGURIReference::addSupportedAttributes(supportedAttributes); | 86 SVGURIReference::addSupportedAttributes(supportedAttributes); |
89 SVGTests::addSupportedAttributes(supportedAttributes); | 87 SVGTests::addSupportedAttributes(supportedAttributes); |
90 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | |
91 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); | 88 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); |
92 supportedAttributes.add(SVGNames::patternUnitsAttr); | 89 supportedAttributes.add(SVGNames::patternUnitsAttr); |
93 supportedAttributes.add(SVGNames::patternContentUnitsAttr); | 90 supportedAttributes.add(SVGNames::patternContentUnitsAttr); |
94 supportedAttributes.add(SVGNames::patternTransformAttr); | 91 supportedAttributes.add(SVGNames::patternTransformAttr); |
95 supportedAttributes.add(SVGNames::xAttr); | 92 supportedAttributes.add(SVGNames::xAttr); |
96 supportedAttributes.add(SVGNames::yAttr); | 93 supportedAttributes.add(SVGNames::yAttr); |
97 supportedAttributes.add(SVGNames::widthAttr); | 94 supportedAttributes.add(SVGNames::widthAttr); |
98 supportedAttributes.add(SVGNames::heightAttr); | 95 supportedAttributes.add(SVGNames::heightAttr); |
99 } | 96 } |
100 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 97 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
(...skipping 24 matching lines...) Expand all Loading... |
125 } else if (name == SVGNames::xAttr) | 122 } else if (name == SVGNames::xAttr) |
126 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); | 123 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); |
127 else if (name == SVGNames::yAttr) | 124 else if (name == SVGNames::yAttr) |
128 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError))
; | 125 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError))
; |
129 else if (name == SVGNames::widthAttr) | 126 else if (name == SVGNames::widthAttr) |
130 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro
r, ForbidNegativeLengths)); | 127 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro
r, ForbidNegativeLengths)); |
131 else if (name == SVGNames::heightAttr) | 128 else if (name == SVGNames::heightAttr) |
132 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr
ror, ForbidNegativeLengths)); | 129 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr
ror, ForbidNegativeLengths)); |
133 else if (SVGURIReference::parseAttribute(name, value) | 130 else if (SVGURIReference::parseAttribute(name, value) |
134 || SVGTests::parseAttribute(name, value) | 131 || SVGTests::parseAttribute(name, value) |
135 || SVGExternalResourcesRequired::parseAttribute(name, value) | |
136 || SVGFitToViewBox::parseAttribute(this, name, value)) { | 132 || SVGFitToViewBox::parseAttribute(this, name, value)) { |
137 } else | 133 } else |
138 ASSERT_NOT_REACHED(); | 134 ASSERT_NOT_REACHED(); |
139 | 135 |
140 reportAttributeParsingError(parseError, name, value); | 136 reportAttributeParsingError(parseError, name, value); |
141 } | 137 } |
142 | 138 |
143 void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName) | 139 void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName) |
144 { | 140 { |
145 if (!isSupportedAttribute(attrName)) { | 141 if (!isSupportedAttribute(attrName)) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 236 |
241 bool SVGPatternElement::selfHasRelativeLengths() const | 237 bool SVGPatternElement::selfHasRelativeLengths() const |
242 { | 238 { |
243 return xCurrentValue().isRelative() | 239 return xCurrentValue().isRelative() |
244 || yCurrentValue().isRelative() | 240 || yCurrentValue().isRelative() |
245 || widthCurrentValue().isRelative() | 241 || widthCurrentValue().isRelative() |
246 || heightCurrentValue().isRelative(); | 242 || heightCurrentValue().isRelative(); |
247 } | 243 } |
248 | 244 |
249 } | 245 } |
OLD | NEW |