Land bug 72747 in pieces: convert users of nsIScrollableFrame::GetScrollPreference to using GetScrollbarStyles. b=72747 r+sr=roc

git-svn-id: svn://10.0.0.236/trunk@161686 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org
2004-09-03 00:43:46 +00:00
parent 18e0ba9e7a
commit 6d37b0243d
3 changed files with 32 additions and 49 deletions

View File

@@ -1473,14 +1473,11 @@ nsListboxScrollPortFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState, nsSize&
outer->GetContent()->GetAttr(kNameSpaceID_None, nsXULAtoms::sizemode, sizeMode);
if (!sizeMode.IsEmpty()) {
nsCOMPtr<nsIScrollableFrame> scrollFrame(do_QueryInterface(mParent));
if (scrollFrame) {
nsIScrollableFrame::nsScrollPref scrollPref;
scrollFrame->GetScrollPreference(aBoxLayoutState.PresContext(), &scrollPref);
if (scrollPref == nsIScrollableFrame::Auto) {
nsMargin scrollbars = scrollFrame->GetDesiredScrollbarSizes(&aBoxLayoutState);
aSize.width += scrollbars.left + scrollbars.right;
}
if (scrollFrame &&
scrollFrame->GetScrollbarStyles().mVertical == NS_STYLE_OVERFLOW_AUTO) {
nsMargin scrollbars =
scrollFrame->GetDesiredScrollbarSizes(&aBoxLayoutState);
aSize.width += scrollbars.left + scrollbars.right;
}
}
else aSize.width = 0;
@@ -1510,14 +1507,10 @@ nsListboxScrollPortFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState, nsSize&
aSize.height = size*outer->GetRowHeightTwips();
nsCOMPtr<nsIScrollableFrame> scrollFrame(do_QueryInterface(mParent));
if (scrollFrame) {
nsIScrollableFrame::nsScrollPref scrollPref;
scrollFrame->GetScrollPreference(aBoxLayoutState.PresContext(), &scrollPref);
if (scrollPref == nsIScrollableFrame::Auto) {
nsMargin scrollbars = scrollFrame->GetDesiredScrollbarSizes(&aBoxLayoutState);
aSize.width += scrollbars.left + scrollbars.right;
}
if (scrollFrame &&
scrollFrame->GetScrollbarStyles().mVertical == NS_STYLE_OVERFLOW_AUTO) {
nsMargin scrollbars = scrollFrame->GetDesiredScrollbarSizes(&aBoxLayoutState);
aSize.width += scrollbars.left + scrollbars.right;
}
AddMargin(child, aSize);