Follow up to https://github.com/brave/brave-browser/issues/1876 and https://github.com/brave/brave-browser/issues/3362
chrome://settings/?search=Brave+colorsLight
White flash

No white flash
Easily reproduced
Brave | 0.61.45 Chromium: 73.0.3683.39聽(Official Build)聽beta聽(64-bit)
-- | --
Revision | cc53b0e12fcaf42e4bab8d6c23bd4fb7aae99f6c-refs/branch-heads/3683@{#413}
OS | Windows聽7 Service Pack 1 Build 7601.24312
Brave | 0.62.16 Chromium: 73.0.3683.39聽(Official Build)聽dev聽(64-bit)
-- | --
Revision | cc53b0e12fcaf42e4bab8d6c23bd4fb7aae99f6c-refs/branch-heads/3683@{#413}
OS | Windows聽7 Service Pack 1 Build 7601.24312
cc @brave/legacy_qa @rossmoody
The issue is reproducible in both White and Dark Theme on Linux - 0.61.46
Brave | 0.61.46 Chromium: 73.0.3683.39 (Official Build) beta (64-bit)
-- | --
Revision | cc53b0e12fcaf42e4bab8d6c23bd4fb7aae99f6c-refs/branch-heads/3683@{#413}
OS | Linux

If/when we have a fix for this, we'll want to make extra sure the fix works really well (especially if uplifting). There have been two rounds of fixes which were approved but ultimately didn't fix the problem:
Also, per @rossmoody in https://github.com/brave/brave-core/pull/1680#issuecomment-464131317:
After talking with @petemill, a more appropriate solve for this in the long run is to investigate setting the image itself as a background on the body. The grey background will help ease the initial load, but the jump issue will likely be fixed with that approach in some capacity.
Hey guys, thanks for all the work you do on Brave.
I know this is not a very high-priority issue but it's incredibly annoying - I think its not just limited to the new tab page. I use the Stylus extension to apply custom dark themes to websites and this bright white flash right before a dark theme is applied makes for really poor UX.
Maybe the browser can default to a dark color background if the dark theme is enabled in settings?
I know this is not a very high-priority issue but it's incredibly annoying
It's so annoying that I switched back to Firefox. I can not work like this at night. This needs fixing asap!
cc: @imptrx, @cezaraugusto Can you guys take a look? I bumped this one up in priority.
See https://github.com/brave/brave-core/pull/1680#issuecomment-464131317
I had started a WIP of setting the background image from a c++ data source instead of waiting for the react code to start. Happy to continue that or for someone to take over.
Though it does seem to be we need to clarify the goal as some are complaining of a white flash on tab-open in light theme mode, and some in dark theme mode?
The two methods we can use are:
I鈥檓 not sure those will solve all the stated issues but it should bring us in line with other NTP. I believe we already have a good default body bg color behind the image, but we should double-check.
I played around with this issue on:
With default appearance settings here is what I see as the current behavior:
Unless this behavior is OS varying, I think the goal here is to make the default browser background black/dark grey on our native Light theme?
@imptrx if you have a moment, please test setting a dark background color directly on the .html file body (not via javascript) and see if that affects the flash of white color.
oh ignore that @imptrx just noticed there is a background-color. I suggest therefore that the fix is to keep the user's chosen light / dark initial background, and then fade in the image / gradient on top of it when it's ready.
Verification passed on
Brave | 0.69.128 Chromium: 77.0.3865.75聽(Official Build)聽(64-bit)
-- | --
Revision | 201e747d032611c5f2785cae06e894cf85be7f8a-refs/branch-heads/3865@{#776}
OS | Ubuntu 18.04 LTS
Verified expected behavior outlined in https://github.com/brave/brave-core/pull/2957


Verification passed on
Brave | 0.69.128 Chromium: 77.0.3865.75聽(Official Build)聽(64-bit)
-- | --
Revision | 201e747d032611c5f2785cae06e894cf85be7f8a-refs/branch-heads/3865@{#776}
OS | Windows聽10 OS Version 1803 (Build 17134.1006)
Verified expected behavior outlined in https://github.com/brave/brave-core/pull/2957
Verified passed with
Brave | 0.69.129 Chromium: 77.0.3865.90聽(Official Build)聽(64-bit)
-- | --
Revision | 58c425ba843df2918d9d4b409331972646c393dd-refs/branch-heads/3865@{#830}
OS | macOS Version 10.13.6 (Build 17G5019)
Verified expected behavior outlined in https://github.com/brave/brave-core/pull/2957