style: Use a user defined type for font weight everywhere.

Bug: 1436048
Reviewed-by: emilio
This commit is contained in:
Jonathan Watt 2018-04-13 20:34:37 +01:00 committed by Emilio Cobos Álvarez
parent 156ef81878
commit 245d848508
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 18 additions and 7 deletions

View file

@ -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),
}
}
}