| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 bool SVGLinearGradientElement::collectGradientAttributes( | 137 bool SVGLinearGradientElement::collectGradientAttributes( |
| 138 LinearGradientAttributes& attributes) { | 138 LinearGradientAttributes& attributes) { |
| 139 if (!layoutObject()) | 139 if (!layoutObject()) |
| 140 return false; | 140 return false; |
| 141 | 141 |
| 142 HeapHashSet<Member<SVGGradientElement>> processedGradients; | 142 HeapHashSet<Member<SVGGradientElement>> processedGradients; |
| 143 SVGGradientElement* current = this; | 143 SVGGradientElement* current = this; |
| 144 | 144 |
| 145 setGradientAttributes(current, attributes); | 145 setGradientAttributes(current, attributes); |
| 146 processedGradients.add(current); | 146 processedGradients.insert(current); |
| 147 | 147 |
| 148 while (true) { | 148 while (true) { |
| 149 // Respect xlink:href, take attributes from referenced element | 149 // Respect xlink:href, take attributes from referenced element |
| 150 Node* refNode = SVGURIReference::targetElementFromIRIString( | 150 Node* refNode = SVGURIReference::targetElementFromIRIString( |
| 151 current->href()->currentValue()->value(), treeScope()); | 151 current->href()->currentValue()->value(), treeScope()); |
| 152 if (refNode && isSVGGradientElement(*refNode)) { | 152 if (refNode && isSVGGradientElement(*refNode)) { |
| 153 current = toSVGGradientElement(refNode); | 153 current = toSVGGradientElement(refNode); |
| 154 | 154 |
| 155 // Cycle detection | 155 // Cycle detection |
| 156 if (processedGradients.contains(current)) | 156 if (processedGradients.contains(current)) |
| 157 return true; | 157 return true; |
| 158 | 158 |
| 159 if (!current->layoutObject()) | 159 if (!current->layoutObject()) |
| 160 return false; | 160 return false; |
| 161 | 161 |
| 162 setGradientAttributes(current, attributes, | 162 setGradientAttributes(current, attributes, |
| 163 isSVGLinearGradientElement(*current)); | 163 isSVGLinearGradientElement(*current)); |
| 164 processedGradients.add(current); | 164 processedGradients.insert(current); |
| 165 } else { | 165 } else { |
| 166 return true; | 166 return true; |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 ASSERT_NOT_REACHED(); | 170 ASSERT_NOT_REACHED(); |
| 171 return false; | 171 return false; |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool SVGLinearGradientElement::selfHasRelativeLengths() const { | 174 bool SVGLinearGradientElement::selfHasRelativeLengths() const { |
| 175 return m_x1->currentValue()->isRelative() || | 175 return m_x1->currentValue()->isRelative() || |
| 176 m_y1->currentValue()->isRelative() || | 176 m_y1->currentValue()->isRelative() || |
| 177 m_x2->currentValue()->isRelative() || | 177 m_x2->currentValue()->isRelative() || |
| 178 m_y2->currentValue()->isRelative(); | 178 m_y2->currentValue()->isRelative(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace blink | 181 } // namespace blink |
| OLD | NEW |