Bug 1382534 - Account for the local transform in nsSVGClipPathFrame::GetBBoxForClipPathFrame(). r=longsonr
MozReview-Commit-ID: HbZzPkAZy7q
--- a/layout/svg/nsSVGClipPathFrame.cpp
+++ b/layout/svg/nsSVGClipPathFrame.cpp
@@ -475,22 +475,23 @@ nsSVGClipPathFrame::GetClipPathTransform
SVGBBox
nsSVGClipPathFrame::GetBBoxForClipPathFrame(const SVGBBox &aBBox,
const gfxMatrix &aMatrix)
{
nsIContent* node = GetContent()->GetFirstChild();
SVGBBox unionBBox, tmpBBox;
for (; node; node = node->GetNextSibling()) {
- nsIFrame *frame =
- static_cast<nsSVGElement*>(node)->GetPrimaryFrame();
+ nsSVGElement* svgNode = static_cast<nsSVGElement*>(node);
+ nsIFrame* frame = svgNode->GetPrimaryFrame();
if (frame) {
nsSVGDisplayableFrame* svg = do_QueryFrame(frame);
if (svg) {
- tmpBBox = svg->GetBBoxContribution(mozilla::gfx::ToMatrix(aMatrix),
+ gfxMatrix matrix = svgNode->PrependLocalTransformsTo(aMatrix, eUserSpaceToParent);
+ tmpBBox = svg->GetBBoxContribution(mozilla::gfx::ToMatrix(matrix),
nsSVGUtils::eBBoxIncludeFill);
SVGObserverUtils::EffectProperties effectProperties =
SVGObserverUtils::GetEffectProperties(frame);
if (effectProperties.HasNoOrValidClipPath()) {
nsSVGClipPathFrame *clipPathFrame =
effectProperties.GetClipPathFrame();
if (clipPathFrame) {
tmpBBox = clipPathFrame->GetBBoxForClipPathFrame(tmpBBox, aMatrix);