diff options
author | Xidorn Quan <me@upsuper.org> | 2017-08-03 19:07:12 +1000 |
---|---|---|
committer | Xidorn Quan <me@upsuper.org> | 2017-08-03 19:07:12 +1000 |
commit | df95a469a0f9becaed38e84e33fefa4b6325735c (patch) | |
tree | 20ab1110cfa47ba7369143add06ddcf998287475 | |
parent | 13df7e4c84e5cfafbb39e2e0096f6a0722bb15dc (diff) | |
download | servo-df95a469a0f9becaed38e84e33fefa4b6325735c.tar.gz servo-df95a469a0f9becaed38e84e33fefa4b6325735c.zip |
Make font-display descriptor behind the pref.
-rw-r--r-- | components/style/font_face.rs | 12 | ||||
-rw-r--r-- | components/style/gecko/generated/structs_debug.rs | 4 | ||||
-rw-r--r-- | components/style/gecko/generated/structs_release.rs | 4 |
3 files changed, 19 insertions, 1 deletions
diff --git a/components/style/font_face.rs b/components/style/font_face.rs index 23f1496b157..77bf43d2017 100644 --- a/components/style/font_face.rs +++ b/components/style/font_face.rs @@ -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 we’d normally not need to, // but in this case we do because we set the value as a side effect diff --git a/components/style/gecko/generated/structs_debug.rs b/components/style/gecko/generated/structs_debug.rs index 7d6eed0e140..e5534663c64 100644 --- a/components/style/gecko/generated/structs_debug.rs +++ b/components/style/gecko/generated/structs_debug.rs @@ -9046,6 +9046,10 @@ pub mod root { pub _address: u8, } extern "C" { + #[link_name = "_ZN7mozilla10StylePrefs19sFontDisplayEnabledE"] + pub static mut StylePrefs_sFontDisplayEnabled: bool; + } + extern "C" { #[link_name = "_ZN7mozilla10StylePrefs19sOpentypeSVGEnabledE"] pub static mut StylePrefs_sOpentypeSVGEnabled: bool; } diff --git a/components/style/gecko/generated/structs_release.rs b/components/style/gecko/generated/structs_release.rs index 7ab31bfc5d0..0a77e3bb564 100644 --- a/components/style/gecko/generated/structs_release.rs +++ b/components/style/gecko/generated/structs_release.rs @@ -8892,6 +8892,10 @@ pub mod root { pub _address: u8, } extern "C" { + #[link_name = "_ZN7mozilla10StylePrefs19sFontDisplayEnabledE"] + pub static mut StylePrefs_sFontDisplayEnabled: bool; + } + extern "C" { #[link_name = "_ZN7mozilla10StylePrefs19sOpentypeSVGEnabledE"] pub static mut StylePrefs_sOpentypeSVGEnabled: bool; } |