| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 else if (element->hasTagName(SVGNames::linearGradientTag) || element->hasTag
Name(SVGNames::radialGradientTag)) | 145 else if (element->hasTagName(SVGNames::linearGradientTag) || element->hasTag
Name(SVGNames::radialGradientTag)) |
| 146 target = toSVGGradientElement(element)->hrefCurrentValue(); | 146 target = toSVGGradientElement(element)->hrefCurrentValue(); |
| 147 else if (element->hasTagName(SVGNames::filterTag)) | 147 else if (element->hasTagName(SVGNames::filterTag)) |
| 148 target = toSVGFilterElement(element)->hrefCurrentValue(); | 148 target = toSVGFilterElement(element)->hrefCurrentValue(); |
| 149 else | 149 else |
| 150 ASSERT_NOT_REACHED(); | 150 ASSERT_NOT_REACHED(); |
| 151 | 151 |
| 152 return SVGURIReference::fragmentIdentifierFromIRIString(target, element->doc
ument()); | 152 return SVGURIReference::fragmentIdentifierFromIRIString(target, element->doc
ument()); |
| 153 } | 153 } |
| 154 | 154 |
| 155 static inline bool svgPaintTypeHasURL(SVGPaint::SVGPaintType paintType) |
| 156 { |
| 157 switch (paintType) { |
| 158 case SVGPaint::SVG_PAINTTYPE_URI_NONE: |
| 159 case SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR: |
| 160 case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR: |
| 161 case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: |
| 162 case SVGPaint::SVG_PAINTTYPE_URI: |
| 163 return true; |
| 164 default: |
| 165 break; |
| 166 } |
| 167 return false; |
| 168 } |
| 169 |
| 155 static inline RenderSVGResourceContainer* paintingResourceFromSVGPaint(Document&
document, const SVGPaint::SVGPaintType& paintType, const String& paintUri, Atom
icString& id, bool& hasPendingResource) | 170 static inline RenderSVGResourceContainer* paintingResourceFromSVGPaint(Document&
document, const SVGPaint::SVGPaintType& paintType, const String& paintUri, Atom
icString& id, bool& hasPendingResource) |
| 156 { | 171 { |
| 157 if (paintType != SVGPaint::SVG_PAINTTYPE_URI && paintType != SVGPaint::SVG_P
AINTTYPE_URI_RGBCOLOR) | 172 if (!svgPaintTypeHasURL(paintType)) |
| 158 return 0; | 173 return 0; |
| 159 | 174 |
| 160 id = SVGURIReference::fragmentIdentifierFromIRIString(paintUri, document); | 175 id = SVGURIReference::fragmentIdentifierFromIRIString(paintUri, document); |
| 161 RenderSVGResourceContainer* container = getRenderSVGResourceContainerById(do
cument, id); | 176 RenderSVGResourceContainer* container = getRenderSVGResourceContainerById(do
cument, id); |
| 162 if (!container) { | 177 if (!container) { |
| 163 hasPendingResource = true; | 178 hasPendingResource = true; |
| 164 return 0; | 179 return 0; |
| 165 } | 180 } |
| 166 | 181 |
| 167 RenderSVGResourceType resourceType = container->resourceType(); | 182 RenderSVGResourceType resourceType = container->resourceType(); |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 if (RenderSVGResourceContainer* stroke = m_fillStrokeData->stroke) | 700 if (RenderSVGResourceContainer* stroke = m_fillStrokeData->stroke) |
| 686 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke->
element()); | 701 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke->
element()); |
| 687 } | 702 } |
| 688 | 703 |
| 689 if (m_linkedResource) | 704 if (m_linkedResource) |
| 690 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_
linkedResource->element()); | 705 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_
linkedResource->element()); |
| 691 } | 706 } |
| 692 #endif | 707 #endif |
| 693 | 708 |
| 694 } | 709 } |
| OLD | NEW |