Further changes required by Servo

This commit is contained in:
Oriol Brufau 2023-05-16 14:12:14 +02:00
parent 4d2ccaf445
commit 3024516019
2 changed files with 23 additions and 0 deletions

View file

@ -289,7 +289,9 @@
% for p in subprops_for_value_info:
${p}::collect_completion_keywords(f);
% endfor
% if engine == "gecko":
<SystemFont as SpecifiedValueInfo>::collect_completion_keywords(f);
% endif
}
}
</%helpers:shorthand>

View file

@ -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<Self, ()> {
Err(())
}
}
const DEFAULT_SCRIPT_MIN_SIZE_PT: u32 = 8;
const DEFAULT_SCRIPT_SIZE_MULTIPLIER: f64 = 0.71;