<?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>178261</bug_id>
          
          <creation_ts>2017-10-13 07:40:20 -0700</creation_ts>
          <short_desc>CSS min-width and max-width media features should not round fractional pixel values</short_desc>
          <delta_ts>2022-11-25 20:26:04 -0800</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>Safari 11</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 11</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Šime Vidas">sime.vidas</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>50167214</cc>
    
    <cc>anonymousert+1</cc>
    
    <cc>bugzilla</cc>
    
    <cc>eoconnor</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>redux</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1359999</commentid>
    <comment_count>0</comment_count>
    <who name="Šime Vidas">sime.vidas</who>
    <bug_when>2017-10-13 07:40:20 -0700</bug_when>
    <thetext>These two media queries both evaluate to `true` in the latest Safari on an iPhone 6:

@media (max-width: 374.99px) {
  p::before {
    content: &quot;👍&quot;;
  }
}

@media (min-width: 375px) {
  p::after {
    content: &quot;👍&quot;;
  }
}

Live demo: https://output.jsbin.com/tafogug/quiet

This doesn’t make sense. The viewport width cannot at the same time be ≤ 374.99px and ≥ 375px. WebKit seems to round the fractional pixel value. Why?

Note that this behavior is preventing the postcss-media-minmax plugin from properly polyfilling “range mode” media queries. See: https://github.com/postcss/postcss-media-minmax/issues/19.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1360287</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-10-13 16:03:24 -0700</bug_when>
    <thetext>&lt;rdar://problem/34988263&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1360423</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick H. Lauke">redux</who>
    <bug_when>2017-10-14 07:19:16 -0700</bug_when>
    <thetext>note this may start having impact on bootstrap-based sites when we merge this https://github.com/twbs/bootstrap/pull/24299</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1385105</commentid>
    <comment_count>3</comment_count>
    <who name="Patrick H. Lauke">redux</who>
    <bug_when>2018-01-02 03:44:30 -0800</bug_when>
    <thetext>Note that Bootstrap 4 now uses fractional viewport values, and yes first reports of incompatibilities are coming in...

https://github.com/twbs/bootstrap/issues/25166

And note the CSS Media Queries 4 spec includes the fractional viewport advice https://github.com/w3c/csswg-drafts/pull/1083</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883977</commentid>
    <comment_count>4</comment_count>
    <who name="yisibl">50167214</who>
    <bug_when>2022-07-14 22:06:26 -0700</bug_when>
    <thetext>I can no longer reproduce this bug in Safari 15.4 (17613.1.17.1.6), it looks like it&apos;s fixed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883990</commentid>
    <comment_count>5</comment_count>
    <who name="Šime Vidas">sime.vidas</who>
    <bug_when>2022-07-14 23:34:49 -0700</bug_when>
    <thetext>I also can no longer reproduce. I tested on iPhone 8 with iOS 15.5. Only the (min-width: 375px) media query matches now.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>