Open bkardell opened 4 months ago
Thinking on this there's a number of places where there's a getSupportedX() function. So a getSupportedCommands() function could work okay? I don't see a problem with adding it?
@keithamus what would you think about it?
You would have potentially interesting situations such as <div popover>
returning ['toggle-popover', 'show-popover'...] but <div>
returning nothing?
How contextual should it be? Would a closed dialog support the 'close' action?
I think we probably already have a HTML spec concept for retrieiving if an action is valid in a given context, so perhaps we can somewhat piggy back off that?
It seems reasonable I'm just not overly convinced on the use case. It seems to mostly be feature detection for polyfills but I think it's reasonably tenable to implement polyfills without the need for such explicit feature detection APIs.
If listing available actions is not an option for now, it would be nice to provide a warning in the HTML or the browser when an action is invalid given the context (or just because of a typo)
In the w3c TAG review, there was a closing comment that
1020 is related - I don't know if we've ever really fully discussed this feedback.