Re: Provide a standardized way to hide scrollbars

> Compared to 'overflow: scroll', 'overflow: hidden' disables all mechanisms
> that allow the user to scroll (including hiding scrollbars). It does not
> disable scrolling entirely: Element.scrollTop and Element.scrollLeft can
> still be set from script.
>
> I suppose we could have a new keyword for the 'overflow' property that
> only hide scrollbars, but leaves other mechanisms. We already have a level
> 3 spec that extends this property:
>
> http://dev.w3.org/csswg/css-overflow/
>
>
> However, if the goal rather than just to hide the native scrollbars is to
> replace them with other scrollbars implemented in JavaScript, I’d recommend
> not to do that. Dispatching a DOM event and doing math in JavaScript before
> setting the new scroll position, for every frame, can probably not be as
> smooth as native scrolling which in some cases is done purely on the GPU.


No, the goal is just to hide the scrollbars visibly (maybe because the
content itself conveys the current scrolling position to the user) but not
to disable native scrolling. Thus 'overflow: hidden' and setting
'scrollTop', 'scrollLeft' by script is no option.

Adding another keyword to the overflow property raises the question whether
the option of scrolling behaviour while not showing the scrollbars is
really exclusive to the other proposed properties for overflow. Reviving
the overflow-style property would not raise this problem and would be
compatible with IE's solution:
http://msdn.microsoft.com/en-us/library/ie/hh771902(v=vs.85).aspx.

Marc Nieper-Wißkirchen

Received on Wednesday, 21 May 2014 15:10:05 UTC