mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Address review comments for bug 905909. r=dholbert
This commit is contained in:
parent
0ac1b39ab6
commit
9588456df8
@ -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();
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user