Bug 605481 and bug 595752. When showing a frameloader, give it the correct size up front, so we don't depend on the ordering of Show() and reflow of the subdocument frame. r=smaug

This commit is contained in:
Boris Zbarsky 2010-11-04 16:06:05 -04:00
Родитель e76ef2bbfe
Коммит 4b2c1608f5
1 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -653,7 +653,18 @@ nsFrameLoader::Show(PRInt32 marginWidth, PRInt32 marginHeight,
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(mDocShell);
NS_ASSERTION(baseWindow, "Found a nsIDocShell that isn't a nsIBaseWindow.");
baseWindow->InitWindow(nsnull, view->GetWidget(), 0, 0, 10, 10);
nsIntSize size;
if (!(frame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
// We have a useful size already; use it, since we might get no
// more size updates.
size = GetSubDocumentSize(frame);
} else {
// Pick some default size for now. Using 10x10 because that's what the
// code here used to do.
size.SizeTo(10, 10);
}
baseWindow->InitWindow(nsnull, view->GetWidget(), 0, 0,
size.width, size.height);
// This is kinda whacky, this "Create()" call doesn't really
// create anything, one starts to wonder why this was named
// "Create"...