mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 413180: Stop distributing span pct-width to cols when there are only 0-width cols left. r+sr=dbaron a=beltzner
This commit is contained in:
parent
569b5e7d24
commit
356cf160e5
@ -573,16 +573,14 @@ BasicTableLayoutStrategy::DistributePctWidthToColumns(float aSpanPrefPct,
|
||||
continue;
|
||||
}
|
||||
|
||||
// the percentage width (only to columns that don't
|
||||
// already have percentage widths, in proportion to
|
||||
// the existing pref widths)
|
||||
float allocatedPct = 0.0f;
|
||||
if (scolFrame->GetPrefPercent() == 0.0f) {
|
||||
NS_ASSERTION((!spanHasNonPctPref ||
|
||||
nonPctTotalPrefWidth != 0) &&
|
||||
nonPctColCount != 0,
|
||||
"should not be zero if we haven't allocated "
|
||||
"all pref percent");
|
||||
|
||||
float allocatedPct; // % width to be given to this column
|
||||
if (spanHasNonPctPref) {
|
||||
// Group so we're multiplying by 1.0f when we need
|
||||
// to use up aSpanPrefPct.
|
||||
@ -601,6 +599,16 @@ BasicTableLayoutStrategy::DistributePctWidthToColumns(float aSpanPrefPct,
|
||||
aSpanPrefPct -= allocatedPct;
|
||||
nonPctTotalPrefWidth -= scolFrame->GetPrefCoord();
|
||||
--nonPctColCount;
|
||||
|
||||
if (!aSpanPrefPct) {
|
||||
// No more span-percent-width to distribute --> we're done.
|
||||
NS_ASSERTION(spanHasNonPctPref ?
|
||||
nonPctTotalPrefWidth == 0 :
|
||||
nonPctColCount == 0,
|
||||
"No more pct width to distribute, but there are "
|
||||
"still cols that need some.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
17
layout/tables/crashtests/413180-1.html
Normal file
17
layout/tables/crashtests/413180-1.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 9%" colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -43,3 +43,4 @@ load 403249-1.html
|
||||
load 403579-1.html
|
||||
load 404301-1.xhtml
|
||||
load 411582.xhtml
|
||||
load 413180-1.html
|
||||
|
Loading…
Reference in New Issue
Block a user