W3C home > Mailing lists > Public > www-style@w3.org > June 2012

Re: [css4-ui] Scrollbar tracking control

From: L. David Baron <dbaron@dbaron.org>
Date: Thu, 14 Jun 2012 17:00:12 -0700
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
Message-ID: <20120615000012.GA23296@crum.dbaron.org>
On Thursday 2012-06-14 16:34 -0700, Tab Atkins Jr. wrote:
> 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?

I'm worried about a few things here:

 * I wouldn't want this to preclude browsers improving their
   behavior in other ways (since there are a bunch of improvements
   that could be made)

 * As a user, I hate this behavior.  I generally want to know where
   I left off, and I hate it when sites think I want the latest and
   don't care where I last stopped reading.  So I'm personally much
   more interested in having the position be maintained.  So it
   seems like there are two separate pieces of information here: (1)
   which end the site is adding content from and (2) whether the
   site things you want scroll-to-latest-if-at-edge.  If they're
   separate, then it's easier for the user to override (2).

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
Received on Friday, 15 June 2012 00:00:39 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:55 GMT