This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14692 - CSS shader feature detection
Summary: CSS shader feature detection
Alias: None
Product: CSS
Classification: Unclassified
Component: Filter Effects (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Dean Jackson
QA Contact: This bug has no owner yet - up for the taking
Depends on:
Reported: 2011-11-04 01:02 UTC by Vincent Hardy
Modified: 2013-07-04 16:05 UTC (History)
5 users (show)

See Also:


Description Vincent Hardy 2011-11-04 01:02:56 UTC
The specification should describe a way for authors to find out if filter effects are supported or not. In addition, it would be useful if there was a way to detect if a particular shading language was supported or not.
Comment 1 Dean Jackson 2011-11-04 05:27:06 UTC
Would a media query be enough? I really like them because they provide both a CSS and JS method to detect features.
Comment 2 Stu Cox 2013-07-01 07:44:20 UTC
Would `@supports()` / `window.CSS.supports()` be able to cover this?

@supports(filter: custom(url('myshader.vs'))) {
    /* Styles applied if shader supported */

Potential down sides:

* `myshader.vs` would have to be downloaded before it could be verified if this shader language is supported (although henceforth could be cached)
* All parameters to the `custom()` function may be needed, which could make this very verbose
Comment 3 Dirk Schulze 2013-07-04 16:05:15 UTC
We added the @support rule with a value of "webgl". If that value is supported, WebGL fragment and vertex shader must be supported.