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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user