Re: [css3] [css21] browser specific CSS

On 4/20/2011 7:15 PM, Boris Zbarsky wrote:
> On 4/20/11 5:23 PM, Glenn Linderman wrote:
>> What solution is used when this case arises?  The "obvious easy"
>> solution would be to leave room for the scrollbars, but don't display
>> them if they aren't actually needed...
>
> This is pretty easy to do, and looks like crap.  Which is why browsers 
> don't do that for overflow:auto....

Well.... at least one browser does do exactly that, in at least one 
not-to-hard-to-trigger circumstance.

http://nevcal.com/test/testovauto.html

Firefox displays two disabled scrollbars.  Opera and IE display a 
disabled vertical scrollbar.  Chrome displays no scrollbars.  Who knows 
what the rest do?

I actually prefer Chrome's solution in this case. (Although as an 
author, I would pick a different background color for the div, probably 
none at all, and then it would blend better.  This color was picked to 
show contrast, in the example.)

All the browsers mentioned produce exactly the same size image and div.

Note: I'm not trying to claim this is a bug in any of the browsers, but 
it is variant behavior.  I didn't find that the CSS standard says 
anything about how to handle this corner case.  I don't imagine this 
exact case would be particularly likely to happen in practice.  
Nonetheless, disabled scrollbars look stupid... even stupider than my 
clashing background color.

Received on Friday, 22 April 2011 06:11:22 UTC