Fixing bug 353460. SVG image has no horizontal scrollbar. r=bzbarsky@mit.edu, sr=roc@ocallahan.org, a=auto (blocking1.9+)

This commit is contained in:
jwatt@jwatt.org 2007-08-30 14:20:41 -07:00
Родитель 25a31f34f3
Коммит a6946f2591
1 изменённых файлов: 13 добавлений и 4 удалений

Просмотреть файл

@ -200,12 +200,16 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext* aPresContext,
nsReflowStatus& aStatus)
{
if (!aReflowState.ShouldReflowAllKids()) {
// We're not the target of the incremental reflow, so just bail.
// This means that something happened to one of our descendants
// (excluding those inside svg:foreignObject, since
// nsSVGForeignObjectFrame is a reflow root).
// We're not the target of the incremental reflow, so just bail. We get
// here when our containing block has changed size (e.g. when the browser
// window is resized). We could in principal also get here if something
// happened to one of our descendants, but since nsSVGForeignObjectFrame is
// a reflow root, and since no other SVG elements participate in CSS
// layout, that currently should never happen.
aDesiredSize.width = mRect.width;
aDesiredSize.height = mRect.height;
aDesiredSize.mOverflowArea.SetRect(0, 0, mRect.width, mRect.height);
FinishAndStoreOverflow(&aDesiredSize);
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}
@ -248,6 +252,11 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext* aPresContext,
// XXX add in CSS borders ??
// Make sure we scroll if we're too big:
// XXX Use the bounding box of our descendants? (See bug 353460 comment 14.)
aDesiredSize.mOverflowArea.SetRect(0, 0, aDesiredSize.width, aDesiredSize.height);
FinishAndStoreOverflow(&aDesiredSize);
aStatus = NS_FRAME_COMPLETE;
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);