| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 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 * Copyright (C) 2005 Oliver Hunt <oliver@nerget.com> | 4 * Copyright (C) 2005 Oliver Hunt <oliver@nerget.com> |
| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 addToPropertyMap(m_x); | 50 addToPropertyMap(m_x); |
| 51 addToPropertyMap(m_y); | 51 addToPropertyMap(m_y); |
| 52 addToPropertyMap(m_z); | 52 addToPropertyMap(m_z); |
| 53 addToPropertyMap(m_pointsAtX); | 53 addToPropertyMap(m_pointsAtX); |
| 54 addToPropertyMap(m_pointsAtY); | 54 addToPropertyMap(m_pointsAtY); |
| 55 addToPropertyMap(m_pointsAtZ); | 55 addToPropertyMap(m_pointsAtZ); |
| 56 addToPropertyMap(m_specularExponent); | 56 addToPropertyMap(m_specularExponent); |
| 57 addToPropertyMap(m_limitingConeAngle); | 57 addToPropertyMap(m_limitingConeAngle); |
| 58 } | 58 } |
| 59 | 59 |
| 60 SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElem
ent) | 60 SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement& svgElem
ent) |
| 61 { | 61 { |
| 62 for (Node* node = svgElement->firstChild(); node; node = node->nextSibling()
) { | 62 return Traversal<SVGFELightElement>::firstChild(svgElement); |
| 63 if (isSVGFELightElement(*node)) | |
| 64 return toSVGFELightElement(node); | |
| 65 } | |
| 66 return 0; | |
| 67 } | 63 } |
| 68 | 64 |
| 69 PassRefPtr<LightSource> SVGFELightElement::findLightSource(const SVGElement* svg
Element) | 65 PassRefPtr<LightSource> SVGFELightElement::findLightSource(const SVGElement& svg
Element) |
| 70 { | 66 { |
| 71 SVGFELightElement* lightNode = findLightElement(svgElement); | 67 SVGFELightElement* lightNode = findLightElement(svgElement); |
| 72 if (!lightNode) | 68 if (!lightNode) |
| 73 return nullptr; | 69 return nullptr; |
| 74 return lightNode->lightSource(); | 70 return lightNode->lightSource(); |
| 75 } | 71 } |
| 76 | 72 |
| 77 bool SVGFELightElement::isSupportedAttribute(const QualifiedName& attrName) | 73 bool SVGFELightElement::isSupportedAttribute(const QualifiedName& attrName) |
| 78 { | 74 { |
| 79 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 75 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 || attrName == SVGNames::specularExponentAttr | 143 || attrName == SVGNames::specularExponentAttr |
| 148 || attrName == SVGNames::limitingConeAngleAttr) { | 144 || attrName == SVGNames::limitingConeAngleAttr) { |
| 149 ContainerNode* parent = parentNode(); | 145 ContainerNode* parent = parentNode(); |
| 150 if (!parent) | 146 if (!parent) |
| 151 return; | 147 return; |
| 152 | 148 |
| 153 RenderObject* renderer = parent->renderer(); | 149 RenderObject* renderer = parent->renderer(); |
| 154 if (!renderer || !renderer->isSVGResourceFilterPrimitive()) | 150 if (!renderer || !renderer->isSVGResourceFilterPrimitive()) |
| 155 return; | 151 return; |
| 156 | 152 |
| 157 if (parent->hasTagName(SVGNames::feDiffuseLightingTag)) { | 153 if (isSVGFEDiffuseLightingElement(*parent)) { |
| 158 toSVGFEDiffuseLightingElement(parent)->lightElementAttributeChanged(
this, attrName); | 154 toSVGFEDiffuseLightingElement(*parent).lightElementAttributeChanged(
this, attrName); |
| 159 return; | 155 return; |
| 160 } else if (parent->hasTagName(SVGNames::feSpecularLightingTag)) { | 156 } |
| 161 toSVGFESpecularLightingElement(parent)->lightElementAttributeChanged
(this, attrName); | 157 if (isSVGFESpecularLightingElement(*parent)) { |
| 158 toSVGFESpecularLightingElement(*parent).lightElementAttributeChanged
(this, attrName); |
| 162 return; | 159 return; |
| 163 } | 160 } |
| 164 } | 161 } |
| 165 | 162 |
| 166 ASSERT_NOT_REACHED(); | 163 ASSERT_NOT_REACHED(); |
| 167 } | 164 } |
| 168 | 165 |
| 169 void SVGFELightElement::childrenChanged(bool changedByParser, Node* beforeChange
, Node* afterChange, int childCountDelta) | 166 void SVGFELightElement::childrenChanged(bool changedByParser, Node* beforeChange
, Node* afterChange, int childCountDelta) |
| 170 { | 167 { |
| 171 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); | 168 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); |
| 172 | 169 |
| 173 if (!changedByParser) { | 170 if (!changedByParser) { |
| 174 if (ContainerNode* parent = parentNode()) { | 171 if (ContainerNode* parent = parentNode()) { |
| 175 RenderObject* renderer = parent->renderer(); | 172 RenderObject* renderer = parent->renderer(); |
| 176 if (renderer && renderer->isSVGResourceFilterPrimitive()) | 173 if (renderer && renderer->isSVGResourceFilterPrimitive()) |
| 177 RenderSVGResource::markForLayoutAndParentResourceInvalidation(re
nderer); | 174 RenderSVGResource::markForLayoutAndParentResourceInvalidation(re
nderer); |
| 178 } | 175 } |
| 179 } | 176 } |
| 180 } | 177 } |
| 181 | 178 |
| 182 } | 179 } |
| OLD | NEW |