Bug 428521: Allow DistributeWidthToColumns to complete BTLS_PREF_WIDTH runs in situations with guess_min < aWidth <= guess_pref. (Reverts optimization from 368504 in which I'd thought that a run with aWidth <= guess_pref would be skippable) r+sr=dbaron a=beltzner

git-svn-id: svn://10.0.0.236/trunk@250759 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dholbert%cs.stanford.edu
2008-04-24 18:48:35 +00:00
parent 7eb8d2da28
commit 9beb2ed862
6 changed files with 116 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
<html>
<head>
<style>
body { margin: 0; }
div.a, div.b { display: inline-block; }
div.a { width: 200px; background: blue; }
div.b { width: 200px; background: green; }
td.c { width: 75%; background: orange; }
div.d { width: 100px; background: purple; }
</style>
</head>
<body>
The blue and green divs should be on the same line.
<table cellspacing=0 cellpadding=0>
<tr><td>
<table cellspacing=0 cellpadding=0>
<tr>
<td colspan="2"><div class="a">a</div><div class="b">b</div></td>
</tr>
<tr>
<td class="c">c</td>
<td><div class="d">d</div></td>
</tr>
</table>
</td></tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,28 @@
<html>
<head>
<style>
body { margin: 0; }
div.a, div.b { display: inline-block; }
div.a { width: 200px; background: blue; }
div.b { width: 200px; background: green; }
td.c { width: 75.1%; background: orange; }
div.d { width: 100px; background: purple; }
</style>
</head>
<body>
The blue and green divs should be on the same line.
<table cellspacing=0 cellpadding=0>
<tr><td>
<table cellspacing=0 cellpadding=0>
<tr>
<td colspan="2"><div class="a">a</div><div class="b">b</div></td>
</tr>
<tr>
<td class="c">c</td>
<td><div class="d">d</div></td>
</tr>
</table>
</td></tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,28 @@
<html>
<head>
<style>
body { margin: 0; }
div.a, div.b { display: inline-block; }
div.a { width: 200px; background: blue; }
div.b { width: 200px; background: green; }
td.c { width: 80%; background: orange; }
div.d { width: 100px; background: purple; }
</style>
</head>
<body>
The blue and green divs should be on the same line.
<table cellspacing=0 cellpadding=0>
<tr><td>
<table cellspacing=0 cellpadding=0>
<tr>
<td colspan="2"><div class="a">a</div><div class="b">b</div></td>
</tr>
<tr>
<td class="c">c</td>
<td><div class="d">d</div></td>
</tr>
</table>
</td></tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,28 @@
<html>
<head>
<style>
body { margin: 0; }
div.a, div.b { display: inline-block; }
div.a { width: 200px; background: blue; }
div.b { width: 200px; background: green; }
td.c { width: 100%; background: orange; }
div.d { width: 100px; background: purple; }
</style>
</head>
<body>
The blue and green divs should be on the same line.
<table cellspacing=0 cellpadding=0>
<tr><td>
<table cellspacing=0 cellpadding=0>
<tr>
<td colspan="2"><div class="a">a</div><div class="b">b</div></td>
</tr>
<tr>
<td class="c">c</td>
<td><div class="d">d</div></td>
</tr>
</table>
</td></tr>
</table>
</body>
</html>

View File

@@ -812,5 +812,8 @@ fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 424074-1-ref2.xul 424074-1-ref3.xul
== 427730-1.html 427730-1-ref.html
== 428423-1a.html 428423-1-ref.html
== 428423-1b.html 428423-1-ref.html
== 428521-1a.html 428521-1-ref.html
== 428521-1b.html 428521-1-ref.html
== 428521-1c.html 428521-1-ref.html
== 430412-1.html 430412-1-ref.html

View File

@@ -774,8 +774,7 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
float f;
} basis; // the sum of the statistic over columns to divide it
if (aWidth < guess_pref) {
if ((aWidthType == BTLS_MIN_WIDTH && aWidth <= guess_min) ||
(aWidthType == BTLS_PREF_WIDTH && aWidth <= guess_pref)) {
if (aWidthType != BTLS_FINAL_WIDTH && aWidth <= guess_min) {
// Return early -- we don't have any extra space to distribute.
return;
}