Propagate |aRemoveOnlyFluidContinuations| when removing continuations in other blocks. b=405178 r+sr=roc a=mtschrep

This commit is contained in:
mats.palmgren@bredband.net 2007-12-01 02:47:58 -08:00
Родитель bd2f7d1b28
Коммит 407868a9b3
3 изменённых файлов: 62 добавлений и 5 удалений

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

@ -5229,7 +5229,8 @@ nsBlockInFlowLineIterator::Prev()
}
}
static nsresult RemoveBlockChild(nsIFrame* aFrame, PRBool aDestroyFrames)
static nsresult RemoveBlockChild(nsIFrame* aFrame, PRBool aDestroyFrames,
PRBool aRemoveOnlyFluidContinuations)
{
if (!aFrame)
return NS_OK;
@ -5238,7 +5239,8 @@ static nsresult RemoveBlockChild(nsIFrame* aFrame, PRBool aDestroyFrames)
NS_ASSERTION(nextBlock->GetType() == nsGkAtoms::blockFrame ||
nextBlock->GetType() == nsGkAtoms::areaFrame,
"Our child's continuation's parent is not a block?");
return nextBlock->DoRemoveFrame(aFrame, aDestroyFrames);
return nextBlock->DoRemoveFrame(aFrame, aDestroyFrames,
aRemoveOnlyFluidContinuations);
}
// This function removes aDeletedFrame and all its continuations. It
@ -5295,7 +5297,8 @@ nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, PRBool aDestroyFrames,
} else {
aDeletedFrame->SetNextSibling(nsnull);
}
return RemoveBlockChild(nif, aDestroyFrames);
return RemoveBlockChild(nif, aDestroyFrames,
aRemoveOnlyFluidContinuations);
}
}
@ -5455,7 +5458,8 @@ found_frame:;
// Continuations for placeholder frames don't always appear in
// consecutive lines. So for placeholders, just continue the slow easy way.
if (isPlaceholder) {
return RemoveBlockChild(deletedNextContinuation, aDestroyFrames);
return RemoveBlockChild(deletedNextContinuation, aDestroyFrames,
aRemoveOnlyFluidContinuations);
}
// See if we should keep looking in the current flow's line list.
@ -5504,7 +5508,8 @@ found_frame:;
#endif
// Advance to next flow block if the frame has more continuations
return RemoveBlockChild(aDeletedFrame, aDestroyFrames);
return RemoveBlockChild(aDeletedFrame, aDestroyFrames,
aRemoveOnlyFluidContinuations);
}
nsresult

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

@ -57,6 +57,7 @@ _TEST_FILES = test_bug288789.html \
test_bug394173.html \
test_bug394239.html \
test_bug402380.html \
test_bug405178.html \
test_character_movement.html \
test_word_movement.html \
$(NULL)

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

@ -0,0 +1,51 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=405178
-->
<head>
<title>Test for Bug 405178</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=405178">Mozilla Bug 405178</a>
<p id="display"><div id="div" style="-moz-column-width: 10px;">&#23377;&#1741; </div></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 405178 **/
var div, textNode;
function boom()
{
div = document.getElementById("div");
textNode = div.firstChild;
div.removeChild(textNode);
setTimeout(boom2, 200);
}
function boom2()
{
textNode.data = "";
div.appendChild(document.createTextNode("X"))
var foo = document.body.offsetHeight;
ok(true, "Test is successful if we get here without crashing");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(boom);
</script>
</pre>
</body>
</html>