Bug 1416754 - Account for a clip-path's transform in nsSVGUtils::GetBBox(). r=longsonr draft
authorBotond Ballo <botond@mozilla.com>
Wed, 15 Nov 2017 17:33:41 -0500
changeset 698522 95bc906f923de229f6af63473f263e07d81e60ff
parent 698434 fc7117ba005a378e6746305e4c5966b7a566920e
child 699817 60fe483c9d650ba3dc0eddddb46f302c24ded37a
push id89321
push userbballo@mozilla.com
push dateWed, 15 Nov 2017 22:34:35 +0000
reviewerslongsonr
bugs1416754
milestone59.0a1
Bug 1416754 - Account for a clip-path's transform in nsSVGUtils::GetBBox(). r=longsonr MozReview-Commit-ID: 87RpVYk0nm0
layout/svg/nsSVGUtils.cpp
--- 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);
       }