From 1c1437df59f6c4f81087caf76a71d0af37af0809 Mon Sep 17 00:00:00 2001 From: Morgan Reschenberg Date: Fri, 4 Oct 2019 16:44:49 +0000 Subject: [PATCH] style: Add readability backplate for all elements containing text when HCM or a11y theme is active. Differential Revision: https://phabricator.services.mozilla.com/D42979 --- components/style/properties/cascade.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/style/properties/cascade.rs b/components/style/properties/cascade.rs index da95840a08ac..d9f9d69ae434 100644 --- a/components/style/properties/cascade.rs +++ b/components/style/properties/cascade.rs @@ -362,9 +362,19 @@ fn should_ignore_declaration_when_ignoring_document_colors( // Treat background-color a bit differently. If the specified color is // anything other than a fully transparent color, convert it into the // Device's default background color. + // Also: for now, we treat background-image a bit differently, too. + // background-image is marked as ignored, but really, we only ignore + // it when backplates are disabled (since then text may be unreadable over + // a background image, if we're ignoring document colors). + // Here we check backplate status to decide if ignoring background-image + // is the right decision. { let background_color = match **declaration { PropertyDeclaration::BackgroundColor(ref color) => color, + // In the future, if/when we remove the backplate pref, we can remove this + // special case along with the 'ignored_when_colors_disabled=True' mako line + // for the "background-image" property. + PropertyDeclaration::BackgroundImage(..) => return !static_prefs::pref!("browser.display.permit_backplate"), _ => return true, };