mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Further changes required by Servo
This commit is contained in:
parent
0cb64672f4
commit
6ea5fdc40e
1 changed files with 10 additions and 3 deletions
|
@ -2036,6 +2036,14 @@ impl FontSynthesis {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn allow_font_synthesis_small_caps() -> bool {
|
||||||
|
#[cfg(feature = "gecko")]
|
||||||
|
return static_prefs::pref!("layout.css.font-synthesis-small-caps.enabled");
|
||||||
|
#[cfg(feature = "servo")]
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
impl Parse for FontSynthesis {
|
impl Parse for FontSynthesis {
|
||||||
fn parse<'i, 't>(
|
fn parse<'i, 't>(
|
||||||
_: &ParserContext,
|
_: &ParserContext,
|
||||||
|
@ -2048,8 +2056,7 @@ impl Parse for FontSynthesis {
|
||||||
"none" if result.is_none() => return Ok(result),
|
"none" if result.is_none() => return Ok(result),
|
||||||
"weight" if !result.weight => result.weight = true,
|
"weight" if !result.weight => result.weight = true,
|
||||||
"style" if !result.style => result.style = true,
|
"style" if !result.style => result.style = true,
|
||||||
"small-caps" if !result.small_caps &&
|
"small-caps" if !result.small_caps && allow_font_synthesis_small_caps()
|
||||||
static_prefs::pref!("layout.css.font-synthesis-small-caps.enabled")
|
|
||||||
=> result.small_caps = true,
|
=> result.small_caps = true,
|
||||||
_ => return Err(input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident))),
|
_ => return Err(input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident))),
|
||||||
}
|
}
|
||||||
|
@ -2100,7 +2107,7 @@ impl SpecifiedValueInfo for FontSynthesis {
|
||||||
"weight",
|
"weight",
|
||||||
"style",
|
"style",
|
||||||
]);
|
]);
|
||||||
if static_prefs::pref!("layout.css.font-synthesis-small-caps.enabled") {
|
if allow_font_synthesis_small_caps() {
|
||||||
f(&["small-caps"]);
|
f(&["small-caps"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue