Make sure we flush out content before we try to set up the plug-in, since

that's going to perform DOM access that can flush.  Bug 377070, r+sr=biesi


git-svn-id: svn://10.0.0.236/trunk@226899 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2007-05-23 19:53:31 +00:00
parent bbbc8dca9f
commit e27e4e7c20

View File

@@ -1294,20 +1294,34 @@ nsObjectLoadingContent::GetFrame()
do_QueryInterface(NS_STATIC_CAST(nsIImageLoadingContent*, this));
NS_ASSERTION(thisContent, "must be a content");
nsIDocument* doc = thisContent->GetCurrentDoc();
if (!doc) {
return nsnull; // No current doc -> no frame
}
PRBool flushed = PR_FALSE;
nsIFrame* frame;
do {
nsIDocument* doc = thisContent->GetCurrentDoc();
if (!doc) {
return nsnull; // No current doc -> no frame
}
nsIPresShell* shell = doc->GetPrimaryShell();
if (!shell) {
return nsnull; // No presentation -> no frame
}
nsIPresShell* shell = doc->GetPrimaryShell();
if (!shell) {
return nsnull; // No presentation -> no frame
}
nsIFrame* frame = shell->GetPrimaryFrameFor(thisContent);
if (!frame) {
return nsnull;
}
frame = shell->GetPrimaryFrameFor(thisContent);
if (!frame) {
return nsnull;
}
if (flushed) {
break;
}
// OK, let's flush out and try again. Note that we want to reget
// the document, etc, since flushing might run script.
doc->FlushPendingNotifications(Flush_ContentAndNotify);
flushed = PR_TRUE;
} while (1);
nsIObjectFrame* objFrame;
CallQueryInterface(frame, &objFrame);