From a9fe204f39a094b707643dfec501ac829561ea3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 18 Jun 2023 13:36:43 +0200 Subject: [PATCH] style: Really honor background-color: transparent in HCM even for form controls I forgot we were doing this "revert-or-initial" shenanigans (which is needed for stuff like link colors to be honored), so we need to early-return. Use a more explicit test rather than a reftest for this. Differential Revision: https://phabricator.services.mozilla.com/D142063 --- components/style/properties/cascade.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/components/style/properties/cascade.rs b/components/style/properties/cascade.rs index 37d47e1ce61..f36109d059e 100644 --- a/components/style/properties/cascade.rs +++ b/components/style/properties/cascade.rs @@ -428,14 +428,17 @@ fn tweak_when_ignoring_colors( // otherwise, this is needed to preserve semi-transparent // backgrounds. // - // NOTE(emilio): We revert even for alpha == 0. Not doing so would - // be a bit special casey, even though it causes issues like - // bug 1625036. The reasoning is that the conditions that trigger - // that (having mismatched widget and default backgrounds) are both - // uncommon, and broken in other applications as well, and not - // honoring transparent makes stuff uglier or break unconditionally + // NOTE(emilio): We honor transparent unconditionally, like we do + // for color, even though it causes issues like bug 1625036. The + // reasoning is that the conditions that trigger that (having + // mismatched widget and default backgrounds) are both uncommon, and + // broken in other applications as well, and not honoring + // transparent makes stuff uglier or break unconditionally // (bug 1666059, bug 1755713). let alpha = alpha_channel(color, context); + if alpha == 0 { + return; + } let mut color = context.builder.device.default_background_color(); color.alpha = alpha; declarations_to_apply_unless_overriden