Handle row borders in border collapsing logic.

Fixes #11527.
This commit is contained in:
Gabriel Poesia 2016-07-13 14:14:26 -03:00
parent 5b46a59194
commit a3af2303d6
17 changed files with 147 additions and 58 deletions

View file

@ -1,3 +0,0 @@
[border-bottom-applies-to-004.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[border-bottom-color-applies-to-004.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[border-bottom-width-applies-to-004.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[border-conflict-style-101.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[border-left-applies-to-004.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[border-left-color-applies-to-004.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[border-left-width-applies-to-004.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[border-right-applies-to-004.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[border-right-color-applies-to-004.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[border-right-width-applies-to-004.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[vertical-align-121.htm]
type: reftest
expected: FAIL

View file

@ -792,6 +792,18 @@
"url": "/_mozilla/css/border_collapse_missing_cell_a.html"
}
],
"css/border_collapse_row_a.html": [
{
"path": "css/border_collapse_row_a.html",
"references": [
[
"/_mozilla/css/border_collapse_row_ref.html",
"=="
]
],
"url": "/_mozilla/css/border_collapse_row_a.html"
}
],
"css/border_collapse_rowgroup_a.html": [
{
"path": "css/border_collapse_rowgroup_a.html",
@ -10102,6 +10114,18 @@
"url": "/_mozilla/css/border_collapse_missing_cell_a.html"
}
],
"css/border_collapse_row_a.html": [
{
"path": "css/border_collapse_row_a.html",
"references": [
[
"/_mozilla/css/border_collapse_row_ref.html",
"=="
]
],
"url": "/_mozilla/css/border_collapse_row_a.html"
}
],
"css/border_collapse_rowgroup_a.html": [
{
"path": "css/border_collapse_rowgroup_a.html",

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>row border collapse test</title>
<link rel="match" href="border_collapse_row_ref.html">
<style>
table {
border-collapse: collapse;
}
td {
width: 64px;
height: 32px;
}
.tr_with_border {
border-top: 2px solid black;
border-right: 2px solid black;
border-bottom: 2px solid black;
}
</style>
</head>
<body>
<table>
<tr><td></td><td></td></tr>
<tr class="tr_with_border"><td></td><td></td></tr>
<tr class="tr_with_border"><td></td><td></td></tr>
<tr class="tr_with_border"><td></td><td></td></tr>
<tr class="tr_with_border"><td></td><td></td></tr>
</table>
</body>
</html>

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>row border collapse test - reference</title>
<style>
table {
border-collapse: collapse;
}
td {
width: 64px;
height: 32px;
}
.td_left {
border-top: 2px solid black;
border-bottom: 2px solid black;
}
.td_right {
border-top: 2px solid black;
border-right: 2px solid black;
border-bottom: 2px solid black;
}
</style>
</head>
<body>
<table>
<tr><td></td><td></td></tr>
<tr><td class="td_left"></td><td class="td_right"</td></tr>
<tr><td class="td_left"></td><td class="td_right"</td></tr>
<tr><td class="td_left"></td><td class="td_right"</td></tr>
<tr><td class="td_left"></td><td class="td_right"</td></tr>
</table>
</body>
</html>

View file

@ -8,6 +8,9 @@
FIXME(pcwalton): This is currently offset by -2px in block and inline directions because we
don't correctly handle collapsed borders when calculating `table_border_padding` in
`table_wrapper.rs`.
FIXME(gpoesia): This test does not behave exactly like Gecko yet, because cell5's
height is currently 2px smaller in Servo.
-->
<link rel=match href=border_collapse_simple_ref.html>
<style>
@ -19,7 +22,7 @@ html {
}
body {
/* See `FIXME` above. */
padding: 2px;
padding-top: 2px;
}
table {
border-collapse: collapse;
@ -28,14 +31,20 @@ table {
td {
border: 2px solid black;
padding: 16px;
width: 32px;
width: 30px;
height: 32px;
}
td.cell5 {
border: 30px solid black;
width: 32px;
}
td.cell6 {
border: 4px solid black;
width: 32px;
}
#row1 td {
height: 32px;
}
</style>
</head>