From 11fba76f602eeb58815d4c3976e0537f86918930 Mon Sep 17 00:00:00 2001 From: kipp Date: Tue, 30 Jun 1998 20:22:44 +0000 Subject: [PATCH] Use new PropagateContentOffsets API --- layout/generic/nsPageFrame.cpp | 10 ++++++---- layout/html/base/src/nsPageFrame.cpp | 10 ++++++---- layout/html/table/src/nsTableOuterFrame.cpp | 6 +++++- layout/tables/nsTableOuterFrame.cpp | 6 +++++- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp index 426474c3255..ab07ac7ddaf 100644 --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -54,10 +54,6 @@ void nsPageFrame::CreateFirstChild(nsIPresContext* aPresContext) mChildCount = 1; mFirstContentOffset = i; mLastContentOffset = i; - - // We are always a pseudo-frame; make sure our content offset is - // properly pushed upwards - PropagateContentOffsets(); } NS_RELEASE(cd); } @@ -169,6 +165,12 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext, aDesiredSize.height = aReflowState.maxSize.height; } + // We are always a pseudo-frame; make sure our content offset is + // properly pushed upwards + nsContainerFrame* parent = (nsContainerFrame*) mGeometricParent; + parent->PropagateContentOffsets(this, mFirstContentOffset, + mLastContentOffset, mLastContentIsComplete); + #ifdef NS_DEBUG PostReflowCheck(aStatus); #endif diff --git a/layout/html/base/src/nsPageFrame.cpp b/layout/html/base/src/nsPageFrame.cpp index 426474c3255..ab07ac7ddaf 100644 --- a/layout/html/base/src/nsPageFrame.cpp +++ b/layout/html/base/src/nsPageFrame.cpp @@ -54,10 +54,6 @@ void nsPageFrame::CreateFirstChild(nsIPresContext* aPresContext) mChildCount = 1; mFirstContentOffset = i; mLastContentOffset = i; - - // We are always a pseudo-frame; make sure our content offset is - // properly pushed upwards - PropagateContentOffsets(); } NS_RELEASE(cd); } @@ -169,6 +165,12 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext, aDesiredSize.height = aReflowState.maxSize.height; } + // We are always a pseudo-frame; make sure our content offset is + // properly pushed upwards + nsContainerFrame* parent = (nsContainerFrame*) mGeometricParent; + parent->PropagateContentOffsets(this, mFirstContentOffset, + mLastContentOffset, mLastContentIsComplete); + #ifdef NS_DEBUG PostReflowCheck(aStatus); #endif diff --git a/layout/html/table/src/nsTableOuterFrame.cpp b/layout/html/table/src/nsTableOuterFrame.cpp index 009953f7c07..95de24f9ebd 100644 --- a/layout/html/table/src/nsTableOuterFrame.cpp +++ b/layout/html/table/src/nsTableOuterFrame.cpp @@ -1491,7 +1491,11 @@ PRBool nsTableOuterFrame::DeleteChildsNextInFlow(nsIFrame* aChild) if (nsnull != parent->mFirstChild) { parent->SetFirstContentOffset(parent->mFirstChild); if (parent->IsPseudoFrame()) { - parent->PropagateContentOffsets(); + // Tell the parent's parent to update its content offsets + nsContainerFrame* pp = (nsContainerFrame*) parent->mGeometricParent; + pp->PropagateContentOffsets(parent, parent->mFirstContentOffset, + parent->mLastContentOffset, + parent->mLastContentIsComplete); } } diff --git a/layout/tables/nsTableOuterFrame.cpp b/layout/tables/nsTableOuterFrame.cpp index 009953f7c07..95de24f9ebd 100644 --- a/layout/tables/nsTableOuterFrame.cpp +++ b/layout/tables/nsTableOuterFrame.cpp @@ -1491,7 +1491,11 @@ PRBool nsTableOuterFrame::DeleteChildsNextInFlow(nsIFrame* aChild) if (nsnull != parent->mFirstChild) { parent->SetFirstContentOffset(parent->mFirstChild); if (parent->IsPseudoFrame()) { - parent->PropagateContentOffsets(); + // Tell the parent's parent to update its content offsets + nsContainerFrame* pp = (nsContainerFrame*) parent->mGeometricParent; + pp->PropagateContentOffsets(parent, parent->mFirstContentOffset, + parent->mLastContentOffset, + parent->mLastContentIsComplete); } }