Bright white flashes on opening new tabs and page reload when using macOS Dark Mode or Firefox Dark theme

NEW
Unassigned

Status

()

5 months ago
11 hours ago

People

(Reporter: m_khvoinitsky, Unassigned)

Tracking

(Depends on: 2 bugs)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

Created attachment 9006206 [details]
bright-flash.webm

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
Build ID: 20180808222917

Steps to reproduce:

1. Enable Firefox' Dark theme.
2. Open any website with native dark theme or install any add-on that makes web dark and open any website


Actual results:

Bright flash will appear between dark home page and dark website


Expected results:

Bright flash should not appear between dark home page and dark website
Created attachment 9006208 [details] [diff] [review]
dark-theme-fix.patch

Here is a patch. However, I'm not quite sure whether var(--chrome-background-color) is the best choice for that or not. Please, take a look.
Attachment #9006208 - Flags: review?(dao+bmo)
Created attachment 9006211 [details]
bright-flash-fixed.webm
(Reporter)

Updated

5 months ago
Component: Untriaged → Tabbed Browser
Blocks: 1402312, 1379587
Comment on attachment 9006208 [details] [diff] [review]
dark-theme-fix.patch

This results in the opposite problem on light websites (which is most websites), e.g. when opening a link in a new tab without going through about:newtab.
Attachment #9006208 - Flags: review?(dao+bmo) → review-
Yes, but now the same is happening in Private Browsing (due to bug 1379587 fix) — under some circumstances page reload of light website flashes dark purple. I guess that people who use Dark Firefox tend to use dark websites or add-ons for that. Also, dark blink on bright screen doesn't hurt eyes while bright flash on dark screen does.
(In reply to Khvoinitsky Mikhail [:m_khvoinitsky] from comment #4)
> Yes, but now the same is happening in Private Browsing (due to bug 1379587
> fix) — under some circumstances page reload of light website flashes dark
> purple.

The reload case sounds line an independent Gecko bug. E.g. when not using the dark theme and reloading a dark page, we'd like to keep the page background without showing white in between. In my experience this already works most of the time, but there might be edge cases where it doesn't.

> I guess that people who use Dark Firefox tend to use dark websites
> or add-ons for that.

That's an interesting guess but it doesn't seem to be backed by data.

> Also, dark blink on bright screen doesn't hurt eyes
> while bright flash on dark screen does.

It's still an annoying interruption though.
(In reply to Dão Gottwald [::dao] from comment #5)
> (In reply to Khvoinitsky Mikhail [:m_khvoinitsky] from comment #4)
> > Yes, but now the same is happening in Private Browsing (due to bug 1379587
> > fix) — under some circumstances page reload of light website flashes dark
> > purple.
> 
> The reload case sounds line an independent Gecko bug. E.g. when not using
> the dark theme and reloading a dark page, we'd like to keep the page
> background without showing white in between. In my experience this already
> works most of the time, but there might be edge cases where it doesn't.

Indeed, reload isn't a problem usually. It mostly loading a page in a new tab.

> > I guess that people who use Dark Firefox tend to use dark websites
> > or add-ons for that.
> That's an interesting guess but it doesn't seem to be backed by data.

Unfortunately, yes.

> > Also, dark blink on bright screen doesn't hurt eyes
> > while bright flash on dark screen does.
> 
> It's still an annoying interruption though.

But less severe.

I'm a developer of one of the add-ons that makes web dark. FYI, related bug: https://github.com/m-khvoinitsky/dark-background-light-text-extension/issues/131
Ideally, Firefox built-in dark theme should affect everything what is not available for add-ons.

As I already said, the same is already done now for Private Browsing, why that was not a problem?

Finally, do you have a better suggestion?

Comment 7

5 months ago
(In reply to Khvoinitsky Mikhail [:m_khvoinitsky] from comment #6)
> Finally, do you have a better suggestion?

My suggestion would be to allow add-ons to customize the default content area background: see bug 1459504. 

I can mentor you through this bug if you're interested.
(In reply to Tim Nguyen :ntim from comment #7)
> (In reply to Khvoinitsky Mikhail [:m_khvoinitsky] from comment #6)
> > Finally, do you have a better suggestion?
> 
> My suggestion would be to allow add-ons to customize the default content
> area background: see bug 1459504. 
> 
> I can mentor you through this bug if you're interested.

That would just shift this patch's problem from being built in to extensions. Making this part of the theming API is basically a footgun. I morphed bug 1459504 to avoid that.
Depends on: 1459504
Priority: -- → P5

Comment 9

5 months ago
i just wanted to confirm, that I've seen the same behavior. the bug can be forced by rapidly opening new tabs with firefox home as default for new tabs and the dark theme active.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I think this bug deserves to be re-triaged to a higher priority than P5 now that Firefox's Default theme turns dark when macOS 10.14's Dark Mode is enabled (bug 1466335). The white flashes look really janky. macOS Dark Mode is not enabled by default, but it seems like a popular macOS feature.

STR:
1. Enable macOS 10.14's Dark Mode in System Preferences > General.
2. Launch Firefox in a new user profile.

RESULT:
The browser window will flash white for about half a second before the dark about:newtab page is loaded.

STR continued:
3. Cmd+R to reload the about:newtab page.

RESULT:
The browser window will flash white briefly before the dark about:newtab page is loaded.

STR continued:
4. Click on one of the links on the about:newtab page

RESULT:
The browser window will flash white briefly after the dark about:newtab page is unloaded and before the clicked link is loaded.
Blocks: 1466335
Priority: P5 → --
Summary: Bright flashes on opening new tabs and page reload when using Dark Firefox theme with dark websites and/or add-ons that make web dark → Bright white flashes on opening new tabs and page reload when using macOS Dark Mode or Firefox Dark theme

Updated

a month ago
Duplicate of this bug: 1513593
No longer blocks: 1402312, 1466335
See Also: → bug 1402312, bug 1466335
Depends on: 1494034
Comment hidden (advocacy)
You need to log in before you can comment on or make changes to this bug.