Bug 1077745 - Get rid of the scaling hack and GetCanvasTM() call in nsSVGPathGeometryFrame::GetBBoxContribution. r=longsonr
--- a/layout/svg/nsSVGPathGeometryFrame.cpp
+++ b/layout/svg/nsSVGPathGeometryFrame.cpp
@@ -353,37 +353,17 @@ nsSVGPathGeometryFrame::ReflowSVG()
uint16_t hitTestFlags = GetHitTestFlags();
if ((hitTestFlags & SVG_HIT_TEST_FILL)) {
flags |= nsSVGUtils::eBBoxIncludeFillGeometry;
}
if ((hitTestFlags & SVG_HIT_TEST_STROKE)) {
flags |= nsSVGUtils::eBBoxIncludeStrokeGeometry;
}
- // We'd like to just pass the identity matrix to GetBBoxContribution, but if
- // this frame's user space size is _very_ large/small then the extents we
- // obtain below might have overflowed or otherwise be broken. This would
- // cause us to end up with a broken mRect and visual overflow rect and break
- // painting of this frame. This is particularly noticeable if the transforms
- // between us and our nsSVGOuterSVGFrame scale this frame to a reasonable
- // size. To avoid this we sadly have to do extra work to account for the
- // transforms between us and our nsSVGOuterSVGFrame, even though the
- // overwhelming number of SVGs will never have this problem.
- // XXX Will Azure eventually save us from having to do this?
- gfxSize scaleFactors = GetCanvasTM().ScaleFactors(true);
- bool applyScaling = fabs(scaleFactors.width) >= 1e-6 &&
- fabs(scaleFactors.height) >= 1e-6;
- gfx::Matrix scaling;
- if (applyScaling) {
- scaling.PreScale(scaleFactors.width, scaleFactors.height);
- }
- gfxRect extent = GetBBoxContribution(scaling, flags).ToThebesRect();
- if (applyScaling) {
- extent.Scale(1 / scaleFactors.width, 1 / scaleFactors.height);
- }
+ gfxRect extent = GetBBoxContribution(Matrix(), flags).ToThebesRect();
mRect = nsLayoutUtils::RoundGfxRectToAppRect(extent,
PresContext()->AppUnitsPerCSSPixel());
if (mState & NS_FRAME_FIRST_REFLOW) {
// Make sure we have our filter property (if any) before calling
// FinishAndStoreOverflow (subsequent filter changes are handled off
// nsChangeHint_UpdateEffects):
nsSVGEffects::UpdateEffects(this);