W3C home > Mailing lists > Public > www-style@w3.org > July 2008

Re: Clarify length units in CSS

From: David Hyatt <hyatt@apple.com>
Date: Thu, 24 Jul 2008 15:17:05 -0500
To: Tomas Carnecky <tom@dbservice.com>
Cc: "Grant, Melinda" <melinda.grant@hp.com>, "robert@ocallahan.org" <robert@ocallahan.org>, "www-style@w3.org" <www-style@w3.org>
Message-id: <277612B4-B52B-4399-8D47-EDF6F4000534@apple.com>

On Jul 24, 2008, at 2:13 PM, Tomas Carnecky wrote:

>
> 2) Should CSS pixels be treated as absolute or relative?
>   (WebKit hardcodes 1in==96px; Gecko tries to follow the spec, making
>    CSS pixels relative, within some restrictions)
>

The CSS pixel is not an absolute unit in either Gecko or WebKit.  If  
you bring up Quartz Debug in OS X and change the user interface  
resolution from the Tools menu, you will see that the CSS pixel in  
WebKit scales right along with the rest of the user interface.  We  
just don't scale the CSS pixel explicitly in WebKit's code, but  
instead honor the pixel scale that is set up explicitly by the device  
or operating system.  Basically our assumption is that if someone  
wants to scale the "engine pixel" of WebKit, that it will happen at a  
level underneath WebKit (we also know how many device pixels = 1  
engine pixel so that we can do rounding in certain situations).

The part that is fixed in WebKit is that we will continue to pretend  
that 1 CSS px = 1/96th of an inch even when the CSS pixel is scaled.   
Our motivation for doing so is primarily the 'pt' unit, but this  
decision ends up affecting all absolute units (inches, centimeters,  
etc.).

dave
(hyatt@apple.com)
Received on Thursday, 24 July 2008 20:17:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:10 GMT