| 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 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 path.addRect(FloatRect(x, y, width, height)); | 115 path.addRect(FloatRect(x, y, width, height)); |
| 116 return path; | 116 return path; |
| 117 } | 117 } |
| 118 | 118 |
| 119 void SVGRectElement::collectStyleForPresentationAttribute( | 119 void SVGRectElement::collectStyleForPresentationAttribute( |
| 120 const QualifiedName& name, | 120 const QualifiedName& name, |
| 121 const AtomicString& value, | 121 const AtomicString& value, |
| 122 MutableStylePropertySet* style) { | 122 MutableStylePropertySet* style) { |
| 123 SVGAnimatedPropertyBase* property = propertyFromAttribute(name); | 123 SVGAnimatedPropertyBase* property = propertyFromAttribute(name); |
| 124 if (property == m_x) | 124 if (property == m_x) { |
| 125 addPropertyToPresentationAttributeStyle( | 125 addPropertyToPresentationAttributeStyle(style, CSSPropertyX, |
| 126 style, CSSPropertyX, m_x->currentValue()->asCSSPrimitiveValue()); | 126 m_x->cssValue()); |
| 127 else if (property == m_y) | 127 } else if (property == m_y) { |
| 128 addPropertyToPresentationAttributeStyle( | 128 addPropertyToPresentationAttributeStyle(style, CSSPropertyY, |
| 129 style, CSSPropertyY, m_y->currentValue()->asCSSPrimitiveValue()); | 129 m_y->cssValue()); |
| 130 else if (property == m_width) | 130 } else if (property == m_width) { |
| 131 addPropertyToPresentationAttributeStyle( | 131 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, |
| 132 style, CSSPropertyWidth, | 132 m_width->cssValue()); |
| 133 m_width->currentValue()->asCSSPrimitiveValue()); | 133 } else if (property == m_height) { |
| 134 else if (property == m_height) | 134 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, |
| 135 addPropertyToPresentationAttributeStyle( | 135 m_height->cssValue()); |
| 136 style, CSSPropertyHeight, | 136 } else if (property == m_rx) { |
| 137 m_height->currentValue()->asCSSPrimitiveValue()); | 137 addPropertyToPresentationAttributeStyle(style, CSSPropertyRx, |
| 138 else if (property == m_rx) | 138 m_rx->cssValue()); |
| 139 addPropertyToPresentationAttributeStyle( | 139 } else if (property == m_ry) { |
| 140 style, CSSPropertyRx, m_rx->currentValue()->asCSSPrimitiveValue()); | 140 addPropertyToPresentationAttributeStyle(style, CSSPropertyRy, |
| 141 else if (property == m_ry) | 141 m_ry->cssValue()); |
| 142 addPropertyToPresentationAttributeStyle( | 142 } else { |
| 143 style, CSSPropertyRy, m_ry->currentValue()->asCSSPrimitiveValue()); | |
| 144 else | |
| 145 SVGGeometryElement::collectStyleForPresentationAttribute(name, value, | 143 SVGGeometryElement::collectStyleForPresentationAttribute(name, value, |
| 146 style); | 144 style); |
| 145 } |
| 147 } | 146 } |
| 148 | 147 |
| 149 void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) { | 148 void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) { |
| 150 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || | 149 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || |
| 151 attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr || | 150 attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr || |
| 152 attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr) { | 151 attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr) { |
| 153 SVGElement::InvalidationGuard invalidationGuard(this); | 152 SVGElement::InvalidationGuard invalidationGuard(this); |
| 154 | 153 |
| 155 invalidateSVGPresentationAttributeStyle(); | 154 invalidateSVGPresentationAttributeStyle(); |
| 156 setNeedsStyleRecalc(LocalStyleChange, | 155 setNeedsStyleRecalc(LocalStyleChange, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 177 m_height->currentValue()->isRelative() || | 176 m_height->currentValue()->isRelative() || |
| 178 m_rx->currentValue()->isRelative() || | 177 m_rx->currentValue()->isRelative() || |
| 179 m_ry->currentValue()->isRelative(); | 178 m_ry->currentValue()->isRelative(); |
| 180 } | 179 } |
| 181 | 180 |
| 182 LayoutObject* SVGRectElement::createLayoutObject(const ComputedStyle&) { | 181 LayoutObject* SVGRectElement::createLayoutObject(const ComputedStyle&) { |
| 183 return new LayoutSVGRect(this); | 182 return new LayoutSVGRect(this); |
| 184 } | 183 } |
| 185 | 184 |
| 186 } // namespace blink | 185 } // namespace blink |
| OLD | NEW |