| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 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 10 matching lines...) Expand all Loading... |
| 21 #include "config.h" | 21 #include "config.h" |
| 22 | 22 |
| 23 #include "core/svg/SVGFEMergeNodeElement.h" | 23 #include "core/svg/SVGFEMergeNodeElement.h" |
| 24 | 24 |
| 25 #include "core/svg/SVGElementInstance.h" | 25 #include "core/svg/SVGElementInstance.h" |
| 26 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h" | 26 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h" |
| 27 | 27 |
| 28 namespace WebCore { | 28 namespace WebCore { |
| 29 | 29 |
| 30 // Animated property definitions | 30 // Animated property definitions |
| 31 DEFINE_ANIMATED_STRING(SVGFEMergeNodeElement, SVGNames::inAttr, In1, in1) | |
| 32 | 31 |
| 33 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEMergeNodeElement) | 32 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEMergeNodeElement) |
| 34 REGISTER_LOCAL_ANIMATED_PROPERTY(in1) | |
| 35 END_REGISTER_ANIMATED_PROPERTIES | 33 END_REGISTER_ANIMATED_PROPERTIES |
| 36 | 34 |
| 37 inline SVGFEMergeNodeElement::SVGFEMergeNodeElement(Document& document) | 35 inline SVGFEMergeNodeElement::SVGFEMergeNodeElement(Document& document) |
| 38 : SVGElement(SVGNames::feMergeNodeTag, document) | 36 : SVGElement(SVGNames::feMergeNodeTag, document) |
| 37 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) |
| 39 { | 38 { |
| 40 ScriptWrappable::init(this); | 39 ScriptWrappable::init(this); |
| 40 addToPropertyMap(m_in1); |
| 41 registerAnimatedPropertiesForSVGFEMergeNodeElement(); | 41 registerAnimatedPropertiesForSVGFEMergeNodeElement(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 PassRefPtr<SVGFEMergeNodeElement> SVGFEMergeNodeElement::create(Document& docume
nt) | 44 PassRefPtr<SVGFEMergeNodeElement> SVGFEMergeNodeElement::create(Document& docume
nt) |
| 45 { | 45 { |
| 46 return adoptRef(new SVGFEMergeNodeElement(document)); | 46 return adoptRef(new SVGFEMergeNodeElement(document)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 bool SVGFEMergeNodeElement::isSupportedAttribute(const QualifiedName& attrName) | 49 bool SVGFEMergeNodeElement::isSupportedAttribute(const QualifiedName& attrName) |
| 50 { | 50 { |
| 51 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 51 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 52 if (supportedAttributes.isEmpty()) | 52 if (supportedAttributes.isEmpty()) |
| 53 supportedAttributes.add(SVGNames::inAttr); | 53 supportedAttributes.add(SVGNames::inAttr); |
| 54 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 54 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void SVGFEMergeNodeElement::parseAttribute(const QualifiedName& name, const Atom
icString& value) | 57 void SVGFEMergeNodeElement::parseAttribute(const QualifiedName& name, const Atom
icString& value) |
| 58 { | 58 { |
| 59 if (!isSupportedAttribute(name)) { | 59 if (!isSupportedAttribute(name)) { |
| 60 SVGElement::parseAttribute(name, value); | 60 SVGElement::parseAttribute(name, value); |
| 61 return; | 61 return; |
| 62 } | 62 } |
| 63 | 63 |
| 64 if (name == SVGNames::inAttr) { | 64 SVGParsingError parseError = NoError; |
| 65 setIn1BaseValue(value); | |
| 66 return; | |
| 67 } | |
| 68 | 65 |
| 69 ASSERT_NOT_REACHED(); | 66 if (name == SVGNames::inAttr) |
| 67 m_in1->setBaseValueAsString(value, parseError); |
| 68 else |
| 69 ASSERT_NOT_REACHED(); |
| 70 |
| 71 reportAttributeParsingError(parseError, name, value); |
| 70 } | 72 } |
| 71 | 73 |
| 72 void SVGFEMergeNodeElement::svgAttributeChanged(const QualifiedName& attrName) | 74 void SVGFEMergeNodeElement::svgAttributeChanged(const QualifiedName& attrName) |
| 73 { | 75 { |
| 74 if (!isSupportedAttribute(attrName)) { | 76 if (!isSupportedAttribute(attrName)) { |
| 75 SVGElement::svgAttributeChanged(attrName); | 77 SVGElement::svgAttributeChanged(attrName); |
| 76 return; | 78 return; |
| 77 } | 79 } |
| 78 | 80 |
| 79 SVGElementInstance::InvalidationGuard invalidationGuard(this); | 81 SVGElementInstance::InvalidationGuard invalidationGuard(this); |
| 80 | 82 |
| 81 if (attrName == SVGNames::inAttr) { | 83 if (attrName == SVGNames::inAttr) { |
| 82 invalidateFilterPrimitiveParent(this); | 84 invalidateFilterPrimitiveParent(this); |
| 83 return; | 85 return; |
| 84 } | 86 } |
| 85 | 87 |
| 86 ASSERT_NOT_REACHED(); | 88 ASSERT_NOT_REACHED(); |
| 87 } | 89 } |
| 88 | 90 |
| 89 } | 91 } |
| OLD | NEW |