I tried to illustrate what I meant here: http://jsfiddle.net/timdream/ewJZZ/
It should help you to get a better picture with CSS units.

On Thu, May 16, 2013 at 7:03 PM, pancake <[email protected]> wrote:
> On 05/16/13 06:11, Tim Chien wrote:
>>
>> Hi Pancake,
>>
>> If you read the CSS spec carefully, you would find that on a screen,
>> these real-world units doesn't have to be sized in the same way on a
>> physical ruler (though on paper it should).
>>
>> http://www.w3.org/TR/CSS21/syndata.html#length-units
>>
>> If you are looking to size an HTML element with physical size, the
>> non-standard mozmm is the unit you are looking for -- but I am pretty
>> sure we didn't set the Gecko pref() right on all devices for all FxOS
>> devices. We should file bugs on that.
>>
>> MDN is more understandable than the spec on this topic:
>> https://developer.mozilla.org/en-US/docs/Web/CSS/length
>>
>
> I've tested mozmm on desktop (looks fine), but it doesnt works fine on Peak
> or Keon. Should I fill a bug for that?
>

Yes, please do. Someone probably already filed that.
FxOS underneath should expose correct dpi information so Gecko would
draw the unit correctly on these small screens.

However, even if the bug is fixed, you should probably avoid using the
unit because it's not widely supported on the web. It's not a "safe"
unit to depend on for web app engineering, nor FxOS web app
engineering, if the latter even exist :-/

> In the "browser compatibility" doesnt appears 'mozmm', but testing on iphone
> it's not supoprted (acording to this table, mozmm should work on safari too)
> (mobile safari is not listed).

No. 'mozmm' is a prefixed unit that only worked on Gecko.

> Is this a bug in the configuration of the keon/peak? or should i avoid
> depending on phisical sizes? I don't understand why 'cm' or 'in' units
> exists in CSS if they are not honored on any platform/browser..

They are indeed honored, if you, say, print out the web pages on a
physical A4, or letter sized, paper (whichever office paper size
scheme your country is using).

On screens, they don't make sense to you because you are only think of
small screens on mobile devices.
The web runs on plenty of devices and screen, e.g. laptop, external
screen, big out-door screen, projectors, etc.; some of them doesn't
even exists yet.

> The other way I thought is .. make this device-independent. But I will need
> a way to know in which device I'm running. Which API should I use to get
> this information?
>
> Thanks
>
> --pancake



--
Tim Guan-tin Chien, Engineering Manager and Front-end Lead, Firefox
OS, Mozilla Corp. (Taiwan)
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to