зеркало из https://github.com/mozilla/gecko-dev.git
Remove some no longer needed code. Bug 368273, r+sr=dbaron
This commit is contained in:
Родитель
fcd7e069de
Коммит
4fcbe6d913
|
@ -572,18 +572,11 @@ static void printSize(char * aDesc, nscoord aSize)
|
|||
nscoord
|
||||
nsComboboxControlFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
|
||||
{
|
||||
// Note: to fix the combobox equivalent of bug 40596 while still working
|
||||
// correctly in general, we want to return our preferred width as our min
|
||||
// width if our style width is auto. Otherwise, we're ok with shrinking as
|
||||
// small as needed.
|
||||
// We want to size to our pref width
|
||||
nscoord result;
|
||||
DISPLAY_MIN_WIDTH(this, result);
|
||||
|
||||
if (GetStylePosition()->mWidth.GetUnit() == eStyleUnit_Auto) {
|
||||
result = GetPrefWidth(aRenderingContext);
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
result = GetPrefWidth(aRenderingContext);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -244,32 +244,16 @@ nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
nscoord
|
||||
nsHTMLButtonControlFrame::GetMinWidth(nsIRenderingContext* aRenderingContext)
|
||||
{
|
||||
return DoGetMinWidth(aRenderingContext, PR_TRUE);
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsHTMLButtonControlFrame::DoGetMinWidth(nsIRenderingContext* aRenderingContext,
|
||||
PRBool aZeroIfWidthSpecified)
|
||||
{
|
||||
nscoord result;
|
||||
DISPLAY_MIN_WIDTH(this, result);
|
||||
|
||||
// Note: to fix the button equivalent of bug 40596 while still working
|
||||
// correctly in general, we want to return our actual min width as our min
|
||||
// width if our style width is auto. Otherwise, we're ok with shrinking as
|
||||
// small as needed.
|
||||
if (!aZeroIfWidthSpecified ||
|
||||
GetStylePosition()->mWidth.GetUnit() == eStyleUnit_Auto) {
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||
kid,
|
||||
nsLayoutUtils::MIN_WIDTH);
|
||||
|
||||
result += mRenderer.GetAddedButtonBorderAndPadding().LeftRight();
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||
kid,
|
||||
nsLayoutUtils::MIN_WIDTH);
|
||||
|
||||
result += mRenderer.GetAddedButtonBorderAndPadding().LeftRight();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -373,7 +357,7 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
|||
// better look in such cases we adjust the available width and our left
|
||||
// offset to allow the kid to spill left into our padding.
|
||||
nscoord xoffset = aFocusPadding.left + aReflowState.mComputedBorderPadding.left;
|
||||
nscoord extrawidth = DoGetMinWidth(aReflowState.rendContext, PR_FALSE) -
|
||||
nscoord extrawidth = GetMinWidth(aReflowState.rendContext) -
|
||||
aReflowState.ComputedWidth();
|
||||
if (extrawidth > 0) {
|
||||
nscoord extraleft = extrawidth / 2;
|
||||
|
|
|
@ -75,11 +75,6 @@ public:
|
|||
|
||||
virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext);
|
||||
|
||||
// Differs from GetMinWidth in that it allows one to specify whether
|
||||
// to fall back on 0 for the min width if we have a specified width.
|
||||
nscoord DoGetMinWidth(nsIRenderingContext *aRenderingContext,
|
||||
PRBool aZeroIfWidthSpecified);
|
||||
|
||||
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -1744,17 +1744,11 @@ nsTextControlFrame::CreateAnonymousContent(nsPresContext* aPresContext,
|
|||
nscoord
|
||||
nsTextControlFrame::GetMinWidth(nsIRenderingContext* aRenderingContext)
|
||||
{
|
||||
// Note: to fix bug 40596 while still working correctly in general, we want
|
||||
// to return our preferred width as our min width if our style width is auto.
|
||||
// Otherwise, we're ok with shrinking as small as needed.
|
||||
// Our min width is just our preferred width if we have auto width.
|
||||
nscoord result;
|
||||
DISPLAY_MIN_WIDTH(this, result);
|
||||
|
||||
if (GetStylePosition()->mWidth.GetUnit() == eStyleUnit_Auto) {
|
||||
result = GetPrefWidth(aRenderingContext);
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
result = GetPrefWidth(aRenderingContext);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче