From 36158ba5065c52eb911569d0474e3f08ad4dd9a9 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Tue, 19 Jan 1999 06:00:08 +0000 Subject: [PATCH] Changed it so the DidReflow() temporary hack doesn't apply to scrolled frames --- layout/generic/nsAreaFrame.cpp | 44 ++++++++++++++++------------ layout/html/base/src/nsAreaFrame.cpp | 44 ++++++++++++++++------------ 2 files changed, 52 insertions(+), 36 deletions(-) diff --git a/layout/generic/nsAreaFrame.cpp b/layout/generic/nsAreaFrame.cpp index 9ba4d89d8d34..acbe12b86a8d 100644 --- a/layout/generic/nsAreaFrame.cpp +++ b/layout/generic/nsAreaFrame.cpp @@ -317,26 +317,34 @@ nsAreaFrame::DidReflow(nsIPresContext& aPresContext, nsresult rv = nsBlockFrame::DidReflow(aPresContext, aStatus); if (NS_FRAME_REFLOW_FINISHED == aStatus) { - nsIView* view; - GetView(view); - // Size and position the view if requested - if (nsnull != view) { - // Position and size view relative to its parent, not relative to our - // parent frame (our parent frame may not have a view). - nsIView* parentWithView; - nsPoint origin; - GetOffsetFromView(origin, parentWithView); - nsIViewManager *vm; - view->GetViewManager(vm); + // XXX Not if we're being scrolled, because the scroll-frame handles + // this... + nsIAtom* pseudoType; + mStyleContext->GetPseudoType(pseudoType); + PRBool isScrolled = nsHTMLAtoms::scrolledContentPseudo == pseudoType; + NS_IF_RELEASE(pseudoType); - // Take into account any absolutely positioned children - nscoord xMost, yMost; - GetPositionedInfo(xMost, yMost); - - vm->ResizeView(view, PR_MAX(mRect.width, xMost), PR_MAX(mRect.height, yMost)); - vm->MoveViewTo(view, origin.x, origin.y); - NS_RELEASE(vm); + if (!isScrolled) { + nsIView* view; + GetView(view); + if (nsnull != view) { + // Position and size view relative to its parent, not relative to our + // parent frame (our parent frame may not have a view). + nsIView* parentWithView; + nsPoint origin; + GetOffsetFromView(origin, parentWithView); + nsIViewManager *vm; + view->GetViewManager(vm); + + // Take into account any absolutely positioned children + nscoord xMost, yMost; + GetPositionedInfo(xMost, yMost); + + vm->ResizeView(view, PR_MAX(mRect.width, xMost), PR_MAX(mRect.height, yMost)); + vm->MoveViewTo(view, origin.x, origin.y); + NS_RELEASE(vm); + } } } diff --git a/layout/html/base/src/nsAreaFrame.cpp b/layout/html/base/src/nsAreaFrame.cpp index 9ba4d89d8d34..acbe12b86a8d 100644 --- a/layout/html/base/src/nsAreaFrame.cpp +++ b/layout/html/base/src/nsAreaFrame.cpp @@ -317,26 +317,34 @@ nsAreaFrame::DidReflow(nsIPresContext& aPresContext, nsresult rv = nsBlockFrame::DidReflow(aPresContext, aStatus); if (NS_FRAME_REFLOW_FINISHED == aStatus) { - nsIView* view; - GetView(view); - // Size and position the view if requested - if (nsnull != view) { - // Position and size view relative to its parent, not relative to our - // parent frame (our parent frame may not have a view). - nsIView* parentWithView; - nsPoint origin; - GetOffsetFromView(origin, parentWithView); - nsIViewManager *vm; - view->GetViewManager(vm); + // XXX Not if we're being scrolled, because the scroll-frame handles + // this... + nsIAtom* pseudoType; + mStyleContext->GetPseudoType(pseudoType); + PRBool isScrolled = nsHTMLAtoms::scrolledContentPseudo == pseudoType; + NS_IF_RELEASE(pseudoType); - // Take into account any absolutely positioned children - nscoord xMost, yMost; - GetPositionedInfo(xMost, yMost); - - vm->ResizeView(view, PR_MAX(mRect.width, xMost), PR_MAX(mRect.height, yMost)); - vm->MoveViewTo(view, origin.x, origin.y); - NS_RELEASE(vm); + if (!isScrolled) { + nsIView* view; + GetView(view); + if (nsnull != view) { + // Position and size view relative to its parent, not relative to our + // parent frame (our parent frame may not have a view). + nsIView* parentWithView; + nsPoint origin; + GetOffsetFromView(origin, parentWithView); + nsIViewManager *vm; + view->GetViewManager(vm); + + // Take into account any absolutely positioned children + nscoord xMost, yMost; + GetPositionedInfo(xMost, yMost); + + vm->ResizeView(view, PR_MAX(mRect.width, xMost), PR_MAX(mRect.height, yMost)); + vm->MoveViewTo(view, origin.x, origin.y); + NS_RELEASE(vm); + } } }