W3C home > Mailing lists > Public > www-style@w3.org > January 2008

Re: scroll bar size in width calculations

From: Patrick Garies <pgaries@fastmail.us>
Date: Wed, 09 Jan 2008 04:24:08 -0600
Message-ID: <4784A0C8.3010003@fastmail.us>
To: Andrew Fedoniouk <news@terrainformatica.com>
CC: www-style@w3.org

Andrew Fedoniouk wrote:
>  If it shows scrollbars then for the paragraph
>  <p style="width: 100px; height:100px; background: lightgreen;">some
>  content that does not fit into a container without getting big enough
>  to trigger scroll bars</p>
>  1) outer box [1] does not match margin box of the element.
 > 2) or some box other than border/margin box is used for computation 
of content
>  dimensions of scrollable element. Which one?

With regard to 1), define “outer box”. It seems to me that you might be 
confusing which element that overflow: auto was applied to; it wasn’t 
the paragraph element.

With regard to 2), the content dimensions of the scrollable element (the 
div element) are calculated with respect to the amount of content inside 
that element (including any overflowing content within). That seems 
pretty obvious to me, anyway.

Andrew Fedoniouk wrote:
>  Compare this sample:
>  http://www.terrainformatica.com/w3/overflow-visible.htm in IE and in
>  FF for example.

It helps if you specify version numbers. For example, the renderings of 
Microsoft Internet Explorer 6 and Windows Internet Explorer 7 can be 
quite different; this is notably the case with this specific document.

Andrew Fedoniouk wrote:
>  Two paragraphs on top have text overlapped in FF. That is because
>  Gecko uses overflow:visible; literally and it appears as Trident
>  interprets overflow:visible; as overflow:never for all elements (as
>  for cells). At least I cannot manage to convince IE(6) to overflow in
>  such cases.

Again, it helps if you specify version numbers, this time for rendering 
engines (or if you would stick to mentioning browsers (with version 
numbers) instead of rendering engines).

The MSIE6 behavior that you see is a well known bug (or perhaps it was 
intentional?). This isn’t the behavior of WIE7.

(I also think that property value keywords like “resize”, 
“resize-element”, “expand”, or “expand-element” are more easily 
understood than “never”.)

Andrew Fedoniouk wrote:
>  I personally think that IE (Trident) behavior is more humanistic in
>  this case - leads to more stable and readable renderings.

While is does, perhaps, lead to more readable renderings, the MSIE6 
behavior breaks certain CSS‐based layouts. You might want to check out 
the article IE/win Expanding Box located at the URI 
<http://www.positioniseverything.net/explorer/expandingboxbug.html>. One 
could maintain readability, instead, via the overflow: auto declaration.

Andrew Fedoniouk wrote:
>  For IE scrollbar in case #3 (above) is logical (you see no yellow
>  background there). But it is a mystery for me why Gecko show
>  scrollbars and yellow space - space that was not allocated to any
>  element. For the record: Opera (9.x) shows only v-scrollbar there.

Just think of an element with scrollbars like a viewport within a 
viewport. For example, when an author uses the rule html, body { height: 
100%; } (a common technique) and content overflows into space not 
allocated to any element (i.e., beyond the bottom of the html and body 
elements and the viewport), I don’t see anything odd about it. New space 
within the container of the element that is overflowing (e.g., the 
viewport in my example and the div element in “case #3”) is simply being 
generated to handle the overflowing content since that content has to go 

I find the MSIE6 rendering to be illogical since the background color is 
not respecting the 100 by 100 pixel dimensions of the paragraph element. 
If it were, then you’d be seeing the yellow background of the containing 
div element for any content that escapes the bounds of that 100 by 100 
pixel box. Instead, the browser is not honoring the width and height of 
the paragraph element.

The WIE7 behavior makes no sense, initially; this is probably due to a 
bug. I see a green box with no scrollbars and overflowing content cut 
off. However, if I start highlighting the text and drag my mouse cursor 
downward and beyond the bottom edge of the box, suddenly, two scrollbars 
materialize and I get the behavior of Mozilla Firefox 2.

As for Opera, I see that too in version 9.25. IMO, that rendering is 
incorrect since the scrolling mechanism needed to access the text 
overflowing to the right is missing (i.e., the horizontal scrollbar 
should be present).

Mozilla Firefox 2 and Safari 3 (Windows beta) do things as expected by 
providing two scrollbars and showing the yellow background of the 
containing div element when the text overflows the bounds of the 100×100 
pixel paragraph.

— Patrick Garies
Received on Wednesday, 9 January 2008 10:24:21 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:33 UTC