Implement parsing/serialization for border-image-* longhands

This commit is contained in:
Nazım Can Altınova 2016-10-30 22:35:52 +03:00
parent dbf43c9035
commit da27b61352
2 changed files with 728 additions and 0 deletions

View file

@ -713,6 +713,18 @@ impl ToCss for Percentage {
}
}
impl Parse for Percentage {
#[inline]
fn parse(input: &mut Parser) -> Result<Self, ()> {
let context = AllowedNumericType::All;
match try!(input.next()) {
Token::Percentage(ref value) if context.is_ok(value.unit_value) =>
Ok(Percentage(value.unit_value)),
_ => Err(())
}
}
}
#[derive(Clone, PartialEq, Copy, Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum LengthOrPercentage {