зеркало из https://github.com/mozilla/pjs.git
limit the spread of desired content width in colspans with specified fixed width's
bug 42187, it fixes also the regression in bug 2684. r=karnaze sr=attinasi
This commit is contained in:
Родитель
30fbdfdfb9
Коммит
7f3e46099a
|
@ -332,9 +332,9 @@ BasicTableLayoutStrategy::BalanceColumnWidths(nsIPresContext* aPresCont
|
||||||
// allocate the rest to auto columns, with some exceptions
|
// allocate the rest to auto columns, with some exceptions
|
||||||
if ( (tableIsAutoWidth && (perAdjTableWidth - totalAllocated > 0)) ||
|
if ( (tableIsAutoWidth && (perAdjTableWidth - totalAllocated > 0)) ||
|
||||||
(!tableIsAutoWidth && (totalAllocated < maxWidth)) ) {
|
(!tableIsAutoWidth && (totalAllocated < maxWidth)) ) {
|
||||||
PRInt32 numEffCols = mTableFrame->GetEffectiveColCount();
|
PRInt32 numEffCols = mTableFrame->GetEffectiveColCount();
|
||||||
PRBool excludePct = (totalCounts[PCT] != numEffCols);
|
PRBool excludePct = (totalCounts[PCT] != numEffCols);
|
||||||
PRBool excludeFix = (totalCounts[PCT] + totalCounts[FIX] < numEffCols);
|
PRBool excludeFix = (totalCounts[PCT] + totalCounts[FIX] + totalCounts[FIX_ADJ] < numEffCols);
|
||||||
PRBool excludePro = (totalCounts[DES_CON] > 0);
|
PRBool excludePro = (totalCounts[DES_CON] > 0);
|
||||||
PRBool exclude0Pro = (totalCounts[MIN_PRO] != num0Proportional);
|
PRBool exclude0Pro = (totalCounts[MIN_PRO] != num0Proportional);
|
||||||
if (tableIsAutoWidth) {
|
if (tableIsAutoWidth) {
|
||||||
|
@ -845,6 +845,19 @@ BasicTableLayoutStrategy::ComputeNonPctColspanWidths(PRInt32 aWidthInd
|
||||||
colFrame->SetWidth(aWidthIndex + NUM_MAJOR_WIDTHS, newColAdjWidth);
|
colFrame->SetWidth(aWidthIndex + NUM_MAJOR_WIDTHS, newColAdjWidth);
|
||||||
colFrame->SetConstrainingCell(aCellFrame); // XXX is this right?
|
colFrame->SetConstrainingCell(aCellFrame); // XXX is this right?
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if((newColAdjWidth > 0) && (FIX == aWidthIndex)) {
|
||||||
|
if(colFrame->GetWidth(FIX) < 0) {
|
||||||
|
nscoord desCon = colFrame->GetWidth(DES_CON);
|
||||||
|
if (desCon > newColAdjWidth) {
|
||||||
|
newColAdjWidth = desCon;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(colFrame->GetWidth(FIX_ADJ) < newColAdjWidth) {
|
||||||
|
colFrame->SetWidth(FIX_ADJ, PR_MAX(colWidth,newColAdjWidth));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -332,9 +332,9 @@ BasicTableLayoutStrategy::BalanceColumnWidths(nsIPresContext* aPresCont
|
||||||
// allocate the rest to auto columns, with some exceptions
|
// allocate the rest to auto columns, with some exceptions
|
||||||
if ( (tableIsAutoWidth && (perAdjTableWidth - totalAllocated > 0)) ||
|
if ( (tableIsAutoWidth && (perAdjTableWidth - totalAllocated > 0)) ||
|
||||||
(!tableIsAutoWidth && (totalAllocated < maxWidth)) ) {
|
(!tableIsAutoWidth && (totalAllocated < maxWidth)) ) {
|
||||||
PRInt32 numEffCols = mTableFrame->GetEffectiveColCount();
|
PRInt32 numEffCols = mTableFrame->GetEffectiveColCount();
|
||||||
PRBool excludePct = (totalCounts[PCT] != numEffCols);
|
PRBool excludePct = (totalCounts[PCT] != numEffCols);
|
||||||
PRBool excludeFix = (totalCounts[PCT] + totalCounts[FIX] < numEffCols);
|
PRBool excludeFix = (totalCounts[PCT] + totalCounts[FIX] + totalCounts[FIX_ADJ] < numEffCols);
|
||||||
PRBool excludePro = (totalCounts[DES_CON] > 0);
|
PRBool excludePro = (totalCounts[DES_CON] > 0);
|
||||||
PRBool exclude0Pro = (totalCounts[MIN_PRO] != num0Proportional);
|
PRBool exclude0Pro = (totalCounts[MIN_PRO] != num0Proportional);
|
||||||
if (tableIsAutoWidth) {
|
if (tableIsAutoWidth) {
|
||||||
|
@ -845,6 +845,19 @@ BasicTableLayoutStrategy::ComputeNonPctColspanWidths(PRInt32 aWidthInd
|
||||||
colFrame->SetWidth(aWidthIndex + NUM_MAJOR_WIDTHS, newColAdjWidth);
|
colFrame->SetWidth(aWidthIndex + NUM_MAJOR_WIDTHS, newColAdjWidth);
|
||||||
colFrame->SetConstrainingCell(aCellFrame); // XXX is this right?
|
colFrame->SetConstrainingCell(aCellFrame); // XXX is this right?
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if((newColAdjWidth > 0) && (FIX == aWidthIndex)) {
|
||||||
|
if(colFrame->GetWidth(FIX) < 0) {
|
||||||
|
nscoord desCon = colFrame->GetWidth(DES_CON);
|
||||||
|
if (desCon > newColAdjWidth) {
|
||||||
|
newColAdjWidth = desCon;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(colFrame->GetWidth(FIX_ADJ) < newColAdjWidth) {
|
||||||
|
colFrame->SetWidth(FIX_ADJ, PR_MAX(colWidth,newColAdjWidth));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче