I’m not finding what’s the type of this “xpcomInterface”, and there’s no documentation of any class with this name. Any idea?
This snippet is from Mozilla’s website:
var next = elements.item(i+1);
var xpcomInterface = scroll.boxObject.QueryInterface(
Components.interfaces.nsIScrollBoxObject);
xpcomInterface.ensureElementIsVisible(elements);
–update
I found boxObject that leads to nslBoxObject, but it have no reference to any QueryInterface as used above. There’s also references to xulplanet.com which is no more there.
Well,
xpcomInterfaceis just the name of the variable.You should read about XPCOM and XPCOM interfaces.
QueryInterface()is a method that all XPCOM objects must implement and gives you the possibility to “cast” an object to a certain interface:In this example, there is some object
scroll.boxObject(update: which is ansIBoxObjectas you found out. Note that this again is just an interface (starts withnsI)) that seems to implement thensIScrollBoxObjectinterface. By usingQueryInterface, you can access those interface’s methods likeensureElementIsVisible.