[Webkit-unassigned] [Bug 20277] implement window.scrollByPages and window.scrollByLines

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 3 13:50:13 PDT 2008


https://bugs.webkit.org/show_bug.cgi?id=20277





------- Comment #25 from hyatt at apple.com  2008-10-03 13:50 PDT -------
scroll can be amended to take an additional float multiplier argument
(defaulting to 1) that would allow you to scroll by a multiple of lines/pages. 
Then scrollByLines should pass either n or n / 3 as the multiplier (should
compare to Gecko to see what they do... I suspect they may consider a "line" to
be about 40px like we do, in which case n would be fine rather than n / 3). 
scrollByPages could just pass n.

Your other option if you want to avoid using scroll() is to just do scrollBy
and use the line/page constants from Scrollbar.h.

const int cScrollbarPixelsPerLineStep =  40;
const float cMouseWheelPixelsPerLineStep = 40.0f / 3.0f;
const int cAmountToKeepWhenPaging = 40;

A "line" is always either 40 (if we use the single line idea of hitting the
down arrow on the scrollbar for example), or 40 / 3 (if we want the literal
definition of a single line... used only by wheeling currently).

A "page" is always the visibleHeight() of the ScrollView minus
cAmountToKeepWhenPaging.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list