Changed it so the DidReflow() temporary hack doesn't apply to scrolled

frames
This commit is contained in:
troy%netscape.com 1999-01-19 06:00:08 +00:00
Родитель a38286a6c5
Коммит ba9186df33
2 изменённых файлов: 52 добавлений и 36 удалений

Просмотреть файл

@ -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);
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);
vm->ResizeView(view, PR_MAX(mRect.width, xMost), PR_MAX(mRect.height, yMost));
vm->MoveViewTo(view, origin.x, origin.y);
NS_RELEASE(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);
}
}
}

Просмотреть файл

@ -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);
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);
vm->ResizeView(view, PR_MAX(mRect.width, xMost), PR_MAX(mRect.height, yMost));
vm->MoveViewTo(view, origin.x, origin.y);
NS_RELEASE(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);
}
}
}