Re: [css3-mediaqueries] not (media-feature)

I have seen people trying to use it for feature detection at least, by
comparing window.matchMedia('(feature)').matches to
window.matchMedia('not (feature)').

I think it is derisable to change, and I wouldn't expect it to be much
in use, though I have no data to back that claim up.

Cheers
Kenneth

On Thu, Oct 25, 2012 at 11:24 AM, Florian Rivoal <florian@rivoal.net> wrote:
> On Tue, 23 Oct 2012 17:24:39 +0200, Kenneth Rohde Christiansen
> <kenneth.christiansen@gmail.com> wrote:
>>
>> > > Is "not (media-feature)" forbidden per syntax?
>> >  Yes.
>>
>> It seems a bit counter intuitive and conflicting with:
>>
>> "The logical NOT can be expressed through the ‘not’ keyword. The
>> presence of the keyword ‘not’ at the beginning of the media query
>> negates the result. I.e., if the media query had been true without the
>> ‘not’ keyword it will become false, and vice versa."
>>
>> I stumpled upon this while debugging a website stating that we (tested
>> with Chrome) didn't support the monochrome media query.
>>
>> Maybe we should just fix the grammar?
>
>
> I agree it is not very intuitive the way it is, especially since media
> types are less useful than initially intended. I would be happy to make
> this change, but given how long media queries have been out there,
> supported by everybody, I am not sure we can safely do it.
>
> As the syntax you want looks like it should work already, I am sure
> people have used it, and they may have gotten their page to look the
> way they want without noticing that the media query didn't work. If
> we make it work, these rules will start having an effect, which
> might no longer be the one originally desired.
>
> What does the rest of the WG think? Is this desirable (I think so)?
> Is this safe enough (I don't know)?
>
>  - Florian



-- 
Kenneth Rohde Christiansen
Senior Engineer, WebKit, Qt, EFL
Phone  +45 4093 0598 / E-mail kenneth at webkit.org

﹆﹆﹆

Received on Thursday, 25 October 2012 09:30:26 UTC