style: Use rust types for background-size.

Hopefully straight-forward.

Differential Revision: https://phabricator.services.mozilla.com/D19625
This commit is contained in:
Emilio Cobos Álvarez 2019-02-13 03:59:09 +01:00
parent 1e6338e1ee
commit 07cb325402
6 changed files with 27 additions and 137 deletions

View file

@ -6,19 +6,8 @@
use crate::values::computed::length::NonNegativeLengthPercentage;
use crate::values::generics::background::BackgroundSize as GenericBackgroundSize;
use crate::values::generics::length::LengthPercentageOrAuto;
pub use crate::values::specified::background::BackgroundRepeat;
/// A computed value for the `background-size` property.
pub type BackgroundSize = GenericBackgroundSize<NonNegativeLengthPercentage>;
impl BackgroundSize {
/// Returns `auto auto`.
pub fn auto() -> Self {
GenericBackgroundSize::Explicit {
width: LengthPercentageOrAuto::auto(),
height: LengthPercentageOrAuto::auto(),
}
}
}