[clipboard events] click-to-copy support could be hasFeature discoverable?

Hi,
I'm about to file a bug on implementing click-to-copy and click-to-cut per latest clipboard events spec in Gecko / Firefox, and this reminds me we haven't yet answered the question about discoverability. This functionality has a fallback story (Flash shims for platforms with Flash support, creating a dialog to tell the user to ctrl-c or ctrl-x manually otherwise) but there's not much point in fallback possibilities if support isn't discoverable.

What about hasFeature()? It's sort of not popular these days - because discovering APIs and methods directly is a much better way to do it. But if, as in this case, there is no special method or object to detect, I guess hasFeature() is acceptable as a fallback?

It would be nice if we could just do 

if(document.implementation.hasFeature('click-to-copy'))

or alternatively

if('ClipboardEvent' in window && document.implementation.hasFeature('click-to-copy')) 

to make sure both constructor and security permission is implemented. 

(I know hasFeature() usually takes a version number argument too, would be nice if it can be omitted when not necessary..)

Questions: 
1) Is this a good idea?
2) What's the spec supposed to say to invoke hasFeature() and define a "feature" string for its argument list?
-Hallvord

Received on Monday, 19 May 2014 13:09:37 UTC