Bug 1348564 - Part 3. More comment in nsSVGIntegrationUtils::GetSVGBBoxForNonSVGFrame.
MozReview-Commit-ID: Gq9vLmqrcjy
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -187,18 +187,24 @@ nsSVGIntegrationUtils::GetSVGCoordContex
nsPresContext* presContext = firstFrame->PresContext();
return gfx::Size(presContext->AppUnitsToFloatCSSPixels(r.width),
presContext->AppUnitsToFloatCSSPixels(r.height));
}
gfxRect
nsSVGIntegrationUtils::GetSVGBBoxForNonSVGFrame(nsIFrame* aNonSVGFrame)
{
+ // Except for nsSVGOuterSVGFrame, we shouldn't be getting here with SVG
+ // frames at all. This function is for elements that are laid out using the
+ // CSS box model rules.
NS_ASSERTION(!(aNonSVGFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT),
"Frames with SVG layout should not get here");
+ MOZ_ASSERT_IF(aNonSVGFrame->IsFrameOfType(nsIFrame::eSVG),
+ aNonSVGFrame->GetType() == nsGkAtoms::svgOuterSVGFrame);
+
nsIFrame* firstFrame =
nsLayoutUtils::FirstContinuationOrIBSplitSibling(aNonSVGFrame);
// 'r' is in "user space":
nsRect r = GetPreEffectsVisualOverflowUnion(firstFrame, nullptr, nsRect(),
GetOffsetToBoundingBox(firstFrame));
return nsLayoutUtils::RectToGfxRect(r,
aNonSVGFrame->PresContext()->AppUnitsPerCSSPixel());
}