mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1031934 - Handle collapsing a row / row-group with no cell frames inside it. r=roc
This commit is contained in:
parent
37720865c9
commit
c28f9e7e6f
@ -299,6 +299,8 @@ include table-overflow/reftest.list
|
||||
# table-width/
|
||||
include table-width/reftest.list
|
||||
|
||||
include ../tables/reftests/reftest.list
|
||||
|
||||
# text/
|
||||
include text/reftest.list
|
||||
|
||||
|
18
layout/tables/crashtests/1031934.html
Normal file
18
layout/tables/crashtests/1031934.html
Normal file
@ -0,0 +1,18 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<tbody style="visibility: collapse;">
|
||||
<tr><td hidden=""></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr style="visibility: collapse;"><td hidden=""></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -140,3 +140,4 @@ load 710098-1.html
|
||||
load 759249-1.html
|
||||
load 759249-2.html
|
||||
load 814713.html
|
||||
load 1031934.html
|
||||
|
@ -1142,23 +1142,28 @@ nsTableRowFrame::CollapseRowIfNecessary(nscoord aRowOffset,
|
||||
nscoord shift = 0;
|
||||
|
||||
if (aCollapseGroup || collapseRow) {
|
||||
nsTableCellFrame* cellFrame = GetFirstCell();
|
||||
aDidCollapse = true;
|
||||
int32_t rowIndex;
|
||||
cellFrame->GetRowIndex(rowIndex);
|
||||
shift = rowRect.height + tableFrame->GetCellSpacingY(rowIndex);
|
||||
while (cellFrame) {
|
||||
nsRect cRect = cellFrame->GetRect();
|
||||
// If aRowOffset != 0, there's no point in invalidating the cells, since
|
||||
// we've already invalidated our overflow area. Note that we _do_ still
|
||||
// need to invalidate if our row is not moving, because the cell might
|
||||
// span out of this row, so invalidating our row rect won't do enough.
|
||||
if (aRowOffset == 0) {
|
||||
InvalidateFrame();
|
||||
shift = rowRect.height;
|
||||
nsTableCellFrame* cellFrame = GetFirstCell();
|
||||
if (cellFrame) {
|
||||
int32_t rowIndex;
|
||||
cellFrame->GetRowIndex(rowIndex);
|
||||
shift += tableFrame->GetCellSpacingY(rowIndex);
|
||||
while (cellFrame) {
|
||||
nsRect cRect = cellFrame->GetRect();
|
||||
// If aRowOffset != 0, there's no point in invalidating the cells, since
|
||||
// we've already invalidated our overflow area. Note that we _do_ still
|
||||
// need to invalidate if our row is not moving, because the cell might
|
||||
// span out of this row, so invalidating our row rect won't do enough.
|
||||
if (aRowOffset == 0) {
|
||||
InvalidateFrame();
|
||||
}
|
||||
cRect.height = 0;
|
||||
cellFrame->SetRect(cRect);
|
||||
cellFrame = cellFrame->GetNextCell();
|
||||
}
|
||||
cRect.height = 0;
|
||||
cellFrame->SetRect(cRect);
|
||||
cellFrame = cellFrame->GetNextCell();
|
||||
} else {
|
||||
shift += tableFrame->GetCellSpacingY(GetRowIndex());
|
||||
}
|
||||
rowRect.height = 0;
|
||||
}
|
||||
|
27
layout/tables/reftests/1031934-ref.html
Normal file
27
layout/tables/reftests/1031934-ref.html
Normal file
@ -0,0 +1,27 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<meta charset="utf-8">
|
||||
<title>Testcase for bug 1031934</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table border="1">
|
||||
<tbody style="visibility: collapse;">
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td>Hello</td></tr>
|
||||
</tbody>
|
||||
<tbody style="visibility: collapse;">
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table border="1">
|
||||
<tbody></tbody>
|
||||
<tbody>
|
||||
<tr><td>Hello</td></tr>
|
||||
</tbody>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
54
layout/tables/reftests/1031934.html
Normal file
54
layout/tables/reftests/1031934.html
Normal file
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<meta charset="utf-8">
|
||||
<title>Testcase for bug 1031934</title>
|
||||
<style type="text/css">
|
||||
|
||||
td { display:none; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table border="1">
|
||||
<tbody style="visibility: collapse;">
|
||||
<tr><td></td></tr>
|
||||
<tr><td></td></tr>
|
||||
<tr><td></td></tr>
|
||||
<tr><td></td></tr>
|
||||
<tr><td></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td></td></tr>
|
||||
<tr><td style="display:table-cell">Hello</td></tr>
|
||||
<tr><td></td></tr>
|
||||
</tbody>
|
||||
<tbody style="visibility: collapse;">
|
||||
<tr><td></td></tr>
|
||||
<tr><td></td></tr>
|
||||
<tr><td></td></tr>
|
||||
<tr><td></td></tr>
|
||||
<tr><td></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table border="1">
|
||||
<tbody>
|
||||
<tr style="visibility: collapse;"><td></td></tr>
|
||||
<tr style="visibility: collapse;"><td></td></tr>
|
||||
<tr style="visibility: collapse;"><td></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td></td></tr>
|
||||
<tr><td style="display:table-cell">Hello</td></tr>
|
||||
<tr><td></td></tr>
|
||||
</tbody>
|
||||
<tbody style="visibility: collapse;">
|
||||
<tr style="visibility: collapse;"><td></td></tr>
|
||||
<tr style="visibility: collapse;"><td></td></tr>
|
||||
<tr style="visibility: collapse;"><td></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
1
layout/tables/reftests/reftest.list
Normal file
1
layout/tables/reftests/reftest.list
Normal file
@ -0,0 +1 @@
|
||||
== 1031934.html 1031934-ref.html
|
Loading…
Reference in New Issue
Block a user