From 01d2f5dc7ebb7c272c8ea2009d0499cc8faef1fd Mon Sep 17 00:00:00 2001 From: "attinasi%netscape.com" Date: Tue, 14 Aug 2001 00:08:08 +0000 Subject: [PATCH] Checkin for AlexSavulov@netscape.com: fixes problem of block inside of a NOWRAP block causing incorrect sizing. b=93363, r=peterl sr=attinasi git-svn-id: svn://10.0.0.236/trunk@100962 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsBlockFrame.cpp | 12 +++++++++++- mozilla/layout/html/base/src/nsBlockFrame.cpp | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 0e1aabbff07..f9c2f4da231 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -4118,7 +4118,17 @@ nsBlockFrame::PostPlaceLine(nsBlockReflowState& aState, } // Update xmost - nscoord xmost = aLine->mBounds.XMost(); + nscoord xmost; + if(aLine->IsBlock() && aState.GetFlag(BRS_NOWRAP)) { + // since the nowrap blocks tend to be as wide as their widest element or + // sequel of elements that can't be wrapped anymore (see patch for bug 80817) + // let them set xmost to be the width of the widest element of the reflowed line + // (patches bug 93363 and other NOWRAP dups) + xmost = aMaxElementSize.width; + } else { + xmost = aLine->mBounds.XMost(); + } + #ifdef DEBUG if (CRAZY_WIDTH(xmost)) { ListTag(stdout); diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 0e1aabbff07..f9c2f4da231 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -4118,7 +4118,17 @@ nsBlockFrame::PostPlaceLine(nsBlockReflowState& aState, } // Update xmost - nscoord xmost = aLine->mBounds.XMost(); + nscoord xmost; + if(aLine->IsBlock() && aState.GetFlag(BRS_NOWRAP)) { + // since the nowrap blocks tend to be as wide as their widest element or + // sequel of elements that can't be wrapped anymore (see patch for bug 80817) + // let them set xmost to be the width of the widest element of the reflowed line + // (patches bug 93363 and other NOWRAP dups) + xmost = aMaxElementSize.width; + } else { + xmost = aLine->mBounds.XMost(); + } + #ifdef DEBUG if (CRAZY_WIDTH(xmost)) { ListTag(stdout);