Autoscroll

This patch scrolls the window down as the mouse leaves the viewport (up or down). I really need this for the mobile project I'm working on, and it's something that's especially important for small viewports.
What do you think of this approach? Suggestions welcome :)