mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
style: Be a bit more explicit about background-size.
We have a ton of ad-hoc `From` impls which seem overly generic, I think.
This commit is contained in:
parent
2ac1327e4b
commit
7e4338eed8
4 changed files with 23 additions and 12 deletions
|
@ -13,6 +13,16 @@ use values::generics::background::BackgroundSize as GenericBackgroundSize;
|
|||
/// A computed value for the `background-size` property.
|
||||
pub type BackgroundSize = GenericBackgroundSize<LengthOrPercentageOrAuto>;
|
||||
|
||||
impl BackgroundSize {
|
||||
/// Returns `auto auto`.
|
||||
pub fn auto() -> Self {
|
||||
GenericBackgroundSize::Explicit {
|
||||
width: LengthOrPercentageOrAuto::Auto,
|
||||
height: LengthOrPercentageOrAuto::Auto,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl RepeatableListAnimatable for BackgroundSize {}
|
||||
|
||||
impl ToAnimatedZero for BackgroundSize {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue