From 71ec52f140785086ac8c619b306fc60990465079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 2 Jun 2023 01:45:30 +0200 Subject: [PATCH] style: Partially back out bug 1105364 Apparently using transparent borders and outlines is a common accessibility technique to make those visible in HCM. Bug 1740924 comment 9 seemed to indicate we were the only browser rendering those browsers, but I just confirmed that Edge at least does show them. Keep respecting system colors as that's per spec. Differential Revision: https://phabricator.services.mozilla.com/D131412 --- components/style/properties/cascade.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/components/style/properties/cascade.rs b/components/style/properties/cascade.rs index 0834da93e89..3921a4034ed 100644 --- a/components/style/properties/cascade.rs +++ b/components/style/properties/cascade.rs @@ -465,17 +465,20 @@ fn tweak_when_ignoring_colors( } }, _ => { - // We honor transparent and system colors more generally for all - // colors. + // We honor system colors more generally for all colors. // - // NOTE(emilio): This doesn't handle caret-color and - // accent-color because those use a slightly different syntax - // ( | auto for example). That's probably fine though, as - // using a system color for caret-color doesn't make sense (using - // currentColor is fine), and we ignore accent-color in - // high-contrast-mode anyways. + // We used to honor transparent but that causes accessibility + // regressions like bug 1740924. + // + // NOTE(emilio): This doesn't handle caret-color and accent-color + // because those use a slightly different syntax ( | auto for + // example). + // + // That's probably fine though, as using a system color for + // caret-color doesn't make sense (using currentColor is fine), and + // we ignore accent-color in high-contrast-mode anyways. if let Some(color) = declaration.color_value() { - if color.is_system() || alpha_channel(color, context) == 0 { + if color.is_system() { return; } }