diff --git a/components/style/properties/shorthands/font.mako.rs b/components/style/properties/shorthands/font.mako.rs index 99caaa0ca43..26205c2ea9c 100644 --- a/components/style/properties/shorthands/font.mako.rs +++ b/components/style/properties/shorthands/font.mako.rs @@ -289,7 +289,9 @@ % for p in subprops_for_value_info: ${p}::collect_completion_keywords(f); % endfor + % if engine == "gecko": ::collect_completion_keywords(f); + % endif } } diff --git a/components/style/values/specified/font.rs b/components/style/values/specified/font.rs index b536ddf3e21..329dedd31ca 100644 --- a/components/style/values/specified/font.rs +++ b/components/style/values/specified/font.rs @@ -70,6 +70,7 @@ macro_rules! system_font_methods { Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem )] #[allow(missing_docs)] +#[cfg(feature = "gecko")] pub enum SystemFont { Caption, Icon, @@ -91,6 +92,26 @@ pub enum SystemFont { End, // Just for indexing purposes. } +// We don't parse system fonts in servo, but in the interest of not +// littering a lot of code with `if engine == "gecko"` conditionals, +// we have a dummy system font module that does nothing + +#[derive( + Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem +)] +#[allow(missing_docs)] +#[cfg(feature = "servo")] +/// void enum for system font, can never exist +pub enum SystemFont {} + +#[allow(missing_docs)] +#[cfg(feature = "servo")] +impl SystemFont { + pub fn parse(_: &mut Parser) -> Result { + Err(()) + } +} + const DEFAULT_SCRIPT_MIN_SIZE_PT: u32 = 8; const DEFAULT_SCRIPT_SIZE_MULTIPLIER: f64 = 0.71;