Fwd: event.returnValue

Forwarding previously blocked message.

---------- Forwarded message ----------
From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Tue, 14 Sep 2010 23:42:14 -0700
Subject: Re: event.returnValue
To: "Hallvord R. M. Steen" <hallvord@opera.com>
Cc: Jonas Sicking <jonas@sicking.cc>, www-dom@w3.org

On 9/14/10, Hallvord R. M. Steen <hallvord@opera.com> wrote:
> [Replying to two responses at once - Jonas and Garret]
>
[...]
>> A potential nasty edge case:
>>
[...]
> I'd simply say the last one should always 'win'.
>


MSDN says otherwise. look here:
"    The value of this property takes precedence over values returned
by the function, such as through a Microsoft JScript return statement.
"

<http://msdn.microsoft.com/en-us/library/ms534372%28VS.85%29.aspx>

And so how complicated will it be when one or more functions returns
false, sets e.returnValue = false, and calls ev.preventDefault()?

> Since order event handlers trigger in is normally undefined this is close
> to being a hard question - but we're making it a bit simpler by adding a
> capturing event listener. So clickHandler runs first, then the
> clickHandler2 method.

I'm not sure I agree.
HTML5:
"Event handlers therefore always fire before event listeners attached
using addEventListener()."
<http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#events>

And Event order is defined in D3E.

"Next, the implementation must determine the current target's
candidate event listeners. This shall be the list of all event
listeners that have been registered on the current target in their
order of registration. Once determined, the candidate event listeners
cannot be changed; adding or removing listeners does not affect the
current target's candidate event listeners."
<http://www.w3.org/TR/2010/WD-DOM-Level-3-Events-20100907/#event-phase>

-- 
Garrett

Received on Thursday, 16 September 2010 18:10:10 UTC