Bug 574529: When determining layout-flushing-safety, ignore IsSafeToRunScript if we aren't able to run script in the first place. r=bz a=blocking

This commit is contained in:
Daniel Holbert 2010-09-08 13:40:38 -07:00
parent 27016c473f
commit 68aab64df6

View File

@ -4722,7 +4722,12 @@ PresShell::FlushPendingNotifications(mozFlushType aType)
NS_ASSERTION(aType >= Flush_Frames, "Why did we get called?");
PRBool isSafeToFlush = IsSafeToFlush();
isSafeToFlush = isSafeToFlush && nsContentUtils::IsSafeToRunScript();
// If layout could possibly trigger scripts, then it's only safe to flush if
// it's safe to run script.
if (mDocument->GetScriptGlobalObject()) {
isSafeToFlush = isSafeToFlush && nsContentUtils::IsSafeToRunScript();
}
NS_ASSERTION(!isSafeToFlush || mViewManager, "Must have view manager");
// Make sure the view manager stays alive while batching view updates.