Fix incorrectly placed PR_MAX(), since the span* values are additions to the base values. b=365173 r=bernd sr=bzbarsky
git-svn-id: svn://10.0.0.236/trunk@218260 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
7
mozilla/layout/reftests/bugs/365173-1-ref.html
Normal file
7
mozilla/layout/reftests/bugs/365173-1-ref.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<title>Testcase, bug 365173</title>
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td width="300" bgcolor="lime">300 (2)</td></tr>
|
||||
<tr><td width="300" bgcolor="yellow">x</td></tr>
|
||||
</table>
|
||||
|
||||
7
mozilla/layout/reftests/bugs/365173-1.html
Normal file
7
mozilla/layout/reftests/bugs/365173-1.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<title>Testcase, bug 365173</title>
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td colspan="2" width="300" bgcolor="lime">300 (2)</td></tr>
|
||||
<tr><td width="295" bgcolor="yellow">x</td><td width="5" bgcolor="yellow"></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -34,6 +34,7 @@ f== bugs/360065-1.html bugs/360065-1-ref.html # bug 18217
|
||||
== bugs/364079-1.html bugs/364079-1-ref.html
|
||||
== bugs/364861-1.html bugs/364861-1-ref.html
|
||||
== bugs/364862-1.html bugs/364862-1-ref.html
|
||||
== bugs/365173-1.html bugs/365173-1-ref.html
|
||||
|
||||
# table-dom/
|
||||
== table-dom/appendCells1.html table-dom/appendCells1-ref.html
|
||||
|
||||
@@ -292,6 +292,12 @@ BasicTableLayoutStrategy::ComputeColumnIntrinsicWidths(nsIRenderingContext* aRen
|
||||
colFrame->AddPrefCoord(info.prefCoord, info.hasSpecifiedWidth);
|
||||
colFrame->AddPrefPercent(info.prefPercent);
|
||||
}
|
||||
#ifdef DEBUG_dbaron_off
|
||||
printf("table %p col %d nonspan: min=%d pref=%d spec=%d pct=%f\n",
|
||||
mTableFrame, col, colFrame->GetMinCoord(),
|
||||
colFrame->GetPrefCoord(), colFrame->GetHasSpecifiedCoord(),
|
||||
colFrame->GetPrefPercent());
|
||||
#endif
|
||||
}
|
||||
#ifdef DEBUG_TABLE_STRATEGY
|
||||
printf("ComputeColumnIntrinsicWidths single\n");
|
||||
@@ -431,12 +437,12 @@ BasicTableLayoutStrategy::ComputeColumnIntrinsicWidths(nsIRenderingContext* aRen
|
||||
// influence the result of GetPrefCoord, save the value as it
|
||||
// was during the loop over spanning cells before messing with
|
||||
// anything.
|
||||
nscoord prefCoord = colFrame->GetPrefCoord();
|
||||
colFrame->AddMinCoord(colFrame->GetMinCoord() +
|
||||
colFrame->GetSpanMinCoord());
|
||||
colFrame->AddPrefCoord(prefCoord +
|
||||
PR_MAX(colFrame->GetSpanMinCoord(),
|
||||
colFrame->GetSpanPrefCoord()),
|
||||
nscoord newPref =
|
||||
colFrame->GetPrefCoord() + colFrame->GetSpanPrefCoord();
|
||||
nscoord newMin =
|
||||
colFrame->GetMinCoord() + colFrame->GetSpanMinCoord();
|
||||
colFrame->AddMinCoord(newMin);
|
||||
colFrame->AddPrefCoord(PR_MAX(newPref, newMin),
|
||||
colFrame->GetHasSpecifiedCoord());
|
||||
NS_ASSERTION(colFrame->GetMinCoord() <= colFrame->GetPrefCoord(),
|
||||
"min larger than pref");
|
||||
@@ -445,6 +451,13 @@ BasicTableLayoutStrategy::ComputeColumnIntrinsicWidths(nsIRenderingContext* aRen
|
||||
colFrame->ResetSpanMinCoord();
|
||||
colFrame->ResetSpanPrefCoord();
|
||||
colFrame->ResetSpanPrefPercent();
|
||||
|
||||
#ifdef DEBUG_dbaron_off
|
||||
printf("table %p col %d span %d: min=%d pref=%d spec=%d pct=%f\n",
|
||||
mTableFrame, col, colSpan, colFrame->GetMinCoord(),
|
||||
colFrame->GetPrefCoord(), colFrame->GetHasSpecifiedCoord(),
|
||||
colFrame->GetPrefPercent());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -153,6 +153,10 @@ void nsTableColFrame::Dump(PRInt32 aIndent)
|
||||
printf(" anonymous-cell ");
|
||||
break;
|
||||
}
|
||||
printf("\nm:%d c:%d p:%d sm:%d sc:%d sp:%d f:%d",
|
||||
GetMinCoord(), GetPrefCoord(), GetPrefPercent(),
|
||||
GetSpanMinCoord(), GetSpanPrefCoord(), GetSpanPrefPercent(),
|
||||
GetFinalWidth());
|
||||
printf("\n%s**END COL DUMP** ", indent);
|
||||
delete [] indent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user