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