bug 154780 - Revised bernd's patch. treat null unit margins as auto. leave the cell avail width at 0 if a strategy init will occur. sr=kin, r=alexsavulov.
This commit is contained in:
@@ -796,10 +796,12 @@ nsBlockReflowContext::PlaceBlock(const nsHTMLReflowState& aReflowState,
|
||||
|
||||
// Do not allow auto margins to impact the max-element size
|
||||
// since they are springy and don't really count!
|
||||
if (eStyleUnit_Auto != mStyleMargin->mMargin.GetLeftUnit()) {
|
||||
if ((eStyleUnit_Auto != mStyleMargin->mMargin.GetLeftUnit()) &&
|
||||
(eStyleUnit_Null != mStyleMargin->mMargin.GetLeftUnit())) {
|
||||
m->width += maxElemMargin.left;
|
||||
}
|
||||
if (eStyleUnit_Auto != mStyleMargin->mMargin.GetRightUnit()) {
|
||||
if ((eStyleUnit_Auto != mStyleMargin->mMargin.GetRightUnit()) &&
|
||||
(eStyleUnit_Null != mStyleMargin->mMargin.GetRightUnit())) {
|
||||
m->width += maxElemMargin.right;
|
||||
}
|
||||
|
||||
|
||||
@@ -796,10 +796,12 @@ nsBlockReflowContext::PlaceBlock(const nsHTMLReflowState& aReflowState,
|
||||
|
||||
// Do not allow auto margins to impact the max-element size
|
||||
// since they are springy and don't really count!
|
||||
if (eStyleUnit_Auto != mStyleMargin->mMargin.GetLeftUnit()) {
|
||||
if ((eStyleUnit_Auto != mStyleMargin->mMargin.GetLeftUnit()) &&
|
||||
(eStyleUnit_Null != mStyleMargin->mMargin.GetLeftUnit())) {
|
||||
m->width += maxElemMargin.left;
|
||||
}
|
||||
if (eStyleUnit_Auto != mStyleMargin->mMargin.GetRightUnit()) {
|
||||
if ((eStyleUnit_Auto != mStyleMargin->mMargin.GetRightUnit()) &&
|
||||
(eStyleUnit_Null != mStyleMargin->mMargin.GetRightUnit())) {
|
||||
m->width += maxElemMargin.right;
|
||||
}
|
||||
|
||||
|
||||
@@ -771,6 +771,12 @@ CalcAvailWidth(nsTableFrame& aTableFrame,
|
||||
nscoord& aCellAvailWidth)
|
||||
{
|
||||
aColAvailWidth = aCellAvailWidth = 0;
|
||||
// If the table will intialize the strategy, leave the avail width at
|
||||
// 0 (at this point) in case the cell contains a % width frame. A constrained avail
|
||||
// width forces a computed width, and % width frames inside the cell base their sizes on it.
|
||||
// This can happen during an incremental reflow when multiple commands get coalesced
|
||||
// at the row.
|
||||
if (!aTableFrame.NeedStrategyInit()) {
|
||||
PRInt32 colIndex;
|
||||
aCellFrame.GetColIndex(colIndex);
|
||||
PRInt32 colspan = aTableFrame.GetEffectiveColSpan(aCellFrame);
|
||||
@@ -789,6 +795,7 @@ CalcAvailWidth(nsTableFrame& aTableFrame,
|
||||
aColAvailWidth += cellSpacing;
|
||||
}
|
||||
aCellAvailWidth = aColAvailWidth;
|
||||
}
|
||||
|
||||
nsFrameState frameState;
|
||||
aCellFrame.GetFrameState(&frameState);
|
||||
|
||||
@@ -771,6 +771,12 @@ CalcAvailWidth(nsTableFrame& aTableFrame,
|
||||
nscoord& aCellAvailWidth)
|
||||
{
|
||||
aColAvailWidth = aCellAvailWidth = 0;
|
||||
// If the table will intialize the strategy, leave the avail width at
|
||||
// 0 (at this point) in case the cell contains a % width frame. A constrained avail
|
||||
// width forces a computed width, and % width frames inside the cell base their sizes on it.
|
||||
// This can happen during an incremental reflow when multiple commands get coalesced
|
||||
// at the row.
|
||||
if (!aTableFrame.NeedStrategyInit()) {
|
||||
PRInt32 colIndex;
|
||||
aCellFrame.GetColIndex(colIndex);
|
||||
PRInt32 colspan = aTableFrame.GetEffectiveColSpan(aCellFrame);
|
||||
@@ -789,6 +795,7 @@ CalcAvailWidth(nsTableFrame& aTableFrame,
|
||||
aColAvailWidth += cellSpacing;
|
||||
}
|
||||
aCellAvailWidth = aColAvailWidth;
|
||||
}
|
||||
|
||||
nsFrameState frameState;
|
||||
aCellFrame.GetFrameState(&frameState);
|
||||
|
||||
Reference in New Issue
Block a user