mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Integrate font-variation-settings descriptor with stylo
This commit is contained in:
parent
4c3f1756da
commit
6ffa888dd6
6 changed files with 82 additions and 18 deletions
|
@ -26,7 +26,7 @@ use style_traits::{Comma, CssWriter, OneOrMoreSeparated, ParseError};
|
|||
use style_traits::{StyleParseErrorKind, ToCss};
|
||||
use values::computed::font::FamilyName;
|
||||
#[cfg(feature = "gecko")]
|
||||
use values::specified::font::SpecifiedFontFeatureSettings;
|
||||
use values::specified::font::{SpecifiedFontFeatureSettings, FontVariationSettings};
|
||||
use values::specified::url::SpecifiedUrl;
|
||||
|
||||
/// A source for a font-face rule.
|
||||
|
@ -235,6 +235,12 @@ macro_rules! is_descriptor_enabled {
|
|||
mozilla::StylePrefs_sFontDisplayEnabled
|
||||
}
|
||||
};
|
||||
("font-variation-settings") => {
|
||||
unsafe {
|
||||
use gecko_bindings::structs::mozilla;
|
||||
mozilla::StylePrefs_sFontVariationsEnabled
|
||||
}
|
||||
};
|
||||
($name: tt) => { true }
|
||||
}
|
||||
|
||||
|
@ -245,7 +251,7 @@ macro_rules! font_face_descriptors_common {
|
|||
/// Data inside a `@font-face` rule.
|
||||
///
|
||||
/// <https://drafts.csswg.org/css-fonts/#font-face-rule>
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct FontFaceRuleData {
|
||||
$(
|
||||
#[$doc]
|
||||
|
@ -405,6 +411,11 @@ font_face_descriptors! {
|
|||
font_feature_settings::SpecifiedValue::normal()
|
||||
},
|
||||
|
||||
/// The variation settings of this font face.
|
||||
"font-variation-settings" variation_settings / mFontVariationSettings: FontVariationSettings = {
|
||||
font_variation_settings::SpecifiedValue::normal()
|
||||
},
|
||||
|
||||
/// The language override of this font face.
|
||||
"font-language-override" language_override / mFontLanguageOverride: font_language_override::SpecifiedValue = {
|
||||
font_language_override::SpecifiedValue::Normal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue