Re: [whatwg] DOM Events Proposal: EventListenerOptions 'mayCancel' for improved scroll performance

On Sat, Jul 11, 2015 at 8:19 PM, Domenic Denicola <d@domenic.me> wrote:
> I'm not sure that actually matters though, since canceling inside setTimeout(,0) shouldn't have much affect besides changing `e.defaultPrevented`. So maybe it's OK.

It's fine. The code that dispatches an event and then checks the
event's canceled flag will run before a task queued by invoking
setTimeout() during dispatching runs. You can only change course if
you change the canceled flag during dispatch (which this new way of
listening would prevent).


-- 
https://annevankesteren.nl/

Received on Saturday, 11 July 2015 19:15:03 UTC