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


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

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 UTC