Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: Source/WebCore/rendering/svg/RenderSVGResource.cpp

Issue 9235065: Merge 105978 - crash in WebCore::RenderSVGContainer::paint (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m ode, RenderObject* object, const RenderStyle* style, Color& fallbackColor) 47 static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m ode, RenderObject* object, const RenderStyle* style, Color& fallbackColor)
48 { 48 {
49 ASSERT(object); 49 ASSERT(object);
50 ASSERT(style); 50 ASSERT(style);
51 51
52 // If we have no style at all, ignore it. 52 // If we have no style at all, ignore it.
53 const SVGRenderStyle* svgStyle = style->svgStyle(); 53 const SVGRenderStyle* svgStyle = style->svgStyle();
54 if (!svgStyle) 54 if (!svgStyle)
55 return 0; 55 return 0;
56 56
57 bool isRenderingMask = false;
58 if (object->frame() && object->frame()->view())
59 isRenderingMask = object->frame()->view()->paintBehavior() & PaintBehavi orRenderingSVGMask;
60
57 // If we have no fill/stroke, return 0. 61 // If we have no fill/stroke, return 0.
58 if (mode == ApplyToFillMode) { 62 if (mode == ApplyToFillMode) {
63 // When rendering the mask for a RenderSVGResourceClipper, always use th e initial fill paint server, and ignore stroke.
64 if (isRenderingMask) {
65 RenderSVGResourceSolidColor* colorResource = RenderSVGResource::shar edSolidPaintingResource();
66 colorResource->setColor(SVGRenderStyle::initialFillPaintColor());
67 return colorResource;
68 }
69
59 if (!svgStyle->hasFill()) 70 if (!svgStyle->hasFill())
60 return 0; 71 return 0;
61 } else { 72 } else {
62 if (!svgStyle->hasStroke()) 73 if (!svgStyle->hasStroke() || isRenderingMask)
63 return 0; 74 return 0;
64 } 75 }
65 76
66 bool applyToFill = mode == ApplyToFillMode; 77 bool applyToFill = mode == ApplyToFillMode;
67 SVGPaint::SVGPaintType paintType = applyToFill ? svgStyle->fillPaintType() : svgStyle->strokePaintType(); 78 SVGPaint::SVGPaintType paintType = applyToFill ? svgStyle->fillPaintType() : svgStyle->strokePaintType();
68 if (paintType == SVGPaint::SVG_PAINTTYPE_NONE) 79 if (paintType == SVGPaint::SVG_PAINTTYPE_NONE)
69 return 0; 80 return 0;
70 81
71 Color color; 82 Color color;
72 switch (paintType) { 83 switch (paintType) {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 173 }
163 174
164 current = current->parent(); 175 current = current->parent();
165 } 176 }
166 } 177 }
167 178
168 } 179 }
169 180
170 #endif 181 #endif
171 182
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/PaintPhase.h ('k') | Source/WebCore/rendering/svg/RenderSVGResourceClipper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698