Closed
Bug 943613
Opened 11 years ago
Closed 11 years ago
Notify JS implemented Event Target when an event listener is added / removed
Categories
(Firefox OS Graveyard :: NFC, defect)
Firefox OS Graveyard
NFC
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: psiddh, Assigned: smaug)
References
Details
Attachments
(6 files, 2 obsolete files)
4.14 KB,
patch
|
Details | Diff | Splinter Review | |
1.60 KB,
patch
|
Details | Diff | Splinter Review | |
4.15 KB,
patch
|
Details | Diff | Splinter Review | |
1.81 KB,
patch
|
Details | Diff | Splinter Review | |
4.21 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
5.21 KB,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/30.0.1599.114 Chrome/30.0.1599.114 Safari/537.36 Steps to reproduce: Whenever a Gaia application adds / removes event listeners , JS implementation of EventTargets should be notified
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bugs
Assignee | ||
Comment 1•11 years ago
|
||
Avoid adding more callback magic to codegen, but just hack this into DETH and require webidl interface to implement [ChromeOnly] void eventListenerAdded(nsIAtom? aEventNameWithOnPrefix); [ChromeOnly] void eventListenerRemoved(nsIAtom? aEventNameWithOnPrefix); Passing nsIAtom isn't super nice for js impl, but since we normally don't have this stuff called, I'd prefer to not convert the param to string (nor remove on-prefix)
Attachment #8338881 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 2•11 years ago
|
||
dump "on" + eventname to terminal when listener is added to PeerConnection
Comment 3•11 years ago
|
||
> Passing nsIAtom isn't super nice for js impl
How about we just special-case it in BindingUtils.h like we do nsIVariant and convert it to a string JS value at that point?
Comment 4•11 years ago
|
||
Comment on attachment 8338881 [details] [diff] [review] patch OK, I think I've convinced myself that you shouldn't end up with an exception that needs cleanup on rv in these cases (because your compartment is null and because the callback codegen won't throw strings that need deallocating). So r=me if we either make nsIAtom convert to string or if you just make this take a DOMString and use nsDependentAtomString, which should be pretty cheap.
Attachment #8338881 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 5•11 years ago
|
||
Ok, I'll make webidl methods take DOMString and then the param should be without on prefix.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #8338881 -
Attachment is obsolete: true
Assignee | ||
Comment 7•11 years ago
|
||
Attachment #8338882 -
Attachment is obsolete: true
Assignee | ||
Comment 8•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/db836ecd7746
Comment 9•11 years ago
|
||
Backed out because of build bustage: https://hg.mozilla.org/integration/mozilla-inbound/rev/b66f95073899 https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=db836ecd7746
Assignee | ||
Comment 10•11 years ago
|
||
Different method name
Assignee | ||
Comment 11•11 years ago
|
||
Assignee | ||
Comment 12•11 years ago
|
||
Bah, looks like possible exceptions need to be cleared. ErrorResult is so unfriendly for C++ callers :/
Comment 13•11 years ago
|
||
> ErrorResult is so unfriendly for C++ callers :/ Bug 933378. But in this case, see comment 4?
Assignee | ||
Comment 14•11 years ago
|
||
Not pretty, but since we currently have the rather strong assertions in ErrorResult, so have to call WouldReportJSException()
Attachment #8339238 -
Flags: review?(bzbarsky)
Comment 15•11 years ago
|
||
Comment on attachment 8339238 [details] [diff] [review] v3b Hmm. Maybe the right thing is to change http://hg.mozilla.org/mozilla-central/file/34f431863037/dom/bindings/CallbackObject.cpp#l169 to be: if ((mCompartment && mExceptionHandling == eRethrowContentExceptions) || mExceptionHandling == eRethrowExceptions) { because ShouldRethrowException always returns false if !mCompartment. r=me either way, but seems like that would be nicer API-wise.
Attachment #8339238 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 16•11 years ago
|
||
Aha, that is nicer. Wasn't too obvious.
Assignee | ||
Comment 17•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/48e320f58f71
Comment 18•11 years ago
|
||
No, that's wrong. eRethrowExceptions rethrows unconditionally, no matter what mCompartment is. So the mCompartment check should be attached only to the eRethrowContentExceptions case, as in comment 15.
Assignee | ||
Comment 19•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/2d7d09bda021
Comment 20•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/48e320f58f71 https://hg.mozilla.org/mozilla-central/rev/2d7d09bda021
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•