[Project_owners] sizing a xul window to content in a browser element?

Bill Orcutt bill at lilyapp.org
Mon Jun 11 17:02:06 PDT 2007


Thanks for your email Preet-  I tried what you describe before  
hitting the list, but the contentWindow stubbornly reported its size  
as that of the outer window rather its own contents. In the end what  
worked was pulling the offset height & width directly from the  
content itself and then sizing everything up based on that.

-Bill

On Jun 11, 2007, at 3:42 PM, Preet Shihn wrote:

> you can find the full size of the content in the window to be:
> width = contentwindow.innerWidth + contentwindow.scrollMaxX
> height = contentwindow.innerHeight + contentwindow.scrollMaxY
>
> then you can resize your xul window to wdth/height.
> If your browser flex is set to 1, the browser will adjust accordingly.
>
> You might have to give some margin to the width and height to deal  
> with any window/browser borders
>
> - Preet
>
> On 6/10/07, Bill Orcutt <bill at lilyapp.org> wrote:
> Hi-
>
> I have a window that contains a browser element and an onload routine
> that would like to size the outer xul window to fit the content
> contained in the inner browser window. The browser element has an
> attribute of flex=1. Calling sizeToContent on the xul window
> collapses it to nothing. Also tried calling sizeToContent on the
> contentWindow of the browser, but that seems to have no effect.  Has
> anyone found a way to do this?
>
> thanks
>
> -Bill
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
>
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20070611/b58b9752/attachment.html 


More information about the Project_owners mailing list