[Webkit-unassigned] [Bug 131981] New: Make VW unit accurate (computing devicePixelRatio)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 22 02:59:59 PDT 2014


           Summary: Make VW unit accurate (computing devicePixelRatio)
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: iOS
               URL: http://socialblogsitewebdesign.com
        OS/Version: iOS 7.0
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: cuentanumerouno at hotmail.com

Is there any way VW unit return a useful value I can use in IOS?

Right now it returns a value that, when used anywhere in the CSS, produces double or bigger sizes than on a desktop browser.

In order for the VW unit to work as in every screen with devicePixelRatio >1, you have to create separate rules for EACH pixelRatio! (or other css hacks)

To give a container a 10vw (10/100 viewport width units) that look consistent cross-browser, you have to declare separate media queries FOR EVERY existing screen resolution, making a one-liner into:

/* 2 dpr */
(-webkit-min-device-pixel-ratio: 2), 
(min-resolution: 192dpi){ 
    #flex_conteiner {
        font-size: 5vw; /* actual size = 1/2 */

/* 1.25 dpr */
(-webkit-min-device-pixel-ratio: 1.25), 
(min-resolution: 120dpi){ 
    #flex_conteiner {
        font-size: 8vw; /* actual size = 1/1.25 */

/* 1.3 dpr */
(-webkit-min-device-pixel-ratio: 1.3), 
(min-resolution: 124.8dpi){ 
   #flex_conteiner {
        font-size: 7.692vw; /* actual size = 1/1.3 */

/* 1.5 dpr */
(-webkit-min-device-pixel-ratio: 1.5), 
(min-resolution: 144dpi){ 
    #flex_conteiner {
        font-size: 6.666vw; /* actual size = 1/1.5 */

if VW units returned the actual useful number we are required to enter to cheat webkit (we tell iPhones 320px and they show 640px), then we wouldn't need to counter-act every rule coming from its own engine (the viewport width returned)

In short: If the devicePixelRatio is 2, I want 100vw to return 320, not 640.


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