Backed out changeset 8121bf2bc0eb (bug 1806905) for causing wpt failures in /css/css-contain/container-queries/auto-scrollbars.html CLOSED TREE

This commit is contained in:
Sandor Molnar
2022-12-29 00:02:58 +02:00
parent 9ebeba09fc
commit 18cd7ae1d2

View File

@@ -4184,29 +4184,26 @@ void PresShell::CancelPostedReflowCallbacks() {
}
void PresShell::HandlePostedReflowCallbacks(bool aInterruptible) {
while (true) {
// Call all our callbacks, tell us if we need to flush again.
bool shouldFlush = false;
while (mFirstCallbackEventRequest) {
nsCallbackEventRequest* node = mFirstCallbackEventRequest;
mFirstCallbackEventRequest = node->next;
if (!mFirstCallbackEventRequest) {
mLastCallbackEventRequest = nullptr;
}
nsIReflowCallback* callback = node->callback;
FreeByObjectID(eArenaObjectID_nsCallbackEventRequest, node);
if (callback && callback->ReflowFinished()) {
bool shouldFlush = false;
while (mFirstCallbackEventRequest) {
nsCallbackEventRequest* node = mFirstCallbackEventRequest;
mFirstCallbackEventRequest = node->next;
if (!mFirstCallbackEventRequest) {
mLastCallbackEventRequest = nullptr;
}
nsIReflowCallback* callback = node->callback;
FreeByObjectID(eArenaObjectID_nsCallbackEventRequest, node);
if (callback) {
if (callback->ReflowFinished()) {
shouldFlush = true;
}
}
}
if (!shouldFlush || mIsDestroying) {
return;
}
// The flush might cause us to have more callbacks.
const auto flushType =
aInterruptible ? FlushType::InterruptibleLayout : FlushType::Layout;
FlushType flushType =
aInterruptible ? FlushType::InterruptibleLayout : FlushType::Layout;
if (shouldFlush && !mIsDestroying) {
FlushPendingNotifications(flushType);
}
}