You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Media Queries Level 3/4/5 have a consistent description of the way to handle unknown media feature name or unknown media feature value: transform the media query to not all.
An unknown or , or disallowed , results in the value "unknown". A whose value is "unknown" must be replaced with not all.
With the introduction of the new <general-enclosed> term in the grammar and the 3-valued logic evaluation, and the intention of allowing future-proof query matching in the case of unknown media feature, my understanting of the spec would be that:
when one (or several) media feature name or value is unknown, and the complete media query is unknown, such as (width: foobar) (unkown value) or (foobar) (unknown name), it should be replaced with not all.
when one (or several) media feature name or value is unknown, but the complete media query is either true or false, it should not be replaced such as (foobar: foobarvalue) or (color) (assuming color is true).
However, the WPT media queries tests rely on another behavior:
An unknown <<mf-name>> or <<mf-value>>, or a feature value which does not matches the value syntax for that media feature, results in the value “unknown”. A <<media-query>> whose value is “unknown” must be replaced with ''not all''.
I think this makes it pretty clear that Firefox is right here? cc @andruud, given you changed away from this
I think Firefox is right when the media query is unknown (1st example), but not when it's definitely true or false because of 3-value boolean logic (2nd example).
Media Queries Level 3/4/5 have a consistent description of the way to handle unknown media feature name or unknown media feature value: transform the media query to
not all
.(quote from https://drafts.csswg.org/mediaqueries-5/#error-handling)
With the introduction of the new
<general-enclosed>
term in the grammar and the 3-valued logic evaluation, and the intention of allowing future-proof query matching in the case of unknown media feature, my understanting of the spec would be that:(width: foobar)
(unkown value) or(foobar)
(unknown name), it should be replaced withnot all
.(foobar: foobarvalue) or (color)
(assuming color istrue
).However, the WPT media queries tests rely on another behavior:
wpt/css/mediaqueries/resources/matchmedia-utils.js
Line 36 in 0028b5a
Even when the media query result is
unknown
, they don't expect it to be replaced bynot all
. Is this a bug ?Current implementations
The implementations in Firefox and Chrome have different behaviors on this issue.
Firefox Developer Edition (v104):
In Chrome Canary:
The text was updated successfully, but these errors were encountered: