New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 802186 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit 18 days ago
Closed: Sep 24
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug
Team-Accessibility



Sign in to add a comment

NTP doesn't handle inverted color schemes well

Project Member Reported by treib@chromium.org, Jan 16 2018

Issue description

(Split off from  bug 21798 )

Currently, the NTP (local or remote) does weird things with inverted color schemes.

To repro in Win10: Go to Windows' "High contrast settings" and choose "High Contrast #1", "High Contrast #2", or "High Contrast Black", then restart Chrome.

Observed issues:

1) The changes are only fully applied after a Chrome restart. Until then, things are inconsistent.

2) When opening an NTP, there's a black flash before the white NTP background shows up.

3) If you install a theme with a background color (but no image), that color gets inverted, which looks very odd (example theme [1]). There is also a flash in the non-inverted background color before the inverted one shows up.

At least part of the problem is in InstantService::BuildThemeInfo(), which inverts a bunch of colors if the color scheme is inverted. The goal is (presumably) to retain the original (white) NTP even if the color scheme is inverted. However, this is wrong if there's a theme installed, it's inconsistent with the code that draws the background before the page loads (causing the flashes), and it's also not updated when switching between inverted and non-inverted (hence requiring the Chrome restart).

[1] https://chrome.google.com/webstore/detail/material-theme/mdnphgdednjnpcoeamekbogoblkdajep  
 

Comment 1 by treib@chromium.org, Jan 16 2018

(Tagged OS-Windows because I don't know how to enable inverted color schemes on other OSes, but this bug probably applies everywhere.)

Comment 2 by treib@chromium.org, Jan 16 2018

I see two possible solutions:

a) Just remove the color-inverting code in InstantService::BuildThemeInfo(). This will remove all the inconsistencies (i.e. flashes), themes will retain their proper colors, and all will be well. However, the default NTP will be black rather than white, which I'd argue is actually a win.

b) If we want to keep the NTP white even with inverted colors, then it'll be a bit more tricky - essentially, the re-inverting must be applied consistently. Probably it should be moved from InstantService into either ThemeService or ThemeProvider (so that it also applies to the initial color before the page loads, to avoid flashes), and be made conditional on "UsingDefaultTheme()" so it doesn't mess with actual themes.
Labels: contrast win-a11y
Labels: Needs-Feedback
(Adding needs feedback until we know which approach is the preferred one.)
I prefer a)  - no dependency on Windows themes behavior changes.
Labels: zine-triaged
Cc: adriennetran@google.com
Cc: pkasting@chromium.org ramyan@chromium.org
Since I was CCed I'll opine that comment 2 route (a) seems better to me, but I don't know or understand the instant service or the whole "invert colors in high contrast" design well enough to know if the supposition in comment 0 about the purpose here is correct.
Owner: sweilun@chromium.org
Status: Started (was: Available)
I don't familiar with the inverted color setting either. Following c2's instruction, The black flash and the theme color inverted issue is fixed by removing the code that invert the color. Kindly refer to the screencast.

If we apply this change, background color, text color and link color etc. will not invert corresponding to the system setting. Should we apply this change?

Screencast:
https://screencast.googleplex.com/cast/NjIxODQzNjU4MTUyMzQ1NnwyYmE1M2RhNi1lNQ
Not sure, if this issue actual (I don't have any white flashes with Windows 10 high contrast theme and latest (~ half year) Chrome versions).
Cc: -adriennetran@google.com yyushkina@chromium.org lpalmaro@chromium.org
In 69.0.3497.100, when the NTP is not customized or when a theme is installed, I see a black flash before the expected NTP background shows up for High Contrast #1, #2 and Black, but not High Contrast White. The flash doesn't occur for a Chrome customized background b/c it fades in.

The approach described in c#2 (a) that's shown in the screencast looks reasonable to me, and appears to address all three issues described in the bug. 

Yana: wdyt? We should probably consider this when looking at Win10 dark mode too.

Laura: does this satisfy Win 10 a11y expectations?
LGTM
Project Member

Comment 14 by bugdroid1@chromium.org, Sep 24

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3bfc1485458f614ce0e0e953fd3a2942b13f72a0

commit 3bfc1485458f614ce0e0e953fd3a2942b13f72a0
Author: Weilun Shi <sweilun@chromium.org>
Date: Mon Sep 24 21:15:29 2018

[NTP] Remove invert color function for new tab page

NTP will not invert the color back to white when we set invert color
scheme on system setting. This can not only make the default background
color change according to the system setting but also  avoid weird color
on both themes and custom backgrounds. Notice that, only windows has the
invert color setting.

Screencast:
https://screencast.googleplex.com/cast/NjI0ODU4OTI2NTIwNzI5NnxhYzdiNWI3YS04NQ

Bug:  802186 
Change-Id: Icd64f1350b8014d15107c565785b612ae9febe2e
Reviewed-on: https://chromium-review.googlesource.com/1241156
Reviewed-by: Kristi Park <kristipark@chromium.org>
Reviewed-by: Ramya Nagarajan <ramyan@chromium.org>
Commit-Queue: Weilun Shi <sweilun@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593679}
[modify] https://crrev.com/3bfc1485458f614ce0e0e953fd3a2942b13f72a0/chrome/browser/search/instant_service.cc

Status: Fixed (was: Started)
Tested this issue on Windows 10 on the build without fix 69.0.3497.100 and unable to reproduce the issue by following the below steps.

1. On Windows, set the High contrast settings to High Contrast #1.
2. Launched Chrome and while opening a NTP, cannot observe any black flash.
3. On clicking the Gear icon -> Chrome background and adding a background, cannot observe any wierd colors.
4. Also on adding the theme attached in the original comment, cannot observe any issues.
Attached is the screen cast for reference.

sweilun@ Request you to check and confirm if anything is missed from our end in verifying the issue and help us in verifying the fix on the latest M-71 build.

Thanks.
802186.mp4
3.5 MB View Download
Are you sure you correctly set the high contrast setting? Would you try High Contrast #2? With or without the fix, the color of chrome UI eg. nav tab, omnibox, App icon should be inverted eg. without theme those UI should be in different color than white. But I can't see that apply to your case. So, I believe you may not set the inverted color scheme for some reasons.

Please refer to the screencast! Thank you~

capture (1).webm
10.0 MB View Download

Sign in to add a comment