Closed
Bug 1276424
Opened 7 years ago
Closed 7 years ago
EventListenerWasAdded/Remove doesn't work in JS implemented webidl because of missing 'override'
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla49
People
(Reporter: smaug, Assigned: smaug)
References
Details
(Whiteboard: btpp-active)
Attachments
(1 file)
4.89 KB,
patch
|
bzbarsky
:
review+
Sylvestre
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
This used to work just fine, but looks like we've become more strict with 'override' usage, and so the generated code isn't working anymore.
Assignee | ||
Comment 1•7 years ago
|
||
bz, is this too ugly approach? This is so special case, for now at least, that adding a new annotation or anything doesn't quite make sense. My test interface [JSImplementation="@mozilla.org/test/event-target;1"] interface TestEventTarget : EventTarget { [ChromeOnly] void eventListenerWasAdded(DOMString aType); [ChromeOnly] void eventListenerWasRemoved(DOMString aType); void fooBarMethod(); }; get the following methods virtual void EventListenerWasAdded(const nsAString& aType, ErrorResult& aRv, JSCompartment* aCompartment = nullptr) override; virtual void EventListenerWasRemoved(const nsAString& aType, ErrorResult& aRv, JSCompartment* aCompartment = nullptr) override; void FooBarMethod(ErrorResult& aRv, JSCompartment* aCompartment = nullptr); aswan, want to try this patch?
Flags: needinfo?(bzbarsky)
Flags: needinfo?(aswan)
Assignee | ||
Comment 2•7 years ago
|
||
(can't ask review from bz atm)
![]() |
||
Comment 3•7 years ago
|
||
> and so the generated code isn't working anymore
When you say "not working" does that mean "doesn't compile" or something else? I'm assuming it doesn't compile because it overrides without saying so?
Assignee | ||
Comment 4•7 years ago
|
||
Oops, https://bugzilla.mozilla.org/show_bug.cgi?id=1268077#c2 is the context here.
Updated•7 years ago
|
Whiteboard: btpp-active
![]() |
||
Comment 5•7 years ago
|
||
Comment on attachment 8757622 [details] [diff] [review] patch This is probably fine. If we wanted to, we could add an extended attribute for this, just to prevent issues with other interfaces that use these method names, unlikely as that is. r=me, in any case.
Flags: needinfo?(bzbarsky)
Attachment #8757622 -
Flags: review+
Assignee | ||
Comment 6•7 years ago
|
||
well, that should be very unlikely, which is why I took this quick and dirty approach. If we'll add more this kind of methods, then sure, some annotation in webidl hinting that the js implementation method should have virtual and override.
Pushed by opettay@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/5583f4e00aa7 EventListenerWasAdded/Remove doesn't work in JS implemented webidl because of missing 'override', r=bz
Comment 8•7 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #1) > aswan, want to try this patch? confirmed that it appears to fix the problem I ran into, thanks!
Flags: needinfo?(aswan)
Comment 9•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5583f4e00aa7
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Updated•7 years ago
|
status-firefox48:
--- → affected
Comment 10•7 years ago
|
||
we would need an uplift request too :) thank
Comment 11•7 years ago
|
||
bugherderuplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/c6c037a5f3bd
Comment 12•7 years ago
|
||
Comment on attachment 8757622 [details] [diff] [review] patch Approval Request Comment [Feature/regressing bug #]: [User impact if declined]: This bug blocks bug 1268077 which was approved for uplift, there is a discussion there about the impact. [Describe test coverage new/current, TreeHerder]: try run for this bug plus 1268077 against beta: https://treeherder.mozilla.org/#/jobs?repo=try&revision=09967b7d9658 [Risks and why]: see discussion in bug 1268077 [String/UUID change made/needed]: none
Attachment #8757622 -
Flags: approval-mozilla-beta?
Comment 13•7 years ago
|
||
Comment on attachment 8757622 [details] [diff] [review] patch Thanks, approving for posterity
Attachment #8757622 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Updated•4 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•