mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
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:
parent
1a83c738f3
commit
a9fe204f39
1 changed files with 9 additions and 6 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue