diff --git a/components/style/values/resolved/counters.rs b/components/style/values/resolved/counters.rs index c00e63fda22..cdaebcdea3e 100644 --- a/components/style/values/resolved/counters.rs +++ b/components/style/values/resolved/counters.rs @@ -7,6 +7,14 @@ use super::{Context, ToResolvedValue}; use crate::values::computed; +#[inline] +fn allow_element_content_none() -> bool { + #[cfg(feature = "gecko")] + return static_prefs::pref!("layout.css.element-content-none.enabled"); + #[cfg(feature = "servo")] + return false; +} + /// https://drafts.csswg.org/css-content/#content-property /// /// We implement this at resolved value time because otherwise it causes us to @@ -35,7 +43,7 @@ impl ToResolvedValue for computed::Content { // https://github.com/w3c/csswg-drafts/issues/6124 // Ditto for non-pseudo elements if the pref is disabled. Self::None if (is_pseudo && !is_before_or_after && !is_marker) || - (!is_pseudo && !static_prefs::pref!("layout.css.element-content-none.enabled")) => Self::Normal, + (!is_pseudo && !allow_element_content_none()) => Self::Normal, other => other, } }