W3C home > Mailing lists > Public > www-style@w3.org > October 2011

Re: [css3-conditional] @supports API

From: L. David Baron <dbaron@dbaron.org>
Date: Mon, 10 Oct 2011 11:55:57 -0700
To: Peter Beverloo <peter@lvp-media.com>
Cc: Paul Irish <paul.irish@gmail.com>, www-style@w3.org
Message-ID: <20111010185557.GA23717@pickering.dbaron.org>
On Monday 2011-10-10 19:33 +0100, Peter Beverloo wrote:
> The primary reason for matchMedia to return a MediaQueryList object is that
> media queries can change while the page is active, and thus provides
> listeners for it.  Considering an engine's support for certain CSS
> properties is unlikely to change during a page's execution, a simpler API
> may be more appropriate.
> window.supportsStyle('width: 1fr');
> Going even further, part of the parsing step could be circumvented by
> accepting two arguments, the property name and the value:
> window.supportsStyle('width', '1fr');
> Neither would not support checking multiple property-value pairs at once,
> but it reduces complexity significantly.

Agreed; I think I like the second form better.  Support for handling
'or', 'and', and 'not' isn't needed for JS callers, since JS has
those already.

(I might be inclined towards supportsCSS rather than supportsStyle,
but I'd be open to better suggestions.  CSS seems more specific, but
maybe it's too specific in the wrong way, in that people would
expect it to take arbitrary CSS.)


𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
Received on Monday, 10 October 2011 18:56:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:05 UTC