[clipboard-apis] Should queryCommandEnabled(cut|copy|paste) trigger onbefore* events? (#4)

Through onbefore* events, JS can ensure copy/cut/paste UI in the browsers is enabled even if there is no selection or editable context. However, unless we spec queryCommandEnabled() to fire onbefore* events and return true if those are prevented, we risk that queryCommandEnabled() returns false even when the UI gets enabled and the actions are in fact available.

Proposal: the clipboard-apis spec can write an "enabledness check" algorithm which [the editing spec](https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#querycommandenabled%28%29) can hook into.

The enabledness check will be spec'ed roughly like this:
1) Fire one onbefore<action> event on document
2) When any event handler(s) are done, check if the default action was prevented/return value was false. If this is the case, return true for "enabledness check"
3) Otherwise, fall back to the implementation's default logic.

Criticism welcome.


---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/issues/4

Received on Friday, 8 May 2015 10:59:14 UTC