layout: Implement empty-cells per CSS 2.1 § 17.6.1.1.

This commit is contained in:
Patrick Walton 2014-12-16 16:03:08 -08:00
parent 592c93e0c2
commit 5675274c44
8 changed files with 98 additions and 13 deletions

View file

@ -215,3 +215,4 @@ fragment=top != ../html/acid2.html acid2_ref.html
== legacy_table_border_attribute_a.html legacy_table_border_attribute_ref.html
== inset.html inset_ref.html
== outset.html outset_ref.html
== empty_cells_a.html empty_cells_ref.html

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<!-- Tests that `empty-cells` works—in particular, that the definition of emptiness is correct. -->
<style>
table {
empty-cells: hide;
}
section {
float: right;
}
nav {
position: absolute;
}
</style>
</head>
<body>
<table border=3>
<tr><td>Yo</td><td>Howdy</td><td><section>&nbsp;</section></td><td></td></tr>
<tr><td>Later</td><td><nav></nav></td><td>See ya</td><td>Aloha</td></tr>
<tr><td></td><td>Sayonara</td><td></td><td><span></span></td></tr>
</table>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<!-- Tests that `empty-cells` works—in particular, that the definition of emptiness is correct. -->
<style>
.empty {
border: none;
}
</style>
</head>
<body>
<table border=3>
<tr><td>Yo</td><td>Howdy</td><td></td><td class=empty></td></tr>
<tr><td>Later</td><td class=empty></td><td>See ya</td><td>Aloha</td></tr>
<tr><td class=empty></td><td>Sayonara</td><td class=empty></td><td></td></tr>
</table>
</body>
</html>