W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2010

Re: Event Handler Attribute

From: Doug Schepers <schepers@w3.org>
Date: Thu, 23 Dec 2010 22:45:24 -0500
Message-ID: <4D141754.4080109@w3.org>
To: Garrett Smith <dhtmlkitchen@gmail.com>
CC: DOM mailing list <www-dom@w3.org>
Hi, Garrett-

Garrett Smith wrote (on 12/23/10 9:55 PM):
> Where is the `thisArg` specified in D3E? Context for event handler
> properties or eventListeners registered with addEventListener is
> generally set to the object on which the callback has been set on.
> Example:
>
>    document.body.addEventListener("click", f, false);
>
>    function f() {
>      alert( this === document.body );
>    }
>
> That behavior should be specified somewhere, and if not in D3E, then
> somewhere that D3E links to, like HTML5.

As far as I know, the 'this' keyword is defined in ECMAScript [1].  ECMA 
5, section 11.1.1 says:
[[
  The this keyword evaluates to the value of the ThisBinding of the 
current execution context.
]]

DOM3 Events doesn't define script execution (in fact, it tries to be 
language-neutral, and should work with Java as well as Javascript).


[1] http://www.ecmascript.org/docs/tc39-2009-043.pdf

Regards-
-Doug Schepers
W3C Team Contact, SVG, WebApps, and Web Events WGs
Received on Friday, 24 December 2010 03:45:27 GMT

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