Auto merge of #17961 - upsuper:font-display-pref, r=heycam

Make font-display descriptor behind the pref

This is the Servo side change of [bug 1386871](https://bugzilla.mozilla.org/show_bug.cgi?id=1386871).

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17961)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-03 04:46:52 -05:00 committed by GitHub
commit 24b2cd89c1
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

View file

@ -9045,6 +9045,10 @@ pub mod root {
pub struct StylePrefs {
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;

View file

@ -8891,6 +8891,10 @@ pub mod root {
pub struct StylePrefs {
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;