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

I suppose we could specify that media queries round up the the closest integer pixel value before doing the comparison, but while this would solve this particular problem, this would cause the opposite problems when using inequalities:

So they may not be equal, for example:
Web page zoom level: 300%;
Physical pixel width: 1000px;
"window.matchMedia('(width >  333px)').matches" would return false, even though it is actually true.

Hopefully we can fix this problem on the cssom side, but even if we cannot, given that width mediaqueries are more useful for inequalities than for equalities, I'm inclined to keep the behavior of mediaqueries unchanged.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4713#issuecomment-635181281 using your GitHub account

Received on Thursday, 28 May 2020 07:58:18 UTC