Allow JS-implemented Web IDL objects to be created against a non-window scope
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox44 | --- | affected |
People
(Reporter: bzbarsky, Unassigned)
References
Details
In particular, right now we tell a JS-implemented object about its associated global via the nsIDOMGlobalPropertyInitializer setup, which takes an nsIDOMWindow. But some objects (e.g. for bug 1215591) would like to be creatable from system globals. The way I see it, we have two main options: 1) Change nsIDOMGlobalPropertyInitializer to take nsISupports (since nsIGlobalObject is not scriptable). 2) Add a new interface taking nsISupports and QI to it in addition to nsIDOMGlobalPropertyInitializer. I somewhat prefer option (1), I think; I expect it to be compatible-enough. Any objections?
Assignee | ||
Updated•5 years ago
|
Comment 1•4 years ago
|
||
Option 1 seems fine, though I think we're trying to move away from JS-implemented DOM objects.
Comment 2•4 years ago
|
||
Yeah, seems like we should WONTFIX this given that js-implemented WebIDL is deprecated?
Reporter | ||
Comment 3•4 years ago
|
||
Sure, but we have existing JS-implemented things and they're a pain to use for people right now... So unless we have a concrete plan for reimplementing them, it might be worth making their use be less footgunny.
Reporter | ||
Comment 4•4 years ago
|
||
That said, for the particular case of RTCPeerConnection even if we changed the C++ bits we'd then land at https://searchfox.org/mozilla-central/rev/62a130ba0ac80f75175e4b65536290b52391f116/dom/media/PeerConnection.jsm#419-421 and later things like https://searchfox.org/mozilla-central/rev/62a130ba0ac80f75175e4b65536290b52391f116/dom/media/PeerConnection.jsm#424 would throw, and you wouldn't have it working anyway. So this change would be necessary to allow things like bug 1215591 but definitely not sufficient.
Comment 5•4 years ago
|
||
(In reply to Boris Zbarsky [:bzbarsky, bz on IRC] from comment #3)
Sure, but we have existing JS-implemented things and they're a pain to use for people right now... So unless we have a concrete plan for reimplementing them, it might be worth making their use be less footgunny.
Fair, but we should definitely compare the cost of doing more work on this infrastructure against the cost of reimplementing the WebRTC stuff in native code. That's really the last big consumer of this deprecated machinery, so I'm more keen on fixing that than fixing the machinery.
Reporter | ||
Comment 6•4 years ago
|
||
Fair. Given that bug 1215591 got resolved for now, let's wonfix this.
Description
•