Replace percent_resolved_* functions with methods

This commit is contained in:
Simon Sapin 2019-12-07 15:08:25 +01:00
parent a2c2b294d5
commit ce7e84be72
3 changed files with 61 additions and 44 deletions

View file

@ -207,6 +207,15 @@ impl<LengthPercentage> MaxSize<LengthPercentage> {
pub fn none() -> Self {
MaxSize::None
}
/// Convert
#[cfg(not(feature = "gecko"))]
pub fn to_option(self) -> Option<LengthPercentage> {
match self {
Self::LengthPercentage(lp) => Some(lp),
Self::None => None,
}
}
}
/// A generic `<length>` | `<number>` value for the `-moz-tab-size` property.