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

Issue 883177 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Jan 16
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows
Pri: 1
Type: Bug
Team-Accessibility



Sign in to add a comment

Hosted app title bar text colour inconsistent on Windows 7/Linux

Project Member Reported by alancutter@chromium.org, Sep 12

Issue description

Chrome Version: 70
OS: Windows 7, Linux

What steps will reproduce the problem?
(1) Visit fast-lute.glitch.me.
(2) Menu > Install Fast Lute...
(3) Look at title bar text

What is the expected result?
Text should be white.

What happens instead?
Text is black.


The background colours of Inbox (#4285f4 blue) and Gmail (#d6493b orange) normally have white text on them.

Hosted app title bars on Linux and Windows 7 are using black instead due to the use of color_utils::GetReadableColor() which picks white or black depending on which one has the higher contrast ratio.
On Windows 10 it mimics native Windows and picks white/black based on the background luma.
On Android and ChromeOS it prefers white and only uses a dark shade if white's contrast ratio is less than 3.
See screenshots.

I've made fast-lute.glitch.me have the orange colour and watery-shingle.glitch.me have the blue colour for testing.

We should make Linux/Windows 7 be consistent with Windows 10, Android, Chrome OS, Gmail and Inbox. I'm not sure why the contrast ratio is higher with black but empirically I think white is easier to read and is probably why the other platforms use it.

 
fast-lute.glitch.me screenshots.
linux-orange.png
12.0 KB View Download
win7-orange.png
6.8 KB View Download
chromeos-orange.png
8.7 KB View Download
win10-orange.png
12.1 KB View Download
watery-shingle.glitch.me screenshots.
linux-blue.png
20.6 KB View Download
win7-blue.png
9.3 KB View Download
chromeos-blue.png
10.2 KB View Download
win10-blue.png
18.6 KB View Download
WIP CL screenshots: https://chromium-review.googlesource.com/c/chromium/src/+/1218186
linux-orange-after.png
16.2 KB View Download
linux-blue-after.png
21.6 KB View Download
Screenshot of Gmail and Inbox with black titlebar text.
gmail-inbox.png
29.2 KB View Download
Chrome OS before/after screenshots for CL.
chromeos-before.png
53.8 KB View Download
chromeos-after.png
53.8 KB View Download
Project Member

Comment 6 by bugdroid1@chromium.org, Sep 14

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

commit 9c6ad3095f59d1378e785eb7c4289bf2c6edadd3
Author: Alan Cutter <alancutter@chromium.org>
Date: Fri Sep 14 03:22:23 2018

Fix inconsistent hosted app title bar text color readability algorithm

This CL updates the title text color for Linux and Windows 7 hosted
app windows to be more consistent with Windows 10, Chrome OS, Android
and text colors used by Gmail and Inbox.

Before: https://bugs.chromium.org/p/chromium/issues/attachment?aid=357634&signed_aid=ONM068fpCagoCFdrDrfYuw==&inline=1
After: https://bugs.chromium.org/p/chromium/issues/attachment?aid=357642&signed_aid=2gnT0P6z9_fNMEZAGLKLnw==&inline=1
See bug for more screenshots.

Bug:  883177 
Change-Id: Ic24e1cf0b445251ebfdcd1aa0ae74c9343b1ff8e
Reviewed-on: https://chromium-review.googlesource.com/1218186
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591279}
[modify] https://crrev.com/9c6ad3095f59d1378e785eb7c4289bf2c6edadd3/ash/frame/caption_buttons/frame_caption_button.cc
[modify] https://crrev.com/9c6ad3095f59d1378e785eb7c4289bf2c6edadd3/chrome/browser/ui/views/frame/hosted_app_button_container.h
[modify] https://crrev.com/9c6ad3095f59d1378e785eb7c4289bf2c6edadd3/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
[modify] https://crrev.com/9c6ad3095f59d1378e785eb7c4289bf2c6edadd3/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
[add] https://crrev.com/9c6ad3095f59d1378e785eb7c4289bf2c6edadd3/chrome/browser/ui/views/frame/opaque_browser_frame_view_browsertest.cc
[modify] https://crrev.com/9c6ad3095f59d1378e785eb7c4289bf2c6edadd3/chrome/test/BUILD.gn
[modify] https://crrev.com/9c6ad3095f59d1378e785eb7c4289bf2c6edadd3/ui/gfx/color_utils.cc
[modify] https://crrev.com/9c6ad3095f59d1378e785eb7c4289bf2c6edadd3/ui/gfx/color_utils.h

Status: Verified (was: Assigned)
Verified this is fixed on Windows 7.
w7orange-fixed.png
115 KB View Download
w7blue-fixed.png
64.0 KB View Download
Labels: Merge-Request-70
Requesting merge of https://crrev.com/9c6ad3095f59d1378e785eb7c4289bf2c6edadd3 for 70.
Project Member

Comment 9 by sheriffbot@chromium.org, Sep 17

Labels: -Merge-Request-70 Merge-Review-70 Hotlist-Merge-Review
This bug requires manual review: M70 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: benmason@(Android), kariahda@(iOS), geohsu@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: bettes@chromium.org
Do we have signoff from UX on this? Why is this critical for M70?
+bettes@
Cc: hwi@chromium.org
#10 +hwi should be able to comment.

Upon inspection, it looks like the main examples we've found of this being an issue (with the middle-of-the-road theme colours) are Google apps like Inbox and Gmail which aren't actually PWAs. We haven't found an example of a real-world desktop PWA that exhibits this. So maybe it's fine to leave out from M70.
This applies to all bookmark apps, not only PWAs.
c10: Hi abdulsyed@, yes, c7 is what we should go with. The same title bar text color across the platforms is what the developer expects and should expect. Consistent color display is critical for the apps' branding and business. 

It would be great if we can manual review and merge this. 

Thanks for considering. 
Cc: austinknight@chromium.org
Labels: -Merge-Review-70 Merge-Approved-70
Thanks for more feedback. Approved for M70. Branch:3538
Project Member

Comment 16 by bugdroid1@chromium.org, Sep 18

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

commit 545d0bf4e0f195bb58f1620a1ad6958a8a95ed9d
Author: Asanka Herath <asanka@chromium.org>
Date: Tue Sep 18 16:27:45 2018

Revert "Fix inconsistent hosted app title bar text color readability algorithm"

This reverts commit 9c6ad3095f59d1378e785eb7c4289bf2c6edadd3.

Reason for revert: Tests added in this CL are failing on mac-cocoa-rel
 since landing.

Original change's description:
> Fix inconsistent hosted app title bar text color readability algorithm
> 
> This CL updates the title text color for Linux and Windows 7 hosted
> app windows to be more consistent with Windows 10, Chrome OS, Android
> and text colors used by Gmail and Inbox.
> 
> Before: https://bugs.chromium.org/p/chromium/issues/attachment?aid=357634&signed_aid=ONM068fpCagoCFdrDrfYuw==&inline=1
> After: https://bugs.chromium.org/p/chromium/issues/attachment?aid=357642&signed_aid=2gnT0P6z9_fNMEZAGLKLnw==&inline=1
> See bug for more screenshots.
> 
> Bug:  883177 
> Change-Id: Ic24e1cf0b445251ebfdcd1aa0ae74c9343b1ff8e
> Reviewed-on: https://chromium-review.googlesource.com/1218186
> Commit-Queue: Alan Cutter <alancutter@chromium.org>
> Reviewed-by: James Cook <jamescook@chromium.org>
> Reviewed-by: Michael Wasserman <msw@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#591279}

TBR=jamescook@chromium.org,msw@chromium.org,alancutter@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug:  883177 
Bug:  885164 
Change-Id: I22a52611a5478ee1d430ccd8ca1a507f7237d4f7
Reviewed-on: https://chromium-review.googlesource.com/1230435
Reviewed-by: Asanka Herath <asanka@chromium.org>
Commit-Queue: Asanka Herath <asanka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592069}
[modify] https://crrev.com/545d0bf4e0f195bb58f1620a1ad6958a8a95ed9d/ash/frame/caption_buttons/frame_caption_button.cc
[modify] https://crrev.com/545d0bf4e0f195bb58f1620a1ad6958a8a95ed9d/chrome/browser/ui/views/frame/hosted_app_button_container.h
[modify] https://crrev.com/545d0bf4e0f195bb58f1620a1ad6958a8a95ed9d/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
[modify] https://crrev.com/545d0bf4e0f195bb58f1620a1ad6958a8a95ed9d/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
[delete] https://crrev.com/4e0dc98a4148183d1fcd770f0899a96354b25b06/chrome/browser/ui/views/frame/opaque_browser_frame_view_browsertest.cc
[modify] https://crrev.com/545d0bf4e0f195bb58f1620a1ad6958a8a95ed9d/chrome/test/BUILD.gn
[modify] https://crrev.com/545d0bf4e0f195bb58f1620a1ad6958a8a95ed9d/ui/gfx/color_utils.cc
[modify] https://crrev.com/545d0bf4e0f195bb58f1620a1ad6958a8a95ed9d/ui/gfx/color_utils.h

Thanks much abdulsyed@!
Project Member

Comment 18 by bugdroid1@chromium.org, Sep 20

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

commit 9c6415198fe67aad0461181ac5b544e0f08fe076
Author: Alan Cutter <alancutter@chromium.org>
Date: Thu Sep 20 02:22:39 2018

Reland: Fix inconsistent hosted app title bar text color readability algorithm

This is a reland of https://chromium-review.googlesource.com/c/chromium/src/+/1218186
which was reverted in https://chromium-review.googlesource.com/1230435
due to the added test failing mac-cocoa-rel.
This reland removes the test from non-Views mac builds as it's only
applicable with Views enabled.

This CL updates the title text color for Linux and Windows 7 hosted
app windows to be more consistent with Windows 10, Chrome OS, Android
and text colors used by Gmail and Inbox.

Before: https://bugs.chromium.org/p/chromium/issues/attachment?aid=357634&signed_aid=ONM068fpCagoCFdrDrfYuw==&inline=1
After: https://bugs.chromium.org/p/chromium/issues/attachment?aid=357642&signed_aid=2gnT0P6z9_fNMEZAGLKLnw==&inline=1
See bug for more screenshots.

Bug:  883177 ,  885164 
Change-Id: Iaeae13799629d418dfa4c4285032bf1d7990c402
Reviewed-on: https://chromium-review.googlesource.com/1233074
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592661}
[modify] https://crrev.com/9c6415198fe67aad0461181ac5b544e0f08fe076/ash/frame/caption_buttons/frame_caption_button.cc
[modify] https://crrev.com/9c6415198fe67aad0461181ac5b544e0f08fe076/chrome/browser/ui/views/frame/hosted_app_button_container.h
[modify] https://crrev.com/9c6415198fe67aad0461181ac5b544e0f08fe076/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
[modify] https://crrev.com/9c6415198fe67aad0461181ac5b544e0f08fe076/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
[add] https://crrev.com/9c6415198fe67aad0461181ac5b544e0f08fe076/chrome/browser/ui/views/frame/opaque_browser_frame_view_browsertest.cc
[modify] https://crrev.com/9c6415198fe67aad0461181ac5b544e0f08fe076/chrome/test/BUILD.gn
[modify] https://crrev.com/9c6415198fe67aad0461181ac5b544e0f08fe076/ui/gfx/color_utils.cc
[modify] https://crrev.com/9c6415198fe67aad0461181ac5b544e0f08fe076/ui/gfx/color_utils.h

Project Member

Comment 19 by bugdroid1@chromium.org, Sep 21

Labels: merge-merged-3538
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4f5b467eb2f880fdcdc96a369572bacc578f5e0a

commit 4f5b467eb2f880fdcdc96a369572bacc578f5e0a
Author: Alan Cutter <alancutter@chromium.org>
Date: Fri Sep 21 04:00:53 2018

Reland: Fix inconsistent hosted app title bar text color readability algorithm

This is a reland of https://chromium-review.googlesource.com/c/chromium/src/+/1218186
which was reverted in https://chromium-review.googlesource.com/1230435
due to the added test failing mac-cocoa-rel.
This reland removes the test from non-Views mac builds as it's only
applicable with Views enabled.

This CL updates the title text color for Linux and Windows 7 hosted
app windows to be more consistent with Windows 10, Chrome OS, Android
and text colors used by Gmail and Inbox.

Before: https://bugs.chromium.org/p/chromium/issues/attachment?aid=357634&signed_aid=ONM068fpCagoCFdrDrfYuw==&inline=1
After: https://bugs.chromium.org/p/chromium/issues/attachment?aid=357642&signed_aid=2gnT0P6z9_fNMEZAGLKLnw==&inline=1
See bug for more screenshots.

Bug:  883177 ,  885164 
Change-Id: Iaeae13799629d418dfa4c4285032bf1d7990c402
Reviewed-on: https://chromium-review.googlesource.com/1233074
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#592661}(cherry picked from commit 9c6415198fe67aad0461181ac5b544e0f08fe076)
Reviewed-on: https://chromium-review.googlesource.com/1237895
Reviewed-by: Alan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/branch-heads/3538@{#555}
Cr-Branched-From: 79f7c91a2b2a2932cd447fa6f865cb6662fa8fa6-refs/heads/master@{#587811}
[modify] https://crrev.com/4f5b467eb2f880fdcdc96a369572bacc578f5e0a/ash/frame/caption_buttons/frame_caption_button.cc
[modify] https://crrev.com/4f5b467eb2f880fdcdc96a369572bacc578f5e0a/chrome/browser/ui/views/frame/hosted_app_button_container.h
[modify] https://crrev.com/4f5b467eb2f880fdcdc96a369572bacc578f5e0a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
[modify] https://crrev.com/4f5b467eb2f880fdcdc96a369572bacc578f5e0a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
[add] https://crrev.com/4f5b467eb2f880fdcdc96a369572bacc578f5e0a/chrome/browser/ui/views/frame/opaque_browser_frame_view_browsertest.cc
[modify] https://crrev.com/4f5b467eb2f880fdcdc96a369572bacc578f5e0a/chrome/test/BUILD.gn
[modify] https://crrev.com/4f5b467eb2f880fdcdc96a369572bacc578f5e0a/ui/gfx/color_utils.cc
[modify] https://crrev.com/4f5b467eb2f880fdcdc96a369572bacc578f5e0a/ui/gfx/color_utils.h

Labels: -Merge-Approved-70 Merge-Merged-70-refsbranch-heads3538
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4f5b467eb2f880fdcdc96a369572bacc578f5e0a
Commit: 4f5b467eb2f880fdcdc96a369572bacc578f5e0a
Author: alancutter@chromium.org
Commiter: alancutter@chromium.org
Date: 2018-09-21 04:00:53 +0000 UTC
Reland: Fix inconsistent hosted app title bar text color readability algorithm

This is a reland of https://chromium-review.googlesource.com/c/chromium/src/+/1218186
which was reverted in https://chromium-review.googlesource.com/1230435
due to the added test failing mac-cocoa-rel.
This reland removes the test from non-Views mac builds as it's only
applicable with Views enabled.

This CL updates the title text color for Linux and Windows 7 hosted
app windows to be more consistent with Windows 10, Chrome OS, Android
and text colors used by Gmail and Inbox.

Before: https://bugs.chromium.org/p/chromium/issues/attachment?aid=357634&signed_aid=ONM068fpCagoCFdrDrfYuw==&inline=1
After: https://bugs.chromium.org/p/chromium/issues/attachment?aid=357642&signed_aid=2gnT0P6z9_fNMEZAGLKLnw==&inline=1
See bug for more screenshots.

Bug:  883177 ,  885164 
Change-Id: Iaeae13799629d418dfa4c4285032bf1d7990c402
Reviewed-on: https://chromium-review.googlesource.com/1233074
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#592661}(cherry picked from commit 9c6415198fe67aad0461181ac5b544e0f08fe076)
Reviewed-on: https://chromium-review.googlesource.com/1237895
Reviewed-by: Alan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/branch-heads/3538@{#555}
Cr-Branched-From: 79f7c91a2b2a2932cd447fa6f865cb6662fa8fa6-refs/heads/master@{#587811}

Comment 21 Deleted

Comment 22 Deleted

Cc: lpalmaro@chromium.org
Components: UI>Accessibility
(Rewording my comments 21/22, which I deleted due to tone.  I'm sorry for how I phrased these.)

I'm reopening this out of concern for the effects on accessibility.  We've recently been making a push to hit a consistently high GAR in Chrome, and part of that is about trying to ensure all our top chrome text reaches WCAG minimums, which specify a contrast ratio of 4.5 for text of this size.

With the two background colors given in comment 0, the black text we were using on Linux and Win 7 met WCAG requirements; white text does not, and in the case of the blue background, is fairly significantly lower-contrast (3.56 vs. 5.89); compare the readability without squinting/eyestrain of https://contrast-ratio.com/#black-on-%234285f4 to https://contrast-ratio.com/#white-on-%234285f4 .

I appreciate the desire to be consistent, especially so developers can know what to expect.  It's surprising that we were inconsistent before, especially that Win 10 and Win 7 were not consistent.  I'm happy to help look into why, if we don't understand what was going on there.

I do also think it's reasonable to try to defer to the OS if there's a clear, strong OS convention to follow.  That said, on OSes we control, like CrOS, we should make sure the OS convention is one that meets those same high accessibility standards.

I opened a CL to revert the original change (which I won't be landing without at least preliminary agreement); I'd like to extend the original Linux/Win 7 behavior to Win 10/CrOS/Android-if-we-can to ensure maximum accessibility and give developers some consistency, but maybe there are other routes.  I've looped in lpalmaro@ for an a11y viewpoint.

Hopefully I'm not stirring up something that was already carefully considered before and determined to meet all our relevant standards, but I didn't see any comments from Laura, accessibility ownership in engineering is unclear right now, and post-GM2 we've been trying to improve this area specifically, so I figured it's better to be safe than sorry.
Gmail red:
 - White text 4.3: https://contrast-ratio.com/#white-on-%23d6493b
 - Black text 4.87: https://contrast-ratio.com/#black-on-%23d6493b
Inbox blue:
 - White text 3.56: https://contrast-ratio.com/#white-on-%234285f4
 - Black text 5.89: https://contrast-ratio.com/#black-on-%234285f4
Starbucks green:
 - White text 3.09: https://contrast-ratio.com/#white-on-%2300a862
 - Black text 6.77: https://contrast-ratio.com/#black-on-%2300a862

These changes were made with the impression that the minimum contrast ratio was 3 based on the existing code. Looks like that originated from here: https://chromium.googlesource.com/chromium/src/+/df1702e8aa43e3996d64c0988e48612a5fad4624/chrome/android/java/src/org/chromium/chrome/browser/document/BrandColorUtils.java

I personally find the white text easier to read for titles because it's more eye catching than black so it's good to know there are other opinions about it.

I'm quite happy to comply with the push for meeting the 4.5 requirement if accessibility is in agreement for these particular examples.
Summarizing the GAR contrast doc at https://docs.google.com/document/d/100kFNb_uyEyRo88p7EQTfkTVj3NxsC62PUziXjOBM6o/edit?hl=en (which has more detail, and aligns with WCAG):

3:1 is the minimum for AA "large text" (higher contrast encouraged), but either some or all of the text in these cases is "normal text" ("large" is >18pt regular or >14pt bold, though there is some disagreement both within and outside the doc over whether ">" or ">=" should be used).  Inbox' specific case (white on Google Blue 500) is a color combo that used to have a specific exception, but that exception was deprecated in Q2 2018.

I would be happy to have Laura or another a11y person chime in.
Cc: harrisjay@chromium.org
Here are screenshots of changing kContrastLightItemThreshold from 3 to 4.5 (https://cs.chromium.org/chromium/src/ui/gfx/color_utils.cc?type=cs&q=kContrastLightItemThreshold&sq=package:chromium&g=0&l=313).

ratio3.png
128 KB View Download
ratio4.5.png
127 KB View Download
Commented on the CL -- I think changing just that threshold could actually make contrast worse in some cases.  In the specific screenshots you give, we see this in two of the three modified cases:

Window 1 goes from contrast 3.56 to 3.25
Window 2 goes from contrast 4.3 to 3.3
Window 3 goes from contrast 3.09 to 3.6

You probably want to instead try to rewrite calls to GetThemedAssetColor() as calls to GetColorWithMinimumContrast(SK_ColorWHITE, theme_color) or something similar.
Good point, I neglected to consider that it doesn't ensure anything about 64% black's contrast ratio.
Before and after screenshots of pkasting's CL: https://chromium-review.googlesource.com/c/chromium/src/+/1407264
before.png
56.9 KB View Download
after.png
57.6 KB View Download
My personal subjective eyeball thoughts on the changes:
The watery-shingle.glitch.me Inbox blue is really on the edge of readability with black, white was much more constrasting against that blue.
The Starbucks green is more readable with the change to black.
I'm glad the fast-lute.glitch.me Gmail red remained with white text.
Objective number-wise:

White's contrast ratio against that blue (#4285f4) is 3.56, which is significantly below WCAG AA minimums; Grey 900 (#202124, which is used in the patch) is 4.51, which is just barely over the minimum.  Neither color is very good; contrast ratios of 7 are prefered (WCAG AAA), but we can't hit that against this color, and in fact the best we could do if we relaxed the material refresh "grey 900 is the darkest color" restriction would be black at 5.89.

Subjective opinion-wise:

As before, I find white to cause me to squint against that blue.  Grey 900 leads to less eyestrain, especially with the three-dot menu.  But both are hard to read, honestly.
Thanks for revisiting the earlier call I made (c13). 

Having 4.5 as a consistent measure would be the right path forward. Based on this measure, if the combination doesn't look good as we see in the examples, hopefully, site developers can adjust to go darker or lighter.
Project Member

Comment 34 by bugdroid1@chromium.org, Jan 16 (6 days ago)

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

commit 0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5
Author: Peter Kasting <pkasting@chromium.org>
Date: Wed Jan 16 16:17:39 2019

Remove GetThemedAssetColor().

This method was first added in http://crrev.com/550045 to fix  bug 814121  by
matching Clank behavior.  It was then generalized in http://crrev.com/592661 to
apply to more cases.

Unfortunately, the Clank behavior does not guarantee sufficient contrast to meet
WCAG AA standards.  It guarantees contrast 3 against darker colors, when the
minimum for text is 4.5; and it uses 64% black otherwise, which with the 3
threshold only guarantees a contrast ratio of ~4.

This patch removes the special "themed" path and uses the normal path for
caption colors, and restores auto color readability to labels.  The net result
of this is that:
* On opaque frame (Linux, Win 7 non-Aero, some themes), title and caption
  buttons will use the color that contrasts most with the background, between
  white and GG900 (the Material Refresh "darkest color").
* On glass frame (Win 7 Aero, Win 10), the behavior is very similar, but uses
  black instead of GG900 and a "luma midpoint" instead of luminance midpoint
  check.  These better match native.
* On Ash, caption buttons use GG200 or GG700, but will push the contrast up
  until it reaches at least 3.  Window titles, which use auto color readability,
  will further push the contrast of this color to try and reach 4.5.

Effectively,  bug 883177 , which was originally fixed by moving Linux and Win 7
toward CrOS, is largely WontFixed, but hopefully the caption button colors and
title text are now more consistent; and  bug 814121 , which was fixed by matching
Clank, is instead fixed by enforcing minimum contrast ratios.

As a nice bonus, this is noticeably simpler.

Bug:  883177 
Change-Id: I0803617c9dfd7e2a27ef399c89ba64d1eec98867
Reviewed-on: https://chromium-review.googlesource.com/c/1407264
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Alan Cutter <alancutter@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623253}
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/ash/public/cpp/caption_buttons/frame_caption_button_container_view.cc
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/ash/public/cpp/caption_buttons/frame_caption_button_container_view.h
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/ash/public/cpp/frame_header.cc
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/ash/public/cpp/frame_header.h
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/frame/browser_non_client_frame_view.h
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.h
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/frame/glass_browser_frame_view.h
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/frame/opaque_browser_frame_view_browsertest.cc
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/chrome/browser/ui/views/location_bar/custom_tab_bar_view.h
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/ui/gfx/color_utils.cc
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/ui/gfx/color_utils.h
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/ui/views/window/frame_caption_button.cc
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/ui/views/window/frame_caption_button.h
[modify] https://crrev.com/0d7ebfdf51a4c76d023b5171172f7a4d6966d3e5/ui/views/window/frame_caption_button_unittest.cc

Comment 35 by pkasting@chromium.org, Jan 16 (6 days ago)

Status: WontFix (was: Assigned)
The fix that landed leaves things inconsistent between platforms, with Win/Mac/Linux largely coherent but Ash less so.  So this is somewhere between "Fixed" and "WontFix".

Sign in to add a comment