From 37a9603e3b42bdbc06ae07e8e6b9eba3b281ea72 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Thu, 23 Jul 1998 20:19:05 +0000 Subject: [PATCH] Moved cde that does damage repair for a resize reflow from the body to the root content frame --- layout/html/base/src/nsBodyFrame.cpp | 15 ++++----------- layout/html/base/src/nsRootPart.cpp | 6 +++--- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/layout/html/base/src/nsBodyFrame.cpp b/layout/html/base/src/nsBodyFrame.cpp index 4f46a38419de..190428d26405 100644 --- a/layout/html/base/src/nsBodyFrame.cpp +++ b/layout/html/base/src/nsBodyFrame.cpp @@ -242,16 +242,9 @@ NS_METHOD nsBodyFrame::Reflow(nsIPresContext& aPresContext, ComputeDesiredSize(desiredRect, rsp->maxSize, borderPadding, aDesiredSize); // Decide how much to repaint based on the reflow type. - // Note: we don't have to handle the initial reflow case, because that's - // handled by the root content frame - switch (rsp->reason) { - case eReflowReason_Resize: - // For a resize just repaint the entire frame - damageArea.width = aDesiredSize.width; - damageArea.height = aDesiredSize.height; - break; - - case eReflowReason_Incremental: + // Note: we don't have to handle the initial reflow case and the resize reflow + // case, because they're handled by the root content frame + if (eReflowReason_Incremental == rsp->reason) { // For append reflow commands that target the body just repaint the newly // added part of the frame. if ((nsIReflowCommand::FrameAppended == reflowCmdType) && @@ -260,7 +253,7 @@ NS_METHOD nsBodyFrame::Reflow(nsIPresContext& aPresContext, damageArea.y = kidOldRect.YMost(); damageArea.width = aDesiredSize.width; damageArea.height = aDesiredSize.height - kidOldRect.height; - + } else { // Ideally the frame that is the target of the reflow command (or its parent // frame) would generate a damage rect, but since none of the frame classes diff --git a/layout/html/base/src/nsRootPart.cpp b/layout/html/base/src/nsRootPart.cpp index 048c143913eb..1c9822e763a5 100644 --- a/layout/html/base/src/nsRootPart.cpp +++ b/layout/html/base/src/nsRootPart.cpp @@ -443,9 +443,9 @@ NS_METHOD RootContentFrame::Reflow(nsIPresContext& aPresContext, nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height); mFirstChild->SetRect(rect); - // If this is the initial reflow of the child then repaint the entire - // visible area - if (eReflowReason_Initial == reflowReason) { + // For initial reflow and resize reflow repaint the entire visible area + if ((eReflowReason_Initial == reflowReason) || + (eReflowReason_Resize == aReflowState.reason)) { Invalidate(nsRect(0, 0, aReflowState.maxSize.width, aReflowState.maxSize.height)); } }