From 7cbc963fc7c624d5de71a20f8f9bf2d2ceace54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 18 May 2020 10:54:16 +0000 Subject: [PATCH] style: Make ::-moz-focus-outer a no-op, and remove it on Nightly. See https://bugzilla.mozilla.org/show_bug.cgi?id=932410#c2 for the context for which this pseudo-element was added. In the previous patch, I had to special-case range appearance because of this pseudo-class, but that patch makes this pseudo-class completely redundant, as now all form controls, themed and unthemed, display outlines, unless the native theme displays a focus indicator on its own. Remove the special case, and make ranges use outlines like everything else rather than this bespoke pseudo-element. Differential Revision: https://phabricator.services.mozilla.com/D74734 --- components/style/gecko/pseudo_element.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/style/gecko/pseudo_element.rs b/components/style/gecko/pseudo_element.rs index 3ca06eea37e..b537295f785 100644 --- a/components/style/gecko/pseudo_element.rs +++ b/components/style/gecko/pseudo_element.rs @@ -159,7 +159,13 @@ impl PseudoElement { /// Whether this pseudo-element is enabled for all content. pub fn enabled_in_content(&self) -> bool { - (self.flags() & structs::CSS_PSEUDO_ELEMENT_ENABLED_IN_UA_SHEETS_AND_CHROME) == 0 + if (self.flags() & structs::CSS_PSEUDO_ELEMENT_ENABLED_IN_UA_SHEETS_AND_CHROME) != 0 { + return false; + } + match *self { + PseudoElement::MozFocusOuter => static_prefs::pref!("layout.css.moz-focus-outer.enabled"), + _ => true, + } } /// Whether this pseudo is enabled explicitly in UA sheets.