Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: Get rid of gecko_size_type. #19966

Merged
merged 5 commits into from Feb 7, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

style: Make MozLength / MaxLength a bit more clear and do a bit less …

…work.
  • Loading branch information
emilio committed Feb 6, 2018
commit 45ba167030f7bf746b61e61eae57a89b528ff6c9
@@ -888,6 +888,7 @@ pub enum MozLength {

impl MozLength {
/// Returns the `auto` value.
#[inline]
pub fn auto() -> Self {
MozLength::LengthOrPercentageOrAuto(LengthOrPercentageOrAuto::Auto)
}
@@ -1131,9 +1131,16 @@ impl MozLength {
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks,
) -> Result<Self, ParseError<'i>> {
input.try(ExtremumLength::parse).map(MozLength::ExtremumLength)
.or_else(|_| input.try(|i| LengthOrPercentageOrAuto::parse_non_negative_quirky(context, i, allow_quirks))
.map(MozLength::LengthOrPercentageOrAuto))
if let Ok(l) = input.try(ExtremumLength::parse) {
return Ok(MozLength::ExtremumLength(l));
}

let length = LengthOrPercentageOrAuto::parse_non_negative_quirky(
context,
input,
allow_quirks,
)?;
Ok(MozLength::LengthOrPercentageOrAuto(length))
}
}

@@ -1158,8 +1165,15 @@ impl MaxLength {
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks,
) -> Result<Self, ParseError<'i>> {
input.try(ExtremumLength::parse).map(MaxLength::ExtremumLength)
.or_else(|_| input.try(|i| LengthOrPercentageOrNone::parse_non_negative_quirky(context, i, allow_quirks))
.map(MaxLength::LengthOrPercentageOrNone))
if let Ok(l) = input.try(ExtremumLength::parse) {
return Ok(MaxLength::ExtremumLength(l));
}

let length = LengthOrPercentageOrNone::parse_non_negative_quirky(
context,
input,
allow_quirks,
)?;
Ok(MaxLength::LengthOrPercentageOrNone(length))
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.