Bug 519079 - Set a maximum on CSS shadow blur radius so that stupid values don't hang the browser r=roc

This commit is contained in:
Michael Ventnor 2010-03-15 14:16:17 +10:00
parent e8a95ea783
commit 195169647a

View File

@ -3660,6 +3660,8 @@ ImageRenderer::Draw(nsPresContext* aPresContext,
}
}
#define MAX_BLUR_RADIUS 300
// -----
// nsContextBoxBlur
// -----
@ -3675,6 +3677,7 @@ nsContextBoxBlur::Init(const nsRect& aRect, nscoord aBlurRadius,
}
PRInt32 blurRadius = static_cast<PRInt32>(aBlurRadius / aAppUnitsPerDevPixel);
blurRadius = PR_MIN(blurRadius, MAX_BLUR_RADIUS);
mDestinationCtx = aDestinationCtx;
// If not blurring, draw directly onto the destination device
@ -3685,7 +3688,6 @@ nsContextBoxBlur::Init(const nsRect& aRect, nscoord aBlurRadius,
// Convert from app units to device pixels
gfxRect rect = RectToGfxRect(aRect, aAppUnitsPerDevPixel);
rect.RoundOut();
gfxRect dirtyRect = RectToGfxRect(aDirtyRect, aAppUnitsPerDevPixel);
dirtyRect.RoundOut();