It is common knowledge that CSS offers various units for measuring length, ranging from physical measurements like inches and millimeters to relative units like em width and percentage.
Unlike other units, pixels do not fall into either category. Originally, they were simply the smallest dot on a user's screen. However, this straightforward definition poses several challenges:
- The renderer might utilize sub-pixel positioning to avoid rounding discrepancies.
- The output device may lack actual pixels - for example, a ten-dot font on a 600dpi printer may not match the designer's intentions.
- Pages designed for low-resolution displays may appear poorly on high-resolution screens.
- Fortunately, modern browsers offer tools for scaling and magnifying pages.
Therefore, CSS pixels serve as a valuable abstraction, maintaining consistent relationships with other measurements (at least within individual browsers). Page designers can trust that their designs will closely resemble the results, even when the browser adjusts the relationship with actual device pixels.
In response to your second query, there is no need to convert between physical and CSS pixels. Such conversions would disrupt the crucial abstraction required by the renderer for proper operation. While Gecko does provide a method for determining this relationship, it is meant for chrome scripts, keeping regular web pages blissfully unaware of these complexities.
For further exploration: Units Patch Landed