W3C home > Mailing lists > Public > public-css-testsuite@w3.org > January 2012

Re: [RC6] c5510-padn-000 has a fractional pixel issue

From: Øyvind Stenhaug <oyvinds@opera.com>
Date: Wed, 25 Jan 2012 18:15:00 +0100
To: "Chris Lilley" <chris@w3.org>
Cc: "Public CSS test suite mailing list" <public-css-testsuite@w3.org>
Message-ID: <op.v8ngvac4bunlto@oyvinds-desktop>
On Wed, 25 Jan 2012 17:13:35 +0100, Chris Lilley <chris@w3.org> wrote:

> On Tuesday, January 24, 2012, 5:28:54 AM, Gérard wrote:
>
> GT> 138px mult by 0.17391 == 23.99958px
> GT> but both Chrome 16.0.912.77, Konqueror 4.7.4 and Opera 11.60 will
> GT> unexpectedly truncate that value to 23px!
>
> Why on earth do they truncate rather than round? Is there some  
> spec-conformance issue that makes them do this (apparently dumb)  
> behaviour?

I don't know if this is the real reason, but it's one possible  
disadvantage to rounding to nearest:

#col1, #col3 { float: left; width: 15%; }
#col2 { float: left; width: 70%; }

<div id="wrapper">
<div id="col1">...</div>
<div id="col2">...</div>
<div id="col3">...</div>
</div>

15% + 70% + 15% = 100%, so these would be expected to fit nicely beside  
each other. But suppose the window size happens to put #wrapper at, say,  
791px. 791*0.7 = 553.7, 791*0.15 = 118.65, and 554 + 119*2 = 792. So #col3  
will end up being pushed down below the rest. 1px empty space looks less  
bad in comparison.

-- 
Øyvind Stenhaug
Core Norway, Opera Software ASA
Received on Wednesday, 25 January 2012 17:15:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 January 2012 17:15:38 GMT