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)
Tracking
()
RESOLVED
FIXED
mozilla49
People
(Reporter: smaug, Assigned: baku)
References
Details
(Keywords: dev-doc-complete, Whiteboard: btpp-fixlater)
Attachments
(3 files)
21.39 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
13.40 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
23.62 KB,
patch
|
Sylvestre
:
approval-mozilla-esr45+
|
Details | Diff | Splinter Review |
This is the more important part, and support for 'passive' can be added later.
Updated•9 years ago
|
Keywords: dev-doc-needed
Updated•9 years ago
|
Whiteboard: btpp-fixlater
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → amarchesini
Assignee | ||
Comment 1•9 years ago
|
||
In this patch I'm not implementing "passive" nor "once".
Attachment #8745144 -
Flags: review?(masayuki)
Comment 2•9 years ago
|
||
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)
Reporter | ||
Comment 3•9 years ago
|
||
yeah, I can take a look given that I was fighting against this syntax, but failed :/
Assignee | ||
Comment 4•9 years ago
|
||
Or maybe you prefer to have the dictionary propagated up to the EventListenerManager...
Attachment #8745164 -
Flags: review?(bugs)
Reporter | ||
Comment 5•9 years ago
|
||
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+
Reporter | ||
Comment 6•9 years ago
|
||
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+
Assignee | ||
Comment 8•9 years ago
|
||
> So, we need some tests too, wpt tests hopefully.
I and smaug tested it locally.
Reporter | ||
Comment 9•9 years ago
|
||
and wpt tests are coming from blink folks hopefully later this week.
Comment 10•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5b7777972750
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Comment 11•9 years ago
|
||
[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.
Assignee | ||
Comment 12•9 years ago
|
||
[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?
Comment 13•8 years ago
|
||
Sylvestre, do you know who handles ESR approvals? This has been waiting for a month now... Thanks!
Flags: needinfo?(sledru)
Comment 14•8 years ago
|
||
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+
Comment 15•8 years ago
|
||
I guess 47 & 48 are fixed somewhere else, right?
status-firefox-esr38:
--- → wontfix
status-firefox-esr45:
--- → affected
Comment 16•8 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-esr45/rev/02df988a56ae
Comment 17•8 years ago
|
||
Updated: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener and https://developer.mozilla.org/en-US/Firefox/Releases/49#DOM_HTML_DOM
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•