In general developers should probably default to marking their
listeners as passive, unless their listeners are actually going to
call preventDefault(). We don't have a console log for saying "use a
passive listener", no. We can easily detect listeners that are not
marked passive and that are impacting scrolling latency (for example),
but it's impossible to tell with 100% accuracy if those listeners
*should* be marked passive or not. Some of those listeners are
probably legitimately not passive, because they do call
preventDefault() under some conditions - but we can't know that until
those conditions occur and preventDefault() is called.

Cheers,
kats

On Thu, May 5, 2016 at 3:21 PM, Justin Dolske <dol...@mozilla.com> wrote:
> How will a developer know when it would be worthwhile to mark their event
> listener as passive? Do we perhaps log something to the console?
>
> Justin
>
> On Wed, May 4, 2016 at 3:19 PM, Kartikaya Gupta <kgu...@mozilla.com> wrote:
>>
>> Summary: Authors can declare in their addEventListener call that the
>> listener will not be calling preventDefault() on the event. This
>> unlocks certain performance optimizations.
>>
>> Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1266066
>>
>> Link to standard:
>> https://dom.spec.whatwg.org/#dom-addeventlisteneroptions-passive -
>> note that this intent email is specifically about the "passive" flag;
>> the AddEventListenerOptions dictionary and addEventListener
>> modifications were already implemented in bug 1266194. I don't recall
>> seeing an intent email for that but maybe I missed it.
>> There is also an explainer doc at
>> https://github.com/WICG/EventListenerOptions which might be easier to
>> read for those already familiar with DOM events.
>>
>> Platform coverage: all platforms
>>
>> Estimated or target release: Hoping to get it in Firefox 49. I wrote
>> the patches today (they were pretty small) hence combining the intent
>> to implement and ship into this email rather than sending two separate
>> emails.
>>
>> Preference behind which this will be implemented: none at the moment
>>
>> Other browsers: See
>> https://github.com/WICG/EventListenerOptions#status-of-implementations
>> _______________________________________________
>> dev-platform mailing list
>> dev-platform@lists.mozilla.org
>> https://lists.mozilla.org/listinfo/dev-platform
>
>
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to