W3C home > Mailing lists > Public > www-style@w3.org > April 2015

Re: [mediaqueries] @media not (unsupported-media-feature) v.s. @media not (unsupported + syntax)

From: Florian Rivoal <florian@rivoal.net>
Date: Fri, 24 Apr 2015 21:47:10 +0200
Cc: Simon Pieters <simonp@opera.com>, Simon Sapin <simon.sapin@exyr.org>, www-style list <www-style@w3.org>
Message-Id: <B3B8A3DD-CE09-4B00-93DB-8B25A2C0CC92@rivoal.net>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

> On 24 Apr 2015, at 21:12, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> 
> So we've got a few choices here:
> 
> 1. Assume that cases like the last two really are rare in practice
> (they only show up once each, in the corpus of nearly 6M pages), and
> decide that we're okay with them occasionally giving weird results.
> I'd like to examine the pages they show up in to see what they're
> really using these for.  (This would remove the ability to use
> always-true prefixed MQs as a browser filter, but you can still use
> @supports for this, so no big loss.)
> 
> 2. Switch "maybe" to "bottom", so that OR is the only way to escape
> from a "bottom" pit.  DeMorgan's law is lost (in general; it still
> applies to expressions that don't contain a "bottom") but shrug.
> 
> 3. Keep Kleene semantics for "maybe", but specially recognize prefixed
> values (ones that start with a single dash) and give them "bottom"
> semantics, which can only be escaped by OR.  Custom (double-dash) or
> unknown (no dash) MQs continue to be "maybe" with the Kleene
> semantics.  This means we have a four-valued logic, technically.
> 
> 4. Decide that "not screen" is the problem (media types in general are
> the problem), and declare that screen == all, or at least that "not
> screen" == "not all".  This'll fix the third and fourth lines.

While 3 might give use useful semantics when you don't think of it,
it will give us very complicated semantics when you do think of it.
I doubt any author wants to learn to reason about 4-valued logic
just to figure out what's going on with their slightly unusual media
query.

As for 4, I suspect it will break print stylesheets. "not screen" has,
as you noted, effectively meant "print", and I'd be shocked if people
didn't depend on it to do so.

So that leaves us with 1 and 2. 1 is a bit nicer, but has a bit higher
compat risk. 2 is a bit safer, and a bit less nice. I'd prefer 1 if
implementors are willing to do that, but I can live with either.

 - Florian
Received on Friday, 24 April 2015 19:47:36 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:30 UTC