Switched to using nsIScrollableView::GetScrollbarVisibility() to tell

whether the vertical scrollbar is currently showing


git-svn-id: svn://10.0.0.236/trunk@19412 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy%netscape.com 1999-02-03 04:30:57 +00:00
parent fe2a1595ea
commit 79891cd010
3 changed files with 18 additions and 25 deletions

View File

@ -164,17 +164,18 @@ ViewportFrame::ReflowFixedFrame(nsIPresContext& aPresContext,
}
// XXX Temporary hack until the block/inline code starts using 'computedWidth'
kidReflowState.availableWidth = kidReflowState.computedWidth;
nsMargin kidBorderPadding;
nsHTMLReflowState::ComputeBorderPaddingFor(aKidFrame, &aReflowState, kidBorderPadding);
kidReflowState.availableWidth = kidReflowState.computedWidth +
kidBorderPadding.left + kidBorderPadding.right;
htmlReflow->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus);
// XXX If the child had a fixed height, then make sure it respected it...
if (NS_AUTOHEIGHT != kidReflowState.computedHeight) {
if (kidDesiredSize.height < kidReflowState.computedHeight) {
kidDesiredSize.height = kidReflowState.computedHeight;
nsMargin borderPadding;
nsHTMLReflowState::ComputeBorderPaddingFor(aKidFrame, &aReflowState, borderPadding);
kidDesiredSize.height += borderPadding.top + borderPadding.bottom;
kidDesiredSize.height += kidBorderPadding.top + kidBorderPadding.bottom;
}
}

View File

@ -303,21 +303,12 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext,
// Note: an important but subtle point is that for incremental reflow
// we must give the frame being reflowed the same amount of available
// width; otherwise, it's not only just an incremental reflow but also
// a resize reflow
nsSize oldScrollSize(mRect.width, mRect.height);
nsSize kidSize;
kidFrame->GetSize(kidSize);
oldScrollSize.width -= border.left + border.right;
oldScrollSize.height -= border.top + border.bottom;
if (kidSize.width > oldScrollSize.width) {
// Horizontal scrollbar is showing
oldScrollSize.height -= NSToCoordRound(sbHeight);
}
if (kidSize.height > oldScrollSize.height) {
roomForVerticalScrollbar = PR_TRUE;
nsIScrollableView* scrollingView;
nsIView* view;
GetView(view);
if (NS_SUCCEEDED(view->QueryInterface(kScrollViewIID, (void**)&scrollingView))) {
PRBool unused;
scrollingView->GetScrollbarVisibility(&roomForVerticalScrollbar, &unused);
}
}

View File

@ -164,17 +164,18 @@ ViewportFrame::ReflowFixedFrame(nsIPresContext& aPresContext,
}
// XXX Temporary hack until the block/inline code starts using 'computedWidth'
kidReflowState.availableWidth = kidReflowState.computedWidth;
nsMargin kidBorderPadding;
nsHTMLReflowState::ComputeBorderPaddingFor(aKidFrame, &aReflowState, kidBorderPadding);
kidReflowState.availableWidth = kidReflowState.computedWidth +
kidBorderPadding.left + kidBorderPadding.right;
htmlReflow->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus);
// XXX If the child had a fixed height, then make sure it respected it...
if (NS_AUTOHEIGHT != kidReflowState.computedHeight) {
if (kidDesiredSize.height < kidReflowState.computedHeight) {
kidDesiredSize.height = kidReflowState.computedHeight;
nsMargin borderPadding;
nsHTMLReflowState::ComputeBorderPaddingFor(aKidFrame, &aReflowState, borderPadding);
kidDesiredSize.height += borderPadding.top + borderPadding.bottom;
kidDesiredSize.height += kidBorderPadding.top + kidBorderPadding.bottom;
}
}