Re: [mediaqueries] Error handling for media-condition

On Tue, Sep 22, 2015 at 5:51 AM, Simon Pieters <simonp@opera.com> wrote:
> https://drafts.csswg.org/mediaqueries-4/#error-handling seems only concerned
> about media queries, not so much media condition. <img sizes> uses a media
> condition, not a media query. Please state in the spec:
>
> * What should happen when a media condition doesn't match the grammar?

That's up to the calling site.  Typically you'll just try to match it
against a grammar, and if it doesn't match the grammar, you'll throw
it away.  This is what sizes='' does; it parses a comma-separated list
of tokens, then matches each entry against the <source-size> grammar
and discards things that don't match.

> * What should happen when a media condition has an unknown <mf-name> or
> <mf-value>, or disallowed <mf-value>?

I've amended that section to say it resolves to "unknown" (and then an
MQ that resolves to unknown becomes "not all").

> * If the result of a media condition is unknown, should it match or not?

I've rejiggered the text there to be more generic - if "unknown"
escapes into any boolean context, it automatically becomes false.

~TJ

Received on Thursday, 24 September 2015 00:03:37 UTC