Bug 1382534 - Use clip-rule instead of fill-rule when calculating the bounding box contribution of an SVG geometry frame inside a clip-path. r=longsonr
MozReview-Commit-ID: 1rAKmp2ET6A
--- a/layout/svg/SVGGeometryFrame.cpp
+++ b/layout/svg/SVGGeometryFrame.cpp
@@ -538,17 +538,20 @@ SVGGeometryFrame::GetBBoxContribution(co
RefPtr<gfxASurface> refSurf =
gfxPlatform::GetPlatform()->ScreenReferenceSurface();
tmpDT = gfxPlatform::GetPlatform()->
CreateDrawTargetForSurface(refSurf, IntSize(1, 1));
#else
tmpDT = gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget();
#endif
- FillRule fillRule = nsSVGUtils::ToFillRule(StyleSVG()->mFillRule);
+ FillRule fillRule = nsSVGUtils::ToFillRule(
+ (GetStateBits() & NS_STATE_SVG_CLIPPATH_CHILD)
+ ? StyleSVG()->mClipRule
+ : StyleSVG()->mFillRule);
RefPtr<Path> pathInUserSpace = element->GetOrBuildPath(*tmpDT, fillRule);
if (!pathInUserSpace) {
return bbox;
}
RefPtr<Path> pathInBBoxSpace;
if (aToBBoxUserspace.IsIdentity()) {
pathInBBoxSpace = pathInUserSpace;
} else {