Bug 735579. Correctly handle changes to column widths in fixed-layout tables. r=ehsan

This commit is contained in:
Boris Zbarsky 2012-03-16 15:56:41 -04:00
parent 4f06e926a2
commit c6d965bec9
4 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<body style="height: 0">
<table style="width: 250px; table-layout: fixed;">
<tr>
<td style="width: 100px; background: #CC99CC;">A</td>
<td style="width: 100px; background: #99CCCC;">B</td>
<td style="background: #CCCC99;">C</td>
</tr>
<tr>
<td style="background: #CC99CC;">D</td>
<td style="background: #99CCCC;">E</td>
<td style="background: #CCCC99;">F</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- The fixed height on the body is in fact needed to reproduce bug 735579
for some reason -->
<body style="height: 100px;">
<script>
window.onload = function() {
var target = document.getElementById("test-target");
window.targetWidth = target.getBoundingClientRect().width;
target.style.width = "100px";
document.documentElement.className = "";
}
</script>
<table style="width: 250px; table-layout: fixed;">
<tr>
<td style="width: 100px; background: #CC99CC;">A</td>
<td id="test-target" style="background: #99CCCC;">B</td>
<td style="background: #CCCC99;">C</td>
</tr>
<tr>
<td style="background: #CC99CC;">D</td>
<td style="background: #99CCCC;">E</td>
<td style="background: #CCCC99;">F</td>
</tr>
</table>
</body>
</html>

View File

@ -58,3 +58,4 @@ fails == default-box-sizing-collapse-quirks.html default-box-sizing-collapse-qui
== colgroup-vs-column-2.html colgroup-vs-column-2-ref.html
== colgroup-vs-column-3.html colgroup-vs-column-3-ref.html
== colgroup-vs-column-4.html colgroup-vs-column-4-ref.html
== dynamic-fixed-layout-1.html dynamic-fixed-layout-1-ref.html

View File

@ -438,7 +438,7 @@ FixedTableLayoutStrategy::ComputeColumnWidths(const nsHTMLReflowState& aReflowSt
}
if (oldColWidths.ElementAt(col) != colFrame->GetFinalWidth()) {
mTableFrame->DidResizeColumns();
}
break;
}
}
}