| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 SVGTests::trace(visitor); | 86 SVGTests::trace(visitor); |
| 87 } | 87 } |
| 88 | 88 |
| 89 DEFINE_NODE_FACTORY(SVGMaskElement) | 89 DEFINE_NODE_FACTORY(SVGMaskElement) |
| 90 | 90 |
| 91 void SVGMaskElement::collectStyleForPresentationAttribute( | 91 void SVGMaskElement::collectStyleForPresentationAttribute( |
| 92 const QualifiedName& name, | 92 const QualifiedName& name, |
| 93 const AtomicString& value, | 93 const AtomicString& value, |
| 94 MutableStylePropertySet* style) { | 94 MutableStylePropertySet* style) { |
| 95 SVGAnimatedPropertyBase* property = propertyFromAttribute(name); | 95 SVGAnimatedPropertyBase* property = propertyFromAttribute(name); |
| 96 if (property == m_x) | 96 if (property == m_x) { |
| 97 addPropertyToPresentationAttributeStyle( | 97 addPropertyToPresentationAttributeStyle(style, CSSPropertyX, |
| 98 style, CSSPropertyX, m_x->currentValue()->asCSSPrimitiveValue()); | 98 m_x->cssValue()); |
| 99 else if (property == m_y) | 99 } else if (property == m_y) { |
| 100 addPropertyToPresentationAttributeStyle( | 100 addPropertyToPresentationAttributeStyle(style, CSSPropertyY, |
| 101 style, CSSPropertyY, m_y->currentValue()->asCSSPrimitiveValue()); | 101 m_y->cssValue()); |
| 102 else if (property == m_width) | 102 } else if (property == m_width) { |
| 103 addPropertyToPresentationAttributeStyle( | 103 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, |
| 104 style, CSSPropertyWidth, | 104 m_width->cssValue()); |
| 105 m_width->currentValue()->asCSSPrimitiveValue()); | 105 } else if (property == m_height) { |
| 106 else if (property == m_height) | 106 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, |
| 107 addPropertyToPresentationAttributeStyle( | 107 m_height->cssValue()); |
| 108 style, CSSPropertyHeight, | 108 } else { |
| 109 m_height->currentValue()->asCSSPrimitiveValue()); | |
| 110 else | |
| 111 SVGElement::collectStyleForPresentationAttribute(name, value, style); | 109 SVGElement::collectStyleForPresentationAttribute(name, value, style); |
| 110 } |
| 112 } | 111 } |
| 113 | 112 |
| 114 void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName) { | 113 void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName) { |
| 115 bool isLengthAttr = | 114 bool isLengthAttr = |
| 116 attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || | 115 attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || |
| 117 attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr; | 116 attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr; |
| 118 | 117 |
| 119 if (isLengthAttr || attrName == SVGNames::maskUnitsAttr || | 118 if (isLengthAttr || attrName == SVGNames::maskUnitsAttr || |
| 120 attrName == SVGNames::maskContentUnitsAttr || | 119 attrName == SVGNames::maskContentUnitsAttr || |
| 121 SVGTests::isKnownAttribute(attrName)) { | 120 SVGTests::isKnownAttribute(attrName)) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 154 } |
| 156 | 155 |
| 157 bool SVGMaskElement::selfHasRelativeLengths() const { | 156 bool SVGMaskElement::selfHasRelativeLengths() const { |
| 158 return m_x->currentValue()->isRelative() || | 157 return m_x->currentValue()->isRelative() || |
| 159 m_y->currentValue()->isRelative() || | 158 m_y->currentValue()->isRelative() || |
| 160 m_width->currentValue()->isRelative() || | 159 m_width->currentValue()->isRelative() || |
| 161 m_height->currentValue()->isRelative(); | 160 m_height->currentValue()->isRelative(); |
| 162 } | 161 } |
| 163 | 162 |
| 164 } // namespace blink | 163 } // namespace blink |
| OLD | NEW |