Commit 8dc9565b authored by Markus Stange's avatar Markus Stange
Browse files

Bug 513502 - Don't allow fractional sizes for the length of the scrollbar thumb. r=roc

--HG--
extra : rebase_source : 5f297336e5acd0ffedea5944745db92f28770840
parent 39090d5b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -416,6 +416,11 @@ nsSliderFrame::DoLayout(nsBoxLayoutState& aState)
    thumbLength = PR_MAX(thumbLength, NSToCoordRound(availableLength * ratio));
  }

  // Round the thumb's length to device pixels.
  nsPresContext* presContext = PresContext();
  thumbLength = presContext->DevPixelsToAppUnits(
                  presContext->AppUnitsToDevPixels(thumbLength));

  // mRatio translates the thumb position in app units to the value.
  mRatio = (minPos != maxPos) ? float(availableLength - thumbLength) / float(maxPos - minPos) : 1;