Bug 806964 - Stop calling UpdateOverflow on frames that are scheduled to be reflowed. r=roc.

This commit is contained in:
Jonathan Watt 2012-10-31 04:10:47 +00:00
parent 7ef5e107ca
commit 8bee0afef8

View File

@ -8221,38 +8221,46 @@ nsCSSFrameConstructor::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
for ( ; childFrame; childFrame = childFrame->GetNextSibling()) {
NS_ABORT_IF_FALSE(childFrame->IsFrameOfType(nsIFrame::eSVG),
"Not expecting non-SVG children");
childFrame->UpdateOverflow();
if (!(childFrame->GetStateBits() &
(NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN))) {
childFrame->UpdateOverflow();
}
NS_ASSERTION(!nsLayoutUtils::GetNextContinuationOrSpecialSibling(childFrame),
"SVG frames should not have continuations or special siblings");
NS_ASSERTION(childFrame->GetParent() == frame,
"SVG child frame not expected to have different parent");
}
}
while (frame) {
nsOverflowAreas* pre = static_cast<nsOverflowAreas*>
(frame->Properties().Get(frame->PreTransformOverflowAreasProperty()));
if (pre) {
// FinishAndStoreOverflow will change the overflow areas passed in,
// so make a copy.
nsOverflowAreas overflowAreas = *pre;
frame->FinishAndStoreOverflow(overflowAreas, frame->GetSize());
} else {
frame->UpdateOverflow();
}
// If |frame| is dirty or has dirty children, we don't bother updating
// overflows since that will happen when it's reflowed.
if (!(frame->GetStateBits() &
(NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN))) {
while (frame) {
nsOverflowAreas* pre = static_cast<nsOverflowAreas*>
(frame->Properties().Get(frame->PreTransformOverflowAreasProperty()));
if (pre) {
// FinishAndStoreOverflow will change the overflow areas passed in,
// so make a copy.
nsOverflowAreas overflowAreas = *pre;
frame->FinishAndStoreOverflow(overflowAreas, frame->GetSize());
} else {
frame->UpdateOverflow();
}
nsIFrame* next =
nsLayoutUtils::GetNextContinuationOrSpecialSibling(frame);
// Update the ancestors' overflow after we have updated the overflow
// for all the continuations with the same parent.
if (!next || frame->GetParent() != next->GetParent()) {
for (nsIFrame* ancestor = frame->GetParent(); ancestor;
ancestor = ancestor->GetParent()) {
if (!ancestor->UpdateOverflow()) {
break;
nsIFrame* next =
nsLayoutUtils::GetNextContinuationOrSpecialSibling(frame);
// Update the ancestors' overflow after we have updated the overflow
// for all the continuations with the same parent.
if (!next || frame->GetParent() != next->GetParent()) {
for (nsIFrame* ancestor = frame->GetParent(); ancestor;
ancestor = ancestor->GetParent()) {
if (!ancestor->UpdateOverflow()) {
break;
}
}
}
frame = next;
}
frame = next;
}
}
if (hint & nsChangeHint_UpdateCursor) {