Closed Bug 1245140 Opened 4 years ago Closed 2 years ago

Get addons to stop using DOM_OBJECT classinfo

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox47 --- affected

People

(Reporter: bzbarsky, Unassigned)

References

(Blocks 2 open bugs)

Details

We need this to be able to do bug 1207321, right?
So https://mxr.mozilla.org/addons/search?string=DOM_OBJECT&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=addons says "Found 492 matching lines in 215 files".  A bunch of those are fxos emulators which we can ignore.  for the rest, it would be good to figure out whether they would actually break if we made this flag a no-op (and possibly stopped exposing XPCWrappedNative to the web)...
It looks like some of them are just using code from old tutorials, like: http://web.archive.org/web/20090221185408/http://xulplanet.com/tutorials/xulqa/q_treebview.html

What exactly does an object gain by setting this flag? Would there be a workaround available for cases where an add-on breaks?

Also, would it be possible to add a deprecation console warning to give developers time to adjust?
Peter, do you know what the current state of the answers to Jorge's first two questions is?  If no, I can try to figure it out.

For the third question, it should be possible to a deprecation warning, yes.
Flags: needinfo?(peterv)
I think the only thing we use the flag for is CanCreateWrapper.

I don't know the particulars of the treeview usage, but a lot of these are probably using JavaScript-global-property to add a property to window. Without the DOM_OBJECT flag we'll refuse to create the XPCWrappedNative's JS object around the XPCWrappedJS (the security manager will block that in nsScriptSecurityManager::CanCreateWrapper). I don't think we have an alternative for that usage.
Flags: needinfo?(peterv)
Component: Tracking → DOM
QA Contact: chofmann
I guess this counts as an issue that will go away when XPCOM addons are no longer supported.
JavaScript-global-property went away in bug 1442360.

I am going to remove support for DOM_OBJECT classinfo altogether in bug 1448414.
Depends on: 1448414
Is this WFM now?
Flags: needinfo?(bzbarsky)
Yep, effectively; there's no more DOM_OBJECT flag.  I just forgot to resolve this bug, even after adding the note to self in comment 6...
Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(bzbarsky)
Resolution: --- → WORKSFORME
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.