LeaVerou / css3test

How does your browser score for its CSS3 support?
http://css3test.com
MIT License
214 stars 83 forks source link

Way of testing at-rules cannot cover extensions to @supports #186

Open SebastianZ opened 5 years ago

SebastianZ commented 5 years ago

@supports has a very loose syntax. The specification says this:

The above grammar is purposely very loose for forwards-compatibility reasons, since the <general-enclosed> production allows for substantial future extensibility.

A user agent compliant to the spec. will also parse an @supports rule like this one:

@supports foo(bar) { }

For basic support of that rule it may be sufficient to test whether the syntax is parsed correctly, but Conditional Rules 4 added support for selector().

So to check whether a browser actually supports this new selector() feature, it needs to be checked using CSS.supports(). A browser that supports it will output true for CSS.supports('selector(span)') while one that doesn't outputs false.

Sebastian