There are a number of places in WebCore where the same complicated declaration is used: int pageStep = std::max(std::max<int>(clientWidth * Scrollbar::minFractionToStepWhenPaging(), clientWidth - Scrollbar::maxOverlapBetweenPages()), 1); To ensure that the correct rounding/truncating and clamping are used in all of these places, we should create a method that does this job for us: int pageStep = Scrollbar::pageStep(clientWidth);
Furthermore, attempt to reduce small scroll calculation errors by properly rounding fractional step amounts by using lroundf during the calculation of the step size.
Created attachment 236134 [details] Patch
<rdar://problem/17938368>
Committed r172182: <http://trac.webkit.org/changeset/172182>