diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index f123d41641b..96e0f9d82c4 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -1045,6 +1045,9 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext, } } + const nsStyleVisibility* vis; + GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis); + #ifdef IBMBIDI // Retrieve the scrollbar's width and height float sbWidth = 0.0; @@ -1055,9 +1058,6 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext, // Convert to nscoord's by rounding nscoord scrollbarWidth = NSToCoordRound(sbWidth); - const nsStyleVisibility* vis; - GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis); - if (vis->mDirection == NS_STYLE_DIRECTION_RTL) { nscoord bidiScrolledAreaWidth = scrolledAreaDesiredSize.maxElementSize->width; firstPassState.reason = eReflowReason_StyleChange; @@ -1103,6 +1103,16 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext, aDesiredSize.maxElementSize->height = aDesiredSize.height; } + // Set the visibility of the scrollbars + // although this may "turn on" both scrollbars everythime + // they do get adjusted back and show correctly + nsIScrollableView* scrollableView; + GetScrollableView(scrollableView); + if (scrollableView) { + PRBool isVis = vis->IsVisible(); + scrollableView->SetScrollbarVisibility(isVis, isVis); + } + aStatus = NS_FRAME_COMPLETE; #ifdef DEBUG_rodsX diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index f123d41641b..96e0f9d82c4 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -1045,6 +1045,9 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext, } } + const nsStyleVisibility* vis; + GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis); + #ifdef IBMBIDI // Retrieve the scrollbar's width and height float sbWidth = 0.0; @@ -1055,9 +1058,6 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext, // Convert to nscoord's by rounding nscoord scrollbarWidth = NSToCoordRound(sbWidth); - const nsStyleVisibility* vis; - GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis); - if (vis->mDirection == NS_STYLE_DIRECTION_RTL) { nscoord bidiScrolledAreaWidth = scrolledAreaDesiredSize.maxElementSize->width; firstPassState.reason = eReflowReason_StyleChange; @@ -1103,6 +1103,16 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext, aDesiredSize.maxElementSize->height = aDesiredSize.height; } + // Set the visibility of the scrollbars + // although this may "turn on" both scrollbars everythime + // they do get adjusted back and show correctly + nsIScrollableView* scrollableView; + GetScrollableView(scrollableView); + if (scrollableView) { + PRBool isVis = vis->IsVisible(); + scrollableView->SetScrollbarVisibility(isVis, isVis); + } + aStatus = NS_FRAME_COMPLETE; #ifdef DEBUG_rodsX