зеркало из https://github.com/mozilla/gecko-dev.git
bug 15247 - ComputeAvailableTableWidth accounts for margins
This commit is contained in:
Родитель
97bc7cdc28
Коммит
8589f840a1
|
@ -762,6 +762,7 @@ nsresult nsTableOuterFrame::SizeAndPlaceChildren(const nsSize& aInnerSi
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// computes the table width
|
// computes the table width
|
||||||
nscoord nsTableOuterFrame::ComputeAvailableTableWidth(const nsHTMLReflowState& aReflowState)
|
nscoord nsTableOuterFrame::ComputeAvailableTableWidth(const nsHTMLReflowState& aReflowState)
|
||||||
{
|
{
|
||||||
|
@ -782,8 +783,15 @@ nscoord nsTableOuterFrame::ComputeAvailableTableWidth(const nsHTMLReflowState& a
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case eStyleUnit_Auto:
|
case eStyleUnit_Auto:
|
||||||
maxWidth = aReflowState.availableWidth;
|
{
|
||||||
break;
|
const nsStyleSpacing* spacing =
|
||||||
|
(const nsStyleSpacing*)mStyleContext->GetStyleData(eStyleStruct_Spacing);
|
||||||
|
nsMargin margin(0,0,0,0);
|
||||||
|
// XXX handle percentages
|
||||||
|
spacing->GetMargin(margin);
|
||||||
|
maxWidth = aReflowState.availableWidth - margin.left - margin.right;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case eStyleUnit_Percent:
|
case eStyleUnit_Percent:
|
||||||
maxWidth = (nscoord)((float)aReflowState.availableWidth * position->mWidth.GetPercentValue());
|
maxWidth = (nscoord)((float)aReflowState.availableWidth * position->mWidth.GetPercentValue());
|
||||||
|
|
|
@ -762,6 +762,7 @@ nsresult nsTableOuterFrame::SizeAndPlaceChildren(const nsSize& aInnerSi
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// computes the table width
|
// computes the table width
|
||||||
nscoord nsTableOuterFrame::ComputeAvailableTableWidth(const nsHTMLReflowState& aReflowState)
|
nscoord nsTableOuterFrame::ComputeAvailableTableWidth(const nsHTMLReflowState& aReflowState)
|
||||||
{
|
{
|
||||||
|
@ -782,8 +783,15 @@ nscoord nsTableOuterFrame::ComputeAvailableTableWidth(const nsHTMLReflowState& a
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case eStyleUnit_Auto:
|
case eStyleUnit_Auto:
|
||||||
maxWidth = aReflowState.availableWidth;
|
{
|
||||||
break;
|
const nsStyleSpacing* spacing =
|
||||||
|
(const nsStyleSpacing*)mStyleContext->GetStyleData(eStyleStruct_Spacing);
|
||||||
|
nsMargin margin(0,0,0,0);
|
||||||
|
// XXX handle percentages
|
||||||
|
spacing->GetMargin(margin);
|
||||||
|
maxWidth = aReflowState.availableWidth - margin.left - margin.right;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case eStyleUnit_Percent:
|
case eStyleUnit_Percent:
|
||||||
maxWidth = (nscoord)((float)aReflowState.availableWidth * position->mWidth.GetPercentValue());
|
maxWidth = (nscoord)((float)aReflowState.availableWidth * position->mWidth.GetPercentValue());
|
||||||
|
|
Загрузка…
Ссылка в новой задаче