Correct z-ordering for some table parts and add reftests.

This commit is contained in:
Fedor 2020-06-10 21:11:50 +03:00
parent c687567d8f
commit 45a37d248e
5 changed files with 164 additions and 2 deletions

View File

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html>
<head>
<title>Table border collapse</title>
<style>
table {
border-collapse: collapse;
}
tr.odd {
background-color: LightCyan;
}
tr.even {
background-color: LightSkyBlue;
}
td {
border: 5px solid DarkBlue;
}
.inner td {
border: 5px solid red;
}
.inner tr:first-child td {
border-top: 5px solid DarkBlue;
}
.inner tr td:first-child {
border-left: 5px solid DarkBlue;
}
.inner tr:last-child td {
border-bottom: 5px solid DarkBlue;
}
.inner tr td:last-child {
border-right: 5px solid DarkBlue;
}
div {
height: 10px;
}
</style>
</head>
<body>
<div></div>
<table>
<caption></caption>
<tr class="odd">
<td>Cell 1-1</td>
<td>Cell 1-2</td>
</tr>
<tr class="even">
<td>Cell 2-1</td>
<td>Cell 2-2
<table class="inner">
<tr class="odd">
<td>Cell 2-2/1-1</td>
<td>Cell 2-2/1-2</td>
</tr>
<tr class="even">
<td>Cell 2-2/2-1</td>
<td>Cell 2-2/2-2</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>Table border collapse</title>
<style>
table {
border-collapse: collapse;
}
tr.odd {
background-color: LightCyan;
}
tr.even {
background-color: LightSkyBlue;
}
td {
border: 5px solid DarkBlue;
}
div {
height: 10px;
}
</style>
</head>
<body>
<div></div>
<table>
<tr class="odd">
<td>Cell 1-1</td>
<td>Cell 1-2</td>
</tr>
<tr class="even">
<td>Cell 2-1</td>
<td>Cell 2-2
<table>
<tr class="odd">
<td>Cell 2-2/1-1</td>
<td>Cell 2-2/1-2</td>
</tr>
<tr class="even">
<td>Cell 2-2/2-1</td>
<td>Cell 2-2/2-2</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>Table border collapse</title>
<style>
table {
border-collapse: collapse;
}
tr.odd {
background-color: LightCyan;
}
tr.even {
background-color: LightSkyBlue;
}
td {
border: 5px solid DarkBlue;
}
caption {
height: 10px
}
</style>
</head>
<body>
<table>
<caption></caption>
<tr class="odd">
<td>Cell 1-1</td>
<td>Cell 1-2</td>
</tr>
<tr class="even">
<td>Cell 2-1</td>
<td>Cell 2-2
<table>
<tr class="odd">
<td>Cell 2-2/1-1</td>
<td>Cell 2-2/1-2</td>
</tr>
<tr class="even">
<td>Cell 2-2/2-1</td>
<td>Cell 2-2/2-2</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

View File

@ -3,6 +3,8 @@
== bug1375518-3.html bug1375518-ref.html
== bug1375518-4.html bug1375518-4-ref.html
== bug1375518-5.html bug1375518-5-ref.html
== bug1394226.html bug1394226-ref.html
!= bug1394226.html bug1394226-notref.html
== bc_dyn_cell1.html bc_dyn_cell1_ref.html
== bc_dyn_cell2.html bc_dyn_cell2_ref.html
== bc_dyn_cell3.html bc_dyn_cell3_ref.html

View File

@ -187,8 +187,11 @@ nsTableWrapperFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
BuildDisplayListForChild(aBuilder, mCaptionFrames.FirstChild(), captionSet);
// Now we have to sort everything by content order, since the caption
// may be somewhere inside the table
set.BlockBorderBackgrounds()->SortByContentOrder(GetContent());
// may be somewhere inside the table.
// We don't sort BlockBorderBackgrounds and BorderBackgrounds because the
// display items in those lists should stay out of content order in order to
// follow the rules in https://www.w3.org/TR/CSS21/zindex.html#painting-order
// and paint the caption background after all of the rest.
set.Floats()->SortByContentOrder(GetContent());
set.Content()->SortByContentOrder(GetContent());
set.PositionedDescendants()->SortByContentOrder(GetContent());