-
Notifications
You must be signed in to change notification settings - Fork 757
Description
(Ooops I typed enter too fast)
This is triggered by mozilla-mobile/fenix#15124 (comment)
window.matchMedia('(max-width: 567px) and (max-aspect-ratio: 1/1)').media
Safari returns
"(max-aspect-ratio: 1/1) and (max-width: 567px)" = $1
Chrome returns
"(max-aspect-ratio: 1/1) and (max-width: 567px)"
Firefox returns
"(max-width: 567px) and (max-aspect-ratio: 1)"
And just for the sake of testing, if I do
window.matchMedia('(max-width: 567px) and (max-aspect-ratio: 1/2)').media
Firefox returns
"(max-width: 567px) and (max-aspect-ratio: 1 / 2)"
while Safari/Chrome return
window.matchMedia('(max-width: 567px) and (max-aspect-ratio: 1/2)').media
https://codepen.io/webcompat/pen/abZbvMV
illustrating the differences in between chrome and Firefox.

https://drafts.csswg.org/cssom-view/#dom-window-matchmedia
Return a new MediaQueryList object, with the context object’s associated Document as the document, with parsed media query list as its associated media query list.
Then https://drafts.csswg.org/cssom-view/#media-query-list
A MediaQueryList object has an associated media which is the serialized form of the associated media query list.
Then https://drafts.csswg.org/cssom/#serialize-a-media-query-list
To serialize a media query list run these steps:
- If the media query list is empty, then return the empty string.
- Serialize each media query in the list of media queries, in the same order as they appear in the media query list, and then serialize the list.
window.matchMedia('(max-width: 100px) and (max-aspect-ratio: 1/1)').media
- So Safari and Chrome have a bug on the order?
- And Firefox a bug on the serialization of aspect-ratio value?
Is the specification clear enough?