<?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>78087</bug_id>
          
          <creation_ts>2012-02-08 01:26:57 -0800</creation_ts>
          <short_desc>Enable the &apos;resolution&apos; media query by default</short_desc>
          <delta_ts>2022-05-26 09:52:13 -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>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=100137</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>99077</dependson>
    
    <dependson>100231</dependson>
    
    <dependson>100382</dependson>
    
    <dependson>229776</dependson>
    
    <dependson>229777</dependson>
    
    <dependson>236734</dependson>
          <blocked>93304</blocked>
    
    <blocked>16832</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Sam Sneddon [:gsnedders]">gsnedders</assigned_to>
          <cc>adele</cc>
    
    <cc>alexander.shalamov</cc>
    
    <cc>ap</cc>
    
    <cc>astorino.design</cc>
    
    <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
    
    <cc>dino</cc>
    
    <cc>eoconnor</cc>
    
    <cc>eric</cc>
    
    <cc>gsnedders</cc>
    
    <cc>jicheu</cc>
    
    <cc>kenneth</cc>
    
    <cc>matthew.wade</cc>
    
    <cc>nicolas</cc>
    
    <cc>rik</cc>
    
    <cc>sh4.seo</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>spamfaenger</cc>
    
    <cc>syoichi</cc>
    
    <cc>vertigoback</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>551881</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2012-02-08 01:26:57 -0800</bug_when>
    <thetext>Need to implement
http://dev.w3.org/csswg/css3-mediaqueries/#resolution0

See FIXME in MediaQueryEvaluator.cpp:
FIXME: following media features are not implemented: color_index, scan, resolution</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>551883</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2012-02-08 01:28:11 -0800</bug_when>
    <thetext>This should do the right thing when printing too (report printer output resolution).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>551889</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2012-02-08 01:43:21 -0800</bug_when>
    <thetext>Also need to match what other browsers do when pageScale changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>552365</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2012-02-08 12:03:32 -0800</bug_when>
    <thetext>&lt;rdar://problem/10829378&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>604002</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Meyer">eric</who>
    <bug_when>2012-04-17 07:14:09 -0700</bug_when>
    <thetext>If you want a quick initial test, http://meyerweb.com/eric/css/tests/mq-valueless.html includes valueless, iPhone 4S value (I think), and min/max queries.  See test 11.  If not, no harm done.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>658694</commentid>
    <comment_count>5</comment_count>
    <who name="Theresa O&apos;Connor">eoconnor</who>
    <bug_when>2012-06-27 10:20:59 -0700</bug_when>
    <thetext>General comment: It&apos;s not clear to me why we would implement the resolution media query, considering how broken it is.

Eric, that isn&apos;t the correct iPhone 4S value per the spec, because the CSS dpi unit is &quot;physical pixels per CSS inch&quot; and a CSS inch is 96 CSS pixels. So &quot;resolution: 192dpi&quot; should match on an iPhone 4S.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>659164</commentid>
    <comment_count>6</comment_count>
    <who name="Seo Sanghyeon">sh4.seo</who>
    <bug_when>2012-06-27 21:46:32 -0700</bug_when>
    <thetext>How does this relate to bug 85262?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>659176</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2012-06-27 21:59:37 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; How does this relate to bug 85262?

That is about a new CSS property based on the resolution of image resources. This is about a media query based on screen resolution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>748751</commentid>
    <comment_count>8</comment_count>
    <who name="Adele Peterson">adele</who>
    <bug_when>2012-10-23 10:01:19 -0700</bug_when>
    <thetext>Should we dupe this to https://bugs.webkit.org/show_bug.cgi?id=99077?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>748757</commentid>
    <comment_count>9</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2012-10-23 10:05:06 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; Should we dupe this to https://bugs.webkit.org/show_bug.cgi?id=99077?

It still need some special handling when printing as smfr pointed out, but maybe that is another bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>749565</commentid>
    <comment_count>10</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2012-10-24 05:12:04 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Also need to match what other browsers do when pageScale changes.

According to https://bugzilla.mozilla.org/show_bug.cgi?id=662061 zooming ( and I assume pageScale) should not affect the resolution values.

It currently does in Firefox 16, at least full page zoom, though not text size zoom.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>926889</commentid>
    <comment_count>11</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2013-09-09 14:04:01 -0700</bug_when>
    <thetext>Support for the &apos;resolution&apos;  media query was added behind ENABLE(RESOLUTION_MEDIA_QUERY) via bug 99077.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1055467</commentid>
    <comment_count>12</comment_count>
    <who name="Albert Scheiner">vertigoback</who>
    <bug_when>2014-12-13 20:26:10 -0800</bug_when>
    <thetext>Are there any plans to enable it by default any time soon? Once dppx support lands in IE (it&apos;s currently in preview built) all other major browser have added full support.

http://dabblet.com/gist/7166616
https://status.modern.ie/dppxunitfortheresolutionmediaquery?term=dppx</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1130708</commentid>
    <comment_count>13</comment_count>
    <who name="Chris Rebert">webkit</who>
    <bug_when>2015-10-05 12:39:13 -0700</bug_when>
    <thetext>MS Edge has shipped this (see http://caniuse.com/#feat=css-media-resolution ), so now only WebKit doesn&apos;t support this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1674317</commentid>
    <comment_count>14</comment_count>
    <who name="Mattia Astorino">astorino.design</who>
    <bug_when>2020-07-23 12:22:19 -0700</bug_when>
    <thetext>This bug was filed 8 years ago, even IE 9 supports this important media query. What happened here? 😕</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1786974</commentid>
    <comment_count>15</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2021-08-24 15:43:36 -0700</bug_when>
    <thetext>(In reply to Mattia Astorino from comment #14)
&gt; This bug was filed 8 years ago, even IE 9 supports this important media
&gt; query. What happened here? 😕

The media query has existed in WebKit since 2012. It looks like some details specific to printing were not completed

@Mattia: What issues have you had when you used the &apos;resolution&apos; media query in Webkit? Were you attempting printing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1787022</commentid>
    <comment_count>16</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2021-08-24 17:22:26 -0700</bug_when>
    <thetext>(In reply to Brent Fulgham from comment #15)
&gt; (In reply to Mattia Astorino from comment #14)
&gt; &gt; This bug was filed 8 years ago, even IE 9 supports this important media
&gt; &gt; query. What happened here? 😕
&gt; 
&gt; The media query has existed in WebKit since 2012. It looks like some details
&gt; specific to printing were not completed
&gt; 
&gt; @Mattia: What issues have you had when you used the &apos;resolution&apos; media query
&gt; in Webkit? Were you attempting printing?

I see - it&apos;s present but apparently not enabled by default? I&apos;m trying to see what the correct state of this flag should be.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1787103</commentid>
    <comment_count>17</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-08-25 00:35:19 -0700</bug_when>
    <thetext>(In reply to Brent Fulgham from comment #16)
&gt; (In reply to Brent Fulgham from comment #15)
&gt; &gt; (In reply to Mattia Astorino from comment #14)
&gt; &gt; &gt; This bug was filed 8 years ago, even IE 9 supports this important media
&gt; &gt; &gt; query. What happened here? 😕
&gt; &gt; 
&gt; &gt; The media query has existed in WebKit since 2012. It looks like some details
&gt; &gt; specific to printing were not completed
&gt; &gt; 
&gt; &gt; @Mattia: What issues have you had when you used the &apos;resolution&apos; media query
&gt; &gt; in Webkit? Were you attempting printing?
&gt; 
&gt; I see - it&apos;s present but apparently not enabled by default? I&apos;m trying to
&gt; see what the correct state of this flag should be.

Correct; ENABLE_RESOLUTION_MEDIA_QUERY is not defined for any current port, as far as I can tell (and that&apos;s likely been the case since the Blink fork). It doesn&apos;t look like there&apos;s anything too likely to have bitrotted or is missing there, at least.

(In reply to Theresa O&apos;Connor from comment #5)
&gt; General comment: It&apos;s not clear to me why we would implement the resolution
&gt; media query, considering how broken it is.

The thread starting at https://lists.w3.org/Archives/Public/www-style/2012Apr/0674.html is about this brokenness, and summarised in Maciej&apos;s response in https://lists.w3.org/Archives/Public/www-style/2012Apr/0747.html:

&gt; For comparison, device-pixel-ratio was first implemented as a vendor extension in 2006[1] and exists (prefixed) in at least WebKit, Presto and Gecko. So I wondered why device-pixel-ratio counts as &quot;add[ing] anything new&quot; but the [first defined in late 2011/early 2012] dppx unit does not. I don&apos;t follow closely, so maybe there is some reason for diverging from content and implementations here.

Regardless, while it might be the case that resolution: [n]dppx (and the other &lt;resolution&gt; units, aside from dppx, are confusing) is redundant with -webkit-device-pixel-ratio: n (which is itself now standardised in https://compat.spec.whatwg.org/#css-media-queries-webkit-device-pixel-ratio), I think it&apos;s pretty clear the ship here has sailed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1822795</commentid>
    <comment_count>18</comment_count>
      <attachid>446755</attachid>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-12-10 10:33:48 -0800</bug_when>
    <thetext>Created attachment 446755
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1822959</commentid>
    <comment_count>19</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2021-12-10 13:57:34 -0800</bug_when>
    <thetext>Committed r286874 (245104@main): &lt;https://commits.webkit.org/245104@main&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446755.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1842531</commentid>
    <comment_count>20</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2022-02-16 14:37:49 -0800</bug_when>
    <thetext>Re-opened since this is blocked by bug 236734</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1843370</commentid>
    <comment_count>21</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2022-02-18 05:50:02 -0800</bug_when>
    <thetext>bug 236804 reverted the revert; this shouldn&apos;t have been reverted on trunk for that breakage</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1871754</commentid>
    <comment_count>22</comment_count>
    <who name="">matthew.wade</who>
    <bug_when>2022-05-25 09:58:28 -0700</bug_when>
    <thetext>I&apos;m having trouble understanding the recent commits / reverts on this.

Is there an intent to *enable* the &apos;resolution&apos; media query by default in Webkit (Safari)?

Or when we say &quot;that ship has sailed,&quot; are we saying that Safari will continue to *not* support the &apos;resolution&apos; media query in lieu of the &apos;-webkit-device-pixel-ratio&apos; feature?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1871780</commentid>
    <comment_count>23</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2022-05-25 11:03:28 -0700</bug_when>
    <thetext>(In reply to matthew.wade from comment #22)
&gt; I&apos;m having trouble understanding the recent commits / reverts on this.
&gt; 
&gt; Is there an intent to *enable* the &apos;resolution&apos; media query by default in
&gt; Webkit (Safari)?
&gt; 
&gt; Or when we say &quot;that ship has sailed,&quot; are we saying that Safari will
&gt; continue to *not* support the &apos;resolution&apos; media query in lieu of the
&gt; &apos;-webkit-device-pixel-ratio&apos; feature?

It is enabled by default, and has been on trunk since December. It was disabled on one Safari release branch (and, inadvertently also on trunk briefly) due to site breakage caused by enabling it (mostly sites using `@media not all and (min-resolution:.001dpcm)` to specifically target WebKit, which inevitably stops matching with support for the resolution feature).

As for Safari, Apple does not comment on future releases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1872028</commentid>
    <comment_count>24</comment_count>
    <who name="">matthew.wade</who>
    <bug_when>2022-05-26 09:52:13 -0700</bug_when>
    <thetext>(In reply to Sam Sneddon [:gsnedders] from comment #23)
&gt; (In reply to matthew.wade from comment #22)
&gt; &gt; I&apos;m having trouble understanding the recent commits / reverts on this.
&gt; &gt; 
&gt; &gt; Is there an intent to *enable* the &apos;resolution&apos; media query by default in
&gt; &gt; Webkit (Safari)?
&gt; &gt; 
&gt; &gt; Or when we say &quot;that ship has sailed,&quot; are we saying that Safari will
&gt; &gt; continue to *not* support the &apos;resolution&apos; media query in lieu of the
&gt; &gt; &apos;-webkit-device-pixel-ratio&apos; feature?
&gt; 
&gt; It is enabled by default, and has been on trunk since December. It was
&gt; disabled on one Safari release branch (and, inadvertently also on trunk
&gt; briefly) due to site breakage caused by enabling it (mostly sites using
&gt; `@media not all and (min-resolution:.001dpcm)` to specifically target
&gt; WebKit, which inevitably stops matching with support for the resolution
&gt; feature).
&gt; 
&gt; As for Safari, Apple does not comment on future releases.

Thanks, this is very helpful! Also, you practically read my mind with the `@media not all and (min-resolution: .001dpcm)` hack, I was essentially asking how &quot;safe&quot; that is to continue using as a way to detect Safari. Based on all this, my guess is the answer is basically &quot;it still works in the latest Safari, but could stop working at any time.&quot;

I didn&apos;t realize the split between Webkit and how Apple uses it in Safari releases, so thanks for that context as well.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>446755</attachid>
            <date>2021-12-10 10:33:48 -0800</date>
            <delta_ts>2021-12-10 13:57:40 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-78087-20211210183346.patch</filename>
            <type>text/plain</type>
            <size>1497</size>
            <attacher name="Sam Sneddon [:gsnedders]">gsnedders</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjg2ODU3CmRpZmYgLS1naXQgYS9Tb3VyY2UvV1RGL0NoYW5n
ZUxvZyBiL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCmluZGV4IDc0NTdlMTkzOGE0YWMwMjJkM2VmZDBh
OTllYTFhYjY5ZjkyYTYwNWEuLjNkNGNlM2ViNjJlZTMxZmM2N2Q4NTAyYmQyMDE3ZWEzZGYyYTdi
N2EgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XVEYvQ2hh
bmdlTG9nCkBAIC0xLDMgKzEsMTIgQEAKKzIwMjEtMTItMTAgIFNhbSBTbmVkZG9uICA8Z3NuZWRk
ZXJzQGFwcGxl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