Bug 1416754 - Account for a clip-path's transform in nsSVGUtils::GetBBox(). r=longsonr a=gchang
authorBotond Ballo <botond@mozilla.com>
Wed, 15 Nov 2017 17:33:41 -0500
changeset 444839 847de4bb6c76a6cd54d3993c232cfac247e87cff
parent 444838 bfce9141d7d9929c68d4be1bd651a45282afc11d
child 444840 520fd735565ef440e6c63effcb78b922257f09c3
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr, gchang
bugs1416754
milestone58.0
Bug 1416754 - Account for a clip-path's transform in nsSVGUtils::GetBBox(). r=longsonr a=gchang 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);
       }