Re: [css3-mediaqueries] width/height and viewport scrollbars

On Wed, 01 Jul 2009 00:02:39 +0200, L. David Baron <dbaron@dbaron.org>  
wrote:

> On Thursday 2009-06-11 18:35 +0200, Øyvind Stenhaug wrote:
>> The descriptions of the 'width' and 'height' media features should
>> perhaps clarify whether or not viewport scrollbars are included. It  
>> seems
>> that the presence of scrollbars makes no difference on Minefield
>> (Gecko/20090610) while it does in Safari 4 public beta.
>
> Removing the space occupied by viewport scrollbars for the values of
> 'width' and 'height' seems like a pretty clear bug to me.

Well, an interpretation of the specs as written may result in that  
conclusion. The ICB "has the dimensions of the viewport" (CSS2.1 10.1),  
and the space taken up by an element's scrollbars is subtracted from the  
containing block it forms (CSS2.1 11.1.1, though again the viewport as a  
special (non-"element") case doesn't seem to be mentioned).

But I'm not arguing that the space should be removed (our internal builds  
don't do that either).

> There are
> already ways for style sheets to affect whether there are scrollbars
> on the viewport, so we really shouldn't make whether there are
> scrollbars on the viewport affect which style sheets are chosen.
> (If we do, then we need to give the rules for how to end the
> resulting infinite loops.)

Yes. I noticed some text in section 2 saying that "[t]o avoid circular  
dependencies, it is never necessary to apply the style sheet in order to  
evaluate expressions", mentioning an example of using "the default aspect  
ratio", but I'm not sure how to interpret it in such a situation. (Lay out  
the document without the style sheet first to see if the viewport gets  
scrollbars? That doesn't seem good. Use the "default" width/height, i.e.  
the viewport dimensions as they would be for an empty document? That would  
be equivalent to Gecko's behavior.)

I see that a similar case came up in a later thread,  
http://lists.w3.org/Archives/Public/www-style/2009Jul/0021.html (vw/vh/vm  
units).

-- 
Øyvind Stenhaug
Core Norway, Opera Software ASA

Received on Friday, 24 July 2009 13:38:44 UTC