Bug 413286: Let empty auto-width columns be expanded. r+sr=dbaron a=blocking1.9+

git-svn-id: svn://10.0.0.236/trunk@246270 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dholbert%cs.stanford.edu
2008-02-22 03:25:57 +00:00
parent b600e89a59
commit e1b4966724
21 changed files with 1334 additions and 10 deletions

View File

@@ -0,0 +1,89 @@
<html>
<head>
<style>
table { width: 400px; height: 25px; }
td.blue { background: lightblue; }
td.green { background: lightgreen; }
td.skinny { width: 100px }
td.medium { width: 200px }
td.wide { width: 300px }
</style>
</head>
<body>
With colspan:
<table cellspacing=0 cellpadding=0>
<tbody><tr>
<td class="blue skinny"></td>
<td class="green wide"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<tbody><tr>
<td class="blue skinny"></td>
<td class="green wide"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<tbody><tr>
<td class="blue skinny"></td>
<td class="green wide"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<tbody><tr>
<td class="blue skinny"></td>
<td class="green wide"></td>
</tr></tbody>
</table>
Without colspan:
<table cellspacing=0 cellpadding=0>
<tbody><tr>
<td class="blue skinny"></td>
<td class="green wide"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<tbody><tr>
<td class="blue skinny"></td>
<td class="green wide"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<tbody><tr>
<td class="blue skinny"></td>
<td class="green wide"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<tbody><tr>
<td class="blue skinny"></td>
<td class="green wide"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<tbody><tr>
<td class="blue skinny"></td>
<td class="green wide"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<tbody><tr>
<td class="blue skinny"></td>
<td class="green wide"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<tbody><tr>
<td class="blue skinny"></td>
<td class="green wide"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<tbody><tr>
<td class="blue skinny"></td>
<td class="green wide"></td>
</tr></tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,108 @@
<html>
<head>
<style>
table { width: 400px; height: 25px; }
td.blue { background: lightblue; color: lightblue }
td.green { background: lightgreen; color: lightgreen }
col.a { width: 100px; }
col.c { width: 25%; }
</style>
</head>
<body>
With colspan:
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green" colspan="2"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green" colspan="2"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green" colspan="2">xxx</td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green" colspan="2">xxx</td>
</tr></tbody>
</table>
Without colspan:
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green"></td>
<td class="green"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green"></td>
<td class="green"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green">xxx</td>
<td class="green"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green"></td>
<td class="green">xxx</td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green">xxx</td>
<td class="green"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green"></td>
<td class="green">xxx</td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green">xxx</td>
<td class="green">xxx</td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green">xxx</td>
<td class="green">xxx</td>
</tr></tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,108 @@
<html>
<head>
<style>
table { width: 400px; height: 25px; }
td.blue { background: lightblue; color: lightblue }
td.green { background: lightgreen; color: lightgreen }
col.a { width: 25%; }
col.c { width: 25%; }
</style>
</head>
<body>
With colspan:
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green" colspan="2"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green" colspan="2"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green" colspan="2">xxx</td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green" colspan="2">xxx</td>
</tr></tbody>
</table>
Without colspan:
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green"></td>
<td class="green"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green"></td>
<td class="green"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green">xxx</td>
<td class="green"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green"></td>
<td class="green">xxx</td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green">xxx</td>
<td class="green"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green"></td>
<td class="green">xxx</td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green">xxx</td>
<td class="green">xxx</td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green">xxx</td>
<td class="green">xxx</td>
</tr></tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,108 @@
<html>
<head>
<style>
table { width: 400px; height: 25px; }
td.blue { background: lightblue; color: lightblue }
td.green { background: lightgreen; color: lightgreen }
col.a { width: 100px; }
col.c { width: 100px; }
</style>
</head>
<body>
With colspan:
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green" colspan="2"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green" colspan="2"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green" colspan="2">xxx</td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green" colspan="2">xxx</td>
</tr></tbody>
</table>
Without colspan:
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green"></td>
<td class="green"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green"></td>
<td class="green"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green">xxx</td>
<td class="green"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green"></td>
<td class="green">xxx</td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green">xxx</td>
<td class="green"></td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green"></td>
<td class="green">xxx</td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue"></td>
<td class="green">xxx</td>
<td class="green">xxx</td>
</tr></tbody>
</table>
<table cellspacing=0 cellpadding=0>
<colgroup><col class="a"/><col/><col class="c"/></colgroup>
<tbody><tr>
<td class="blue">xxx</td>
<td class="green">xxx</td>
<td class="green">xxx</td>
</tr></tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,66 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Reference Case</title>
<style>
table { width: 500px; }
td { height: 2em; }
td.aqua { background: aqua }
td.lime { background: lime }
td.blue { background: blue }
td.pink { background: pink }
td.yellow { background: yellow }
</style>
</head>
<body>
<h2>No third column</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
</tr><tr>
<td class="lime" style="width: 50px"></td>
<td class="blue" style="width: 450px"></td>
</tr>
</table>
<h2>Third column with low percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
<td class="yellow"></td>
</tr><tr>
<td class="lime" style="width: 50px"></td>
<td class="blue" style="width: 400px"></td>
<td class="pink" style="width: 50px"></td>
</tr>
</table>
<h2>Third column with medium percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
<td class="yellow"></td>
</tr><tr>
<td class="lime" style="width: 50px"></td>
<td class="blue" style="width: 250px"></td>
<td class="pink" style="width: 200px"></td>
</tr>
</table>
<h2>Third column with preferred width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
<td class="yellow"></td>
</tr><tr>
<td class="lime" style="width: 50px"></td>
<td class="blue" style="width: 400px"></td>
<td class="pink" style="width: 50px"></td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,67 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Spanning cell has no specified width</title>
<style>
table { width: 500px; }
td { height: 2em; }
td.aqua { background: aqua }
td.lime { background: lime }
td.blue { background: blue }
td.pink { background: pink }
td.yellow { background: yellow }
td.lowPct { width: 10% }
td.medPct { width: 40% }
td.hiPct { width: 50% }
td.specWidth { width: 50px }
</style>
</head>
<body>
<h2>No third column</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
</tr>
</table>
<h2>Third column with low percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua"></td>
<td class="yellow lowPct"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
<td class="pink lowPct"></td>
</tr>
</table>
<h2>Third column with medium percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua"></td>
<td class="yellow medPct"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
<td class="pink medPct"></td>
</tr>
</table>
<h2>Third column with preferred width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua"></td>
<td class="yellow specWidth"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
<td class="pink specWidth"></td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,68 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Spanning cell has nonzero pref & min width</title>
<style>
table { width: 500px; }
td { height: 2em; }
td.aqua { background: aqua }
td.lime { background: lime }
td.blue { background: blue }
td.pink { background: pink }
td.yellow { background: yellow }
td.aquaText { color: aqua }
td.lowPct { width: 10% }
td.medPct { width: 40% }
td.hiPct { width: 50% }
td.specWidth { width: 50px }
</style>
</head>
<body>
<h2>No third column</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua aquaText">text</td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
</tr>
</table>
<h2>Third column with low percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua aquaText">text</td>
<td class="yellow lowPct"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
<td class="pink lowPct"></td>
</tr>
</table>
<h2>Third column with medium percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua aquaText">text</td>
<td class="yellow medPct"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
<td class="pink medPct"></td>
</tr>
</table>
<h2>Third column with preferred width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua aquaText">text</td>
<td class="yellow specWidth"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
<td class="pink specWidth"></td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,67 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Spanning cell has low percent width</title>
<style>
table { width: 500px; }
td { height: 2em; }
td.aqua { background: aqua }
td.lime { background: lime }
td.blue { background: blue }
td.pink { background: pink }
td.yellow { background: yellow }
td.lowPct { width: 10% }
td.medPct { width: 40% }
td.hiPct { width: 50% }
td.specWidth { width: 50px }
</style>
</head>
<body>
<h2>No third column</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua lowPct"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
</tr>
</table>
<h2>Third column with low percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua lowPct"></td>
<td class="yellow lowPct"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
<td class="pink lowPct"></td>
</tr>
</table>
<h2>Third column with medium percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua lowPct"></td>
<td class="yellow medPct"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
<td class="pink medPct"></td>
</tr>
</table>
<h2>Third column with preferred width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua lowPct"></td>
<td class="yellow specWidth"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
<td class="pink specWidth"></td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,66 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Reference Case</title>
<style>
table { width: 500px; }
td { height: 2em; }
td.aqua { background: aqua }
td.lime { background: lime }
td.blue { background: blue }
td.pink { background: pink }
td.yellow { background: yellow }
</style>
</head>
<body>
<h2>No third column</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
</tr><tr>
<td class="lime" style="width: 250px"></td>
<td class="blue" style="width: 250px"></td>
</tr>
</table>
<h2>Third column with low percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
<td class="yellow"></td>
</tr><tr>
<td class="lime" style="width: 250px"></td>
<td class="blue" style="width: 200px"></td>
<td class="pink" style="width: 50px"></td>
</tr>
</table>
<h2>Third column with medium percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
<td class="yellow"></td>
</tr><tr>
<td class="lime" style="width: 250px"></td>
<td class="blue" style="width: 50px"></td>
<td class="pink" style="width: 200px"></td>
</tr>
</table>
<h2>Third column with preferred width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
<td class="yellow"></td>
</tr><tr>
<td class="lime" style="width: 250px"></td>
<td class="blue" style="width: 200px"></td>
<td class="pink" style="width: 50px"></td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,67 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Spanning cell has high percent width</title>
<style>
table { width: 500px; }
td { height: 2em; }
td.aqua { background: aqua }
td.lime { background: lime }
td.blue { background: blue }
td.pink { background: pink }
td.yellow { background: yellow }
td.lowPct { width: 10% }
td.medPct { width: 40% }
td.hiPct { width: 50% }
td.specWidth { width: 50px }
</style>
</head>
<body>
<h2>No third column</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua hiPct"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
</tr>
</table>
<h2>Third column with low percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua hiPct"></td>
<td class="yellow lowPct"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
<td class="pink lowPct"></td>
</tr>
</table>
<h2>Third column with medium percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua hiPct"></td>
<td class="yellow medPct"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
<td class="pink medPct"></td>
</tr>
</table>
<h2>Third column with preferred width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua hiPct"></td>
<td class="yellow specWidth"></td>
</tr><tr>
<td class="lime specWidth"></td>
<td class="blue"></td>
<td class="pink specWidth"></td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,66 @@
<!DOCTYPE HTML>
<html>
<head>
<title>First two columns have no width</title>
<style>
table { width: 500px; }
td { height: 2em; }
td.aqua { background: aqua }
td.lime { background: lime }
td.blue { background: blue }
td.pink { background: pink }
td.yellow { background: yellow }
</style>
</head>
<body>
<h2>No third column</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
</tr><tr>
<td class="lime" style="width: 250px"></td>
<td class="blue" style="width: 250px"></td>
</tr>
</table>
<h2>Third column with low percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
<td class="yellow"></td>
</tr><tr>
<td class="lime" style="width: 225px"></td>
<td class="blue" style="width: 225px"></td>
<td class="pink" style="width: 50px"></td>
</tr>
</table>
<h2>Third column with medium percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
<td class="yellow"></td>
</tr><tr>
<td class="lime" style="width: 150px"></td>
<td class="blue" style="width: 150px"></td>
<td class="pink" style="width: 200px"></td>
</tr>
</table>
<h2>Third column with preferred width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
<td class="yellow"></td>
</tr><tr>
<td class="lime" style="width: 225px"></td>
<td class="blue" style="width: 225px"></td>
<td class="pink" style="width: 50px"></td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,66 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Span & its columns have no width</title>
<style>
table { width: 500px; }
td { height: 2em; }
td.aqua { background: aqua }
td.lime { background: lime }
td.blue { background: blue }
td.pink { background: pink }
td.yellow { background: yellow }
td.lowPct { width: 10% }
td.medPct { width: 40% }
td.specWidth { width: 50px }
</style>
</head>
<body>
<h2>No third column</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua"></td>
</tr><tr>
<td class="lime"></td>
<td class="blue"></td>
</tr>
</table>
<h2>Third column with low percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua"></td>
<td class="yellow lowPct"></td>
</tr><tr>
<td class="lime"></td>
<td class="blue"></td>
<td class="pink lowPct"></td>
</tr>
</table>
<h2>Third column with medium percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua"></td>
<td class="yellow medPct"></td>
</tr><tr>
<td class="lime"></td>
<td class="blue"></td>
<td class="pink medPct"></td>
</tr>
</table>
<h2>Third column with preferred width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" class="aqua"></td>
<td class="yellow specWidth"></td>
</tr><tr>
<td class="lime"></td>
<td class="blue"></td>
<td class="pink specWidth"></td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,70 @@
<!DOCTYPE HTML>
<html>
<head>
<title>First two columns have no width</title>
<style>
table { width: 500px; }
td { height: 2em; }
td.aqua { background: aqua }
td.lime { background: lime }
td.blue { background: blue }
td.pink { background: pink }
td.yellow { background: yellow }
td.lowPct { width: 10% }
td.medPct { width: 40% }
td.specWidth { width: 50px }
</style>
</head>
<body>
<h2>No third column</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
</tr><tr>
<td class="lime"></td>
<td class="blue"></td>
</tr>
</table>
<h2>Third column with low percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
<td class="yellow lowPct"></td>
</tr><tr>
<td class="lime"></td>
<td class="blue"></td>
<td class="pink lowPct"></td>
</tr>
</table>
<h2>Third column with medium percent width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
<td class="yellow medPct"></td>
</tr><tr>
<td class="lime"></td>
<td class="blue"></td>
<td class="pink medPct"></td>
</tr>
</table>
<h2>Third column with preferred width</h2>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="aqua"></td>
<td class="aqua"></td>
<td class="yellow specWidth"></td>
</tr><tr>
<td class="lime"></td>
<td class="blue"></td>
<td class="pink specWidth"></td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,68 @@
<html>
<head><style>
table { width: 600px }
td.smallSpec { width: 100px; }
td.bigSpec { width: 500px; }
td.smallPct { width: 10%; }
td.bigPct { width: 90%; }
td.pink { background: pink }
td.teal { background: teal }
</style></head>
<body>
<h2>Other column fixed-width</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallSpec pink">100</td>
<td class="bigSpec teal"/>
</tr>
</table>
<h2>Other column percent-width</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallPct pink">10%</td>
<td class="bigPct teal"/>
</tr>
</table>
<h2>Other column fixed-width; zero column spanned by colspan (crossing other column)</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallSpec pink">100</td>
<td class="bigSpec teal"/>
</tr>
</table>
<h2>Other column percent-width; zero column spanned by colspan (crossing other column)</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallPct pink">10%</td>
<td class="bigPct teal"/>
</tr>
</table>
<h2>Other column fixed-width; two zero columns with colspan</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallSpec pink">100</td>
<td class="bigSpec teal"/>
</tr>
</table>
<h2>Other column percent-width; two zero columns with colspan</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallPct pink">10%</td>
<td class="bigPct teal"/>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,68 @@
<html>
<head><style>
table { width: 600px }
td.smallSpec { width: 100px; }
td.smallPct { width: 10%; }
td.pink { background: pink }
td.teal { background: teal }
</style></head>
<body>
<h2>Other column fixed-width</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallSpec pink">100</td>
<td class="teal"/>
</tr>
</table>
<h2>Other column percent-width</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallPct pink">10%</td>
<td class="teal"/>
</tr>
</table>
<h2>Other column fixed-width; zero column spanned by colspan (crossing other column)</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallSpec pink">100</td>
<td class="teal"/>
</tr>
<tr><td colspan="2"/></tr>
</table>
<h2>Other column percent-width; zero column spanned by colspan (crossing other column)</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallPct pink">10%</td>
<td class="teal"/>
</tr>
<tr><td colspan="2"/></tr>
</table>
<h2>Other column fixed-width; two zero columns with colspan</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallSpec pink">100</td>
<td class="teal" colspan="2"/>
</tr>
</table>
<h2>Other column percent-width; two zero columns with colspan</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallPct pink">10%</td>
<td class="teal" colspan="2"/>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,48 @@
<html>
<head><style>
table { width: 600px; }
td.smallSpec { width: 100px; }
td.bigSpec { width: 500px; }
td.smallPct { width: 10%; }
td.bigPct { width: 90%; }
td.pink { background: pink; }
td.teal { background: teal; }
</style></head>
<body>
<h2>Other column fixed-width; two zero columns with colspan; explicit 0 width on span</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallSpec pink">100</td>
<td class="bigSpec teal"/>
</tr>
</table>
<h2>Other column percent-width; two zero columns with colspan; explicit 0 width on span</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallPct pink">10%</td>
<td class="bigPct teal"/>
</tr>
</table>
<h2>Other column fixed-width; zero-column explicitly zero-width; zero column spanned by colspan (crossing other column)</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="pink">100</td>
</tr>
</table>
<h2>Other column percent-width; zero-column explicitly zero-width; zero column spanned by colspan (crossing other column)</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="pink">10%</td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,51 @@
<html>
<head><style>
table { width: 600px; }
td.smallSpec { width: 100px; }
td.zeroSpec { width: 0px; }
td.smallPct { width: 10%; }
td.pink { background: pink; }
td.teal { background: teal; }
</style></head>
<body>
<h2>Other column fixed-width; two zero columns with colspan; explicit 0 width on span</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallSpec pink">100</td>
<td class="zeroSpec teal" colspan="2"/>
</tr>
</table>
<h2>Other column percent-width; two zero columns with colspan; explicit 0 width on span</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallPct pink">10%</td>
<td class="zeroSpec teal" colspan="2"/>
</tr>
</table>
<h2>Other column fixed-width; zero-column explicitly zero-width; zero column spanned by colspan (crossing other column)</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallSpec pink">100</td>
<td class="zeroSpec teal"/>
</tr>
<tr><td colspan="2"/></tr>
</table>
<h2>Other column percent-width; zero-column explicitly zero-width; zero column spanned by colspan (crossing other column)</h2>
<table cellspacing="0" cellpadding="0">
<tr>
<td class="smallPct pink">10%</td>
<td class="zeroSpec teal"/>
</tr>
<tr><td colspan="2"/></tr>
</table>
</body>
</html>

View File

@@ -708,6 +708,17 @@ random == 403134-1.html 403134-1-ref.html # bug 405377
== 412607-1b.html 412607-1-ref.html
== 412679-1.html 412679-1-ref.html
== 412679-2.html 412679-2-ref.html
== 413286-1a.html 413286-1-ref.html
== 413286-1b.html 413286-1-ref.html
== 413286-1c.html 413286-1-ref.html
== 413286-2a.html 413286-2-ref.html
== 413286-2b.html 413286-2-ref.html
== 413286-2c.html 413286-2-ref.html
== 413286-3.html 413286-3-ref.html
== 413286-4a.html 413286-4-ref.html
== 413286-4b.html 413286-4-ref.html
== 413286-5.html 413286-5-ref.html
== 413286-6.html 413286-6-ref.html
== 413292-1.html 413292-1-ref.html
== 413361-1.html 413361-1-ref.html
== 413840-background-unchanged.html 413840-background-unchanged-ref.html

View File

@@ -51,6 +51,20 @@ td { background: black; background: currentColor; }
<td style="color:blue" width="250">&nbsp;</td>
</tr></table>
<!-- width: 420px --><table><tr>
<td style="color:aqua" width="75">&nbsp;</td>
<td style="color:yellow" width="85">&nbsp;</td>
<td style="color:fuchsia" width="50">&nbsp;</td>
<td style="color:blue" width="210">&nbsp;</td>
</tr></table>
<!-- width: 400px --><table><tr>
<td style="color:aqua" width="60">&nbsp;</td>
<td style="color:yellow" width="80">&nbsp;</td>
<td style="color:fuchsia" width="60">&nbsp;</td>
<td style="color:blue" width="200">&nbsp;</td>
</tr></table>
<!-- width: 400px --><table><tr>
<td style="color:aqua" width="100">&nbsp;</td>
<td style="color:yellow" width="100">&nbsp;</td>

View File

@@ -57,10 +57,11 @@ span {
<td style="color:blue" width="50%"><span></span></td>
</tr></table>
<!-- XXXdholbert: Change "width: 0px" to width="0px" in next 2 cases -->
<table width="438"><tr>
<td style="color:aqua" width="75"><span></span>&#x200b;<span></span>&#x200b;<span></span></td>
<td style="color:yellow" width="25"><span></span></td>
<td style="color:red"></td>
<td style="color:red; width: 0px"></td>
<td style="color:fuchsia" width="50"><span></span></td>
<td style="color:blue" width="50%"><span></span></td>
</tr></table>
@@ -68,11 +69,25 @@ span {
<table width="418"><tr>
<td style="color:aqua" width="10%"><span></span></td>
<td style="color:yellow" width="10%"><span></span></td>
<td style="color:red"></td>
<td style="color:red; width: 0px"></td>
<td style="color:fuchsia" width="10%"><span></span></td>
<td style="color:blue" width="50%"><span></span></td>
</tr></table>
<table width="435"><tr>
<td style="color:aqua" width="75"><span></span>&#x200b;<span></span>&#x200b;<span></span></td>
<td style="color:yellow"></td>
<td style="color:fuchsia" width="50"><span></span></td>
<td style="color:blue" width="50%"><span></span></td>
</tr></table>
<table width="415"><tr>
<td style="color:aqua" width="15%"><span></span></td>
<td style="color:yellow"></td>
<td style="color:fuchsia" width="15%"><span></span></td>
<td style="color:blue" width="50%"><span></span></td>
</tr></table>
<table width="415"><tr>
<td style="color:aqua"></td>
<td style="color:yellow"></td>

View File

@@ -672,13 +672,17 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
* percent width have nonzero pref width, in proportion to pref
* width [total_flex_pref]
*
* b. otherwise, if any columns without percent width have nonzero
* b. (NOTE: this case is for BTLS_FINAL_WIDTH only) otherwise, if any
* columns without a specified coordinate width or percent width have
* zero pref width, equally between these [numNonSpecZeroWidthCols]
*
* c. otherwise, if any columns without percent width have nonzero
* pref width, in proportion to pref width [total_fixed_pref]
*
* c. otherwise, if any columns have nonzero percentage widths, in
* d. otherwise, if any columns have nonzero percentage widths, in
* proportion to the percentage widths [total_pct]
*
* d. otherwise, equally.
* e. otherwise, equally.
*/
// Loop #1 over the columns, to figure out the four values above so
@@ -692,6 +696,7 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
total_fixed_pref = 0;
float total_pct = 0.0f; // 0.0f to 1.0f
PRInt32 numInfiniteWidthCols = 0;
PRInt32 numNonSpecZeroWidthCols = 0;
PRInt32 col;
for (col = aFirstCol; col < aFirstCol + aColCount; ++col) {
@@ -713,7 +718,7 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
} else {
nscoord pref_width = colFrame->GetPrefCoord();
if (pref_width == nscoord_MAX) {
numInfiniteWidthCols++;
++numInfiniteWidthCols;
}
guess_pref = NSCoordSaturatingAdd(guess_pref, pref_width);
guess_min_pct += min_width;
@@ -725,6 +730,10 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
guess_min_spec = NSCoordSaturatingAdd(guess_min_spec, delta);
total_fixed_pref = NSCoordSaturatingAdd(total_fixed_pref,
pref_width);
} else if (pref_width == 0) {
if (aWidthType == BTLS_FINAL_WIDTH) {
++numNonSpecZeroWidthCols;
}
} else {
total_flex_pref = NSCoordSaturatingAdd(total_flex_pref,
pref_width);
@@ -739,9 +748,10 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
FLEX_FIXED_SMALL, // between (2) and (3) above
FLEX_FLEX_SMALL, // between (3) and (4) above
FLEX_FLEX_LARGE, // greater than (4) above, case (a)
FLEX_FIXED_LARGE, // greater than (4) above, case (b)
FLEX_PCT_LARGE, // greater than (4) above, case (c)
FLEX_ALL_LARGE // greater than (4) above, case (d)
FLEX_FLEX_LARGE_ZERO, // greater than (4) above, case (b)
FLEX_FIXED_LARGE, // greater than (4) above, case (c)
FLEX_PCT_LARGE, // greater than (4) above, case (d)
FLEX_ALL_LARGE // greater than (4) above, case (e)
};
Loop2Type l2t;
@@ -782,6 +792,12 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
if (total_flex_pref > 0) {
l2t = FLEX_FLEX_LARGE;
basis.c = total_flex_pref;
} else if (numNonSpecZeroWidthCols > 0) {
NS_ASSERTION(aWidthType == BTLS_FINAL_WIDTH,
"numNonSpecZeroWidthCols should only "
"be set when we're setting final width.");
l2t = FLEX_FLEX_LARGE_ZERO;
basis.c = numNonSpecZeroWidthCols;
} else if (total_fixed_pref > 0) {
l2t = FLEX_FIXED_LARGE;
basis.c = total_fixed_pref;
@@ -878,7 +894,7 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
if (numInfiniteWidthCols) {
if (colFrame->GetPrefCoord() == nscoord_MAX) {
c = c / float(numInfiniteWidthCols);
numInfiniteWidthCols--;
--numInfiniteWidthCols;
} else {
c = 0.0f;
}
@@ -908,6 +924,23 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
}
}
break;
case FLEX_FLEX_LARGE_ZERO:
NS_ASSERTION(aWidthType == BTLS_FINAL_WIDTH,
"FLEX_FLEX_LARGE_ZERO only should be hit "
"when we're setting final width.");
if (pct == 0.0f &&
!colFrame->GetHasSpecifiedCoord()) {
NS_ASSERTION(col_width == 0 &&
colFrame->GetPrefCoord() == 0,
"Since we're in FLEX_FLEX_LARGE_ZERO case, "
"all auto-width cols should have zero pref "
"width.");
float c = float(space) / float(basis.c);
col_width += NSToCoordRound(c);
--basis.c;
}
break;
case FLEX_FIXED_LARGE:
if (pct == 0.0f) {
NS_ASSERTION(col_width == colFrame->GetPrefCoord(),