Address review comments for bug 905909. r=dholbert

This commit is contained in:
Robert O'Callahan 2013-09-19 16:30:30 +12:00
parent 0ac1b39ab6
commit 9588456df8
2 changed files with 8 additions and 7 deletions

View File

@ -943,15 +943,14 @@ nsTreeBodyFrame::CheckOverflow(const ScrollParts& aParts)
// Flush those explicitly now, so that we can guard against potential infinite
// recursion. See bug 905909.
if (!weakFrame.IsAlive()) {
fprintf(stderr, "FRAME DEAD 1!\n");
return;
}
NS_ASSERTION(!mCheckingOverflow, "mCheckingOverflow should not already be set");
// Don't use AutoRestore since we want to not touch mCheckingOverflow if we fail
// the weakFrame.IsAlive() check below
mCheckingOverflow = true;
fprintf(stderr, "BEGIN FlushPendingNotifications\n");
presShell->FlushPendingNotifications(Flush_Layout);
fprintf(stderr, "END FlushPendingNotifications\n");
if (!weakFrame.IsAlive()) {
fprintf(stderr, "FRAME DEAD 2!\n");
return;
}
mCheckingOverflow = false;
@ -4672,10 +4671,10 @@ nsTreeBodyFrame::FullScrollbarsUpdate(bool aNeedsFullInvalidation)
// force any nested checks to round-trip through the event loop. See bug
// 905909.
nsRefPtr<nsOverflowChecker> checker = new nsOverflowChecker(this);
if (mCheckingOverflow) {
NS_DispatchToCurrentThread(checker);
} else {
if (!mCheckingOverflow) {
nsContentUtils::AddScriptRunner(checker);
} else {
NS_DispatchToCurrentThread(checker);
}
return weakFrame.IsAlive();
}

View File

@ -617,6 +617,8 @@ protected: // Data Members
bool mReflowCallbackPosted;
// Set while we flush layout to take account of effects of
// overflow/underflow event handlers
bool mCheckingOverflow;
// Hash table to keep track of which listeners we created and thus