| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 if (!attributes.hasX2() && current->hasAttribute(SVGNames::x2Attr)) | 159 if (!attributes.hasX2() && current->hasAttribute(SVGNames::x2Attr)) |
| 160 attributes.setX2(linear->x2CurrentValue()); | 160 attributes.setX2(linear->x2CurrentValue()); |
| 161 | 161 |
| 162 if (!attributes.hasY2() && current->hasAttribute(SVGNames::y2Attr)) | 162 if (!attributes.hasY2() && current->hasAttribute(SVGNames::y2Attr)) |
| 163 attributes.setY2(linear->y2CurrentValue()); | 163 attributes.setY2(linear->y2CurrentValue()); |
| 164 } | 164 } |
| 165 | 165 |
| 166 processedGradients.add(current); | 166 processedGradients.add(current); |
| 167 | 167 |
| 168 // Respect xlink:href, take attributes from referenced element | 168 // Respect xlink:href, take attributes from referenced element |
| 169 Node* refNode = SVGURIReference::targetElementFromIRIString(current->hre
fCurrentValue(), &document()); | 169 Node* refNode = SVGURIReference::targetElementFromIRIString(current->hre
fCurrentValue(), document()); |
| 170 if (refNode && (refNode->hasTagName(SVGNames::linearGradientTag) || refN
ode->hasTagName(SVGNames::radialGradientTag))) { | 170 if (refNode && (refNode->hasTagName(SVGNames::linearGradientTag) || refN
ode->hasTagName(SVGNames::radialGradientTag))) { |
| 171 current = toSVGGradientElement(refNode); | 171 current = toSVGGradientElement(refNode); |
| 172 | 172 |
| 173 // Cycle detection | 173 // Cycle detection |
| 174 if (processedGradients.contains(current)) { | 174 if (processedGradients.contains(current)) { |
| 175 current = 0; | 175 current = 0; |
| 176 break; | 176 break; |
| 177 } | 177 } |
| 178 | 178 |
| 179 isLinear = current->hasTagName(SVGNames::linearGradientTag); | 179 isLinear = current->hasTagName(SVGNames::linearGradientTag); |
| 180 } else | 180 } else |
| 181 current = 0; | 181 current = 0; |
| 182 } | 182 } |
| 183 | 183 |
| 184 return true; | 184 return true; |
| 185 } | 185 } |
| 186 | 186 |
| 187 bool SVGLinearGradientElement::selfHasRelativeLengths() const | 187 bool SVGLinearGradientElement::selfHasRelativeLengths() const |
| 188 { | 188 { |
| 189 return x1CurrentValue().isRelative() | 189 return x1CurrentValue().isRelative() |
| 190 || y1CurrentValue().isRelative() | 190 || y1CurrentValue().isRelative() |
| 191 || x2CurrentValue().isRelative() | 191 || x2CurrentValue().isRelative() |
| 192 || y2CurrentValue().isRelative(); | 192 || y2CurrentValue().isRelative(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 } | 195 } |
| OLD | NEW |