RE: scroll bar size in width calculations

You're right in saying that vertical and horizontal scroll bars (especially with orverflow:auto) should only be displayed when needed i.e. non-breakable content requires it. However I don't agree this must be a requirement because it will be hard to measure 'correctness' and/or 'compliance'.

Consider scenarios when vertical scrollbar is required due to vertical overflow of the content (just like your example of using your email client bellow). Now the content area is reduced by the size of the vertical scroll, hence your content is reformatted. At the same time let's say there is a non-breakable content that requires the horizontal scroll to be flipped on. Well, now the horizontal scroll takes size out of your content height so there is a new reformatting required again... You see where I'm going with this.. I suppose that might be the reason you're seeing the horizontal scrolls.

So, from the example above, let's say that every different browser has different size of the non-breakable content (very often the case with text due to different glyph sizes). Then, the different behavior will suggest non-compliance...



-Rossen

________________________________
From: Brad Kemper [brkemper@comcast.net]
Sent: Saturday, January 05, 2008 3:44 PM
To: Rossen Atanassov
Cc: Andrew Fedoniouk; fantasai; Alex Mogilevsky; CSS Style; Sam Fortiner; Harel Williams; Scott Dickens; Boris Zbarsky
Subject: Re: scroll bar size in width calculations


On Jan 5, 2008, at 12:55 PM, Rossen Atanassov wrote:

Now however the containing block as changed size to (100 - SB x 100 - SB) which you can't really see since the content inside has fixed size. In this case the vertical scroll by the way causes the horizontal scroll to appear as well.

In some browsers the horizontal scroll bar appears whenever the vertical one does, but this seems wrong to me. With overflow:auto, there is supposed to be "a scrolling mechanism to be provided for overflowing boxes"[1]. If the block is not overflowing horizontally, why is there a horizontal scrollbar in some browsers? I know the scrolling mechanism itself is UA dependant (Safari for iPhone has scrollbars that only appear translucently when actually scrolling, and they do not affect width and height of the content at all), but I wish we could change that line to the following:

auto
The behavior of the 'auto' value is user agent-dependent, but should cause a horizontal scrolling mechanism to be provided for horizontally overflowing boxes, and  should cause a vertical scrolling mechanism to be provided for vertical overflowing boxes.

I usually resort to "overflow-x: hidden;" so that I can get consistent results, predictable content heights, and no useless UI elements taking up space when they are not needed.

As I right this e-mail using mail.app in Mac OS X, there are no vertical scrollbars unless I make the editing window short enough to need them, and would only have horizontal scrollbars if I had unbreakable content (such as an image) that was wider than the editing window. It is similar in concept to overflow:auto.

[1] http://www.w3.org/TR/CSS21/visufx.html#overflow

Received on Sunday, 6 January 2008 02:19:26 UTC