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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 // Animated property definitions | 34 // Animated property definitions |
35 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::xAttr, X, x) | 35 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::xAttr, X, x) |
36 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::yAttr, Y, y) | 36 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::yAttr, Y, y) |
37 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::widthAttr, Width, width) | 37 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::widthAttr, Width, width) |
38 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::heightAttr, Height, height) | 38 DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::heightAttr, Height, height) |
39 DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternUnitsAttr, Patte
rnUnits, patternUnits, SVGUnitTypes::SVGUnitType) | 39 DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternUnitsAttr, Patte
rnUnits, patternUnits, SVGUnitTypes::SVGUnitType) |
40 DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternContentUnitsAttr
, PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType) | 40 DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternContentUnitsAttr
, PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType) |
41 DEFINE_ANIMATED_TRANSFORM_LIST(SVGPatternElement, SVGNames::patternTransformAttr
, PatternTransform, patternTransform) | 41 DEFINE_ANIMATED_TRANSFORM_LIST(SVGPatternElement, SVGNames::patternTransformAttr
, PatternTransform, patternTransform) |
42 DEFINE_ANIMATED_STRING(SVGPatternElement, XLinkNames::hrefAttr, Href, href) | 42 DEFINE_ANIMATED_STRING(SVGPatternElement, XLinkNames::hrefAttr, Href, href) |
43 DEFINE_ANIMATED_BOOLEAN(SVGPatternElement, SVGNames::externalResourcesRequiredAt
tr, ExternalResourcesRequired, externalResourcesRequired) | |
44 DEFINE_ANIMATED_RECT(SVGPatternElement, SVGNames::viewBoxAttr, ViewBox, viewBox) | 43 DEFINE_ANIMATED_RECT(SVGPatternElement, SVGNames::viewBoxAttr, ViewBox, viewBox) |
45 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGPatternElement, SVGNames::preserveAspectR
atioAttr, PreserveAspectRatio, preserveAspectRatio) | 44 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGPatternElement, SVGNames::preserveAspectR
atioAttr, PreserveAspectRatio, preserveAspectRatio) |
46 | 45 |
47 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPatternElement) | 46 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPatternElement) |
48 REGISTER_LOCAL_ANIMATED_PROPERTY(x) | 47 REGISTER_LOCAL_ANIMATED_PROPERTY(x) |
49 REGISTER_LOCAL_ANIMATED_PROPERTY(y) | 48 REGISTER_LOCAL_ANIMATED_PROPERTY(y) |
50 REGISTER_LOCAL_ANIMATED_PROPERTY(width) | 49 REGISTER_LOCAL_ANIMATED_PROPERTY(width) |
51 REGISTER_LOCAL_ANIMATED_PROPERTY(height) | 50 REGISTER_LOCAL_ANIMATED_PROPERTY(height) |
52 REGISTER_LOCAL_ANIMATED_PROPERTY(patternUnits) | 51 REGISTER_LOCAL_ANIMATED_PROPERTY(patternUnits) |
53 REGISTER_LOCAL_ANIMATED_PROPERTY(patternContentUnits) | 52 REGISTER_LOCAL_ANIMATED_PROPERTY(patternContentUnits) |
54 REGISTER_LOCAL_ANIMATED_PROPERTY(patternTransform) | 53 REGISTER_LOCAL_ANIMATED_PROPERTY(patternTransform) |
55 REGISTER_LOCAL_ANIMATED_PROPERTY(href) | 54 REGISTER_LOCAL_ANIMATED_PROPERTY(href) |
56 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | |
57 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) | 55 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) |
58 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) | 56 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) |
59 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) | 57 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) |
60 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) | 58 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) |
61 END_REGISTER_ANIMATED_PROPERTIES | 59 END_REGISTER_ANIMATED_PROPERTIES |
62 | 60 |
63 inline SVGPatternElement::SVGPatternElement(Document& document) | 61 inline SVGPatternElement::SVGPatternElement(Document& document) |
64 : SVGElement(SVGNames::patternTag, document) | 62 : SVGElement(SVGNames::patternTag, document) |
65 , m_x(LengthModeWidth) | 63 , m_x(LengthModeWidth) |
66 , m_y(LengthModeHeight) | 64 , m_y(LengthModeHeight) |
(...skipping 10 matching lines...) Expand all Loading... |
77 { | 75 { |
78 return adoptRef(new SVGPatternElement(document)); | 76 return adoptRef(new SVGPatternElement(document)); |
79 } | 77 } |
80 | 78 |
81 bool SVGPatternElement::isSupportedAttribute(const QualifiedName& attrName) | 79 bool SVGPatternElement::isSupportedAttribute(const QualifiedName& attrName) |
82 { | 80 { |
83 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 81 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
84 if (supportedAttributes.isEmpty()) { | 82 if (supportedAttributes.isEmpty()) { |
85 SVGURIReference::addSupportedAttributes(supportedAttributes); | 83 SVGURIReference::addSupportedAttributes(supportedAttributes); |
86 SVGTests::addSupportedAttributes(supportedAttributes); | 84 SVGTests::addSupportedAttributes(supportedAttributes); |
87 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | |
88 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); | 85 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); |
89 supportedAttributes.add(SVGNames::patternUnitsAttr); | 86 supportedAttributes.add(SVGNames::patternUnitsAttr); |
90 supportedAttributes.add(SVGNames::patternContentUnitsAttr); | 87 supportedAttributes.add(SVGNames::patternContentUnitsAttr); |
91 supportedAttributes.add(SVGNames::patternTransformAttr); | 88 supportedAttributes.add(SVGNames::patternTransformAttr); |
92 supportedAttributes.add(SVGNames::xAttr); | 89 supportedAttributes.add(SVGNames::xAttr); |
93 supportedAttributes.add(SVGNames::yAttr); | 90 supportedAttributes.add(SVGNames::yAttr); |
94 supportedAttributes.add(SVGNames::widthAttr); | 91 supportedAttributes.add(SVGNames::widthAttr); |
95 supportedAttributes.add(SVGNames::heightAttr); | 92 supportedAttributes.add(SVGNames::heightAttr); |
96 } | 93 } |
97 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 94 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
(...skipping 24 matching lines...) Expand all Loading... |
122 } else if (name == SVGNames::xAttr) | 119 } else if (name == SVGNames::xAttr) |
123 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); | 120 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); |
124 else if (name == SVGNames::yAttr) | 121 else if (name == SVGNames::yAttr) |
125 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError))
; | 122 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError))
; |
126 else if (name == SVGNames::widthAttr) | 123 else if (name == SVGNames::widthAttr) |
127 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro
r, ForbidNegativeLengths)); | 124 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro
r, ForbidNegativeLengths)); |
128 else if (name == SVGNames::heightAttr) | 125 else if (name == SVGNames::heightAttr) |
129 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr
ror, ForbidNegativeLengths)); | 126 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr
ror, ForbidNegativeLengths)); |
130 else if (SVGURIReference::parseAttribute(name, value) | 127 else if (SVGURIReference::parseAttribute(name, value) |
131 || SVGTests::parseAttribute(name, value) | 128 || SVGTests::parseAttribute(name, value) |
132 || SVGExternalResourcesRequired::parseAttribute(name, value) | |
133 || SVGFitToViewBox::parseAttribute(this, name, value)) { | 129 || SVGFitToViewBox::parseAttribute(this, name, value)) { |
134 } else | 130 } else |
135 ASSERT_NOT_REACHED(); | 131 ASSERT_NOT_REACHED(); |
136 | 132 |
137 reportAttributeParsingError(parseError, name, value); | 133 reportAttributeParsingError(parseError, name, value); |
138 } | 134 } |
139 | 135 |
140 void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName) | 136 void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName) |
141 { | 137 { |
142 if (!isSupportedAttribute(attrName)) { | 138 if (!isSupportedAttribute(attrName)) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 234 |
239 bool SVGPatternElement::selfHasRelativeLengths() const | 235 bool SVGPatternElement::selfHasRelativeLengths() const |
240 { | 236 { |
241 return xCurrentValue().isRelative() | 237 return xCurrentValue().isRelative() |
242 || yCurrentValue().isRelative() | 238 || yCurrentValue().isRelative() |
243 || widthCurrentValue().isRelative() | 239 || widthCurrentValue().isRelative() |
244 || heightCurrentValue().isRelative(); | 240 || heightCurrentValue().isRelative(); |
245 } | 241 } |
246 | 242 |
247 } | 243 } |
OLD | NEW |