style: Respect transparent and system color border colors in forced-colors mode

Differential Revision: https://phabricator.services.mozilla.com/D123111
This commit is contained in:
Emilio Cobos Álvarez 2023-05-22 14:36:08 +02:00 committed by Oriol Brufau
parent f31f541125
commit 26c5db6a6e
2 changed files with 47 additions and 3 deletions

View file

@ -464,7 +464,22 @@ fn tweak_when_ignoring_colors(
}
}
},
_ => {},
_ => {
// We honor transparent and 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
// (<color> | 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 {
return;
}
}
},
}
*declaration.to_mut() =