mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Cleanup font-weight parsing.
This commit is contained in:
parent
1e0fd7da30
commit
f37859375e
2 changed files with 29 additions and 32 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue