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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 supportedAttributes.add(SVGNames::patternContentUnitsAttr); | 81 supportedAttributes.add(SVGNames::patternContentUnitsAttr); |
82 supportedAttributes.add(SVGNames::patternTransformAttr); | 82 supportedAttributes.add(SVGNames::patternTransformAttr); |
83 supportedAttributes.add(SVGNames::xAttr); | 83 supportedAttributes.add(SVGNames::xAttr); |
84 supportedAttributes.add(SVGNames::yAttr); | 84 supportedAttributes.add(SVGNames::yAttr); |
85 supportedAttributes.add(SVGNames::widthAttr); | 85 supportedAttributes.add(SVGNames::widthAttr); |
86 supportedAttributes.add(SVGNames::heightAttr); | 86 supportedAttributes.add(SVGNames::heightAttr); |
87 } | 87 } |
88 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 88 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
89 } | 89 } |
90 | 90 |
| 91 bool SVGPatternElement::isPresentationAttribute(const QualifiedName& attrName) c
onst |
| 92 { |
| 93 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr) |
| 94 return true; |
| 95 return SVGElement::isPresentationAttribute(attrName); |
| 96 } |
| 97 |
| 98 bool SVGPatternElement::isPresentationAttributeWithSVGDOM(const QualifiedName& a
ttrName) const |
| 99 { |
| 100 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr) |
| 101 return true; |
| 102 return SVGElement::isPresentationAttributeWithSVGDOM(attrName); |
| 103 } |
| 104 |
| 105 void SVGPatternElement::collectStyleForPresentationAttribute(const QualifiedName
& name, const AtomicString& value, MutableStylePropertySet* style) |
| 106 { |
| 107 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute
(name); |
| 108 if (property == m_x) |
| 109 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyX, *m
_x->currentValue()); |
| 110 else if (property == m_y) |
| 111 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyY, *m
_y->currentValue()); |
| 112 else |
| 113 SVGElement::collectStyleForPresentationAttribute(name, value, style); |
| 114 } |
| 115 |
91 void SVGPatternElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) | 116 void SVGPatternElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) |
92 { | 117 { |
93 parseAttributeNew(name, value); | 118 parseAttributeNew(name, value); |
94 } | 119 } |
95 | 120 |
96 void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName) | 121 void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName) |
97 { | 122 { |
98 if (!isSupportedAttribute(attrName)) { | 123 if (!isSupportedAttribute(attrName)) { |
99 SVGElement::svgAttributeChanged(attrName); | 124 SVGElement::svgAttributeChanged(attrName); |
100 return; | 125 return; |
101 } | 126 } |
102 | 127 |
103 SVGElement::InvalidationGuard invalidationGuard(this); | 128 SVGElement::InvalidationGuard invalidationGuard(this); |
104 | 129 |
105 if (attrName == SVGNames::xAttr | 130 if (attrName == SVGNames::xAttr |
| 131 || attrName == SVGNames::yAttr) { |
| 132 invalidateSVGPresentationAttributeStyle(); |
| 133 setNeedsStyleRecalc(LocalStyleChange, |
| 134 StyleChangeReasonForTracing::fromAttribute(attrName)); |
| 135 } |
| 136 |
| 137 if (attrName == SVGNames::xAttr |
106 || attrName == SVGNames::yAttr | 138 || attrName == SVGNames::yAttr |
107 || attrName == SVGNames::widthAttr | 139 || attrName == SVGNames::widthAttr |
108 || attrName == SVGNames::heightAttr) | 140 || attrName == SVGNames::heightAttr) |
109 updateRelativeLengthsInformation(); | 141 updateRelativeLengthsInformation(); |
110 | 142 |
111 RenderSVGResourceContainer* renderer = toRenderSVGResourceContainer(this->re
nderer()); | 143 RenderSVGResourceContainer* renderer = toRenderSVGResourceContainer(this->re
nderer()); |
112 if (renderer) | 144 if (renderer) |
113 renderer->invalidateCacheAndMarkForLayout(); | 145 renderer->invalidateCacheAndMarkForLayout(); |
114 } | 146 } |
115 | 147 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 231 |
200 bool SVGPatternElement::selfHasRelativeLengths() const | 232 bool SVGPatternElement::selfHasRelativeLengths() const |
201 { | 233 { |
202 return m_x->currentValue()->isRelative() | 234 return m_x->currentValue()->isRelative() |
203 || m_y->currentValue()->isRelative() | 235 || m_y->currentValue()->isRelative() |
204 || m_width->currentValue()->isRelative() | 236 || m_width->currentValue()->isRelative() |
205 || m_height->currentValue()->isRelative(); | 237 || m_height->currentValue()->isRelative(); |
206 } | 238 } |
207 | 239 |
208 } // namespace blink | 240 } // namespace blink |
OLD | NEW |