W3C home > Mailing lists > Public > www-style@w3.org > November 2004

Re: [CSS21] Overflow and scroll bar behavior

From: by way of Bert Bos <mikko.rantalainen@peda.net>
Date: Mon, 15 Nov 2004 13:11:58 +0100
To: www-style@w3.org
Message-Id: <200411151311.58563.mikko.rantalainen@peda.net>


[was: [CSS21] Contradiction in the spec with auto-offset fixed-position
   elements]

Andrew Fedoniouk wrote:
> As you know straightforward implementation of overflow:auto when size
> of content is close to the size of viewport is potentially
> oscillating function. And could not be implemented without use of
> heuristics limiting the number of oscillations. (Size of viewport is
> changing when scrollbars appear). If you will move scrollbars out of
> the viewport calculation become stable two step process.

How about following algorithm:
1) Try to fit content without scroll bars
2) If 1 fails, add vertical scroll bar and try again
3) If 2 fails, remove vertical scroll bar, add horizontal
    scroll bar and try again
4) If 3 fails, add both vertical and horizontal scroll bars
    and render the content.

This algorithm is incremental and UA might skip step 3. This algorithm
never oscillates between two states during rendering because UA should
return to step 1 only if content changes or UA window has been resized.

> And no one UA handles this 'properly'  as there are no solution at
> all in the given model.
>
> E.g. here is the document
> http://www.terrainformatica.com/w3/overflow.htm and here is a
> screenshot in FireFox
> http://www.terrainformatica.com/w3/overflow-ff.gif As you may see
> scrollbars are gone but they should be there. "Heuristics" in effect.

The problem isn't "heuristics" but the fact that Firefox has about 100
pixel minimum height for the viewport, regardless if that high viewport
can fit the window. If you slowly increase the height of the window,
 you see that vertical scroll bar doesn't change and horizontal scroll
 bar slowly becomes visible again. That is, horizontal scroll bar is
 there as it should. Unfortunately it cannot always fit the visible
 window area. That's a bug but it isn't because the scroll bar behavior
 would be somehow "undecideable" or something.

> IE handles this particular situation better but it has problems with
>  overflow:auto in different places.

IE always displays vertical scroll bar so it doesn't have similar
problems with content width.

--
Mikko
Received on Tuesday, 16 November 2004 17:15:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:34 GMT