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

On Sat, Jul 11, 2015 at 11:41 PM, Rick Byers <rbyers@chromium.org> wrote:
> What Anne describes is perfect!  I'm not hung up on the value of cancelable
> itself - some internal bit on Event that makes preventDefault a no-op (or
> event throw) during listener invocation is fine with me (and I agree - less
> weird).  If code really wants to test whether it's call to preventDefault
> took effect, it can check defaultPrevented afterward.

No, that is not what I said. I said we'd disable preventDefault() for
the listeners that have this bit set. If all listeners for a given
event have the bit said, the UA can make the optimization.

(And the setTimeout() example is perfectly deterministic. It changes
the canceled flag, but after that flag has been consulted by the
dispatcher.)


-- 
https://annevankesteren.nl/

Received on Sunday, 12 July 2015 06:40:49 UTC