stylo: Bug 1355345 - Support font-display descriptor in @font-face rule

This commit is contained in:
Fernando Jiménez Moreno 2017-05-18 13:12:27 +02:00 committed by Anthony Ramine
parent a0886213b6
commit 96a23d9b73
2 changed files with 28 additions and 2 deletions

View file

@ -72,6 +72,17 @@ impl ToCss for UrlSource {
}
}
/// A font-display value for a @font-face rule.
/// The font-display descriptor determines how a font face is displayed based
/// on whether and when it is downloaded and ready to use.
define_css_keyword_enum!(FontDisplay:
"auto" => Auto,
"block" => Block,
"swap" => Swap,
"fallback" => Fallback,
"optional" => Optional);
add_impls_for_keyword_enum!(FontDisplay);
/// Parse the block inside a `@font-face` rule.
///
/// Note that the prelude parsing code lives in the `stylesheets` module.
@ -332,6 +343,9 @@ font_face_descriptors! {
/// The stretch of this font face
"font-stretch" stretch / mStretch: font_stretch::T = font_stretch::T::normal,
/// The display of this font face
"font-display" display / mDisplay: FontDisplay = FontDisplay::Auto,
/// The ranges of code points outside of which this font face should not be used.
"unicode-range" unicode_range / mUnicodeRange: Vec<UnicodeRange> = vec![
UnicodeRange { start: 0, end: 0x10FFFF }
@ -342,7 +356,7 @@ font_face_descriptors! {
font_feature_settings::T::Normal
},
// FIXME: add font-language-override, and font-display.
// FIXME: add font-language-override.
]
}