diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index 97024dd4245..e503e8a2f16 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -2083,7 +2083,6 @@ impl BreakWithin { Eq, Hash, MallocSizeOf, - Parse, PartialEq, SpecifiedValueInfo, ToCss, @@ -2098,10 +2097,28 @@ pub enum Overflow { Scroll, Auto, #[cfg(feature = "gecko")] - #[parse(aliases = "-moz-hidden-unscrollable")] Clip, } +// This can be derived once we remove or keep `-moz-hidden-unscrollable` +// indefinitely. +impl Parse for Overflow { + fn parse<'i, 't>(_: &ParserContext, input: &mut Parser<'i, 't>) -> Result> { + Ok(try_match_ident_ignore_ascii_case! { input, + "visible" => Self::Visible, + "hidden" => Self::Hidden, + "scroll" => Self::Scroll, + "auto" => Self::Auto, + #[cfg(feature = "gecko")] + "clip" => Self::Clip, + #[cfg(feature = "gecko")] + "-moz-hidden-unscrollable" if static_prefs::pref!("layout.css.overflow-moz-hidden-unscrollable.enabled") => { + Overflow::Clip + }, + }) + } +} + impl Overflow { /// Return true if the value will create a scrollable box. #[inline]