Skip to content

Commit 3abe531

Browse files
committedMay 10, 2024
Bug 1895928 - PresShell::ScheduleViewManagerFlush shouldn't set the layout flush bit. r=smaug
A version of the patch in bug 1895870 caused some WPT tests to time out because document.fonts.ready never resolves. This is because I made PresShell::HasPendingReflow look at mNeedLayoutFlush, and nsIFrame::SchedulePaint() calls PresShell::ScheduleViewManagerFlush() which sets that bit. So we end up with mNeedLayoutFlush, but without a flush scheduled, and the ready promise doesn't resolve until something else schedules a flush. I fixed the original patch to preserve behavior, but requesting a repaint shouldn't require a layout flush. This call was added in bug 598482 part 16: https://hg.mozilla.org/mozilla-central/rev/71d77495b606fc145bdceabcda29181978bd9405 We only need the layout flush if there are view geometry updates, so shift the call up to the view manager. Differential Revision: https://phabricator.services.mozilla.com/D209938
1 parent 7b679f8 commit 3abe531

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed
 

‎layout/base/PresShell.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -3931,11 +3931,9 @@ void PresShell::ScheduleViewManagerFlush() {
39313931
return;
39323932
}
39333933

3934-
nsPresContext* presContext = GetPresContext();
3935-
if (presContext) {
3934+
if (nsPresContext* presContext = GetPresContext()) {
39363935
presContext->RefreshDriver()->ScheduleViewManagerFlush();
39373936
}
3938-
SetNeedLayoutFlush();
39393937
}
39403938

39413939
void PresShell::DispatchSynthMouseMove(WidgetGUIEvent* aEvent) {

‎view/nsView.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1081,8 +1081,7 @@ void nsView::DidCompositeWindow(mozilla::layers::TransactionId aTransactionId,
10811081
}
10821082

10831083
void nsView::RequestRepaint() {
1084-
PresShell* presShell = mViewManager->GetPresShell();
1085-
if (presShell) {
1084+
if (PresShell* presShell = mViewManager->GetPresShell()) {
10861085
presShell->ScheduleViewManagerFlush();
10871086
}
10881087
}

‎view/nsViewManager.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ void nsViewManager::PostPendingUpdate() {
455455
nsViewManager* rootVM = RootViewManager();
456456
rootVM->mHasPendingWidgetGeometryChanges = true;
457457
if (rootVM->mPresShell) {
458+
rootVM->mPresShell->SetNeedLayoutFlush();
458459
rootVM->mPresShell->ScheduleViewManagerFlush();
459460
}
460461
}

0 commit comments

Comments
 (0)
Failed to load comments.