4 ms·
> This is just another reason why all browsers (not just mobile) should be reporting their screen size. As in, the actual height/width. That's completely usele
by masklinn 12y ago
> This is just another reason why all browsers (not just mobile) should be reporting their screen size. As in, the actual height/width.
That's completely useless, 1cm on a mobile device and 1cm on a desktop are not the same for a user, to say nothing of 1cm on a TV screen, an Oculus Rift (where would you even measure size there?) or a projector (which would require a rangefinder for precise estimation and will probably vary slightly over the whole surface, won't that be fun?)
> Not pixels. Pixels lie and so do browsers, actually.
And you'd expect them to lie less for "physical dimensions"… why?
> Did you know that the CSS spec has 'in' and 'mm' as size options? Yet when you set the font-size to '1in' you will almost never get a font that is one inch tall because the browser is hard-coded to assume that the user's display is 96dpi. It drives me crazy and it will only get worse over time as we get a larger variety of devices.
Before suggested that others read the CSS spec, you may want to do so yourself:
http://www.w3.org/TR/css3-values/#absolute-lengths http://www.w3.org/TR/css3-values/#absolute-lengths
> For lower-resolution devices, and devices with unusual viewing distances, it is recommended instead that the anchor unit be the pixel unit. For such devices it is recommended that the pixel unit refer to the whole number of device pixels that best approximates the reference pixel.
> The reference pixel is the visual angle of one pixel on a device with a pixel density of 96dpi and a distance from the reader of an arm's length. For a nominal arm's length of 28 inches, the visual angle is therefore about 0.0213 degrees. For reading at arm's length, 1px thus corresponds to about 0.26 mm (1/96 inch).
> We need to stop the madness (that was introduced by Apple with the pretend-the-screen-has-this-many-pixels nonsense)
That's not going to happen. Every time some schmuck advocates "practicality > purity" somebody down the road will have to support their "practical choice" and you end up with virtual pixels because all content is completely broken if you use actual physical pixels.
> switch to accurate screen size/dpi reporting.
http://www.quirksmode.org/blog/archives/2012/06/devicepixelrati.html http://www.quirksmode.org/blog/archives/2012/06/devicepixelr...
http://www.quirksmode.org/blog/archives/2012/07/more_about_devi.html http://www.quirksmode.org/blog/archives/2012/07/more_about_d...
- drivingmenuts 12y ago> 1cm on a mobile device and 1cm on a desktop You lost me. How is 1cm on a mobile device not the same as 1 cm on a desktop. Yes, they have different pixels resolutions within that centimeter, but the length of a centimeter doesn't change. Well, unless the engineers are fudging the standard so marketing isn't seen to be lying.
- bzbarsky 12y agoThe difference is that they look like different sizes to the user because of the different viewing distance. The really user-relevant size is subtended angle, not linear size, which is why the "px" unit in CSS was defined the way it was.
- masklinn 12y agoIt's worse than that, there's the visual effect from angular size and the "manipulative" effect from interaction device. For instance, because it's used with fat and impressive fingers a smartphone held close to your face (and thus with a high angular size for its physical size) needs to provide much bigger controls (in both angular and absolute terms) than a desktop computer manipulated through a mouse. And of course this isn't linear as manipulating e.g. a Wii through its remote is also very impressive.
- masklinn 12y ago> You lost me. How is 1cm on a mobile device not the same as 1 cm on a desktop. That's because you stopped there and didn't read the rest of the phrase. > Yes, they have different pixels resolutions within that centimeter That's not relevant in any way, shape or form, the issue would exist even if all devices had the exact same pixel density. > the length of a centimeter doesn't change. The length of a cm doesn't change, but what you can do with it changes a lot due to different viewing distances: a cm at 20cm, a cm at 80cm and a cm at 3m are very different visual beasts, and so are a cm manipulated using fat fingers, a mouse, a stylus or some sort of laser/ir pointer.