Open Bug 1603918 Opened 5 years ago Updated 1 years ago

Regression: A bright flicker appears on the New Tab Page when opening a new window in System Dark Mode

Categories

(Firefox :: New Tab Page, defect, P2)

defect

Tracking

()

People

(Reporter: mehmet.sahin, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(6 files)

Attached video Flicker_NTP_Nightly.mov (deleted) —

Nightly 73.0a1 (2019-12-13)
macOS 10.15.2

  1. Enable System Dark Mode
  2. Open a new Window

Actual: A bright flicker is to see before the NTP appears

Expected: No flicker should be to see. The background should be dark.

A screencast is attached.

Attached video Expected.mov (deleted) —

+Screencast of the Expected behavior, how it works Firefox 71 Stable.

Mardak - this looks like a regression between Fx 71 and Nightly 73 - do you have any insights on where/how this could have been introduced?

Flags: needinfo?(edilee)

FYI: I think this is a very recent regression. Maybe happens since approx. the last 5 days...

I can reproduce the flash on 71.0 release opening new windows, so it doesn't seem particularly new regression. An even easier way to trigger the white flash is to reload the page.

If it's easier to trigger on recent nightly, I would guess there's some timing / perf regression allowing the white background to be shown slightly longer before the message arrives to set the dark theme styling.

I suppose an alternative fix is to somehow make sure the page is loaded with the correct theme instead of relying on an async message.

Flags: needinfo?(edilee)

To be clear, there's 3 background shown with 2 of them being the same color.

  1. dark background from an not-yet-loaded browser showing tabbrowser-tabpanels' background https://searchfox.org/mozilla-central/rev/c61720a7d0c094d772059f9d6a7844eb7619f107/browser/themes/shared/tabs.inc.css#31-45
  2. light background from firefox home page without theme set
  3. dark background from firefox home page with theme set

So the flash comes from firefox getting ready to load a browser frame then actually loading the page content which by default says to show a light background until a later message arrives to make it show dark.

Also, the "regression" could be that the initial page loaded with light background is actually faster than before.

Would be very cool to set a default dark background when System Dark Mode is enabled (since this sometimes also happens when opening a new tab/NTP in the same window).

+Screencast to my comment 7.

Bisecting: 0 revisions left to test after this (roughly 0 steps)
[17ca1155bbdc9cd81574c3775cd538dcf4625ddd] Bug 1599544 - Remove the workaround hiding the initial browser. r=florian

From bisecting with 10 new window openings: "good" revisions with <30% flash on new windows and "bad" revisions with >70% flash on new windows.

Perhaps the fix for bug 1379587 "White flash when opening new tabs" isn't quite ready to be removed?

Flags: needinfo?(florian)
Keywords: regression
Regressed by: 1599544
Has Regression Range: --- → yes
Flags: needinfo?(florian) → needinfo?(dao+bmo)

florian/dao, what I believe is happening now is without the MozAfterPaint -> FirstNonBlankPaint listeners and async messages (which were triggered by about:home painting something), the browser[blank] { opacity: 0 } [0] is no longer showing the background set on tabbrowser-tabpanels, i.e., hiding the initial white page of about:home, which gets its styles set with an async LightweightTheme:Set message [1]. There has been a race condition even without the workaround removal, and as suggested in comment 4, this is easily reproduced by reloading the page without a new window, so there's an underlying issue of the page first painting light then dark.

[0] https://searchfox.org/mozilla-central/rev/c61720a7d0c094d772059f9d6a7844eb7619f107/browser/base/content/tabbrowser.css#81
[1] https://searchfox.org/mozilla-central/source/browser/base/content/contentTheme.js

I did see a white flash while working on bug 1599544, but I saw it with and without my patch. That's consistent with comment 10 I suppose. I can back out bug 1599544 for now based on the assumption that it makes the issue more frequent, but how should we go about addressing the underlying bug? Has it always been like this or did something regress after bug 1379587 landed? Would bug 1408122 help perhaps?

Flags: needinfo?(dao+bmo) → needinfo?(florian)

Fun Fact: When I use the Firefox Light Theme in OS-Dark-Mode, the NTP is flickering with a dark background. Why it is not possible to use this black background as default in OS-Dark-Mode? Is that so difficult? Thanks in advance.

Flags: needinfo?(sdowne)

This doesn't look critical, from a regression point of view. Looks like it's been an ongoing problem, with varying degrees of severity for a while now.

I think I'll dig into this a bit next release and try to find a fundamental fix, or at least an explanation as to why we cannot fix it.

Assignee: nobody → sdowne
Flags: needinfo?(sdowne)
Priority: -- → P2

(In reply to Scott [:thecount] Downe from comment #13)

I think I'll dig into this a bit next release and try to find a fundamental fix, or at least an explanation as to why we cannot fix it.

Great, thanks in advance.

(In reply to Dão Gottwald [::dao] from comment #11)

Would bug 1408122 help perhaps?

That just landed on autoland so we should be able to tell soon if it helps with this bug.

(In reply to Dão Gottwald [::dao] from comment #15)

(In reply to Dão Gottwald [::dao] from comment #11)

Would bug 1408122 help perhaps?

That just landed on autoland so we should be able to tell soon if it helps with this bug.

Thanks for fixing bug 1408122 👍. About://blank is now dark, when using OS Dark Mode and Nightly Dark Theme.

But unfortunately it has not the hoped fixing effect for issue reported here. Opening a new Window or opening a NTP is still flickering white, when using OS Dark Mode and Nightly Dark Theme 🙁

Tested with Nightly 75.0a1 (2020-03-01) (64-Bit).

Attached a screencast.

Issue still present Firefox stable 79.0. It is a little bit more intense

Firefox version 81.0
Issue still present

Attached video Flicker (deleted) —
Attached video Video (Firefox 81.0) (deleted) —
Assignee: sdowne → nobody
Severity: normal → S3
Severity: normal → S3
Flags: needinfo?(florian)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: