Closed Bug 1867042 Opened 10 months ago Closed 10 months ago

(regression) white flickering on every page reload / navigation

Categories

(Core :: Layout, defect, P2)

Firefox 122
defect

Tracking

()

VERIFIED FIXED
122 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox120 --- unaffected
firefox121 --- unaffected
firefox122 blocking verified
firefox123 --- verified

People

(Reporter: soeren.hentzschel, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Since Firefox Nightly from 2023-11-27 / the landing of the last patch in bug 1807253 there is a very annoying white flickering on every page reload or navigation on websites.

Please see the following screencast that compares Firefox 120 with the latest Nightly:

https://www.youtube.com/watch?v=T55M3VDHeXU

Flags: needinfo?(fwang)
Flags: needinfo?(fwang)
Flags: needinfo?(fwang)

It's easy to reproduce using the pagination controls in https://www.camp-firefox.de/. I bisected manually and got to the same pushlog, just fwiw:

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=9ea04a2cc829da8ce1048f38bb015b869d9273aa&tochange=95679f6ce2544b21ec9cfd0d19961058d60155d6

The page has a resize observer so it's not too unbelievable that this could've affected it...

[Tracking Requested - why for this release]: Seems in some circumstances after that bug paint suppression is broken and we pain the new page too early.

Severity: -- → S2
Priority: -- → P2

Okay, I took a quick poke and it seems we're initializing the pres shell too early from:

PresShell::Initialize(https://www.camp-firefox.de/?sortField=time&sortOrder=DESC&pageNo=4)#01: mozilla::PresShell::Initialize() (/home/emilio/src/moz/gecko-2/layout/base/PresShell.cpp:1719)
#02: nsContentSink::StartLayout(bool) (/home/emilio/src/moz/gecko-2/dom/base/nsContentSink.cpp:610)
#03: mozilla::dom::Document::FlushPendingNotifications(mozilla::ChangesToFlush) (/home/emilio/src/moz/gecko-2/dom/base/Document.cpp:10843)
#04: mozilla::dom::BrowsingContext::PreOrderWalkVoid(std::function<void (mozilla::dom::BrowsingContext*)> const&) (/home/emilio/src/moz/gecko-2/docshell/base/BrowsingContext.cpp:1191)
#05: mozilla::dom::Document::DetermineProximityToViewportAndNotifyResizeObservers() (/home/emilio/src/moz/gecko-2/dom/base/Document.cpp:17186)
#06: nsRefreshDriver::DetermineProximityToViewportAndNotifyResizeObservers() (/home/emilio/src/moz/gecko-2/layout/base/nsRefreshDriver.cpp:2266)
#07: nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp, nsRefreshDriver::IsExtraTick) (/home/emilio/src/moz/gecko-2/layout/base/nsRefreshDriver.cpp:2762)
#08: mozilla::detail::RunnableFunction<nsRefreshDriver::EnsureTimerStarted(nsRefreshDriver::EnsureTimerStartedFlags)::$_1>::Run() (/home/emilio/src/moz/gecko-2/obj-debug/dist/include/nsThreadUtils.h:549)
#09: mozilla::RunnableTask::Run() (/home/emilio/src/moz/gecko-2/xpcom/threads/TaskController.cpp:550)
#10: mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) (/home/emilio/src/moz/gecko-2/xpcom/threads/TaskController.cpp:876)
#11: mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) (/home/emilio/src/moz/gecko-2/xpcom/threads/TaskController.cpp:0)
#12: mozilla::TaskController::ProcessPendingMTTask(bool) (/home/emilio/src/moz/gecko-2/xpcom/threads/TaskController.cpp:485)
#13: mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_0>::Run() (/home/emilio/src/moz/gecko-2/xpcom/threads/nsThreadUtils.h:549)
#14: nsThread::ProcessNextEvent(bool, bool*) (/home/emilio/src/moz/gecko-2/xpcom/threads/nsThread.cpp:1202)
#15: NS_ProcessNextEvent(nsIThread*, bool) (/home/emilio/src/moz/gecko-2/xpcom/threads/nsThreadUtils.cpp:480)
#16: mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) (/home/emilio/src/moz/gecko-2/ipc/glue/MessagePump.cpp:85)
#17: MessageLoop::Run() (/home/emilio/src/moz/gecko-2/ipc/chromium/src/base/message_loop.cc:346)
#18: nsBaseAppShell::Run() (/home/emilio/src/moz/gecko-2/widget/nsBaseAppShell.cpp:150)
#19: nsAppShell::Run() (/home/emilio/src/moz/gecko-2/widget/gtk/nsAppShell.cpp:427)
#20: XRE_RunAppShell() (/home/emilio/src/moz/gecko-2/toolkit/xre/nsEmbedFunctions.cpp:721)
#21: mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) (/home/emilio/src/moz/gecko-2/ipc/glue/MessagePump.cpp:235)
#22: MessageLoop::Run() (/home/emilio/src/moz/gecko-2/ipc/chromium/src/base/message_loop.cc:346)
#23: XRE_InitChildProcess(int, char**, XREChildData const*) (/home/emilio/src/moz/gecko-2/toolkit/xre/nsEmbedFunctions.cpp:660)
#24: main (/home/emilio/src/moz/gecko-2/browser/app/nsBrowserApp.cpp:375)

We probably don't want to trigger pres shell initialization from that code.

This is unfortunately somewhat hard to test, because paint suppression
is not really quite observable by the page.

This makes sure that we don't report resize observations etc until the
page has been laid out for other reasons.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(fwang)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7aca76ceb374 Don't force PresShell initialization from ResizeObserver handling. r=fredw
See Also: → 1867258
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
Blocks: 1867258
See Also: 1867258
Regressions: 1868824
Flags: qe-verify+

I can't seem to reproduce this issue on an old MacBook Air with MacOS 11 using Nightly v122.0a1 from 2023-11-27 and 2023-11-28. No white flicker was observed when reloading webpage https://www.camp-firefox.de/. This being said, I can not verify this fix using this system.

This being said, I can not verify this fix using this system.

I can verify that the reported issue no longer happens.

Reproduced the issue on Firefox 122.0a1 (2023-11-28) on macOS 13.6.3 by following the infos provided in Comment 0.

The issue is fixed on Firefox 122.0a1 (2023-11-30) and 123.0a1 (2024-01-21) on the same machine.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: