Last Comment Bug 558585 - Window flashes white when a new tab is made, despite settings
: Window flashes white when a new tab is made, despite settings
Status: VERIFIED FIXED
:
Product: Firefox
Classification: Client Software
Component: Tabbed Browser (show other bugs)
: Trunk
: All All
: -- trivial with 4 votes (vote)
: Firefox 6
Assigned To: Dão Gottwald [:dao]
:
Mentors:
: 576495 644240 670054 (view as bug list)
Depends on: 591341 658726
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-10 15:00 PDT by danthau
Modified: 2011-07-12 04:37 PDT (History)
20 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (1.63 KB, patch)
2011-04-16 15:25 PDT, Dão Gottwald [:dao]
gavin.sharp: review+
Details | Diff | Splinter Review

Description danthau 2010-04-10 15:00:13 PDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a5pre) Gecko/20100410 Minefield/3.7a5pre
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a5pre) Gecko/20100410 Minefield/3.7a5pre

I have both browser.display.background_color and browser.display.focus_background_color set to '#000000'.  Additionally, I have 'When Minefield starts' set to 'Show a blank page'.

Despite all this, when a new tab is made the window flashes white then turns black.  It should never flash white with these settings.

Reproducible: Always

Steps to Reproduce:
1.  Set browser.display.focus_background_color and browser.display.background_color to something dark (such as #000000)
2.  Make a new tab
3.  Notice the split-second white flash
Actual Results:  
The main window flashed white for a short period of time

Expected Results:  
The window should have remained the set background color

I use this black-background setup along with a dark GTK theme and 'use system colors' when in a low-light environment.  The sudden bright flashes in an otherwise dark environment are unpleasant and hurt my eyes after a while.  With previous versions of Firefox which did not flash white when making a new tab this was not the case.
Comment 1 danthau 2010-07-07 22:09:18 PDT
I tried it in Windows XP x86 and Windows 7 x86_64, and found another bug report with the same problem on Windows XP x86_64:

https://bugzilla.mozilla.org/show_bug.cgi?id=576495

So I updated "Platform" to reflect that this is not specific to Linux or x86 as I had it previously.
Comment 2 Joonas Marttila 2010-10-12 08:34:37 PDT
*** Bug 576495 has been marked as a duplicate of this bug. ***
Comment 3 Jeremy Greene 2011-01-08 17:19:38 PST
This bug is a serious problem for me. I have a circadian rhythm disorder, and I must not expose myself to bright lights in the evening, or I will have trouble falling asleep. Therefore, in the evening I turn off the lights in my room and I enable a Windows theme in which all backgrounds are black, and the text is dark green. I use Firefox's accessibility features to force it to adopt this theme, by going to Options / Content / Colors, checking "Use system colors," and unchecking "Allow pages to choose their own colors, instead of my selections above."

Every time a new tab opens, I am momentarily blinded by a bright white background in the tab. This did not happen in Firefox 3. The expected behavior is that as soon as the tab opens, it should have the correct background color.

If you try to reproduce this bug and think that the bright white background flashes by really quickly, then consider this: on single-core PC that has been running 10 Firefox tabs for several hours, nothing happens quickly. Sure, when I first launch Firefox, it is very quick and the flashing background is not very noticeable. But after running several tabs for several hours, Firefox is much slower and these "flashing white tabs" will now take up to half a second to turn black.

Build identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b9pre) Gecko/20110108 Firefox/4.0b9pre
Comment 4 danthau 2011-03-23 07:12:55 PDT
I've found a line which, when thrown into userChrome.css, seems to resolve the issue.

tabbrowser tabpanels { background-color: black !important; }

(feel free to change black to whichever color you would like)

Found here:

http://forums.mozillazine.org/viewtopic.php?f=23&t=2138435

While this is adequate for my purposes (and hence, I'm resolving the ticket), Firefox should chose this value from other settings (such as the Windows or GTK theme, if set to use those) rather than defaulting to white.
Comment 5 Vincent Povirk 2011-03-23 07:28:31 PDT
It's good that there's a work-around, but that doesn't make this less of a bug. I think you should reopen.
Comment 6 danthau 2011-03-23 07:31:37 PDT
I wasn't sure about the policy for such things, but you're probably correct.  Re-opened.  Firefox should chose the tabpanels background color based on other settings (such as the Windows or GTK theme, if set to those) rather than defaulting to white.
Comment 7 Jeremy Greene 2011-03-25 04:33:00 PDT
[danthau: Thank you *so much* for the workaround you provided above. No more blinding white flashes anymore!]

I agree that this bug should be kept open, and I would suggest that the fix should be for Firefox to set the tabpanel's background color to match the color that is configured in Tools / Options / Content / Colors / Background.

The impact of this bug is rather severe for those of us that have eyestrain, circadian disorders, or other such issues that require us to modify the accessibility settings in Firefox. Therefore I would suggest that this be treated as an accessibility-related bug.

Sorry I'm not familiar with the code, otherwise I would attempt to submit a patch.
Comment 8 Dão Gottwald [:dao] 2011-03-30 01:47:13 PDT
*** Bug 644240 has been marked as a duplicate of this bug. ***
Comment 9 Ed Morley [:emorley] 2011-03-30 01:49:58 PDT
Marking new given the two dupes.

Please can someone find the regression range:
http://harthur.github.com/mozregression/
Comment 10 Dão Gottwald [:dao] 2011-03-30 02:20:59 PDT
Don't need a regression range. browser.display.background_color had never been respected here.
Comment 11 Ed Morley [:emorley] 2011-03-30 02:22:32 PDT
Both this bug and the other report this as being a new issue to Fx4...
Comment 12 ngoonee.talk 2011-03-30 03:33:05 PDT
I'm affected by this bug (or something very similar), did not occur in fx3 but now happens in fx4. The thing is, I have not used any of the alphas/betas of Fx4 till b11 or so, and this already had that issue. Hence I'm not sure if I'll even be able to do the regression range test (not knowing how far back to go, unless its all the way to fx3?)
Comment 13 Dão Gottwald [:dao] 2011-03-30 04:20:00 PDT
Again, we don't need a regression range. This needs bug 591341 to be fixed.
Comment 14 Xolotl Loki 2011-04-14 17:31:29 PDT
This problem was preventing me from using Firefox 4.0 and above, so thanks for the workaround.  If someone can point me to the relevant code, I'll be happy to fix it.
Comment 15 Dão Gottwald [:dao] 2011-04-16 15:25:11 PDT
Created attachment 526526 [details] [diff] [review]
patch
Comment 16 Dão Gottwald [:dao] 2011-04-16 15:44:45 PDT
The code selecting the background color is in nsPresContext.cpp, nsPresContext::GetDocumentColorPreferences(). Note that it ignores browser.display.use_system_colors if an "accessibility theme" is used, which I don't think I can detect here.
Comment 17 Florian Quèze [:florian] [:flo] 2011-04-16 15:51:47 PDT
Comment on attachment 526526 [details] [diff] [review]
patch

>+          this.style.backgroundColor =
>+            Services.prefs.getBoolPref("browser.display.use_system_colors") ?
>+              "-moz-default-background-color" :
>+              Services.prefs.getCharPref("browser.display.background_color");

Isn't "-moz-default-background-color" always the value you want? If I remember correctly, it does take into account the value of the color preferences.
Comment 18 Dão Gottwald [:dao] 2011-04-16 16:00:23 PDT
(In reply to comment #17)
> Comment on attachment 526526 [details] [diff] [review]
> patch
> 
> >+          this.style.backgroundColor =
> >+            Services.prefs.getBoolPref("browser.display.use_system_colors") ?
> >+              "-moz-default-background-color" :
> >+              Services.prefs.getCharPref("browser.display.background_color");
> 
> Isn't "-moz-default-background-color" always the value you want? If I remember
> correctly, it does take into account the value of the color preferences.

Unfortunately, it doesn't honor the prefs in chrome documents.
Comment 19 Dão Gottwald [:dao] 2011-05-04 01:37:00 PDT
http://hg.mozilla.org/mozilla-central/rev/e90bdd97d168
Comment 20 Can 2011-05-04 06:18:32 PDT
I'm using a 3rd party dark theme which is Nasa Night Launch with latest trunk builds. Window was flashing when i open a new tab, but thought this was about theme, so didn't file a bug.

I tested the theme with this patch but window still flashes with one difference. It does flash for some (randomly) new tabs, not for all. 

Should this have fixed that or am i expecting wrong ?
Comment 21 Dão Gottwald [:dao] 2011-05-04 06:28:17 PDT
(In reply to comment #20)
> I'm using a 3rd party dark theme which is Nasa Night Launch with latest trunk
> builds. Window was flashing when i open a new tab, but thought this was about
> theme, so didn't file a bug.
> 
> I tested the theme with this patch but window still flashes with one
> difference. It does flash for some (randomly) new tabs, not for all. 
> 
> Should this have fixed that or am i expecting wrong ?

It's possible that the theme is overriding the background color that we set, so you should probably report this to that theme's author.
Comment 22 Can 2011-05-04 06:34:22 PDT
(In reply to comment #21)
> (In reply to comment #20)
> > I'm using a 3rd party dark theme which is Nasa Night Launch with latest trunk
> > builds. Window was flashing when i open a new tab, but thought this was about
> > theme, so didn't file a bug.
> > 
> > I tested the theme with this patch but window still flashes with one
> > difference. It does flash for some (randomly) new tabs, not for all. 
> > 
> > Should this have fixed that or am i expecting wrong ?
> 
> It's possible that the theme is overriding the background color that we set, so
> you should probably report this to that theme's author.

if you mean overriding the pref: browser.display.background_color

i checked that, theme does not override it. 

Then i override it myself from #FFFFFF to #000000, then no flashes.
Comment 23 Dão Gottwald [:dao] 2011-05-04 06:38:13 PDT
(In reply to comment #22)
> if you mean overriding the pref: browser.display.background_color
> 
> i checked that, theme does not override it.

No, I mean that the theme could prevent Firefox from coloring the area that you see flashing.
Comment 24 Vlad [QA] 2011-05-05 06:26:52 PDT
This bug is still reproducing for me on Mozilla/5.0 (Windows NT 6.1; rv:6.0a1) Gecko/20110504 Firefox/6.0a1
Comment 25 Tyler Downer [:Tyler] 2011-05-05 06:33:11 PDT
Try with today's build.
Comment 26 Can 2011-05-05 06:51:31 PDT
(In reply to comment #24)
> This bug is still reproducing for me on Mozilla/5.0 (Windows NT 6.1; rv:6.0a1)
> Gecko/20110504 Firefox/6.0a1

yes, for me too.

I tried in a fresh profile with default theme and changed backgroudn color pref to #000000, window flashes with new tabs.Mozilla/5.0 

(Windows NT 6.1; WOW64; rv:6.0a1) Gecko/20110505 Firefox/6.0a1 ID:20110505030608
Comment 27 Can 2011-05-05 06:56:17 PDT
(In reply to comment #26)
> (In reply to comment #24)
> > This bug is still reproducing for me on Mozilla/5.0 (Windows NT 6.1; rv:6.0a1)
> > Gecko/20110504 Firefox/6.0a1
> 
> yes, for me too.
> 
> I tried in a fresh profile with default theme and changed backgroudn color pref
> to #000000, window flashes with new tabs.Mozilla/5.0 
> 
> (Windows NT 6.1; WOW64; rv:6.0a1) Gecko/20110505 Firefox/6.0a1
> ID:20110505030608

sorry about this post, i restarted firefox and there didnt happen any windows flashes.

But this time, when opening default home page and add-ons manager , window flashes.
Comment 28 Gabriela [:gaby2300] 2011-05-06 14:05:56 PDT
Verified fixed in

Mozilla/5.0 (Windows NT 6.1; rv:5.0a2) Gecko/20110506 Firefox/5.0a2 and today's nightly
Comment 29 Geo Mealer [:geo] -- This account is inactive after 2015-07-07 2011-05-06 14:28:46 PDT
Looks like there was a mixup in our bug day query, so Gaby thought this was an Fx5 bug. The verification above unfortunately won't apply. The good news is that this bug isn't affecting everyone.
Comment 30 achalddave 2011-05-06 18:00:29 PDT
(In reply to comment #29)
> Looks like there was a mixup in our bug day query, so Gaby thought this was
> an Fx5 bug. The verification above unfortunately won't apply. The good news
> is that this bug isn't affecting everyone.

Still a bit confused-- does this mean this will be fixed in a soon-upcoming (1-2 days) nightly build? Or will it be fixed in Firefox 6? I see flashes on 5/6/11's nightly build.
Comment 31 George Carstoiu 2011-06-30 04:43:09 PDT
Mozilla/5.0 (X11; Linux i686; rv:7.0a1) Gecko/20110630 Firefox/7.0a1

After restarting browser the issue is no longer reproducible. Verified it on Ubuntu 11.04, WinXP, Win 7 and Mac OS X 10.6 using the steps from Comment 0.

Setting status to Verified Fixed.
Comment 32 George Carstoiu 2011-07-12 04:37:56 PDT
*** Bug 670054 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.