diff options
author | Ben Murdoch <benm@google.com> | 2011-05-24 11:24:40 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-02 09:53:15 +0100 |
commit | 81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch) | |
tree | 7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebCore/rendering/svg/RenderSVGResource.cpp | |
parent | 94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff) | |
download | external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2 |
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebCore/rendering/svg/RenderSVGResource.cpp')
-rw-r--r-- | Source/WebCore/rendering/svg/RenderSVGResource.cpp | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/Source/WebCore/rendering/svg/RenderSVGResource.cpp b/Source/WebCore/rendering/svg/RenderSVGResource.cpp index c0b16c5..12ed53a 100644 --- a/Source/WebCore/rendering/svg/RenderSVGResource.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGResource.cpp @@ -51,33 +51,36 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m return 0; } - SVGPaint* paint = mode == ApplyToFillMode ? svgStyle->fillPaint() : svgStyle->strokePaint(); - ASSERT(paint); - - SVGPaint::SVGPaintType paintType = paint->paintType(); + bool applyToFill = mode == ApplyToFillMode; + SVGPaint::SVGPaintType paintType = applyToFill ? svgStyle->fillPaintType() : svgStyle->strokePaintType(); if (paintType == SVGPaint::SVG_PAINTTYPE_NONE) return 0; Color color; - if (paintType == SVGPaint::SVG_PAINTTYPE_RGBCOLOR - || paintType == SVGPaint::SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR - || paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR - || paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR) - color = paint->color(); - else if (paintType == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR || paintType == SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR) - color = style->visitedDependentColor(CSSPropertyColor); + switch (paintType) { + case SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR: + case SVGPaint::SVG_PAINTTYPE_RGBCOLOR: + case SVGPaint::SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: + case SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR: + case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR: + case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: + color = applyToFill ? svgStyle->fillPaintColor() : svgStyle->strokePaintColor(); + default: + break; + } if (style->insideLink() == InsideVisitedLink) { RenderStyle* visitedStyle = style->getCachedPseudoStyle(VISITED_LINK); ASSERT(visitedStyle); - if (SVGPaint* visitedPaint = mode == ApplyToFillMode ? visitedStyle->svgStyle()->fillPaint() : visitedStyle->svgStyle()->strokePaint()) { - // For SVG_PAINTTYPE_CURRENTCOLOR, 'color' already contains the 'visitedColor'. - if (visitedPaint->paintType() < SVGPaint::SVG_PAINTTYPE_URI_NONE && visitedPaint->paintType() != SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR) { - const Color& visitedColor = visitedPaint->color(); - if (visitedColor.isValid()) - color = Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), color.alpha()); - } + const SVGRenderStyle* svgVisitedStyle = visitedStyle->svgStyle(); + SVGPaint::SVGPaintType visitedPaintType = applyToFill ? svgVisitedStyle->fillPaintType() : svgVisitedStyle->strokePaintType(); + + // For SVG_PAINTTYPE_CURRENTCOLOR, 'color' already contains the 'visitedColor'. + if (visitedPaintType < SVGPaint::SVG_PAINTTYPE_URI_NONE && visitedPaintType != SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR) { + const Color& visitedColor = applyToFill ? svgVisitedStyle->fillPaintColor() : svgVisitedStyle->strokePaintColor(); + if (visitedColor.isValid()) + color = Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), color.alpha()); } } |