style: Cleanup font-weight parsing.

This commit is contained in:
Connor Brewster 2017-11-01 11:06:40 -05:00
parent 1e0fd7da30
commit f37859375e
2 changed files with 29 additions and 32 deletions

View file

@ -5,10 +5,8 @@
//! Computed values for font properties
use app_units::Au;
use cssparser::Parser;
use parser::{Parse, ParserContext};
use std::fmt;
use style_traits::{ParseError, StyleParseErrorKind, ToCss};
use style_traits::ToCss;
use values::animated::ToAnimatedValue;
use values::computed::{Context, NonNegativeLength, ToComputedValue};
use values::specified::font as specified;
@ -136,14 +134,6 @@ impl FontWeight {
}
}
impl Parse for FontWeight {
fn parse<'i, 't>(_: &ParserContext, input: &mut Parser<'i, 't>)
-> Result<FontWeight, ParseError<'i>> {
FontWeight::from_int(input.expect_integer()?)
.map_err(|_| input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
}
}
impl FontSize {
/// The actual computed font size.
pub fn size(self) -> Au {