[Bug 23235] allow triggering copy action from certain event handlers

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23235

--- Comment #6 from Hallvord R. M. Steen <hsteen@mozilla.com> ---
> do we need to consider adding Touch and Pointer events

(Never really responded to this one..) The spec leaves this open in a
(somewhat) hand-wavy manner, saying that implementations should consider all
events it thinks expresses user intention or something like that. That may not
be ideal, given that it opens the door to implementation fragmentation, on the
other hand with the possibility for yet other input modes and events in the
future it's better to leave things slightly underdefined here I think.

(In reply to James M. Greene from comment #5)
> Also, just so I'm clear: this bug originally started by discussing using
> `document.execCommand` to execute copy/cut but the spec update would suggest
> (to me) that developers would be able to dispatch a
> "beforecopy"/"copy"/"beforecut"/"cut" event using the normal event
> dispatching mechanisms (i.e. `EventTarget#dispatchEvent`). 

Don't worry about the before* events, they wouldn't be useful in a
script-triggered context anyway :-). Apart from that: yes, this is correct. The
event API gives you some more power - i.e. if you just want to trigger a copy
of the selected text without further ado you can use execCommand(), if you want
to copy some specific text/data that your script already knows you can dispatch
an event with data and dataType set, and you no longer need the quirky
"dispatch-event-then-run-event-listener-modify-data" hack that the previous
versions of the spec required.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 23 January 2014 23:44:43 UTC