Debounces scroll events in web viewer.

As requested in #5178, this change debounces the scroll events.
The reason for doing so is that browsers can event-storm especially on
scroll, communicating hundreds of subpixel changes.

The main reason for this resulting in poor performance is that on each
scroll event `scrollTop` was queried, which forces layouting.

This change will set the scrolling to happen after 250ms of no more
scrolling happening. While this is a long time for computers, humans
make such pauses frequently on scrolling. Many other js-debouncing
users choose some value between 100ms and 500ms.

Fixes #5178, should improve #5207