| 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) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 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 * |
| 11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
| 15 * | 15 * |
| 16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
| 17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
| 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 #include "config.h" | 22 #include "config.h" |
| 23 #include "core/svg/SVGGradientElement.h" | 23 #include "core/svg/SVGGradientElement.h" |
| 24 | 24 |
| 25 #include "core/XLinkNames.h" | 25 #include "core/XLinkNames.h" |
| 26 #include "core/dom/Attribute.h" | 26 #include "core/dom/Attribute.h" |
| 27 #include "core/dom/ElementTraversal.h" | 27 #include "core/dom/ElementTraversal.h" |
| 28 #include "core/rendering/svg/RenderSVGResourceContainer.h" | 28 #include "core/layout/svg/LayoutSVGResourceContainer.h" |
| 29 #include "core/svg/SVGStopElement.h" | 29 #include "core/svg/SVGStopElement.h" |
| 30 #include "core/svg/SVGTransformList.h" | 30 #include "core/svg/SVGTransformList.h" |
| 31 | 31 |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGSpreadMe
thodType>() | 34 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGSpreadMe
thodType>() |
| 35 { | 35 { |
| 36 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); | 36 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); |
| 37 if (entries.isEmpty()) { | 37 if (entries.isEmpty()) { |
| 38 entries.append(std::make_pair(SVGSpreadMethodPad, "pad")); | 38 entries.append(std::make_pair(SVGSpreadMethodPad, "pad")); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 void SVGGradientElement::svgAttributeChanged(const QualifiedName& attrName) | 84 void SVGGradientElement::svgAttributeChanged(const QualifiedName& attrName) |
| 85 { | 85 { |
| 86 if (!isSupportedAttribute(attrName)) { | 86 if (!isSupportedAttribute(attrName)) { |
| 87 SVGElement::svgAttributeChanged(attrName); | 87 SVGElement::svgAttributeChanged(attrName); |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 | 90 |
| 91 SVGElement::InvalidationGuard invalidationGuard(this); | 91 SVGElement::InvalidationGuard invalidationGuard(this); |
| 92 | 92 |
| 93 RenderSVGResourceContainer* renderer = toRenderSVGResourceContainer(this->re
nderer()); | 93 LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->re
nderer()); |
| 94 if (renderer) | 94 if (renderer) |
| 95 renderer->invalidateCacheAndMarkForLayout(); | 95 renderer->invalidateCacheAndMarkForLayout(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void SVGGradientElement::childrenChanged(const ChildrenChange& change) | 98 void SVGGradientElement::childrenChanged(const ChildrenChange& change) |
| 99 { | 99 { |
| 100 SVGElement::childrenChanged(change); | 100 SVGElement::childrenChanged(change); |
| 101 | 101 |
| 102 if (change.byParser) | 102 if (change.byParser) |
| 103 return; | 103 return; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 117 offset = std::min(std::max(previousOffset, offset), 1.0f); | 117 offset = std::min(std::max(previousOffset, offset), 1.0f); |
| 118 previousOffset = offset; | 118 previousOffset = offset; |
| 119 | 119 |
| 120 stops.append(Gradient::ColorStop(offset, stop->stopColorIncludingOpacity
())); | 120 stops.append(Gradient::ColorStop(offset, stop->stopColorIncludingOpacity
())); |
| 121 } | 121 } |
| 122 | 122 |
| 123 return stops; | 123 return stops; |
| 124 } | 124 } |
| 125 | 125 |
| 126 } | 126 } |
| OLD | NEW |