Fixing bug 474022. Reflow if we're about to instantiate a plugin whose frame has not been reflown yet. This fixes a problem where the WMP plugin doesn't work right if its initial size is 0x0. r+sr=bzbarsky@mit.edu

This commit is contained in:
Johnny Stenback 2009-02-02 17:26:28 -08:00
Родитель 09c42c666f
Коммит 0c8c15400f
1 изменённых файлов: 15 добавлений и 0 удалений

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

@ -751,6 +751,21 @@ nsObjectLoadingContent::EnsureInstantiation(nsIPluginInstance** aInstance)
}
nsIFrame *nsiframe = do_QueryFrame(frame);
if (nsiframe->GetStateBits() & NS_FRAME_FIRST_REFLOW) {
// A frame for this plugin element already exists now, but it has
// not been reflown yet. Force a reflow now so that we don't end
// up initializing a plugin before knowing its size. Also re-fetch
// the frame, as flushing can cause the frame to be deleted.
frame = GetExistingFrame(eFlushLayout);
if (!frame) {
return NS_OK;
}
nsiframe = do_QueryFrame(frame);
}
nsWeakFrame weakFrame(nsiframe);
// We may have a plugin instance already; if so, do nothing