mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Implement parsing/serialization for border-image-* longhands
This commit is contained in:
parent
dbf43c9035
commit
da27b61352
2 changed files with 728 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue