mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Use rust types for background-size.
Hopefully straight-forward. Differential Revision: https://phabricator.services.mozilla.com/D19625
This commit is contained in:
parent
1e6338e1ee
commit
07cb325402
6 changed files with 27 additions and 137 deletions
|
@ -26,7 +26,7 @@ impl Parse for BackgroundSize {
|
|||
let height = input
|
||||
.try(|i| NonNegativeLengthPercentageOrAuto::parse(context, i))
|
||||
.unwrap_or(NonNegativeLengthPercentageOrAuto::auto());
|
||||
return Ok(GenericBackgroundSize::Explicit { width, height });
|
||||
return Ok(GenericBackgroundSize::ExplicitSize { width, height });
|
||||
}
|
||||
Ok(try_match_ident_ignore_ascii_case! { input,
|
||||
"cover" => GenericBackgroundSize::Cover,
|
||||
|
@ -35,16 +35,6 @@ impl Parse for BackgroundSize {
|
|||
}
|
||||
}
|
||||
|
||||
impl BackgroundSize {
|
||||
/// Returns `auto auto`.
|
||||
pub fn auto() -> Self {
|
||||
GenericBackgroundSize::Explicit {
|
||||
width: NonNegativeLengthPercentageOrAuto::auto(),
|
||||
height: NonNegativeLengthPercentageOrAuto::auto(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// One of the keywords for `background-repeat`.
|
||||
#[derive(
|
||||
Clone,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue