W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2012

Re: [Clipboard API] The before* events

From: Glenn Maynard <glenn@zewt.org>
Date: Fri, 2 Nov 2012 09:59:08 -0500
Message-ID: <CABirCh_HERw=bFAPXY_jbTMR71jzcxkmWPC0e4m_nQXh8=MPng@mail.gmail.com>
To: olli@pettay.fi
Cc: Hallvord Reiar Michaelsen Steen <hallvord@opera.com>, Ojan Vafai <ojan@chromium.org>, Travis Leithead <travis.leithead@microsoft.com>, WebApps WG <public-webapps@w3.org>, Ryosuke Niwa <rniwa@webkit.org>, Aryeh Gregor <ayg@aryeh.name>, Daniel Cheng <dcheng@chromium.org>, Bjoern Hoehrmann <derhoermi@gmx.net>, Sebastian Markbåge <sebastian@calyptus.eu>
On Fri, Nov 2, 2012 at 3:06 AM, Olli Pettay <Olli.Pettay@helsinki.fi> wrote:

> It should work just fine if you check the whole eventtarget chain (from
> the target to the window object).
>

But that means adding a capturing listener on the window would apply this
affect to every single element on the page.  If that's an acceptable
result, then just add the menu item all the time and forget about the event
handler logic.


On Fri, Nov 2, 2012 at 3:12 AM, Hallvord Reiar Michaelsen Steen <
hallvord@opera.com> wrote:

> Why not? The UA can tell if there are copy/cut/paste listeners registered
> anywhere in the document. Besides, we have no way to tell whether the
> author's styling is implementing some faux object focus stuff, so we don't
> know where the user thinks the focus is.
>

Because if you're trying to use the existance of event handlers to enable
menu items on the correct elements, there's no way of knowing which element
a capturing event handler higher up the tree is actually for.

Or, for that matter, if it's for anything at all.  A diagnostic library
adding lots of capturing event handlers to the window for logging purposes
shouldn't cause unexpected side-effects, like causing new menu items to
show up.

-- 
Glenn Maynard
Received on Friday, 2 November 2012 14:59:39 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:55 GMT