mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Derive ToCss for font-weight descriptors
This commit is contained in:
parent
3f27654d97
commit
7995a9ed51
1 changed files with 1 additions and 12 deletions
|
@ -75,7 +75,7 @@ add_impls_for_keyword_enum!(FontDisplay);
|
|||
/// A font-weight value for a @font-face rule.
|
||||
/// The font-weight CSS property specifies the weight or boldness of the font.
|
||||
#[cfg(feature = "gecko")]
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, ToCss)]
|
||||
pub enum FontWeight {
|
||||
/// Numeric font weights for fonts that provide more than just normal and bold.
|
||||
Weight(font_weight::T),
|
||||
|
@ -85,17 +85,6 @@ pub enum FontWeight {
|
|||
Bold,
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
impl ToCss for FontWeight {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
match *self {
|
||||
FontWeight::Normal => dest.write_str("normal"),
|
||||
FontWeight::Bold => dest.write_str("bold"),
|
||||
FontWeight::Weight(ref weight) => weight.to_css(dest),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
impl Parse for FontWeight {
|
||||
fn parse<'i, 't>(_: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue