Avoid calling PlaceBlock and unsetting dirty bits that we still need when an ancestor is going to reflow for clearance. (Bug 476357) r+sr=roc

This commit is contained in:
L. David Baron 2009-02-09 20:36:54 -08:00
Родитель 1f7513a161
Коммит 9122459f14
4 изменённых файлов: 36 добавлений и 0 удалений

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

@ -3009,6 +3009,17 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
aState.mPrevBottomMargin = incomingMargin;
continue;
}
if (blockHtmlRS.WillReflowAgainForClearance()) {
// If an ancestor of ours is going to reflow for clearance, we
// need to avoid calling PlaceBlock, because it unsets dirty bits
// on the child block (both itself, and through its call to
// nsFrame::DidReflow), and those dirty bits imply dirtiness for
// all of the child block, including the lines it didn't reflow.
NS_ASSERTION(originalPosition == frame->GetPosition(),
"we need to call PositionChildViews");
return NS_OK;
}
aState.mPrevChild = frame;

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

@ -0,0 +1,8 @@
<!DOCTYPE HTML>
<title>Testcase, bug 476357</title>
<div style="font-size: 30px;">
<div style="float: right; height: 1px"></div>
<div style="clear:both">.</div>
<!-- We never give the following div a reflow with NS_FRAME_IS_DIRTY -->
<div>Text<span>Text</span></div>
</div>

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

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<title>Testcase, bug 476357</title>
<div style="font-size: 10px;" id="page">
<div style="float: right; height: 1px"></div>
<div style="clear:both">.</div>
<!-- We never give the following div a reflow with NS_FRAME_IS_DIRTY -->
<div>Text<span>Text</span></div>
</div>
<script type="text/javascript">
function run() {
document.getElementById('page').style.fontSize='30px';
document.documentElement.removeAttribute("class");
}
setTimeout(run, 0);
</script>

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

@ -1072,6 +1072,7 @@ fails == 461512-1.html 461512-1-ref.html # Bug 461512
== 476063-2.html 476063-2-ref.html
!= 476063-3.html 476063-3-ref.html
== 476063-4.xhtml 476063-4-ref.xhtml
== 476357-1.html 476357-1-ref.html
== 476598-1a.html 476598-1-ref.html
== 476598-1a.html 476598-1-ref2.html
== 476598-1b.html 476598-1-ref.html