Closed PolariTOON closed 1 year ago
@PolariTOON Maybe you have a little time to incorporate my feedback? Would be great to see this land.
Sebastian
@SebastianZ Sorry for letting this PR go stale. I'll rebase and then address your comments as soon as possible.
(force-pushed to rebase and resolve conflicts, comments not addressed yet)
You could have split changing the logic and adding + fixing tests into two changes, but that's ok.
I've split them now.
Sebastian
I went ahead and addressed my comments and rebased the patch again. So we're good to merge the changes now.
Sebastian
In cba6568fa52863517e012f8f2b0964ff0ec5189b, i accidently broke a test about the
(orientation)
media feature because i forgot about the following note inmedia-queries-3.js
:Only counting media queries that are true as passing tests is a long-standing behavior, but I don't think it makes sense because not every media queries can be true at the same time so it's not possible for a browser to reach 100%. Also testing if the negation is true as it was done does not work either because it uses syntaxes like
not (width)
are currently only supported by Firefox.So in this PR, I reverted the way support for media queries is detected to be more like: does it parse or not? Also nowadays, we don't need anymore a polyfill for
matchMedia
so i directly called the built-in function to see if the browser recognizes media queries by checking for"not all"
in the media list.I also fixed some tests and added more tests about the syntax introduced in MQ3 and MQ4.