#43457 split nsStyleSpacing into 4 smaller structures: nsStyleBorder, nsStylePadding, nsStyleMargin, nsStyleOutline. Review=attinasi. Pending Approval: buster.
git-svn-id: svn://10.0.0.236/trunk@85210 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -830,11 +830,8 @@ nsComboboxControlFrame::ReflowItems(nsIPresContext* aPresContext,
|
||||
delete [] str;
|
||||
|
||||
// get the borderPadding for the display area
|
||||
const nsStyleSpacing* dspSpacing;
|
||||
mDisplayFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)dspSpacing);
|
||||
nsMargin dspBorderPadding;
|
||||
dspBorderPadding.SizeTo(0, 0, 0, 0);
|
||||
dspSpacing->CalcBorderPaddingFor(mDisplayFrame, dspBorderPadding);
|
||||
nsMargin dspBorderPadding(0, 0, 0, 0);
|
||||
mDisplayFrame->CalcBorderPadding(dspBorderPadding);
|
||||
|
||||
nscoord frmWidth = maxWidth+dspBorderPadding.left+dspBorderPadding.right+
|
||||
aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right;
|
||||
@@ -886,11 +883,8 @@ nsComboboxControlFrame::ReflowCombobox(nsIPresContext * aPresContext,
|
||||
REFLOW_NOISY_MSG3("mCacheSize.height:%d - %d\n", PX(mCacheSize.height), PX((aBorderPadding.top + aBorderPadding.bottom)));
|
||||
|
||||
// get the border and padding for the DisplayArea (block frame & textframe)
|
||||
const nsStyleSpacing* dspSpacing;
|
||||
aDisplayFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)dspSpacing);
|
||||
nsMargin dspBorderPadding;
|
||||
dspBorderPadding.SizeTo(0, 0, 0, 0);
|
||||
dspSpacing->CalcBorderPaddingFor(aDisplayFrame, dspBorderPadding);
|
||||
nsMargin dspBorderPadding(0, 0, 0, 0);
|
||||
mDisplayFrame->CalcBorderPadding(dspBorderPadding);
|
||||
|
||||
// adjust the height
|
||||
if (mCacheSize.height == kSizeNotSet) {
|
||||
@@ -1154,11 +1148,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext,
|
||||
bailOnWidth, bailOnHeight);
|
||||
if (bailOnWidth) {
|
||||
#ifdef DO_REFLOW_DEBUG // check or size
|
||||
const nsStyleSpacing* spacing;
|
||||
GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)spacing);
|
||||
nsMargin borderPadding;
|
||||
borderPadding.SizeTo(0, 0, 0, 0);
|
||||
spacing->CalcBorderPaddingFor(this, borderPadding);
|
||||
nsMargin borderPadding(0, 0, 0, 0);
|
||||
CalcBorderPadding(borderPadding);
|
||||
UNCONSTRAINED_CHECK();
|
||||
#endif
|
||||
REFLOW_DEBUG_MSG3("^** Done nsCCF DW: %d DH: %d\n\n", PX(aDesiredSize.width), PX(aDesiredSize.height));
|
||||
@@ -1199,11 +1190,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext,
|
||||
// get our border and padding,
|
||||
// XXX - should be the same mComputedBorderPadding?
|
||||
// maybe we should use that?
|
||||
const nsStyleSpacing* spacing;
|
||||
GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)spacing);
|
||||
nsMargin borderPadding;
|
||||
borderPadding.SizeTo(0, 0, 0, 0);
|
||||
spacing->CalcBorderPaddingFor(this, borderPadding);
|
||||
nsMargin borderPadding(0, 0, 0, 0);
|
||||
CalcBorderPadding(borderPadding);
|
||||
|
||||
// Get the current sizes of the combo box child frames
|
||||
mDisplayFrame->GetRect(displayRect);
|
||||
@@ -1480,18 +1468,12 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
// Get the border and padding for the dropdown
|
||||
const nsStyleSpacing* dropSpacing;
|
||||
mDropdownFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)dropSpacing);
|
||||
nsMargin dropBorderPadding;
|
||||
dropBorderPadding.SizeTo(0, 0, 0, 0);
|
||||
dropSpacing->CalcBorderPaddingFor(mDropdownFrame, dropBorderPadding);
|
||||
nsMargin dropBorderPadding(0, 0, 0, 0);
|
||||
mDropdownFrame->CalcBorderPadding(dropBorderPadding);
|
||||
|
||||
// get the borderPadding for the display area
|
||||
const nsStyleSpacing* dspSpacing;
|
||||
mDisplayFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)dspSpacing);
|
||||
nsMargin dspBorderPadding;
|
||||
dspBorderPadding.SizeTo(0, 0, 0, 0);
|
||||
dspSpacing->CalcBorderPaddingFor(mDisplayFrame, dspBorderPadding);
|
||||
nsMargin dspBorderPadding(0, 0, 0, 0);
|
||||
mDisplayFrame->CalcBorderPadding(dspBorderPadding);
|
||||
|
||||
// Substract dropdown's borderPadding from the width of the dropdown rect
|
||||
// to get the size of the content area
|
||||
@@ -1571,12 +1553,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
// get the borderPadding for the display area
|
||||
const nsStyleSpacing* dspSpacing;
|
||||
mDisplayFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct *&)dspSpacing);
|
||||
nsMargin dspBorderPadding;
|
||||
dspBorderPadding.SizeTo(0, 0, 0, 0);
|
||||
|
||||
dspSpacing->CalcBorderPaddingFor(mDisplayFrame, dspBorderPadding);
|
||||
nsMargin dspBorderPadding(0, 0, 0, 0);
|
||||
mDisplayFrame->CalcBorderPadding(dspBorderPadding);
|
||||
|
||||
if (NS_UNCONSTRAINEDSIZE == firstPassState.mComputedWidth) {
|
||||
mItemDisplayWidth = aDesiredSize.width - (dspBorderPadding.left + dspBorderPadding.right);
|
||||
|
||||
Reference in New Issue
Block a user