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 { macro_rules! font_face_descriptors_common {
( (
$( #[$doc: meta] $name: tt $ident: ident / $gecko_ident: ident: $ty: ty, )* $( #[$doc: meta] $name: tt $ident: ident / $gecko_ident: ident: $ty: ty, )*
@ -275,7 +285,7 @@ macro_rules! font_face_descriptors_common {
-> Result<(), ParseError<'i>> { -> Result<(), ParseError<'i>> {
match_ignore_ascii_case! { &*name, match_ignore_ascii_case! { &*name,
$( $(
$name => { $name if is_descriptor_enabled!($name) => {
// DeclarationParser also calls parse_entirely // DeclarationParser also calls parse_entirely
// so wed normally not need to, // so wed normally not need to,
// but in this case we do because we set the value as a side effect // but in this case we do because we set the value as a side effect

View file

@ -9045,6 +9045,10 @@ pub mod root {
pub struct StylePrefs { pub struct StylePrefs {
pub _address: u8, pub _address: u8,
} }
extern "C" {
#[link_name = "_ZN7mozilla10StylePrefs19sFontDisplayEnabledE"]
pub static mut StylePrefs_sFontDisplayEnabled: bool;
}
extern "C" { extern "C" {
#[link_name = "_ZN7mozilla10StylePrefs19sOpentypeSVGEnabledE"] #[link_name = "_ZN7mozilla10StylePrefs19sOpentypeSVGEnabledE"]
pub static mut StylePrefs_sOpentypeSVGEnabled: bool; pub static mut StylePrefs_sOpentypeSVGEnabled: bool;

View file

@ -8891,6 +8891,10 @@ pub mod root {
pub struct StylePrefs { pub struct StylePrefs {
pub _address: u8, pub _address: u8,
} }
extern "C" {
#[link_name = "_ZN7mozilla10StylePrefs19sFontDisplayEnabledE"]
pub static mut StylePrefs_sFontDisplayEnabled: bool;
}
extern "C" { extern "C" {
#[link_name = "_ZN7mozilla10StylePrefs19sOpentypeSVGEnabledE"] #[link_name = "_ZN7mozilla10StylePrefs19sOpentypeSVGEnabledE"]
pub static mut StylePrefs_sOpentypeSVGEnabled: bool; pub static mut StylePrefs_sOpentypeSVGEnabled: bool;