mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Rename overflow:-moz-hidden-unscrollable to overflow:clip.
Differential Revision: https://phabricator.services.mozilla.com/D73716
This commit is contained in:
parent
8f89ebffec
commit
9bfcb3d741
2 changed files with 24 additions and 4 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue