Make font-display descriptor behind the pref.

This commit is contained in:
Xidorn Quan 2017-08-03 19:07:12 +10:00
parent 13df7e4c84
commit df95a469a0
3 changed files with 19 additions and 1 deletions

View file

@ -210,6 +210,16 @@ impl Parse for Source {
}
}
macro_rules! is_descriptor_enabled {
("font-display") => {
unsafe {
use gecko_bindings::structs::mozilla;
mozilla::StylePrefs_sFontDisplayEnabled
}
};
($name: tt) => { true }
}
macro_rules! font_face_descriptors_common {
(
$( #[$doc: meta] $name: tt $ident: ident / $gecko_ident: ident: $ty: ty, )*
@ -275,7 +285,7 @@ macro_rules! font_face_descriptors_common {
-> Result<(), ParseError<'i>> {
match_ignore_ascii_case! { &*name,
$(
$name => {
$name if is_descriptor_enabled!($name) => {
// DeclarationParser also calls parse_entirely
// so wed normally not need to,
// but in this case we do because we set the value as a side effect