diff --git a/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp b/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp index bedaceecd9d..343cbbef98e 100644 --- a/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp @@ -1473,14 +1473,11 @@ nsListboxScrollPortFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState, nsSize& outer->GetContent()->GetAttr(kNameSpaceID_None, nsXULAtoms::sizemode, sizeMode); if (!sizeMode.IsEmpty()) { nsCOMPtr 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 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); diff --git a/mozilla/layout/xul/base/src/nsMenuFrame.cpp b/mozilla/layout/xul/base/src/nsMenuFrame.cpp index 4b843eddce3..16540a561f9 100644 --- a/mozilla/layout/xul/base/src/nsMenuFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuFrame.cpp @@ -1007,23 +1007,18 @@ nsMenuFrame::DoLayout(nsBoxLayoutState& aState) ibox->GetBounds(bounds); nsCOMPtr scrollframe(do_QueryInterface(child)); - if (scrollframe) { - nsIScrollableFrame::nsScrollPref pref; - scrollframe->GetScrollPreference(aState.PresContext(), &pref); + if (scrollframe && + scrollframe->GetScrollbarStyles().mVertical == NS_STYLE_OVERFLOW_AUTO) { + if (bounds.height < prefSize.height) { + // layout the child + ibox->Layout(aState); - if (pref == nsIScrollableFrame::Auto) - { - if (bounds.height < prefSize.height) { - // layout the child - ibox->Layout(aState); - - nsMargin scrollbars = scrollframe->GetActualScrollbarSizes(); - if (bounds.width < prefSize.width + scrollbars.left + scrollbars.right) - { - bounds.width += scrollbars.left + scrollbars.right; - //printf("Width=%d\n",width); - ibox->SetBounds(aState, bounds); - } + nsMargin scrollbars = scrollframe->GetActualScrollbarSizes(); + if (bounds.width < prefSize.width + scrollbars.left + scrollbars.right) + { + bounds.width += scrollbars.left + scrollbars.right; + //printf("Width=%d\n",width); + ibox->SetBounds(aState, bounds); } } } diff --git a/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp b/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp index 6ea75394467..954e8f76a62 100644 --- a/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp +++ b/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp @@ -252,24 +252,19 @@ nsPopupSetFrame::DoLayout(nsBoxLayoutState& aState) ibox->GetBounds(bounds); nsCOMPtr scrollframe = do_QueryInterface(child); - if (scrollframe) { - nsIScrollableFrame::nsScrollPref pref; - scrollframe->GetScrollPreference(aState.PresContext(), &pref); + if (scrollframe && + scrollframe->GetScrollbarStyles().mVertical == NS_STYLE_OVERFLOW_AUTO) { + // if our pref height + if (bounds.height < prefSize.height) { + // layout the child + ibox->Layout(aState); - if (pref == nsIScrollableFrame::Auto) - { - // if our pref height - if (bounds.height < prefSize.height) { - // layout the child - ibox->Layout(aState); - - nsMargin scrollbars = scrollframe->GetActualScrollbarSizes(); - if (bounds.width < prefSize.width + scrollbars.left + scrollbars.right) - { - bounds.width += scrollbars.left + scrollbars.right; - //printf("Width=%d\n",width); - ibox->SetBounds(aState, bounds); - } + nsMargin scrollbars = scrollframe->GetActualScrollbarSizes(); + if (bounds.width < prefSize.width + scrollbars.left + scrollbars.right) + { + bounds.width += scrollbars.left + scrollbars.right; + //printf("Width=%d\n",width); + ibox->SetBounds(aState, bounds); } } }