cannot disable high contrast mode




Disability Access APIs
5 years ago
3 years ago


(Reporter: Davyd McColl, Unassigned)


Windows 8

Firefox Tracking Flags

(Not tracked)



(2 attachments)



5 years ago
User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0
Build ID: 20120912042008

Steps to reproduce:

This is a re-opening of #479454 since, following the comments there, I don't believe the issue will be attended to unless someone re-enters it. The original issue is well defined and was closed for some apparent lack of data (I'm at a loss to find this lack). The original issue is nearly two years old and should be quite trivial to fix if the High Contrast reaction code has been well-written. The original issue is re-iterated here verbatim:

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)

When Windows is set to a High Contrast theme, Firefox automatically applies it to all webpages, overriding preferences and document colors.  Also, no non-default themes can be selected.  There seems to be no way to turn this behavior off.

Reproducible: Always

Steps to Reproduce:
1. Open Control Panel>Personalization>Window Color And Appearance>classic appearance properties
2. Set Color Scheme to any High Contrast scheme
3. Look at Firefox
Actual Results:  
Firefox forces High Contrast colors

Expected Results:  
There should be an option to disable this, at least in about:config

Actual results:

I set my Windows 8 machine to a High Contrast theme and could find no way to convince Firefox not to disable web pages in High Contrast mode.

Expected results:

There should be a setting, even if buried in about:config, to disable this behaviour so that people who want to use high contrast themes don't have high contrast web page rendering forced on them. The issue is especially pertinent in Windows 8 where Metro apps only respond to user color selection in High Contrast mode. So to be able to get a more readable Mail app (and others), the user needs to select High Contrast mode -- and then cannot view web pages as originally intended (or with their own CSS overrides, for that matter).

Comment 1

5 years ago
Created attachment 677695 [details]
Firefox showing in high contrast mode

The only way to set custom UI colour scheme in Windows 8 is to switch to high contrast mode. This makes Firefox unusable, since it applies some mix of the system UI colours and it's own colours to webpages, which makes links nearly invisible and some elements hidden (look at the "Firefox - Free download" button on the screenshot - in this case at least the text stays, but on many websites nothing remains visible).

Additionally, it makes it impossible to print out any webpage, as it applies the same colour scheme (including the black background) to the printed page.

Comment 2

5 years ago
I believe this is much a problem with the OS as it is with the browser.  I just ran into this problem myself.  Both IE 10 and Firefox17 exhibit the problem, whereas Chrome does not.

Comment 3

4 years ago
Also see #639134

I think it's (part of?) the same problem. According to a comment on that bug, it's to do with the code in

The checkbox is not applied, "Allow pages to choose their own colors" even when the user applies it, if a High Contrast theme is selected in Windows.

I don't know whether or not that ALSO covers the removal of all a page's own CSS styling.

This is a bug and NOT a 'feature'. Most of the Web is unusable in Firefox when you have a high contrast Windows theme in Windows 7 or 8. Not only are the colours changed but all CSS styling, including background images of elements etc. is switched off. There should be an option to toggle this feature on or off for the user. 

After all, everyone NOT using a high-contrast Windows theme can optionally set their own stylesheets anyway, or use extensions to set them on a per-site basis. But people using a high contrast theme in Windows are penalised by having it forced verbatim (even if it doesn't translate well to the websites anyway) and the checkbox about 'Allow pages to use their own colors' simply never applied even when the user sets it. Ironically Firefox's design made the Web far more 'inaccessible' by discriminating against anyone using a high-contrast Windows theme for whatever reason.

Comment 4

4 years ago
Created attachment 814501 [details]
Firefox 24 in high contrast mode

Wow, Firefox 24 made high contrast mode even worse - not only it still applies a stylesheet that makes the majority of webpages unusable, it now also uses white background for tabs, and draws the menu entirely in white, and there are some drawing glitches when you mouse over items (and if you decide to show menubar instead, it uses blur effect over the text).

Comment 5

4 years ago
I don't have a proper environment to build/test this in, and likelwise I apologise if my comment breaks any etiquette as it is my first post here. But looking at the source, it seems the relevant change should be made starting at line 626 in /layout/base/nsPresContext.cpp

Specifically, change this bit:

   624     else {
   625       useAccessibilityTheme =
   626         LookAndFeel::GetInt(LookAndFeel::eIntID_UseAccessibilityTheme, 0);
   627       usePrefColors = !useAccessibilityTheme;
   628     }

To this:

   624     else {
   625       useAccessibilityTheme =
   626         !Preferences::GetBool("browser.display.ignore_accessibility_theme", false) &&
   627         LookAndFeel::GetInt(LookAndFeel::eIntID_UseAccessibilityTheme, 0);
   628       usePrefColors = !useAccessibilityTheme;
   629     }

I don't know what other magic (if any) is required to make the browser.display.ignore_accessibility_theme config option available.

Someone who is a proper dev (I'm really not) please, PLEASE look at this, because right now I either have to switch themes every time I want to use my browser, or stick with Opera (which at least renders correctly in high-contrast mode, but has too many other issues to put up with.)

Comment 6

4 years ago
x86_64 Windows 7 has the same bug and it appears to afflict Gnome's high contrast mode too.

Comment 7

4 years ago
The bug reporter says that he applied a custom stylesheet to fix Opera.
I tested:
a { color: #ccf !important; } 
in userContent.css and it seems to have fixed the links.  I imagine a:visited and such would be needed for a proper styling.

I imagine / would probably work too, for a friendlier UI.

Comment 8

4 years ago
I have to add, yes, this doesn't fix the bug, and the code fix sounds better.
Also, he noted backgrounds on buttons are lost (screws up img based buttons which are now black on black), and that's not fixable in CSS by restoring the images.
One *can* write a userContent.css to forcibly render buttons w/ a visible background ofc.

Comment 9

4 years ago
Please, developers, if it is not so hard, fix this, because now using the internet with Firefox in high-contrast mode is not so comfortable and easy. And disabling high-contrast in Windows is not a good option for me. Thanks much in advance!

Comment 10

4 years ago
Some thoughtful person should really make a drop-in high-contrast mode fixing userContent.css for Kolev and others w/ that problem.
Maybe link it from here.  At least until a fix is in place.
If only I wasn't so lazy/busy...

Comment 11

4 years ago
I've found a registry workaround for this on Windows 8/8.1. It's not perfect, but it seems fine so far:

-Load a non-High Contrast theme
-Export the entire registry key: HKEY_CURRENT_USER\Control Panel\Accessibility\HighContrast and save it somewhere
-Load your High Contrast theme
-Double-click the registry file you made to load the keys
-Restart your computer
-After rebooting, open "Personalization", and select "Unsaved Theme". Save it if you like.

So far this has done exactly what I wanted it to. If something gives you trouble, just load another Windows theme to revert all changes.

Comment 12

4 years ago
PLEASE, add the option to override HC theme detection under Win 8.1, or at least let me have the option to see pages in their original colours.

As it stands, HC mode breaks a number of sites for me, forcing me to poke around "in the dark" on pages for buttons that would be easily exposed by the custom toolbar "toggle page colours" button, which used to work great.

Defaulting to high contrast mode if the system is in HC mode is a good idea, but a way to override it is imperative - even if its a about:config option that surely isn't onerous to implement, from what I've seen above.

This problem is affecting me daily and has added to the stress that a visually disabled person faces when upgrading their operating enviromment (in my case XP to Windows 8.1). Suggested theme file hacks and registy tricks haven't helped.

Comment 13

3 years ago
I made the change suggested by T.E. on a Firefox nightly and indeed it works. I now have a configuration option (browser.display.ignore_accessibility_theme) that controls whether Firefox forces the page colour override. I can enjoy pages colours again via my toggle site page colours button.

The latest (31.0a1) has a forced white background URL field, even under the Sandboxie hack that I use to get around the other theme problems when running on a HC system. 

I wish this option could be incorporated in the trunk at some stage.

Comment 14

3 years ago
I don't know why, but on a virtual machine with Windows 7, if I uncheck "Use system colors" and check "Allow sites to use colors different from the ones above", Firefox behaves as we want it to and displays the pages with their original colors/style, even with a high-contrast theme used. But on Windows 8.1, this is not so and Firefox displays pages in high-contrast mode with the same settings and a high-contrast theme used. Both machines are with Firefox v29.0 final. Any ideas?

Comment 15

3 years ago
Confirmed. Firefox 29 in Windows 7 can be set not to use high-contrast theme, but not in Windows 8.1.
Component: Untriaged → Disability Access APIs
Ever confirmed: true
Product: Firefox → Core
Version: 17 Branch → Trunk
Flags: needinfo?(dbolter)
Gijs any ideas about comment 15?
Flags: needinfo?(dbolter) → needinfo?(gijskruitbosch+bugs)

Comment 17

3 years ago
I'm pretty sure this is a dupe of some other bug where we decided that "use author/document colors" should be a tristate pref with "auto" (default, depends on high contrast theme) and "yes" (always) and "no" (never), instead of the checkbox it is now. It seems everyone in this bug wants the "never" behaviour, which we don't currently provide. I don't think that's the case for all users of HCM, though, so I am unwilling to make the pref always override the HCM, as this will break the "default" situation for users of HCM that have come to rely on the existing behaviour.

I don't have the dupe to hand. I can see if I can find time to implement this in the coming two weeks (leaving needinfo), although the migration and so on will be "interesting" - and then I can also dupe as appropriate.

Comment 18

3 years ago
So this is a dupe of bug 639134, but even that's not the bug I was thinking of...
Last Resolved: 3 years ago
Flags: needinfo?(gijskruitbosch+bugs)
Resolution: --- → DUPLICATE
Duplicate of bug: 639134
You need to log in before you can comment on or make changes to this bug.