Bug 1078373 - Use the scrollPositionClampingScrollPortSize when computing whether or not to show the scrollbar. r=tn
☠☠ backed out by b4457e42fcc9 ☠ ☠
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 10 Oct 2014 16:14:52 -0400
changeset 209839 3d9ce78534529af95ba0b9399cbba736e04241ec
parent 209838 fef79e1881e045f9e72a9f25b274166a2ae8472d
child 209840 1965fcfce91dca3f9e7576ecc89bc4a76835a72d
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerstn
bugs1078373
milestone35.0a1
Bug 1078373 - Use the scrollPositionClampingScrollPortSize when computing whether or not to show the scrollbar. r=tn
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -346,40 +346,41 @@ nsHTMLScrollFrame::TryLayout(ScrollReflo
   desiredInsideBorderSize.width = vScrollbarDesiredWidth +
     std::max(aKidMetrics->Width(), hScrollbarMinWidth);
   desiredInsideBorderSize.height = hScrollbarDesiredHeight +
     std::max(aKidMetrics->Height(), vScrollbarMinHeight);
   aState->mInsideBorderSize =
     ComputeInsideBorderSize(aState, desiredInsideBorderSize);
   nsSize scrollPortSize = nsSize(std::max(0, aState->mInsideBorderSize.width - vScrollbarDesiredWidth),
                                  std::max(0, aState->mInsideBorderSize.height - hScrollbarDesiredHeight));
+  nsSize visualScrollPortSize = mHelper.GetScrollPositionClampingScrollPortSize();
 
   if (!aForce) {
     nsRect scrolledRect =
       mHelper.GetScrolledRectInternal(aState->mContentsOverflowAreas.ScrollableOverflow(),
                                      scrollPortSize);
     nscoord oneDevPixel = aState->mBoxState.PresContext()->DevPixelsToAppUnits(1);
 
     // If the style is HIDDEN then we already know that aAssumeHScroll is false
     if (aState->mStyles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN) {
       bool wantHScrollbar =
         aState->mStyles.mHorizontal == NS_STYLE_OVERFLOW_SCROLL ||
-        scrolledRect.XMost() >= scrollPortSize.width + oneDevPixel ||
+        scrolledRect.XMost() >= visualScrollPortSize.width + oneDevPixel ||
         scrolledRect.x <= -oneDevPixel;
       if (scrollPortSize.width < hScrollbarMinSize.width)
         wantHScrollbar = false;
       if (wantHScrollbar != aAssumeHScroll)
         return false;
     }
 
     // If the style is HIDDEN then we already know that aAssumeVScroll is false
     if (aState->mStyles.mVertical != NS_STYLE_OVERFLOW_HIDDEN) {
       bool wantVScrollbar =
         aState->mStyles.mVertical == NS_STYLE_OVERFLOW_SCROLL ||
-        scrolledRect.YMost() >= scrollPortSize.height + oneDevPixel ||
+        scrolledRect.YMost() >= visualScrollPortSize.height + oneDevPixel ||
         scrolledRect.y <= -oneDevPixel;
       if (scrollPortSize.height < vScrollbarMinSize.height)
         wantVScrollbar = false;
       if (wantVScrollbar != aAssumeVScroll)
         return false;
     }
   }