[css4-ui] Scrollbar tracking control

I just received an internal request for some functionality that I
myself have wanted a few times in the past as well.

If you're dynamically adding content to a container on a page, with
enough content to trigger a scrollbar, you usually want the latest
stuff to show up without forcing people to scroll.  Since the
scrollbar position is stable across content changes and is measured
from the top of the box, if you're adding content to the top, you're
fine, but if you're adding content to the bottom, like in a chatroom,
you have to manually adjust the scroll position in JS after adding
each entry.  This is both annoying and potentially racy.  Plus, if you
do it the obvious, naive way (just setting the scroll position to the
bottom every time), you produce a bad user experience, because they
might have scrolled somewhere into the middle of the content to read
or copy something, and you'll interrupt them.  (I've spent a lot of
cusses on software that does exactly this before...)

I request that we add an explicit control for this, such that if a
scrollbar is currently scrolled against a particular edge, it can be
made to "stick" to that edge when the content width/height changes.
Something like:

scrollbar-attachment: normal | edge;

It's UA-defined exactly how close a scrollbar has to be to be
considered "against" a particular edge.  The obvious answer is
"exactly at either end", but it might make sense to be a little looser
in case people stop scrolling a pixel or two away from the edge, so we
should leave this to implementations to decide.

Thoughts?

~TJ

Received on Thursday, 14 June 2012 23:34:59 UTC