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:
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.
@supports has a very loose syntax. The specification says this:
A user agent compliant to the spec. will also parse an @supports rule like this one:
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 usingCSS.supports()
. A browser that supports it will outputtrue
forCSS.supports('selector(span)')
while one that doesn't outputsfalse
.Sebastian