Closed Bug 1448992 Opened 6 years ago Closed 4 years ago

Get rid of nsXPCComponentsBase

Categories

(Core :: XPConnect, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file, 1 obsolete file)

It's unused once bug 1389581 is fixed.
Attached patch Get rid of nsXPCComponentsBase (obsolete) — Splinter Review
Attachment #8962506 - Flags: review?(kmaglione+bmo)
Comment on attachment 8962506 [details] [diff] [review]
Get rid of nsXPCComponentsBase

This isn't right yet.
Attachment #8962506 - Attachment is obsolete: true
Attachment #8962506 - Flags: review?(kmaglione+bmo)
Priority: -- → P2
My patch for this makes layout/reftests/bugs/498228-1.xul fail.

The reason for that is that in toolkit/content/widgets/listbox.xml in the "control" getter of the "listitem" binding we have:

  if (parent instanceof Ci.nsIDOMXULSelectControlElement)

and that throws with this patch (because there is no more Ci in the content XBL scope).

Brian, do we have a plan yet for those nsIDOMXUL* interfaces implemented via XBL implements=""?
Flags: needinfo?(bgrinstead)
(In reply to Boris Zbarsky [:bz] (no decent commit message means r-) from comment #3)
> My patch for this makes layout/reftests/bugs/498228-1.xul fail.
> 
> The reason for that is that in toolkit/content/widgets/listbox.xml in the
> "control" getter of the "listitem" binding we have:
> 
>   if (parent instanceof Ci.nsIDOMXULSelectControlElement)
> 
> and that throws with this patch (because there is no more Ci in the content
> XBL scope).
> 
> Brian, do we have a plan yet for those nsIDOMXUL* interfaces implemented via
> XBL implements=""?

Yes, Neil is trying out two different approaches for [implements] in Bug 1446961. Forwarding ni? to see if they might work for nsIDOMXULSelectControlElement. I also wonder if in practice this getter is only ever called in certain scenarios, such that we could change the instanceof check into a tag name check or look for some own property like `getIndexOfItem` or something like that.
Flags: needinfo?(bgrinstead) → needinfo?(enndeakin)
This pattern looks to be used in a few other places, but is pretty infrequent overall: https://searchfox.org/mozilla-central/search?q=instanceof+Ci.&case=true&path=xml
In this case, the code could be changed to look for specific tags rather than the interface. Note also that the methods are inherited so it will need to deal with both listbox and richlistbox related tags.

Although the work in bug 1446961 could handle some specific cases, it won't be able to handle most of the interface usage. I think you will still have some cases where methods implemented in script will be needed.
Flags: needinfo?(enndeakin)
I know I can use specific tags here.  I was trying to figure out whether there is something else that would be better based on what we plan to do to replace nsIDOMXULSelectControlElement.
I remember you mentioned that we can't right now have a Custom Element use QueryInterface: https://bugzilla.mozilla.org/show_bug.cgi?id=1404420#c15. Is that something that we could change to make `this.QueryInterface` work on DOM nodes, or store some metadata about the interface into the Custom Element registration? That would make migration easier.. but are there downsides to that approach?
Flags: needinfo?(bzbarsky)
Depends on: 1460732
See Also: → 1461742
Sorry, I had thought this was a self-needinfo...

Brian, is the question in comment 8 still relevant given our current plans for custom elements implementing interfaces?
Flags: needinfo?(bzbarsky) → needinfo?(bgrinstead)
(In reply to Boris Zbarsky [:bzbarsky, bz on IRC] from comment #9)
> Sorry, I had thought this was a self-needinfo...
> 
> Brian, is the question in comment 8 still relevant given our current plans
> for custom elements implementing interfaces?

No, this is now possible as of Bug 1478372. Going to ship the first CE using this in Bug 1481949.
Flags: needinfo?(bgrinstead)
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f6f02d0b050d
Get rid of nsXPCComponentsBase. r=bholley
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: