Re: Document size

Boris Zbarsky <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Pekka Vanhoja wrote:
> Is there a way to determine the "preferred" size of an HTML document?

 From JS, no.  From C++ you could get the preferred width of the blockframe for 
the <html> and then reflow to that height.

Of course you could also sizeToContent()....

> I mean that if I have a window with scrollbars and I would like to
> determine the minimum size for the window so that the scrollbars would
> not be needed.

There may not be such a size.  Consider:

   <html style="width: 200%; height: 200%">

-Boris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.