Re: How to get the primaryshell/widget from nsIDocument* with Gecko SDK 2.0

Boris Zbarsky <[email protected]> Thu, 17 Feb 2011 10:28:10 -0500
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
On 2/17/11 8:53 AM, K.V wrote:
> I wrote an extension for Firefox, there I need to interact with the
> controls. For that I tried to get the dimensions of the controls.  I
> used getWidget() on the nsIDocument* as mentioned in the sample code
> to get the Screen Offset values (using WidgetToScreenOffset()). This
> worked properly till Firefox3.6 version but not with Firefox 4.0
> version.

Right, because content documents no longer have widgets.  They might 
also not be on the screen at all, for that matter, or be on it in 
multiple places at once.

I can't tell you what the right approach is for you without having a 
better idea of what you're actually trying to do, unfortunately....

-Boris