| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 70 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicStrin
g& value) | 73 void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicStrin
g& value) |
| 74 { | 74 { |
| 75 parseAttributeNew(name, value); | 75 parseAttributeNew(name, value); |
| 76 } | 76 } |
| 77 | 77 |
| 78 bool SVGRectElement::isPresentationAttribute(const QualifiedName& attrName) cons
t | 78 bool SVGRectElement::isPresentationAttribute(const QualifiedName& attrName) cons
t |
| 79 { | 79 { |
| 80 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr) | 80 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr |
| 81 || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr) |
| 81 return true; | 82 return true; |
| 82 return SVGGeometryElement::isPresentationAttribute(attrName); | 83 return SVGGeometryElement::isPresentationAttribute(attrName); |
| 83 } | 84 } |
| 84 | 85 |
| 85 bool SVGRectElement::isPresentationAttributeWithSVGDOM(const QualifiedName& attr
Name) const | 86 bool SVGRectElement::isPresentationAttributeWithSVGDOM(const QualifiedName& attr
Name) const |
| 86 { | 87 { |
| 87 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr) | 88 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr |
| 89 || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr) |
| 88 return true; | 90 return true; |
| 89 return SVGGeometryElement::isPresentationAttributeWithSVGDOM(attrName); | 91 return SVGGeometryElement::isPresentationAttributeWithSVGDOM(attrName); |
| 90 } | 92 } |
| 91 | 93 |
| 92 void SVGRectElement::collectStyleForPresentationAttribute(const QualifiedName& n
ame, const AtomicString& value, MutableStylePropertySet* style) | 94 void SVGRectElement::collectStyleForPresentationAttribute(const QualifiedName& n
ame, const AtomicString& value, MutableStylePropertySet* style) |
| 93 { | 95 { |
| 94 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute
(name); | 96 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute
(name); |
| 95 if (property == m_x) | 97 if (property == m_x) |
| 96 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyX, *m
_x->currentValue()); | 98 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyX, *m
_x->currentValue()); |
| 97 else if (property == m_y) | 99 else if (property == m_y) |
| 98 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyY, *m
_y->currentValue()); | 100 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyY, *m
_y->currentValue()); |
| 101 else if (property == m_rx) |
| 102 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyRx, *
m_rx->currentValue()); |
| 103 else if (property == m_ry) |
| 104 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyRy, *
m_ry->currentValue()); |
| 99 else | 105 else |
| 100 SVGGeometryElement::collectStyleForPresentationAttribute(name, value, st
yle); | 106 SVGGeometryElement::collectStyleForPresentationAttribute(name, value, st
yle); |
| 101 } | 107 } |
| 102 | 108 |
| 103 void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) | 109 void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) |
| 104 { | 110 { |
| 105 if (!isSupportedAttribute(attrName)) { | 111 if (!isSupportedAttribute(attrName)) { |
| 106 SVGGeometryElement::svgAttributeChanged(attrName); | 112 SVGGeometryElement::svgAttributeChanged(attrName); |
| 107 return; | 113 return; |
| 108 } | 114 } |
| 109 | 115 |
| 110 SVGElement::InvalidationGuard invalidationGuard(this); | 116 SVGElement::InvalidationGuard invalidationGuard(this); |
| 111 | 117 |
| 112 bool isLengthAttributeXY = | 118 bool isPresentationLengthAttribute = |
| 113 attrName == SVGNames::xAttr | 119 attrName == SVGNames::xAttr |
| 114 || attrName == SVGNames::yAttr; | 120 || attrName == SVGNames::yAttr |
| 115 if (isLengthAttributeXY) { | 121 || attrName == SVGNames::rxAttr |
| 122 || attrName == SVGNames::ryAttr; |
| 123 if (isPresentationLengthAttribute) { |
| 116 invalidateSVGPresentationAttributeStyle(); | 124 invalidateSVGPresentationAttributeStyle(); |
| 117 setNeedsStyleRecalc(LocalStyleChange, | 125 setNeedsStyleRecalc(LocalStyleChange, |
| 118 StyleChangeReasonForTracing::fromAttribute(attrName)); | 126 StyleChangeReasonForTracing::fromAttribute(attrName)); |
| 119 } | 127 } |
| 120 | 128 |
| 121 bool isLengthAttribute = isLengthAttributeXY | 129 bool isLengthAttribute = isPresentationLengthAttribute |
| 122 || attrName == SVGNames::widthAttr | 130 || attrName == SVGNames::widthAttr |
| 123 || attrName == SVGNames::heightAttr | 131 || attrName == SVGNames::heightAttr; |
| 124 || attrName == SVGNames::rxAttr | |
| 125 || attrName == SVGNames::ryAttr; | |
| 126 | 132 |
| 127 if (isLengthAttribute) | 133 if (isLengthAttribute) |
| 128 updateRelativeLengthsInformation(); | 134 updateRelativeLengthsInformation(); |
| 129 | 135 |
| 130 LayoutSVGShape* renderer = toLayoutSVGShape(this->renderer()); | 136 LayoutSVGShape* renderer = toLayoutSVGShape(this->renderer()); |
| 131 if (!renderer) | 137 if (!renderer) |
| 132 return; | 138 return; |
| 133 | 139 |
| 134 if (isLengthAttribute) { | 140 if (isLengthAttribute) { |
| 135 renderer->setNeedsShapeUpdate(); | 141 renderer->setNeedsShapeUpdate(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 149 || m_rx->currentValue()->isRelative() | 155 || m_rx->currentValue()->isRelative() |
| 150 || m_ry->currentValue()->isRelative(); | 156 || m_ry->currentValue()->isRelative(); |
| 151 } | 157 } |
| 152 | 158 |
| 153 LayoutObject* SVGRectElement::createRenderer(const LayoutStyle&) | 159 LayoutObject* SVGRectElement::createRenderer(const LayoutStyle&) |
| 154 { | 160 { |
| 155 return new LayoutSVGRect(this); | 161 return new LayoutSVGRect(this); |
| 156 } | 162 } |
| 157 | 163 |
| 158 } // namespace blink | 164 } // namespace blink |
| OLD | NEW |