[Webkit-unassigned] [Bug 167031] Media Query should allow negation for media feature when media type is not specified

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 17 16:20:37 PST 2017


https://bugs.webkit.org/show_bug.cgi?id=167031

--- Comment #2 from Dean Jackson <dino at apple.com> ---
Here's how I'm reading the spec....

Suppose we have:

div {
  width: 100px;
  height: 100px;
  background-color: red;
}

@media not (min-width: 600px) {
  div {
    background-color: blue;
  }
}

Then the @media rule follows

[[[
2.2.1. Negating a Media Query: the not keyword

An individual media query can have its result negated by prefixing it with the keyword not. If the media query would normally evaluate to true, prefixing it with not makes it evaluate to false, and vice versa.
]]]

And it gives an example.

However, I don't this this rule applies in this case. Check out Section 3. Syntax.

<media-query> = <media-condition>
             | [ not | only ]? <media-type> [ and <media-condition-without-or> ]?

In our example, it matches <media-condition>, rather than "not <media-type>".

<media-condition> = <media-not> | <media-and> | <media-or> | <media-in-parens>

Cool. It looks like we are a <media-not>.

<media-not> = not <media-in-parens>
<media-in-parens> = ( <media-condition> ) | <media-feature> | <general-enclosed>

So this is a media-not, that has a media-in-parens that is a media-feature.

None of the browsers follow this behaviour though.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170118/08b1e96b/attachment-0001.html>


More information about the webkit-unassigned mailing list