mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Use Rust sizes for flex-basis, width, height, and their min/max properties.
Really sorry for the size of the patch :( Only intentional behavior change is in the uses of HasLengthAndPercentage(), where it's easier to do the right thing. The checks that used to check for (IsCalcUnit() && CalcHasPercentage()) are wrong since bug 957915. Differential Revision: https://phabricator.services.mozilla.com/D19553
This commit is contained in:
parent
e12c76982d
commit
f7a59bf0ee
9 changed files with 70 additions and 106 deletions
|
@ -18,8 +18,8 @@ impl Parse for FlexBasis {
|
|||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
if let Ok(width) = input.try(|i| Size::parse(context, i)) {
|
||||
return Ok(GenericFlexBasis::Width(width));
|
||||
if let Ok(size) = input.try(|i| Size::parse(context, i)) {
|
||||
return Ok(GenericFlexBasis::Size(size));
|
||||
}
|
||||
try_match_ident_ignore_ascii_case! { input,
|
||||
"content" => Ok(GenericFlexBasis::Content),
|
||||
|
@ -31,12 +31,12 @@ impl FlexBasis {
|
|||
/// `auto`
|
||||
#[inline]
|
||||
pub fn auto() -> Self {
|
||||
GenericFlexBasis::Width(Size::auto())
|
||||
GenericFlexBasis::Size(Size::auto())
|
||||
}
|
||||
|
||||
/// `0%`
|
||||
#[inline]
|
||||
pub fn zero_percent() -> Self {
|
||||
GenericFlexBasis::Width(Size::zero_percent())
|
||||
GenericFlexBasis::Size(Size::zero_percent())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue