Re: [Clipboard] Processing model feedback (and other)

On Mon, Feb 20, 2012 at 2:30 AM, Hallvord R. M. Steen <hallvord@opera.com>wrote:

> ..but what about the steps we need to do for "copy" and "cut" events *if*
> the canceled flag is set? It's actually a bit more complicated than "abort
> these steps", which is why I'm not sure how I should structure it if I try
> to follow your advice.
>

Yuck, I see the behavior now.  Here:

7. Create an event *ev* using the *ClipboardEvent* interface, with its *type
* attribute initialized to *e,* its *clipboardData* attribute initialized
to *data transfer,* and its *isTrusted* attribute initialized to true*.*
8. Dispatch *ev* at *event target*.
9. If *e* is:
    *paste*:
        If *ev*'s *canceled flag* is unset, and the cursor or selection is
in an editable context, insert the data from the clipboard and queue tasks
to fire any events that should fire due to the modification, see
interaction with other events for details
    *cut *or *copy*:
        If *ev*'s *canceled flag* is set,
            ...
        Otherwise,
            ...

(This is a first pass; it could probably be reduced to two steps without
losing precision.  Anne, maybe we need a hook into "fire an event named"
that lets us give the resulting event a name, like "fire an event *ev* named
*paste* at *object*"?  I'm not sure if the word "named" makes that
confusing.  He could just keep saying "the event" and not give it a name,
but it seems like a good idea to name objects when referring to them from
other steps.)

-- 
Glenn Maynard

Received on Monday, 20 February 2012 15:25:08 UTC