[whatwg] Supporting feature tests of untestable features

There are features being added to the DOM/web platform, or at least under consideration, that do not have reasonable feature tests obvious/practical in their design. I consider this a problem, because all features which authors (especially those of libraries, like me) rely on should be able to be tested if present, and fallback if not present.

Paul Irish did a round-up awhile back of so called "undetectables" here: https://github.com/Modernizr/Modernizr/wiki/Undetectables

I don't want to get off topic in the weeds and/or invite bikeshedding about individual "hard to test" features. So I just want to keep this discussion to a narrow request:

Can we add something like a "feature test API" (whatever it's called) where certain "hard" cases can be exposed as tests in some way?

The main motivation for starting this thread is the new `link rel=preload` feature as described here: https://github.com/w3c/preload

Specifically, in this issue thread: https://github.com/w3c/preload/issues/7 I bring up the need for that feature to be testable, and observe that as currently designed, no such test is feasable. I believe that must be addressed, and it was suggested that perhaps a more general solution could be devised if we bring this to a wider discussion audience.

Received on Wednesday, 1 April 2015 04:58:10 UTC