From b64b4cd23bb4c21398bc85155adc30de2a5e5d2f Mon Sep 17 00:00:00 2001 From: "pollmann%netscape.com" Date: Thu, 21 Sep 2000 05:07:06 +0000 Subject: [PATCH] Bug 51576: Fix a crash when resizing browser to zero height or width for frameset pages; Fix thanks to tobias.weibel@gmx.net; r=self, jst, vidur git-svn-id: svn://10.0.0.236/trunk@79714 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsFrameSetFrame.cpp | 4 ++++ mozilla/layout/html/document/src/nsFrameSetFrame.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/mozilla/layout/generic/nsFrameSetFrame.cpp b/mozilla/layout/generic/nsFrameSetFrame.cpp index 52104e4f073..376601f650e 100644 --- a/mozilla/layout/generic/nsFrameSetFrame.cpp +++ b/mozilla/layout/generic/nsFrameSetFrame.cpp @@ -959,8 +959,12 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext* aPresContext, // only borders between s. There are none on the edges (e.g the // leftmost has no left border). PRInt32 borderWidth = GetBorderWidth(aPresContext); + width -= (mNumCols - 1) * borderWidth; + if (width < 0) width = 0; + height -= (mNumRows - 1) * borderWidth; + if (height < 0) height = 0; if (!mDrag.mActive && ( (firstTime) || ( (mRect.width != 0) && (mRect.height != 0) && diff --git a/mozilla/layout/html/document/src/nsFrameSetFrame.cpp b/mozilla/layout/html/document/src/nsFrameSetFrame.cpp index 52104e4f073..376601f650e 100644 --- a/mozilla/layout/html/document/src/nsFrameSetFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameSetFrame.cpp @@ -959,8 +959,12 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext* aPresContext, // only borders between s. There are none on the edges (e.g the // leftmost has no left border). PRInt32 borderWidth = GetBorderWidth(aPresContext); + width -= (mNumCols - 1) * borderWidth; + if (width < 0) width = 0; + height -= (mNumRows - 1) * borderWidth; + if (height < 0) height = 0; if (!mDrag.mActive && ( (firstTime) || ( (mRect.width != 0) && (mRect.height != 0) &&