W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2020

Re: [csswg-drafts] [css-media-queries] css media query width and window.innerWidth may not be equal (#4713)

From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
Date: Thu, 04 Jun 2020 00:01:52 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-638522312-1591228911-sysbot+gh@w3.org>
The CSS Working Group just discussed `css media query width and window.innerWidth may not be equal`, and agreed to the following:

* `RESOLVED: No change to @media width/height`

<details><summary>The full IRC log of that discussion</summary>
&lt;heycam> Topic: css media query width and window.innerWidth may not be equal<br>
&lt;heycam> github: https://github.com/w3c/csswg-drafts/issues/4713<br>
&lt;heycam> florian: MQs lets you test the width (and height)<br>
&lt;heycam> ... of a page, and the MQ works in terms of floating point numbers<br>
&lt;heycam> ... there is also window.innerWidth, which relates to the same dimension, but it's an integer<br>
&lt;heycam> ... the fact that they're different is weird<br>
&lt;heycam> ... if you test the MQ against a value against the window.innerWidth you may get surprising results<br>
&lt;heycam> ... a strict equality MQ could fail<br>
&lt;heycam> ... in practice min-/max- is better.  but this is odd, not sure what to do about that<br>
&lt;heycam> Rossen_: this is when you use window.matchMedia() with a value from window.innerWidth?<br>
&lt;Rossen_> "window.matchMedia('(width > window.InnerWidth)') &lt;&lt; this is a problem<br>
&lt;heycam> dbaron: I think one thing that could be done is to propose an API that is better than window.innerWidth, and returns the float values<br>
&lt;heycam> Rossen_: I guess the questions that is MQ-scoped, is there anything we should be looking at doing for the MQ width or not?<br>
&lt;dbaron> (I think that's a thing that could be done by anyone who thinks this is an issue for them!)<br>
&lt;heycam> florian: I would like to not change it.  but given I don't know how/whether to solve it...<br>
&lt;heycam> ... so would rather go in dbaron's direction<br>
&lt;heycam> ... rather than change MQs to work on integers<br>
&lt;heycam> Rossen_: the usage of @media width is very high<br>
&lt;heycam> ... making a change would be very disruptive, don't think we have that option<br>
&lt;heycam> Rossen_: any objections to not change @media width/height?<br>
&lt;heycam> RESOLVED: No change to @media width/height<br>
&lt;Rossen_> Zakim, end meeting<br>
&lt;Zakim> As of this point the attendees have been Rossen_, plinss, fantasai, stantonm, dbaron, faceless2_, GameMaker, jensimmons, heycam, miriam, chris, chrishtr, dino, drousso, leaverou,<br>

GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4713#issuecomment-638522312 using your GitHub account
Received on Thursday, 4 June 2020 00:01:56 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:09 UTC