Re: [css3-conditional] @supports rule

On Tue, Jan 16, 2018 at 3:45 PM, Dennis Heuer
<einz@verschwendbare-verweise.seinswende.de> wrote:
> Hello,
>
> if I read well, the rule @supports is only taking single properties as
> arguments. I'd like to see it support css version and spec names to
> allow enframing the case more widely, like:
>
> @supports css21 and (css3: text-decoration, compositing, transform) ...
>
> This is a quite arbitrary example... Just a guess...

As previous emails have explained, CSS is not versioned.

As for providing an entire spec name, that's problematic for a few reasons.

1. Some spec names overlap with property names, like "transform".

2. Spec names are intended to be human-only; we didn't choose their
names with the intention to show up in APIs.

3. Most importantly, the @supports rule is very intentionally designed
to rely solely on existing parsing machinery, rather than
human-maintained lists.  To evaluate a support condition, all a
browser has to do is feed the property+value to their CSS parser and
see if it parses or not.  This system avoids the failure modes of
previous attempts at providing an "is this supported?" API, namely
that a human-maintained set of features is often out of date or
encourages lying.  These problems made the legacy hasFeature() JS API
mostly useless, for example.  Allowing an author to ask "is this
entire spec supported?" falls exactly into that failure mode.

~TJ

Received on Wednesday, 17 January 2018 00:13:00 UTC