Bug 1416754 - Account for a clip-path's transform in nsSVGUtils::GetBBox(). r=longsonr
MozReview-Commit-ID: 87RpVYk0nm0
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -1183,16 +1183,17 @@ nsSVGUtils::GetBBox(nsIFrame* aFrame, ui
static_cast<SVGClipPathElement*>(clipPathFrame->GetContent());
RefPtr<SVGAnimatedEnumeration> units = clipContent->ClipPathUnits();
if (units->AnimVal() == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
matrix.PreTranslate(gfxPoint(x, y));
matrix.PreScale(width, height);
} else if (aFrame->IsSVGForeignObjectFrame()) {
matrix = gfxMatrix();
}
+ matrix = clipContent->PrependLocalTransformsTo(matrix, eUserSpaceToParent);
bbox =
clipPathFrame->GetBBoxForClipPathFrame(bbox, matrix).ToThebesRect();
}
if (hasClip) {
bbox = bbox.Intersect(clipRect);
}