From 3cb019ac1eaccdaca9d5c4154743dca0f16dffb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 30 Mar 2020 15:09:33 +0000 Subject: [PATCH] style: Tweak background: transparent handling so that color: transparent doesn't override UA sheet backgrounds. Differential Revision: https://phabricator.services.mozilla.com/D68408 --- components/style/properties/cascade.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/style/properties/cascade.rs b/components/style/properties/cascade.rs index d6c3180acd2..e9a34d6bf34 100644 --- a/components/style/properties/cascade.rs +++ b/components/style/properties/cascade.rs @@ -372,13 +372,12 @@ fn tweak_when_ignoring_colors( // We honor color and background-color: transparent, and // "revert-or-initial" otherwise. PropertyDeclaration::BackgroundColor(ref color) => { - if color.is_transparent() { - return; + if !color.is_transparent() { + let color = builder.device.default_background_color(); + declarations_to_apply_unless_overriden.push( + PropertyDeclaration::BackgroundColor(color.into()) + ) } - let color = builder.device.default_background_color(); - declarations_to_apply_unless_overriden.push( - PropertyDeclaration::BackgroundColor(color.into()) - ) } PropertyDeclaration::Color(ref color) => { // otherwise.