W3C home > Mailing lists > Public > public-css-bugzilla@w3.org > May 2012

[Bug 17182] DIV width in cm has an incorrect length

From: <bugzilla@jessica.w3.org>
Date: Fri, 25 May 2012 17:07:49 +0000
To: public-css-bugzilla@w3.org
Message-Id: <E1SXxzR-00055R-Hb@jessica.w3.org>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17182

Tab Atkins Jr. <jackalmage@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Tab Atkins Jr. <jackalmage@gmail.com> 2012-05-25 17:07:49 UTC ---
I assume you mean that you measured it with a physical ruler against your
screen?

No, this is not a bug.  Web compatibility requires us to fix the ratio between
the 'px' and the 'pt' unit.  Points, though, are defined in terms of inches, so
we had to fix the ratio of 'px' to 'in' as well.  Obviously, then, the ratio of
'px' to 'cm' and 'mm' is similarly fixed now.

So, all the physical units are worth a constant and unchanging number of 'px'
units.  We now have two options.  First, we could make the physical units
correct.  However, this would mean that '1px' will usually not be an integer
number of device pixels, which makes rendering *very* slow and somewhat
unpredictable/fuzzy.  Second, we could make the 'px' unit be an integer number
of device pixels.  However, this would mean that the physical units in CSS
aren't quite correct on all screens - in the worst case (a 144dpi screen)
they'll be 50% off from "real" units.  However, the problem is much smaller on
most screens, and gets better as screens get higher resolution.

The second option was judged to be much less troublesome for the web.  So,
using physical units like "6cm" will often produce lengths on the screen that
aren't *quite* 6 centimeters.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Friday, 25 May 2012 17:08:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 25 May 2012 17:09:00 GMT