| 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) 2008 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 bool SVGRadialGradientElement::collectGradientAttributes( | 152 bool SVGRadialGradientElement::collectGradientAttributes( |
| 153 RadialGradientAttributes& attributes) { | 153 RadialGradientAttributes& attributes) { |
| 154 if (!layoutObject()) | 154 if (!layoutObject()) |
| 155 return false; | 155 return false; |
| 156 | 156 |
| 157 HeapHashSet<Member<SVGGradientElement>> processedGradients; | 157 HeapHashSet<Member<SVGGradientElement>> processedGradients; |
| 158 SVGGradientElement* current = this; | 158 SVGGradientElement* current = this; |
| 159 | 159 |
| 160 setGradientAttributes(current, attributes); | 160 setGradientAttributes(current, attributes); |
| 161 processedGradients.add(current); | 161 processedGradients.insert(current); |
| 162 | 162 |
| 163 while (true) { | 163 while (true) { |
| 164 // Respect xlink:href, take attributes from referenced element | 164 // Respect xlink:href, take attributes from referenced element |
| 165 Node* refNode = SVGURIReference::targetElementFromIRIString( | 165 Node* refNode = SVGURIReference::targetElementFromIRIString( |
| 166 current->href()->currentValue()->value(), treeScope()); | 166 current->href()->currentValue()->value(), treeScope()); |
| 167 if (refNode && isSVGGradientElement(*refNode)) { | 167 if (refNode && isSVGGradientElement(*refNode)) { |
| 168 current = toSVGGradientElement(refNode); | 168 current = toSVGGradientElement(refNode); |
| 169 | 169 |
| 170 // Cycle detection | 170 // Cycle detection |
| 171 if (processedGradients.contains(current)) | 171 if (processedGradients.contains(current)) |
| 172 break; | 172 break; |
| 173 | 173 |
| 174 if (!current->layoutObject()) | 174 if (!current->layoutObject()) |
| 175 return false; | 175 return false; |
| 176 | 176 |
| 177 setGradientAttributes(current, attributes, | 177 setGradientAttributes(current, attributes, |
| 178 isSVGRadialGradientElement(*current)); | 178 isSVGRadialGradientElement(*current)); |
| 179 processedGradients.add(current); | 179 processedGradients.insert(current); |
| 180 } else { | 180 } else { |
| 181 break; | 181 break; |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 | 184 |
| 185 // Handle default values for fx/fy | 185 // Handle default values for fx/fy |
| 186 if (!attributes.hasFx()) | 186 if (!attributes.hasFx()) |
| 187 attributes.setFx(attributes.cx()); | 187 attributes.setFx(attributes.cx()); |
| 188 | 188 |
| 189 if (!attributes.hasFy()) | 189 if (!attributes.hasFy()) |
| 190 attributes.setFy(attributes.cy()); | 190 attributes.setFy(attributes.cy()); |
| 191 | 191 |
| 192 return true; | 192 return true; |
| 193 } | 193 } |
| 194 | 194 |
| 195 bool SVGRadialGradientElement::selfHasRelativeLengths() const { | 195 bool SVGRadialGradientElement::selfHasRelativeLengths() const { |
| 196 return m_cx->currentValue()->isRelative() || | 196 return m_cx->currentValue()->isRelative() || |
| 197 m_cy->currentValue()->isRelative() || | 197 m_cy->currentValue()->isRelative() || |
| 198 m_r->currentValue()->isRelative() || | 198 m_r->currentValue()->isRelative() || |
| 199 m_fx->currentValue()->isRelative() || | 199 m_fx->currentValue()->isRelative() || |
| 200 m_fy->currentValue()->isRelative() || | 200 m_fy->currentValue()->isRelative() || |
| 201 m_fr->currentValue()->isRelative(); | 201 m_fr->currentValue()->isRelative(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace blink | 204 } // namespace blink |
| OLD | NEW |