Backout changeset f568fc280fb0 (bug 539356) because of performance and correctness regressions
This commit is contained in:
@@ -559,6 +559,11 @@ void nsTableCellFrame::VerticallyAlignChild(nscoord aMaxAscent)
|
||||
// if the content is larger than the cell height align from top
|
||||
kidYTop = NS_MAX(0, kidYTop);
|
||||
|
||||
if (kidYTop != kidRect.y) {
|
||||
// Invalidate at the old position first
|
||||
firstKid->InvalidateFrameSubtree();
|
||||
}
|
||||
|
||||
firstKid->SetPosition(nsPoint(kidRect.x, kidYTop));
|
||||
nsHTMLReflowMetrics desiredSize;
|
||||
desiredSize.width = mRect.width;
|
||||
@@ -573,6 +578,9 @@ void nsTableCellFrame::VerticallyAlignChild(nscoord aMaxAscent)
|
||||
// Make sure any child views are correctly positioned. We know the inner table
|
||||
// cell won't have a view
|
||||
nsContainerFrame::PositionChildViews(firstKid);
|
||||
|
||||
// Invalidate new overflow rect
|
||||
firstKid->InvalidateFrameSubtree();
|
||||
}
|
||||
if (HasView()) {
|
||||
nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this,
|
||||
@@ -863,6 +871,9 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
nsPoint kidOrigin(leftInset, topInset);
|
||||
nsRect origRect = firstKid->GetRect();
|
||||
nsRect origVisualOverflow = firstKid->GetVisualOverflowRect();
|
||||
bool firstReflow = (firstKid->GetStateBits() & NS_FRAME_FIRST_REFLOW) != 0;
|
||||
|
||||
ReflowChild(firstKid, aPresContext, kidSize, kidReflowState,
|
||||
kidOrigin.x, kidOrigin.y, NS_FRAME_INVALIDATE_ON_MOVE, aStatus);
|
||||
@@ -873,6 +884,11 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
printf("Set table cell incomplete %p\n", static_cast<void*>(this));
|
||||
}
|
||||
|
||||
// XXXbz is this invalidate actually needed, really?
|
||||
if (GetStateBits() & NS_FRAME_IS_DIRTY) {
|
||||
InvalidateFrameSubtree();
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
DebugCheckChildSize(firstKid, kidSize, availSize);
|
||||
#endif
|
||||
@@ -892,6 +908,9 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
FinishReflowChild(firstKid, aPresContext, &kidReflowState, kidSize,
|
||||
kidOrigin.x, kidOrigin.y, 0);
|
||||
|
||||
nsTableFrame::InvalidateFrame(firstKid, origRect, origVisualOverflow,
|
||||
firstReflow);
|
||||
|
||||
// first, compute the height which can be set w/o being restricted by aMaxSize.height
|
||||
nscoord cellHeight = kidSize.height;
|
||||
|
||||
@@ -924,6 +943,12 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
// If our parent is in initial reflow, it'll handle invalidating our
|
||||
// entire overflow rect.
|
||||
if (!(GetParent()->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
CheckInvalidateSizeChange(aDesiredSize);
|
||||
}
|
||||
|
||||
// remember the desired size for this reflow
|
||||
SetDesiredSize(aDesiredSize);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user