[Webkit-unassigned] [Bug 57065] New: There is no way to respond to the physical dimensions of the user's screen

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 24 16:47:10 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=57065

           Summary: There is no way to respond to the physical dimensions
                    of the user's screen
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Major
          Priority: P3
         Component: CSS
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: anewpage.media at gmail.com
                CC: anewpage.media at gmail.com


When adjusting layout for mobile devices, Media Queries usually make alterations against the horizontal resolution, delivering a necessary experience for that relatively cramped environment.

This is preferable to the legacy system of UA-sniffing, but it comes with an inherent flaw:

Without the capability to detect and respond to physical screen dimensions, there is no reliable way to know whether a device is actually mobile.  As mobile device resolutions increase to meet or exceed many large-screen devices, Media Queries will fail as an adequate solution.

Simply using one layout for all comers will not work, as there are physiological considerations to be made.  Large buttons work well on a 4" touchscreen, but are superfluous, even damaging, on a 24" screen.

The core of the issue resides in CSS units.  The "in" and "cm" units are so-called logical measurements, not actual, physical measurements absolute to the true screen size.


FIRST RESOLUTION:

Adjust the physical units of CSS so that they do correspond to physical dimension when the rendering engine is at a scale of 1.0.  They are seldom used as-is, and the risk of breakage in Standards Mode would be minimal.  However, if this risk is still of concern, introduce the new units "pin" and "pcm", which stand for "Physical Inches" and "Physical Centimeters", respectively.

SECOND RESOLUTION:

Provide window.screen.physicalWidth and window.screen.physicalHeight, both of which contain the appropriate measurements as Numbers.  The unit for these, whether inches or centimeters, is not important.  If both were to be provided (so as to spare hundreds of thousands of developers the task of looking up the conversion ratio), then instead of Numbers, the properties contain Object literals as such:

{
    inch: Number,
    cm: Number
}

If these or similar actions are not taken, once the pixel resolutions of small screens and large screens begin to intersect, Media Queries will quickly give way again to UA sniffing as the preferred method for delivering layouts to varying devices.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list