pub enum Overflow {
Visible,
Clip,
Hidden,
Scroll,
}Expand description
How children overflowing their container should affect layout
In CSS the primary effect of this property is to control whether contents of a parent container that overflow that container should be displayed anyway, be clipped, or trigger the container to become a scroll container. However it also has secondary effects on layout, the main ones being:
- The automatic minimum size Flexbox/CSS Grid items with non-
Visibleoverflow is0rather than being content based Overflow::Scrollnodes have space in the layout reserved for a scrollbar (width controlled by thescrollbar_widthproperty)
In Taffy, we only implement the layout related secondary effects as we are not concerned with drawing/painting. The amount of space reserved for
a scrollbar is controlled by the scrollbar_width property. If this is 0 then Scroll behaves identically to Hidden.
Variants§
Visible
The automatic minimum size of this node as a flexbox/grid item should be based on the size of its content. Content that overflows this node should contribute to the scroll region of its parent.
Clip
The automatic minimum size of this node as a flexbox/grid item should be based on the size of its content. Content that overflows this node should not contribute to the scroll region of its parent.
Hidden
The automatic minimum size of this node as a flexbox/grid item should be 0.
Content that overflows this node should not contribute to the scroll region of its parent.
Scroll
The automatic minimum size of this node as a flexbox/grid item should be 0. Additionally, space should be reserved
for a scrollbar. The amount of space reserved is controlled by the scrollbar_width property.
Content that overflows this node should not contribute to the scroll region of its parent.
Trait Implementations§
§impl<'de> Deserialize<'de> for Overflow
impl<'de> Deserialize<'de> for Overflow
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Overflow, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Overflow, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for Overflow
impl Serialize for Overflow
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for Overflow
impl Eq for Overflow
impl StructuralPartialEq for Overflow
Auto Trait Implementations§
impl Freeze for Overflow
impl RefUnwindSafe for Overflow
impl Send for Overflow
impl Sync for Overflow
impl Unpin for Overflow
impl UnwindSafe for Overflow
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more