<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>131981</bug_id>
          
          <creation_ts>2014-04-22 03:00:20 -0700</creation_ts>
          <short_desc>Make VW unit accurate (computing devicePixelRatio)</short_desc>
          <delta_ts>2022-07-14 10:18:39 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 7.0</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>135254</dup_id>
          
          <bug_file_loc>http://socialblogsitewebdesign.com</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>cuentanumerouno</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>gsnedders</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1002852</commentid>
    <comment_count>0</comment_count>
    <who name="">cuentanumerouno</who>
    <bug_when>2014-04-22 03:00:20 -0700</bug_when>
    <thetext>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 &gt;1, you have to create separate rules for EACH pixelRatio! (or other css hacks)

e.j. 
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 */
@media 
(-webkit-min-device-pixel-ratio: 2), 
(min-resolution: 192dpi){ 
    #flex_conteiner {
        font-size: 5vw; /* actual size = 1/2 */
    }
}

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

/* 1.3 dpr */
@media 
(-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 */
@media 
(-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&apos;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.

Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883502</commentid>
    <comment_count>1</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-13 17:34:09 -0700</bug_when>
    <thetext>@Sam: Is this superseded by any other units work?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883660</commentid>
    <comment_count>2</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2022-07-14 10:18:39 -0700</bug_when>
    <thetext>Dupe of bug 135254 I think, but this was also fixed by iOS Safari moving to WK2.

*** This bug has been marked as a duplicate of bug 135254 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>