Add tests for table-layout:auto table balancing.

git-svn-id: svn://10.0.0.236/trunk@220627 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org
2007-02-21 07:47:47 +00:00
parent 1a79b3bd5e
commit e7bd0674bd
5 changed files with 351 additions and 0 deletions

View File

@@ -0,0 +1,99 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Balancing of tables (shrinking)</title>
<style type="text/css">
table, td {
border: none;
margin: 0;
padding: 0;
border-spacing: 3px;
}
tr { height: 4em; }
td { background: black; background: currentColor; }
body { width: 900px; }
</style>
</head>
<body>
<!--
cell widths are:
min pref pct
50 150
50 50
50 100*
50 50 50%
and the table has 15px of horizontal border-spacing
sizing to col width total
min 200
min/pct 300
min/spec 400
pref 600
-->
<!-- width: 200px --><table><tr>
<td style="color:aqua" width="50">x</td>
<td style="color:yellow" width="50">x</td>
<td style="color:fuchsia" width="50">x</td>
<td style="color:blue" width="50">x</td>
</tr></table>
<!-- width: 250px --><table><tr>
<td style="color:aqua" width="50">x</td>
<td style="color:yellow" width="50">x</td>
<td style="color:fuchsia" width="50">x</td>
<td style="color:blue" width="100">x</td>
</tr></table>
<!-- width: 300px --><table><tr>
<td style="color:aqua" width="50">x</td>
<td style="color:yellow" width="50">x</td>
<td style="color:fuchsia" width="50">x</td>
<td style="color:blue" width="150">x</td>
</tr></table>
<!-- width: 350px --><table><tr>
<td style="color:aqua" width="50">x</td>
<td style="color:yellow" width="50">x</td>
<td style="color:fuchsia" width="75">x</td>
<td style="color:blue" width="175">x</td>
</tr></table>
<!-- width: 400px --><table><tr>
<td style="color:aqua" width="50">x</td>
<td style="color:yellow" width="50">x</td>
<td style="color:fuchsia" width="100">x</td>
<td style="color:blue" width="200">x</td>
</tr></table>
<!-- width: 500px --><table><tr>
<td style="color:aqua" width="100">x</td>
<td style="color:yellow" width="50">x</td>
<td style="color:fuchsia" width="100">x</td>
<td style="color:blue" width="250">x</td>
</tr></table>
<!-- width: 600px --><table><tr>
<td style="color:aqua" width="150">x</td>
<td style="color:yellow" width="50">x</td>
<td style="color:fuchsia" width="100">x</td>
<td style="color:blue" width="300">x</td>
</tr></table>
<!-- width: 800px --><table><tr>
<td style="color:aqua" width="225">x</td>
<td style="color:yellow" width="75">x</td>
<td style="color:fuchsia" width="100">x</td>
<td style="color:blue" width="400">x</td>
</tr></table>
</body>
</html>

View File

@@ -0,0 +1,104 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Balancing of tables (shrinking)</title>
<style type="text/css">
table, td {
border: none;
margin: 0;
padding: 0;
border-spacing: 3px;
}
tr { height: 4em; }
td { background: black; background: currentColor; }
td, span { line-height: 1; }
span {
display: inline-block;
width: 50px;
}
</style>
</head>
<body>
<!--
cell widths are:
min pref pct
50 150
50 50
50 100*
50 50 50%
and the table has 15px of horizontal border-spacing
sizing to col width total
min 200
min/pct 300
min/spec 400
pref 600
-->
<div style="width: 100px"><table><tr>
<td style="color:aqua"><span>x</span>&#x200b;<span>x</span>&#x200b;<span>x</span></td>
<td style="color:yellow"><span>x</span></td>
<td style="color:fuchsia" width="100"><span>x</span></td>
<td style="color:blue" width="50%"><span>x</span></td>
</tr></table></div>
<div style="width: 265px"><table><tr>
<td style="color:aqua"><span>x</span>&#x200b;<span>x</span>&#x200b;<span>x</span></td>
<td style="color:yellow"><span>x</span></td>
<td style="color:fuchsia" width="100"><span>x</span></td>
<td style="color:blue" width="50%"><span>x</span></td>
</tr></table></div>
<div style="width: 315px"><table><tr>
<td style="color:aqua"><span>x</span>&#x200b;<span>x</span>&#x200b;<span>x</span></td>
<td style="color:yellow"><span>x</span></td>
<td style="color:fuchsia" width="100"><span>x</span></td>
<td style="color:blue" width="50%"><span>x</span></td>
</tr></table></div>
<div style="width: 365px"><table><tr>
<td style="color:aqua"><span>x</span>&#x200b;<span>x</span>&#x200b;<span>x</span></td>
<td style="color:yellow"><span>x</span></td>
<td style="color:fuchsia" width="100"><span>x</span></td>
<td style="color:blue" width="50%"><span>x</span></td>
</tr></table></div>
<div style="width: 415px"><table><tr>
<td style="color:aqua"><span>x</span>&#x200b;<span>x</span>&#x200b;<span>x</span></td>
<td style="color:yellow"><span>x</span></td>
<td style="color:fuchsia" width="100"><span>x</span></td>
<td style="color:blue" width="50%"><span>x</span></td>
</tr></table></div>
<div style="width: 515px"><table><tr>
<td style="color:aqua"><span>x</span>&#x200b;<span>x</span>&#x200b;<span>x</span></td>
<td style="color:yellow"><span>x</span></td>
<td style="color:fuchsia" width="100"><span>x</span></td>
<td style="color:blue" width="50%"><span>x</span></td>
</tr></table></div>
<div style="width: 700px"><table><tr>
<td style="color:aqua"><span>x</span>&#x200b;<span>x</span>&#x200b;<span>x</span></td>
<td style="color:yellow"><span>x</span></td>
<td style="color:fuchsia" width="100"><span>x</span></td>
<td style="color:blue" width="50%"><span>x</span></td>
</tr></table></div>
<table width="815"><tr>
<td style="color:aqua"><span>x</span>&#x200b;<span>x</span>&#x200b;<span>x</span></td>
<td style="color:yellow"><span>x</span></td>
<td style="color:fuchsia" width="100"><span>x</span></td>
<td style="color:blue" width="50%"><span>x</span></td>
</tr></table>
</body>
</html>

View File

@@ -0,0 +1,62 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Balancing of tables (growing)</title>
<style type="text/css">
table, td {
border: none;
margin: 0;
padding: 0;
border-spacing: 3px;
}
tr { height: 1.5em; }
td { background: black; background: currentColor; }
</style>
</head>
<body>
<!-- width: 300px --><table><tr>
<td style="color:aqua" width="75">x</td>
<td style="color:yellow" width="25">x</td>
<td style="color:red" width="0"></td>
<td style="color:fuchsia" width="50">x</td>
<td style="color:blue" width="150">x</td>
</tr></table>
<!-- width: 500px --><table><tr>
<td style="color:aqua" width="150">x</td>
<td style="color:yellow" width="50">x</td>
<td style="color:red" width="0"></td>
<td style="color:fuchsia" width="50">x</td>
<td style="color:blue" width="250">x</td>
</tr></table>
<!-- width: 420px --><table><tr>
<td style="color:aqua" width="105">x</td>
<td style="color:yellow" width="35">x</td>
<td style="color:red" width="0"></td>
<td style="color:fuchsia" width="70">x</td>
<td style="color:blue" width="210">x</td>
</tr></table>
<!-- width: 400px --><table><tr>
<td style="color:aqua" width="50">x</td>
<td style="color:yellow" width="50">x</td>
<td style="color:red" width="0"></td>
<td style="color:fuchsia" width="50">x</td>
<td style="color:blue" width="250">x</td>
</tr></table>
<!-- width: 400px --><table><tr>
<td style="color:aqua" width="100">x</td>
<td style="color:yellow" width="100">x</td>
<td style="color:fuchsia" width="100">x</td>
<td style="color:blue" width="100">x</td>
</tr></table>
</body>
</html>

View File

@@ -0,0 +1,84 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Balancing of tables (growing)</title>
<style type="text/css">
table, td {
border: none;
margin: 0;
padding: 0;
border-spacing: 3px;
}
tr { height: 1.5em; }
td { background: black; background: currentColor; }
td, span { line-height: 1; }
span {
display: inline-block;
width: 25px;
}
</style>
</head>
<body>
<!--
cell widths in the first table are:
min pref pct
25 75
25 25
0 0
25 50*
25 25 50%
and the table has 18px of horizontal border-spacing
pref width of columns is 300px
-->
<table><tr>
<td style="color:aqua"><span>x</span>&#x200b;<span>x</span>&#x200b;<span>x</span></td>
<td style="color:yellow"><span>x</span></td>
<td style="color:red"></td>
<td style="color:fuchsia" width="50"><span>x</span></td>
<td style="color:blue" width="50%"><span>x</span></td>
</tr></table>
<table width="518"><tr>
<td style="color:aqua"><span>x</span>&#x200b;<span>x</span>&#x200b;<span>x</span></td>
<td style="color:yellow"><span>x</span></td>
<td style="color:red"></td>
<td style="color:fuchsia" width="50"><span>x</span></td>
<td style="color:blue" width="50%"><span>x</span></td>
</tr></table>
<table width="438"><tr>
<td style="color:aqua" width="75"><span>x</span>&#x200b;<span>x</span>&#x200b;<span>x</span></td>
<td style="color:yellow" width="25"><span>x</span></td>
<td style="color:red"></td>
<td style="color:fuchsia" width="50"><span>x</span></td>
<td style="color:blue" width="50%"><span>x</span></td>
</tr></table>
<table width="418"><tr>
<td style="color:aqua" width="10%"><span>x</span></td>
<td style="color:yellow" width="10%"><span>x</span></td>
<td style="color:red"></td>
<td style="color:fuchsia" width="10%"><span>x</span></td>
<td style="color:blue" width="50%"><span>x</span></td>
</tr></table>
<table width="415"><tr>
<td style="color:aqua"></td>
<td style="color:yellow"></td>
<td style="color:fuchsia"></td>
<td style="color:blue"></td>
</tr></table>
</body>
</html>

View File

@@ -35,3 +35,5 @@
== percent-truncation-1.html percent-truncation-1-ref.html
== percent-truncation-2.html percent-truncation-2-ref.html
== percent-truncation-3.html percent-truncation-3-ref.html
== balancing-1.html balancing-1-ref.html
== balancing-2.html balancing-2-ref.html