From 0b77ffa440f5dca1a848910ad231c4ceed92be23 Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Wed, 28 Jul 2004 01:24:58 +0000 Subject: [PATCH] Bug 252850. Backing out minor listbox layout fix, because it broke something worse git-svn-id: svn://10.0.0.236/trunk@159944 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsListControlFrame.cpp | 19 +++++++------------ .../html/forms/src/nsListControlFrame.cpp | 19 +++++++------------ 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index 0119cceb132..0b3d8e9d9dc 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -1061,6 +1061,7 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext, //--Calculate a width just big enough for the scrollframe to shrink around the //longest element in the list + nsHTMLReflowState secondPassState(aReflowState); nsHTMLReflowState firstPassState(aReflowState); //nsHTMLReflowState firstPassState(aPresContext, nsnull, @@ -1314,20 +1315,14 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext, } } + // Do a second reflow with the adjusted width and height settings + // This sets up all of the frames with the correct width and height. + secondPassState.mComputedWidth = visibleWidth; + secondPassState.mComputedHeight = visibleHeight; + secondPassState.reason = eReflowReason_Resize; + if (mPassId == 0 || mPassId == 2 || visibleHeight != scrolledAreaHeight || visibleWidth != scrolledAreaWidth) { - nsHTMLReflowState secondPassState(aReflowState); - - // Do a second reflow with the adjusted width and height settings - // This sets up all of the frames with the correct width and - // height. Reflow with the same width constraint as for the first - // reflow. If the width is unconstrained, then we want to allow - // the listbox/dropdown to get wider if a vertical scrollbar is - // now needed. - secondPassState.mComputedWidth = aReflowState.mComputedWidth; - secondPassState.mComputedHeight = visibleHeight; - secondPassState.reason = eReflowReason_Resize; - nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, secondPassState, aStatus); if (aReflowState.mComputedHeight == 0) { aDesiredSize.ascent = 0; diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index 0119cceb132..0b3d8e9d9dc 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -1061,6 +1061,7 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext, //--Calculate a width just big enough for the scrollframe to shrink around the //longest element in the list + nsHTMLReflowState secondPassState(aReflowState); nsHTMLReflowState firstPassState(aReflowState); //nsHTMLReflowState firstPassState(aPresContext, nsnull, @@ -1314,20 +1315,14 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext, } } + // Do a second reflow with the adjusted width and height settings + // This sets up all of the frames with the correct width and height. + secondPassState.mComputedWidth = visibleWidth; + secondPassState.mComputedHeight = visibleHeight; + secondPassState.reason = eReflowReason_Resize; + if (mPassId == 0 || mPassId == 2 || visibleHeight != scrolledAreaHeight || visibleWidth != scrolledAreaWidth) { - nsHTMLReflowState secondPassState(aReflowState); - - // Do a second reflow with the adjusted width and height settings - // This sets up all of the frames with the correct width and - // height. Reflow with the same width constraint as for the first - // reflow. If the width is unconstrained, then we want to allow - // the listbox/dropdown to get wider if a vertical scrollbar is - // now needed. - secondPassState.mComputedWidth = aReflowState.mComputedWidth; - secondPassState.mComputedHeight = visibleHeight; - secondPassState.reason = eReflowReason_Resize; - nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, secondPassState, aStatus); if (aReflowState.mComputedHeight == 0) { aDesiredSize.ascent = 0;