Re: Event Handler Attribute

On , Garrett Smith <dhtmlkitchen@gmail.com> wrote:

> 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.

Given that the spec never referred to inline functions as listeners, because that belongs in the ecmascript bindings, it was always implied to be the EventListener object. Setting thisArg to the currentTarget of the event is a defacto behavior by browsers.
So just needs some clarification in the proper ecmascript bindings section.

Received on Friday, 24 December 2010 06:52:13 UTC