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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 // Animated property definitions | 35 // Animated property definitions |
36 DEFINE_ANIMATED_ENUMERATION(SVGMaskElement, SVGNames::maskUnitsAttr, MaskUnits,
maskUnits, SVGUnitTypes::SVGUnitType) | 36 DEFINE_ANIMATED_ENUMERATION(SVGMaskElement, SVGNames::maskUnitsAttr, MaskUnits,
maskUnits, SVGUnitTypes::SVGUnitType) |
37 DEFINE_ANIMATED_ENUMERATION(SVGMaskElement, SVGNames::maskContentUnitsAttr, Mask
ContentUnits, maskContentUnits, SVGUnitTypes::SVGUnitType) | 37 DEFINE_ANIMATED_ENUMERATION(SVGMaskElement, SVGNames::maskContentUnitsAttr, Mask
ContentUnits, maskContentUnits, SVGUnitTypes::SVGUnitType) |
38 DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::xAttr, X, x) | 38 DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::xAttr, X, x) |
39 DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::yAttr, Y, y) | 39 DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::yAttr, Y, y) |
40 DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::widthAttr, Width, width) | 40 DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::widthAttr, Width, width) |
41 DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::heightAttr, Height, height) | 41 DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::heightAttr, Height, height) |
42 DEFINE_ANIMATED_BOOLEAN(SVGMaskElement, SVGNames::externalResourcesRequiredAttr,
ExternalResourcesRequired, externalResourcesRequired) | |
43 | 42 |
44 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMaskElement) | 43 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMaskElement) |
45 REGISTER_LOCAL_ANIMATED_PROPERTY(maskUnits) | 44 REGISTER_LOCAL_ANIMATED_PROPERTY(maskUnits) |
46 REGISTER_LOCAL_ANIMATED_PROPERTY(maskContentUnits) | 45 REGISTER_LOCAL_ANIMATED_PROPERTY(maskContentUnits) |
47 REGISTER_LOCAL_ANIMATED_PROPERTY(x) | 46 REGISTER_LOCAL_ANIMATED_PROPERTY(x) |
48 REGISTER_LOCAL_ANIMATED_PROPERTY(y) | 47 REGISTER_LOCAL_ANIMATED_PROPERTY(y) |
49 REGISTER_LOCAL_ANIMATED_PROPERTY(width) | 48 REGISTER_LOCAL_ANIMATED_PROPERTY(width) |
50 REGISTER_LOCAL_ANIMATED_PROPERTY(height) | 49 REGISTER_LOCAL_ANIMATED_PROPERTY(height) |
51 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | |
52 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) | 50 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) |
53 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) | 51 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) |
54 END_REGISTER_ANIMATED_PROPERTIES | 52 END_REGISTER_ANIMATED_PROPERTIES |
55 | 53 |
56 inline SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document& do
cument) | 54 inline SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document& do
cument) |
57 : SVGElement(tagName, document) | 55 : SVGElement(tagName, document) |
58 , m_maskUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) | 56 , m_maskUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) |
59 , m_maskContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) | 57 , m_maskContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) |
60 , m_x(LengthModeWidth, "-10%") | 58 , m_x(LengthModeWidth, "-10%") |
61 , m_y(LengthModeHeight, "-10%") | 59 , m_y(LengthModeHeight, "-10%") |
(...skipping 10 matching lines...) Expand all Loading... |
72 PassRefPtr<SVGMaskElement> SVGMaskElement::create(const QualifiedName& tagName,
Document& document) | 70 PassRefPtr<SVGMaskElement> SVGMaskElement::create(const QualifiedName& tagName,
Document& document) |
73 { | 71 { |
74 return adoptRef(new SVGMaskElement(tagName, document)); | 72 return adoptRef(new SVGMaskElement(tagName, document)); |
75 } | 73 } |
76 | 74 |
77 bool SVGMaskElement::isSupportedAttribute(const QualifiedName& attrName) | 75 bool SVGMaskElement::isSupportedAttribute(const QualifiedName& attrName) |
78 { | 76 { |
79 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 77 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
80 if (supportedAttributes.isEmpty()) { | 78 if (supportedAttributes.isEmpty()) { |
81 SVGTests::addSupportedAttributes(supportedAttributes); | 79 SVGTests::addSupportedAttributes(supportedAttributes); |
82 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | |
83 supportedAttributes.add(SVGNames::maskUnitsAttr); | 80 supportedAttributes.add(SVGNames::maskUnitsAttr); |
84 supportedAttributes.add(SVGNames::maskContentUnitsAttr); | 81 supportedAttributes.add(SVGNames::maskContentUnitsAttr); |
85 supportedAttributes.add(SVGNames::xAttr); | 82 supportedAttributes.add(SVGNames::xAttr); |
86 supportedAttributes.add(SVGNames::yAttr); | 83 supportedAttributes.add(SVGNames::yAttr); |
87 supportedAttributes.add(SVGNames::widthAttr); | 84 supportedAttributes.add(SVGNames::widthAttr); |
88 supportedAttributes.add(SVGNames::heightAttr); | 85 supportedAttributes.add(SVGNames::heightAttr); |
89 } | 86 } |
90 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 87 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
91 } | 88 } |
92 | 89 |
(...skipping 14 matching lines...) Expand all Loading... |
107 setMaskContentUnitsBaseValue(propertyValue); | 104 setMaskContentUnitsBaseValue(propertyValue); |
108 return; | 105 return; |
109 } else if (name == SVGNames::xAttr) | 106 } else if (name == SVGNames::xAttr) |
110 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); | 107 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); |
111 else if (name == SVGNames::yAttr) | 108 else if (name == SVGNames::yAttr) |
112 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError))
; | 109 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError))
; |
113 else if (name == SVGNames::widthAttr) | 110 else if (name == SVGNames::widthAttr) |
114 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro
r)); | 111 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro
r)); |
115 else if (name == SVGNames::heightAttr) | 112 else if (name == SVGNames::heightAttr) |
116 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr
ror)); | 113 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr
ror)); |
117 else if (SVGTests::parseAttribute(name, value) | 114 else if (SVGTests::parseAttribute(name, value)) { |
118 || SVGExternalResourcesRequired::parseAttribute(name, value)) { | |
119 } else | 115 } else |
120 ASSERT_NOT_REACHED(); | 116 ASSERT_NOT_REACHED(); |
121 | 117 |
122 reportAttributeParsingError(parseError, name, value); | 118 reportAttributeParsingError(parseError, name, value); |
123 } | 119 } |
124 | 120 |
125 void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName) | 121 void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName) |
126 { | 122 { |
127 if (!isSupportedAttribute(attrName)) { | 123 if (!isSupportedAttribute(attrName)) { |
128 SVGElement::svgAttributeChanged(attrName); | 124 SVGElement::svgAttributeChanged(attrName); |
(...skipping 30 matching lines...) Expand all Loading... |
159 | 155 |
160 bool SVGMaskElement::selfHasRelativeLengths() const | 156 bool SVGMaskElement::selfHasRelativeLengths() const |
161 { | 157 { |
162 return xCurrentValue().isRelative() | 158 return xCurrentValue().isRelative() |
163 || yCurrentValue().isRelative() | 159 || yCurrentValue().isRelative() |
164 || widthCurrentValue().isRelative() | 160 || widthCurrentValue().isRelative() |
165 || heightCurrentValue().isRelative(); | 161 || heightCurrentValue().isRelative(); |
166 } | 162 } |
167 | 163 |
168 } | 164 } |
OLD | NEW |