Make sure to flush out reflows before firing onload instead of (imperfectly)

blocking onload on reflow events.  This makes sure that we are in fact fully
reflowed before onload fires.  Bug 379093, r+sr=roc


git-svn-id: svn://10.0.0.236/trunk@225241 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2007-04-30 03:09:55 +00:00
parent 097b0114b0
commit 2cace76786
2 changed files with 14 additions and 40 deletions

View File

@@ -1030,6 +1030,13 @@ DocumentViewerImpl::LoadComplete(nsresult aStatus)
*/
nsCOMPtr<nsIDocumentViewer> kungFuDeathGrip(this);
// Flush out layout so it's up-to-date by the time onload is called
if (mPresShell && !mStopped) {
// Hold strong ref because this could conceivably run script
nsCOMPtr<nsIPresShell> shell = mPresShell;
shell->FlushPendingNotifications(Flush_Layout);
}
// Now, fire either an OnLoad or OnError event to the document...
PRBool restoring = PR_FALSE;
if(NS_SUCCEEDED(aStatus)) {