Bug 421239: Remove broken/brittle optimization of guessing (incorrectly) whether a line might be empty, when we're determining whether we need to mark next line's margin as dirty. r+sr=roc, a=blocking1.9+

This commit is contained in:
dholbert@cs.stanford.edu 2008-03-14 00:21:15 -07:00
Родитель 78178bc5a7
Коммит e814a3b8d1
5 изменённых файлов: 65 добавлений и 1 удалений

Просмотреть файл

@ -1918,7 +1918,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
// to the result of nextLine->ShouldApplyTopMargin.
if (line.next() != end_lines()) {
PRBool maybeWasEmpty = oldY == line.next()->mBounds.y;
PRBool isEmpty = line->mBounds.width == 0 && line->CachedIsEmpty();
PRBool isEmpty = line->CachedIsEmpty();
if (maybeReflowingForFirstTime /*1*/ ||
(isEmpty || maybeWasEmpty) /*2/3/4*/) {
line.next()->MarkPreviousMarginDirty();

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<style>
div#a { margin: 100px 0px 100px 0px; }
</style>
</head>
<body>
<div id="a"></div>
<div>b</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
div#a { margin: 100px 0px 100px 0px; }
</style>
<script>
function boom()
{
var a = document.getElementById("a");
a.removeChild(a.firstChild);
document.documentElement.className = "";
}
</script>
</head>
<body onload="boom();">
<div id="a">a</div>
<div>b</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<style>
div#a { margin: 0px 0px 100px 0px; }
</style>
</head>
<body>
<div id="a"></div>
<div>b</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
div#a { margin: 0px 0px 100px 0px; }
</style>
<script>
function boom()
{
var a = document.getElementById("a");
a.removeChild(a.firstChild);
document.documentElement.className = "";
}
</script>
</head>
<body onload="boom();">
<div id="a">a</div>
<div>b</div>
</body>
</html>