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
This commit is contained in:
Emilio Cobos Álvarez 2023-06-18 13:36:43 +02:00 committed by Martin Robinson
parent 1a83c738f3
commit a9fe204f39

View file

@ -428,14 +428,17 @@ fn tweak_when_ignoring_colors(
// otherwise, this is needed to preserve semi-transparent // otherwise, this is needed to preserve semi-transparent
// backgrounds. // backgrounds.
// //
// NOTE(emilio): We revert even for alpha == 0. Not doing so would // NOTE(emilio): We honor transparent unconditionally, like we do
// be a bit special casey, even though it causes issues like // for color, even though it causes issues like bug 1625036. The
// bug 1625036. The reasoning is that the conditions that trigger // reasoning is that the conditions that trigger that (having
// that (having mismatched widget and default backgrounds) are both // mismatched widget and default backgrounds) are both uncommon, and
// uncommon, and broken in other applications as well, and not // broken in other applications as well, and not honoring
// honoring transparent makes stuff uglier or break unconditionally // transparent makes stuff uglier or break unconditionally
// (bug 1666059, bug 1755713). // (bug 1666059, bug 1755713).
let alpha = alpha_channel(color, context); let alpha = alpha_channel(color, context);
if alpha == 0 {
return;
}
let mut color = context.builder.device.default_background_color(); let mut color = context.builder.device.default_background_color();
color.alpha = alpha; color.alpha = alpha;
declarations_to_apply_unless_overriden declarations_to_apply_unless_overriden