Closed Bug 1266194 Opened 9 years ago Closed 9 years ago

Implement boolean or EventListenerOptions as 3rd param to addEventListener

Categories

(Core :: DOM: Events, defect)

36 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed
firefox-esr38 - wontfix
firefox-esr45 47+ fixed

People

(Reporter: smaug, Assigned: baku)

References

Details

(Keywords: dev-doc-complete, Whiteboard: btpp-fixlater)

Attachments

(3 files)

This is the more important part, and support for 'passive' can be added later.
Whiteboard: btpp-fixlater
Assignee: nobody → amarchesini
Attached patch event.patch (deleted) — Splinter Review
In this patch I'm not implementing "passive" nor "once".
Attachment #8745144 - Flags: review?(masayuki)
Blocks: 1267505
Comment on attachment 8745144 [details] [diff] [review] event.patch Not enough information about this bug in comment 0. Redirecting this review to smaug...
Attachment #8745144 - Flags: review?(masayuki) → review?(bugs)
yeah, I can take a look given that I was fighting against this syntax, but failed :/
Attached patch event2.patch (deleted) — Splinter Review
Or maybe you prefer to have the dictionary propagated up to the EventListenerManager...
Attachment #8745164 - Flags: review?(bugs)
Comment on attachment 8745144 [details] [diff] [review] event.patch >+dictionary EventListenerOptions { >+ boolean capture = false; >+}; >+ >+dictionary AddEventListenerOptions : EventListenerOptions { >+ boolean passive = false; >+ boolean once = false; Could you actually comment the properties we don't support out. That way one can do feature testing by having a getter for the property and making it to throw. If exception is thrown, property is supported in the dictionary. To ease future patches we can still leave AddEventListenerOptions, even though it becomes just empty dictionary inheriting EventListenerOptions
Attachment #8745144 - Flags: review?(bugs) → review+
Comment on attachment 8745164 [details] [diff] [review] event2.patch >+EventListenerManager::RemoveEventListener( >+ const nsAString& aType, >+ const EventListenerHolder& aListenerHolder, >+ const dom::EventListenerOptionsOrBoolean& aOptions) >+{ >+ EventListenerFlags flags; >+ flags.mCapture = >+ aOptions.IsBoolean() ? aOptions.GetAsBoolean() >+ : aOptions.GetAsEventListenerOptions().mCapture; >+ RemoveEventListenerByType(aListenerHolder, aType, flags); >+} I guess this is better than calling the RemoveEventListener above, since we'll need to set other flags once we support passive and once. So, we need some tests too, wpt tests hopefully.
Attachment #8745164 - Flags: review?(bugs) → review+
> So, we need some tests too, wpt tests hopefully. I and smaug tested it locally.
and wpt tests are coming from blink folks hopefully later this week.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
[Tracking Requested - why for this release]: We should backport this to ESR so that once websites start to use this API, they will still work fine on ESR even if they don't feature detect it properly.
Flags: needinfo?(amarchesini)
Attached patch esr-45 (deleted) — Splinter Review
[Approval Request Comment] If this is not a sec:{high,crit} bug, please state case for ESR consideration: User impact if declined: If this optional parameter is used, ESR45 will not be able to handle it. This patch is for web compat. Fix Landed on Version: 49. Risk to taking this patch (and alternatives if risky): not really. The patch is quite simple. String or UUID changes made by this patch: none. See https://wiki.mozilla.org/Release_Management/ESR_Landing_Process for more info.
Flags: needinfo?(amarchesini)
Attachment #8745881 - Flags: approval-mozilla-esr45?
Sylvestre, do you know who handles ESR approvals? This has been waiting for a month now... Thanks!
Flags: needinfo?(sledru)
Comment on attachment 8745881 [details] [diff] [review] esr-45 Improve the ESR status. Sorry about the delay, we start dealing with esr uplifts usually at this time in the beta cycle.
Flags: needinfo?(sledru)
Attachment #8745881 - Flags: approval-mozilla-esr45? → approval-mozilla-esr45+
I guess 47 & 48 are fixed somewhere else, right?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: