style: Rename overflow:-moz-hidden-unscrollable to overflow:clip.

Differential Revision: https://phabricator.services.mozilla.com/D73716
This commit is contained in:
Jeremy Ir 2020-08-01 01:56:58 +00:00 committed by Emilio Cobos Álvarez
parent 8f89ebffec
commit 9bfcb3d741
2 changed files with 24 additions and 4 deletions

View file

@ -1991,5 +1991,25 @@ pub enum Overflow {
Scroll,
Auto,
#[cfg(feature = "gecko")]
MozHiddenUnscrollable,
#[parse(aliases = "-moz-hidden-unscrollable")]
Clip,
}
impl Overflow {
/// Return true if the value will create a scrollable box.
#[inline]
pub fn is_scrollable(&self) -> bool {
matches!(*self, Self::Hidden | Self::Scroll | Self::Auto)
}
/// Convert the value to a scrollable value if it's not already scrollable.
/// This maps `visible` to `auto` and `clip` to `hidden`.
#[inline]
pub fn to_scrollable(&self) -> Self {
match *self {
Self::Hidden | Self::Scroll | Self::Auto => *self,
Self::Visible => Self::Auto,
#[cfg(feature = "gecko")]
Self::Clip => Self::Hidden,
}
}
}