mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
stylo: make font-weight descriptor in @font-face preserve keyword values
This commit is contained in:
parent
f5a61684f4
commit
632c5571a9
2 changed files with 74 additions and 2 deletions
|
@ -9,7 +9,7 @@ use computed_values::{font_feature_settings, font_stretch, font_style, font_weig
|
|||
use computed_values::font_family::FamilyName;
|
||||
use counter_style;
|
||||
use cssparser::UnicodeRange;
|
||||
use font_face::{FontFaceRuleData, Source, FontDisplay};
|
||||
use font_face::{FontFaceRuleData, Source, FontDisplay, FontWeight};
|
||||
use gecko_bindings::bindings;
|
||||
use gecko_bindings::structs::{self, nsCSSFontFaceRule, nsCSSValue};
|
||||
use gecko_bindings::structs::{nsCSSCounterDesc, nsCSSCounterStyleRule};
|
||||
|
@ -34,6 +34,18 @@ impl ToNsCssValue for font_weight::T {
|
|||
}
|
||||
}
|
||||
|
||||
impl ToNsCssValue for FontWeight {
|
||||
fn convert(self, nscssvalue: &mut nsCSSValue) {
|
||||
match self {
|
||||
FontWeight::Normal =>
|
||||
nscssvalue.set_enum(structs::NS_STYLE_FONT_WEIGHT_NORMAL as i32),
|
||||
FontWeight::Bold =>
|
||||
nscssvalue.set_enum(structs::NS_STYLE_FONT_WEIGHT_BOLD as i32),
|
||||
FontWeight::Weight(weight) => nscssvalue.set_integer(weight as i32),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToNsCssValue for font_feature_settings::T {
|
||||
fn convert(self, nscssvalue: &mut nsCSSValue) {
|
||||
match self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue