mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Add place-self shorthand property (it fails unit-test)
This commit is contained in:
parent
d6f4c8c6dd
commit
b6cbd31b73
2 changed files with 41 additions and 0 deletions
|
@ -186,3 +186,27 @@
|
|||
}
|
||||
</%helpers:shorthand>
|
||||
|
||||
<%helpers:shorthand name="place-self" sub_properties="align-self justify-self"
|
||||
spec="https://drafts.csswg.org/css-align/#place-self-property"
|
||||
products="gecko">
|
||||
use values::specified::align::AlignJustifySelf;
|
||||
use parser::Parse;
|
||||
|
||||
pub fn parse_value(context: &ParserContext, input: &mut Parser) -> Result<Longhands, ()> {
|
||||
let align = AlignJustifySelf::parse(context, input)?;
|
||||
let justify = input.try(|input| AlignJustifySelf::parse(context, input)).unwrap_or(align.clone());
|
||||
|
||||
Ok(Longhands {
|
||||
align_self: align,
|
||||
justify_self: justify,
|
||||
})
|
||||
}
|
||||
|
||||
impl<'a> ToCss for LonghandsToSerialize<'a> {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
self.align_self.to_css(dest)?;
|
||||
dest.write_str(" ")?;
|
||||
self.justify_self.to_css(dest)
|
||||
}
|
||||
}
|
||||
</%helpers:shorthand>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue