News for hackers. Stuff that matters.
Re:CSS px is an Angular Measurement by colanderman on Monday March 12, 2012 @04:37PM (#3695371)
I'm not a web designer. Can you explain to me why it's important to be able to position/size something to exactly N pixels, rather than to exactly kN pixels (where k is some integer decided by the browser implementor)?
Re:CSS px is an Angular Measurement by mikeklaas on Monday March 12, 2012 @04:44PM (#3695408)
The biggest reason is that most css properties ignore fractional px values—you can't draw a .5px border, for instance.
Re:CSS px is an Angular Measurement by evincarofautumn on Monday March 12, 2012 @04:56PM (#3695473)
Which is absurd, because antialiasing exists for that very reason. I should be able to render a single-pixel-thick vertical line between two columns of display pixels, and get two columns of display pixels at 50% (apparent) brightness. Subpixel rendering would be even better.
Re:CSS px is an Angular Measurement by bzbarsky on Tuesday March 13, 2012 @02:21AM (#3697248)
This is only true in some UAs.

Gecko has supported fractional pixel values for years in general, though for borders in particular the width is clamped to integer _device_ (not CSS) pixels.

WebKit has been rounding them at parse time (even in cases when 1 CSS px is multiple device pixels) for a while, but they're about to fix that.

I believe that IE also supports subpixel layout. Not sure about Opera, offhand.

Re:CSS px is an Angular Measurement by tlb on Monday March 12, 2012 @04:54PM (#3695455)
Images and <canvas> and <embed> use actual pixels. It's hard to make things look right when you don't have the same unit in CSS.
Re:CSS px is an Angular Measurement by wmf on Monday March 12, 2012 @05:30PM (#3695667)
Maybe I'm misunderstanding, but I don't think this is correct; the browser should scale everything. See http://joubert.posterous.com/crisp-html-5-canvas-text-on-mob... for example.