W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2011

Re: Target of onkeyup/down/press events

From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Thu, 12 May 2011 12:44:38 +0300
Message-ID: <4DCBAC06.5090306@helsinki.fi>
To: Giuseppe Pascale <giuseppep@opera.com>
CC: "www-dom@w3.org" <www-dom@w3.org>
On 05/12/2011 11:38 AM, Giuseppe Pascale wrote:
> Hi all,
> I was looking at DOM specifications and I'm a little bit confused about
> the following.
>
> Question: (according to the spec) can an HTMLDocument receive a
> keyup/down/press event?
>
> I say according to the spec, because this works in practice (tried in
> Opera,Chrome and Firefox on Ubuntu)
>
> Anyway, if I look at the latest stable version of DOM 3 Events
> http://www.w3.org/TR/DOM-Level-3-Events/

That is old.
Use http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html
Although even the latest draft has only Element as the target for key 
events.

But anyway, do you have a testcase where events are targeted to document 
in all those browsers?
(I think you're right, but I'd like to see what you were testing)

-Olli


>
> I see that "Target" for these events is "Element".
>
> Looking at the DOM2
> http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-26809268
>
>
>
> I see that HTMLDocument -> Document -> Node, so HTMLDocument is not an
> Element
>
> So in short, either HTMLDocument cannot receive key events or target in
> DOM3 should be Node. Or I am missing something.
>
> cheers,
> /g
>
> P.S. keep me in CC of the reply since I'm not on this list
>
>
Received on Thursday, 12 May 2011 09:45:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:07 GMT