зеркало из https://github.com/mozilla/gecko-dev.git
bug 77982 - consider border/padding on a cell that goes from empty to non-empty during an incremental reflow. sr=attinasi, r=alexsavulov
This commit is contained in:
Родитель
f007b04e93
Коммит
d98959d0cd
|
@ -738,6 +738,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
|
|||
if (NS_UNCONSTRAINEDSIZE==aReflowState.availableWidth)
|
||||
pMaxElementSize = &maxElementSize;
|
||||
|
||||
PRBool contentEmptyBeforeReflow = GetContentEmpty();
|
||||
/* XXX: remove tableFrame when border-collapse inherits */
|
||||
nsTableFrame* tableFrame=nsnull;
|
||||
rv = nsTableFrame::GetTableFrame(this, tableFrame);
|
||||
|
@ -746,7 +747,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
|
|||
nsMargin borderPadding = aReflowState.mComputedPadding;
|
||||
nsMargin border;
|
||||
GetCellBorder(border, tableFrame);
|
||||
if ((NS_UNCONSTRAINEDSIZE == availSize.width) || !GetContentEmpty()) {
|
||||
if ((NS_UNCONSTRAINEDSIZE == availSize.width) || !contentEmptyBeforeReflow) {
|
||||
borderPadding += border;
|
||||
}
|
||||
|
||||
|
@ -861,6 +862,14 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
|
|||
}
|
||||
else {
|
||||
SetContentEmpty(PR_FALSE);
|
||||
if ((eReflowReason_Incremental == aReflowState.reason) && contentEmptyBeforeReflow) {
|
||||
// need to consider borders, since they were factored out above
|
||||
leftInset += border.left;
|
||||
rightInset += border.right;
|
||||
topInset += border.top;
|
||||
bottomInset += border.bottom;
|
||||
kidOrigin.MoveTo(leftInset, topInset);
|
||||
}
|
||||
}
|
||||
|
||||
const nsStylePosition* pos;
|
||||
|
|
|
@ -785,6 +785,7 @@ CalcAvailWidth(nsTableFrame& aTableFrame,
|
|||
PRInt32 colIndex;
|
||||
aCellFrame.GetColIndex(colIndex);
|
||||
PRInt32 colspan = aTableFrame.GetEffectiveColSpan(aCellFrame);
|
||||
nscoord cellSpacing = 0;
|
||||
|
||||
for (PRInt32 spanX = 0; spanX < colspan; spanX++) {
|
||||
nscoord colWidth = aTableFrame.GetColumnWidth(colIndex + spanX);
|
||||
|
@ -792,9 +793,12 @@ CalcAvailWidth(nsTableFrame& aTableFrame,
|
|||
aColAvailWidth += colWidth;
|
||||
}
|
||||
if ((spanX > 0) && (aTableFrame.GetNumCellsOriginatingInCol(colIndex + spanX) > 0)) {
|
||||
aColAvailWidth += aCellSpacingX;
|
||||
cellSpacing += aCellSpacingX;
|
||||
}
|
||||
}
|
||||
if (aColAvailWidth > 0) {
|
||||
aColAvailWidth += cellSpacing;
|
||||
}
|
||||
aCellAvailWidth = aColAvailWidth;
|
||||
|
||||
// for a cell with a colspan > 1, use its fix width (if set) as the avail width
|
||||
|
|
|
@ -738,6 +738,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
|
|||
if (NS_UNCONSTRAINEDSIZE==aReflowState.availableWidth)
|
||||
pMaxElementSize = &maxElementSize;
|
||||
|
||||
PRBool contentEmptyBeforeReflow = GetContentEmpty();
|
||||
/* XXX: remove tableFrame when border-collapse inherits */
|
||||
nsTableFrame* tableFrame=nsnull;
|
||||
rv = nsTableFrame::GetTableFrame(this, tableFrame);
|
||||
|
@ -746,7 +747,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
|
|||
nsMargin borderPadding = aReflowState.mComputedPadding;
|
||||
nsMargin border;
|
||||
GetCellBorder(border, tableFrame);
|
||||
if ((NS_UNCONSTRAINEDSIZE == availSize.width) || !GetContentEmpty()) {
|
||||
if ((NS_UNCONSTRAINEDSIZE == availSize.width) || !contentEmptyBeforeReflow) {
|
||||
borderPadding += border;
|
||||
}
|
||||
|
||||
|
@ -861,6 +862,14 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
|
|||
}
|
||||
else {
|
||||
SetContentEmpty(PR_FALSE);
|
||||
if ((eReflowReason_Incremental == aReflowState.reason) && contentEmptyBeforeReflow) {
|
||||
// need to consider borders, since they were factored out above
|
||||
leftInset += border.left;
|
||||
rightInset += border.right;
|
||||
topInset += border.top;
|
||||
bottomInset += border.bottom;
|
||||
kidOrigin.MoveTo(leftInset, topInset);
|
||||
}
|
||||
}
|
||||
|
||||
const nsStylePosition* pos;
|
||||
|
|
|
@ -785,6 +785,7 @@ CalcAvailWidth(nsTableFrame& aTableFrame,
|
|||
PRInt32 colIndex;
|
||||
aCellFrame.GetColIndex(colIndex);
|
||||
PRInt32 colspan = aTableFrame.GetEffectiveColSpan(aCellFrame);
|
||||
nscoord cellSpacing = 0;
|
||||
|
||||
for (PRInt32 spanX = 0; spanX < colspan; spanX++) {
|
||||
nscoord colWidth = aTableFrame.GetColumnWidth(colIndex + spanX);
|
||||
|
@ -792,9 +793,12 @@ CalcAvailWidth(nsTableFrame& aTableFrame,
|
|||
aColAvailWidth += colWidth;
|
||||
}
|
||||
if ((spanX > 0) && (aTableFrame.GetNumCellsOriginatingInCol(colIndex + spanX) > 0)) {
|
||||
aColAvailWidth += aCellSpacingX;
|
||||
cellSpacing += aCellSpacingX;
|
||||
}
|
||||
}
|
||||
if (aColAvailWidth > 0) {
|
||||
aColAvailWidth += cellSpacing;
|
||||
}
|
||||
aCellAvailWidth = aColAvailWidth;
|
||||
|
||||
// for a cell with a colspan > 1, use its fix width (if set) as the avail width
|
||||
|
|
Загрузка…
Ссылка в новой задаче