Intent to Ship: modify add/removeEventListener to accept EventListenerOptions

65 views
Skip to first unread message

Dave Tapuska

unread,
Jan 8, 2016, 11:00:30 AM1/8/16
to blink-dev

Contact emails

dtap...@chromium.org, rby...@chromium.org


Spec

https://dom.spec.whatwg.org/#interface-eventtarget


Minor change to an existing API I don't think it requires a TAG review.


Summary

Add the ability to set different options when adding/removing event listeners via add a dictionary to addEventListener, removeEventListener API.

ie: add addEventListener(DOMString, EventListener, EventListenerOptions);

removeEventListener(DOMString, EventListener, EventListenerOptions);


Link to “Intent to Implement” blink-dev discussion

https://groups.google.com/a/chromium.org/d/msg/blink-dev/nyo08pwJcfQ/meb49q1yCQAJ


Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


Interoperability and Compatibility Risk

Low interoperability and compatibility risk. 


The only perceived compatibility risk is the different interpretation when the third argument is an empty object. This was discussed in the spec review and we've added metrics (I don't know why AddEventListenerThirdArgumentsObject doesn't appear on the external page)

https://www.chromestatus.com/metrics/feature/popularity#RemoveEventListenerThirdArgumentIsObject


But nonetheless looking at the internal numbers; Add and Remove with the third argument as an object both have really low usage (generally showing 0.00%). (The data was started tracking in M48.)



OWP launch tracking bug

crbug.com/543685


Entry on the feature dashboard

https://www.chrometatus.com/features/5718574840676352

Rick Byers

unread,
Jan 8, 2016, 12:06:05 PM1/8/16
to Dave Tapuska, blink-dev
Note that this intent covers only the "capture" option in the spec, and so affects only API syntax - doesn't provide any new functionality.  This is a pre-requisite for the more interesting "passive" option, whose intents will come later.

Rick

dtap...@chromium.org

unread,
Jan 8, 2016, 1:02:11 PM1/8/16
to blink-dev, dtap...@chromium.org
Rick indicated to me my precision wasn't clear enough.

Updated metric information from M48 Beta are:

addEventListener 3rd arg object:

  - 0.0003% on windows
  - 0.00008% on Android
removeEventListener 3rd arg object:
  - 0.00008% on windows
  - 0.000002% on Android

Dimitri Glazkov

unread,
Jan 12, 2016, 1:07:06 PM1/12/16
to dtap...@chromium.org, blink-dev
LGTM1.

:DG<

Jochen Eisinger

unread,
Jan 12, 2016, 1:39:55 PM1/12/16
to Dimitri Glazkov, dtap...@chromium.org, blink-dev
lgtmTWO

PhistucK

unread,
Jan 12, 2016, 1:45:49 PM1/12/16
to Jochen Eisinger, Dimitri Glazkov, Dave Tapuska, blink-dev
Can we at least wait for the counters to bake on the stable channel for a release?


PhistucK

lgtmTWO
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Rick Byers

unread,
Jan 12, 2016, 3:30:23 PM1/12/16
to PhistucK, Jochen Eisinger, Dimitri Glazkov, Dave Tapuska, blink-dev
On Tue, Jan 12, 2016 at 1:45 PM, PhistucK <phis...@gmail.com> wrote:
Can we at least wait for the counters to bake on the stable channel for a release?

I don't see a reason to delay personally.  We know the counters themselves can't tell the whole compat story (namely what the developers actual intent was in these broken cases), and IMHO we have enough data to indicate the overall magnitude of the risk isn't huge.  The only way we answer the remaining question is by trying to ship.  We'll need to keep our eyes open for compat issues anyway and be prepared to revert.  As part of this, we can double-check the use counters after 48 goes stable but before 49 goes stable - still plenty of time to revert this CL from the beta branch if such data indicates there is a problem.

Chris Harrelson

unread,
Jan 12, 2016, 5:47:29 PM1/12/16
to Rick Byers, PhistucK, Jochen Eisinger, Dimitri Glazkov, Dave Tapuska, blink-dev
LGTM3 as long as we look closely at the UseCounters and are ready to revert.

Joe Medley

unread,
Jan 12, 2016, 6:59:33 PM1/12/16
to Chris Harrelson, Rick Byers, PhistucK, Jochen Eisinger, Dimitri Glazkov, Dave Tapuska, blink-dev
Which version of Chrome are you targeting?

Joe Medley | Technical Writer, DevPlat | jme...@google.com | 816-678-7195

Dave Tapuska

unread,
Jan 13, 2016, 11:31:20 AM1/13/16
to Joe Medley, Chris Harrelson, Rick Byers, PhistucK, Jochen Eisinger, Dimitri Glazkov, blink-dev
Well it is approved; and Ricks comments were around 49. So I hope to make the change today so it lands before branch on Friday so it will be in 49.

dave.
Reply all
Reply to author
Forward
0 new messages