mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Address review comments
This commit is contained in:
parent
5ac205b3e5
commit
cdae523cd4
8 changed files with 97 additions and 25 deletions
|
@ -1908,15 +1908,14 @@ pub mod longhands {
|
|||
}
|
||||
/// <length> | <percentage> | <absolute-size> | <relative-size>
|
||||
pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
||||
input.try(specified::LengthOrPercentage::parse_non_negative)
|
||||
.map(|value| match value {
|
||||
specified::LengthOrPercentage::Length(value) => value,
|
||||
let value = try!(input.try(specified::LengthOrPercentage::parse_non_negative));
|
||||
match value {
|
||||
specified::LengthOrPercentage::Length(value) => Ok(value),
|
||||
specified::LengthOrPercentage::Percentage(value) =>
|
||||
specified::Length::FontRelative(specified::FontRelativeLength::Em(value.0)),
|
||||
Ok(specified::Length::FontRelative(specified::FontRelativeLength::Em(value.0))),
|
||||
// FIXME(dzbarsky) handle calc for font-size
|
||||
specified::LengthOrPercentage::Calc(_) =>
|
||||
specified::Length::FontRelative(specified::FontRelativeLength::Em(1.)),
|
||||
})
|
||||
specified::LengthOrPercentage::Calc(_) => return Err(())
|
||||
}
|
||||
.or_else(|()| {
|
||||
match_ignore_ascii_case! { try!(input.expect_ident()),
|
||||
"xx-small" => Ok(specified::Length::Absolute(Au::from_px(MEDIUM_PX) * 3 / 5)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue