| Summary: | Consolidate logic for calculating scrollbar page step size | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> | ||||
| Component: | Layout and Rendering | Assignee: | Brent Fulgham <bfulgham> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | bfulgham, simon.fraser, webkit-bug-importer, zalan | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
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
Committed r172182: <http://trac.webkit.org/changeset/172182> |
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);