mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Use a user defined type for font weight everywhere.
Bug: 1436048 Reviewed-by: emilio
This commit is contained in:
parent
156ef81878
commit
245d848508
4 changed files with 18 additions and 7 deletions
|
@ -25,7 +25,7 @@ impl<'a> ToNsCssValue for &'a FamilyName {
|
|||
|
||||
impl ToNsCssValue for font_weight::T {
|
||||
fn convert(self, nscssvalue: &mut nsCSSValue) {
|
||||
nscssvalue.set_integer(self.0 as i32)
|
||||
nscssvalue.set_font_weight(self.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ impl<'a> ToNsCssValue for &'a FontWeight {
|
|||
match *self {
|
||||
FontWeight::Normal => nscssvalue.set_enum(structs::NS_FONT_WEIGHT_NORMAL as i32),
|
||||
FontWeight::Bold => nscssvalue.set_enum(structs::NS_FONT_WEIGHT_BOLD as i32),
|
||||
FontWeight::Weight(weight) => nscssvalue.set_integer(weight.0 as i32),
|
||||
FontWeight::Weight(weight) => nscssvalue.set_font_weight(weight.0),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue