Set flex-basis to 0% when omitted in flex shorthand.

This commit is contained in:
Xidorn Quan 2017-05-29 14:24:07 +10:00
parent aca09436b7
commit acb7242304
4 changed files with 34 additions and 4 deletions

View file

@ -92,7 +92,11 @@
Ok(expanded! {
flex_grow: grow.unwrap_or(Number::new(1.0)),
flex_shrink: shrink.unwrap_or(Number::new(1.0)),
flex_basis: basis.unwrap_or(longhands::flex_basis::SpecifiedValue::zero()),
// Per spec, this should be SpecifiedValue::zero(), but all
// browsers currently agree on using `0%`. This is a spec
// change which hasn't been adopted by browsers:
// https://github.com/w3c/csswg-drafts/commit/2c446befdf0f686217905bdd7c92409f6bd3921b
flex_basis: basis.unwrap_or(longhands::flex_basis::SpecifiedValue::zero_percent()),
})
}