| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
| 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "core/rendering/svg/SVGResourcesCache.h" | 34 #include "core/rendering/svg/SVGResourcesCache.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 static inline bool inheritColorFromParentStyle(RenderObject* object, bool applyT
oFill, Color& color) | 38 static inline bool inheritColorFromParentStyle(RenderObject* object, bool applyT
oFill, Color& color) |
| 39 { | 39 { |
| 40 if (!object->parent() || !object->parent()->style()) | 40 if (!object->parent() || !object->parent()->style()) |
| 41 return false; | 41 return false; |
| 42 const SVGRenderStyle& parentSVGStyle = object->parent()->style()->svgStyle()
; | 42 const SVGRenderStyle& parentSVGStyle = object->parent()->style()->svgStyle()
; |
| 43 SVGPaintType paintType = applyToFill ? parentSVGStyle.fillPaintType() : pare
ntSVGStyle.strokePaintType(); | 43 SVGPaintType paintType = applyToFill ? parentSVGStyle.fillPaintType() : pare
ntSVGStyle.strokePaintType(); |
| 44 if (paintType != SVG_PAINTTYPE_RGBCOLOR && paintType != SVG_PAINTTYPE_RGBCOL
OR_ICCCOLOR) | 44 if (paintType != SVG_PAINTTYPE_RGBCOLOR) |
| 45 return false; | 45 return false; |
| 46 color = applyToFill ? parentSVGStyle.fillPaintColor() : parentSVGStyle.strok
ePaintColor(); | 46 color = applyToFill ? parentSVGStyle.fillPaintColor() : parentSVGStyle.strok
ePaintColor(); |
| 47 return true; | 47 return true; |
| 48 } | 48 } |
| 49 | 49 |
| 50 RenderSVGResource* RenderSVGResource::requestPaintingResource(RenderSVGResourceM
ode mode, RenderObject* object, const RenderStyle* style, bool& hasFallback) | 50 RenderSVGResource* RenderSVGResource::requestPaintingResource(RenderSVGResourceM
ode mode, RenderObject* object, const RenderStyle* style, bool& hasFallback) |
| 51 { | 51 { |
| 52 ASSERT(object); | 52 ASSERT(object); |
| 53 ASSERT(style); | 53 ASSERT(style); |
| 54 | 54 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 79 | 79 |
| 80 bool applyToFill = mode == ApplyToFillMode; | 80 bool applyToFill = mode == ApplyToFillMode; |
| 81 SVGPaintType paintType = applyToFill ? svgStyle.fillPaintType() : svgStyle.s
trokePaintType(); | 81 SVGPaintType paintType = applyToFill ? svgStyle.fillPaintType() : svgStyle.s
trokePaintType(); |
| 82 ASSERT(paintType != SVG_PAINTTYPE_NONE); | 82 ASSERT(paintType != SVG_PAINTTYPE_NONE); |
| 83 | 83 |
| 84 Color color; | 84 Color color; |
| 85 bool hasColor = false; | 85 bool hasColor = false; |
| 86 switch (paintType) { | 86 switch (paintType) { |
| 87 case SVG_PAINTTYPE_CURRENTCOLOR: | 87 case SVG_PAINTTYPE_CURRENTCOLOR: |
| 88 case SVG_PAINTTYPE_RGBCOLOR: | 88 case SVG_PAINTTYPE_RGBCOLOR: |
| 89 case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: | |
| 90 case SVG_PAINTTYPE_URI_CURRENTCOLOR: | 89 case SVG_PAINTTYPE_URI_CURRENTCOLOR: |
| 91 case SVG_PAINTTYPE_URI_RGBCOLOR: | 90 case SVG_PAINTTYPE_URI_RGBCOLOR: |
| 92 case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: | |
| 93 color = applyToFill ? svgStyle.fillPaintColor() : svgStyle.strokePaintCo
lor(); | 91 color = applyToFill ? svgStyle.fillPaintColor() : svgStyle.strokePaintCo
lor(); |
| 94 hasColor = true; | 92 hasColor = true; |
| 95 default: | 93 default: |
| 96 break; | 94 break; |
| 97 } | 95 } |
| 98 | 96 |
| 99 if (style->insideLink() == InsideVisitedLink) { | 97 if (style->insideLink() == InsideVisitedLink) { |
| 100 // FIXME: This code doesn't support the uri component of the visited lin
k paint, https://bugs.webkit.org/show_bug.cgi?id=70006 | 98 // FIXME: This code doesn't support the uri component of the visited lin
k paint, https://bugs.webkit.org/show_bug.cgi?id=70006 |
| 101 SVGPaintType visitedPaintType = applyToFill ? svgStyle.visitedLinkFillPa
intType() : svgStyle.visitedLinkStrokePaintType(); | 99 SVGPaintType visitedPaintType = applyToFill ? svgStyle.visitedLinkFillPa
intType() : svgStyle.visitedLinkStrokePaintType(); |
| 102 | 100 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // This will process the rest of the ancestors. | 213 // This will process the rest of the ancestors. |
| 216 toRenderSVGResourceContainer(current)->removeAllClientsFromCache(); | 214 toRenderSVGResourceContainer(current)->removeAllClientsFromCache(); |
| 217 break; | 215 break; |
| 218 } | 216 } |
| 219 | 217 |
| 220 current = current->parent(); | 218 current = current->parent(); |
| 221 } | 219 } |
| 222 } | 220 } |
| 223 | 221 |
| 224 } | 222 } |
| OLD | NEW |