Don't let columns with no cells originating in them expand in the pass for expanding zero-width columns. b=425972 r=dholbert sr=roc a=blocking1.9+

This commit is contained in:
dbaron%dbaron.org 2008-04-08 19:07:27 +00:00
Родитель f59d6ef6f5
Коммит 4c62fc8d0f
6 изменённых файлов: 69 добавлений и 6 удалений

Просмотреть файл

@ -0,0 +1,14 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>there should not be a red bar over the whole page</title>
</head>
<body >
<table width="100%">
<tbody>
<tr><td bgcolor="#ff3333" width="100%" height="50px"></td></tr>
</tbody>
</table>
</body>
</html>

Просмотреть файл

@ -0,0 +1,15 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>there should be a red bar over the whole page</title>
</head>
<body >
<table width="100%">
<tbody>
<tr><td bgcolor="#ff3333" width="1%" height="50px"></td></tr>
<tr><td colspan="2"></td></tr>
</tbody>
</table>
</body>
</html>

Просмотреть файл

@ -0,0 +1,14 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>there should not be a red bar over the whole page</title>
</head>
<body >
<table width="100%">
<tbody>
<tr><td bgcolor="#ff3333" width="1%" height="50px"></td><td style="padding:0">&nbsp;&nbsp;</td></tr>
</tbody>
</table>
</body>
</html>

Просмотреть файл

@ -0,0 +1,15 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>there should not be a red bar over the whole page</title>
</head>
<body >
<table width="100%">
<tbody>
<tr><td bgcolor="#ff3333" width="1%" height="50px"></td><td style="padding:0"></td></tr>
<tr><td colspan="2"></td></tr>
</tbody>
</table>
</body>
</html>

Просмотреть файл

@ -792,4 +792,6 @@ fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 424074-1-ref2.xul 424074-1-ref3.xul
== 424434-1.html 424434-1-ref.html
== 424631-1.html 424631-1-ref.html
== 424710-1.html 424710-1-ref.html
== 425972-1.html 425972-1-ref.html
== 425972-2.html 425972-2-ref.html
!= 425972-1.html 425972-2.html

Просмотреть файл

@ -680,9 +680,10 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
* percent width have nonzero pref width, in proportion to pref
* width [total_flex_pref]
*
* b. (NOTE: this case is for BTLS_FINAL_WIDTH only) otherwise, if any
* columns without a specified coordinate width or percent width have
* zero pref width, equally between these [numNonSpecZeroWidthCols]
* b. (NOTE: this case is for BTLS_FINAL_WIDTH only) otherwise, if
* any columns without a specified coordinate width or percent
* width, but with cells originating in them have zero pref width,
* equally between these [numNonSpecZeroWidthCols]
*
* c. otherwise, if any columns without percent width have nonzero
* pref width, in proportion to pref width [total_fixed_pref]
@ -739,7 +740,8 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
total_fixed_pref = NSCoordSaturatingAdd(total_fixed_pref,
pref_width);
} else if (pref_width == 0) {
if (aWidthType == BTLS_FINAL_WIDTH) {
if (aWidthType == BTLS_FINAL_WIDTH &&
mTableFrame->GetNumCellsOriginatingInCol(col)) {
++numNonSpecZeroWidthCols;
}
} else {
@ -937,7 +939,8 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
"FLEX_FLEX_LARGE_ZERO only should be hit "
"when we're setting final width.");
if (pct == 0.0f &&
!colFrame->GetHasSpecifiedCoord()) {
!colFrame->GetHasSpecifiedCoord() &&
mTableFrame->GetNumCellsOriginatingInCol(col)) {
NS_ASSERTION(col_width == 0 &&
colFrame->GetPrefCoord() == 0,