Re: Clarify length units in CSS

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 UTC