Bug 135670 - Consolidate logic for calculating scrollbar page step size
Summary: Consolidate logic for calculating scrollbar page step size
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-08-06 14:04 PDT by Brent Fulgham
Modified: 2014-08-06 16:04 PDT (History)
4 users (show)

See Also:


Attachments
Patch (8.03 KB, patch)
2014-08-06 14:12 PDT, Brent Fulgham
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2014-08-06 14:04:50 PDT
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);
Comment 1 Brent Fulgham 2014-08-06 14:11:03 PDT
Furthermore, attempt to reduce small scroll calculation errors by properly rounding fractional step amounts by using lroundf during the calculation of the step size.
Comment 2 Brent Fulgham 2014-08-06 14:12:45 PDT
Created attachment 236134 [details]
Patch
Comment 3 Radar WebKit Bug Importer 2014-08-06 16:00:44 PDT
<rdar://problem/17938368>
Comment 4 Brent Fulgham 2014-08-06 16:04:24 PDT
Committed r172182: <http://trac.webkit.org/changeset/172182>