pub struct Contain(u8);Expand description
The layout-affecting parts of the CSS contain property.
Containment limits the ways in which a box’s contents can affect layout outside of the box (and vice versa). Taffy implements the layout-relevant containment types:
Contain::LAYOUT: the box establishes an independent formatting context, and is treated as having no baseline for baseline-alignment purposes (layout containment).Contain::PAINT: the box establishes an independent formatting context. Paint containment’s other effects (clipping, containing absolutely-positioned descendants, stacking context) are outside of Taffy’s scope.
The style containment type has no effect on layout and is therefore not represented
(it is accepted and ignored when parsing). Size and inline-size containment are not
currently implemented.
Tuple Fields§
§0: u8Implementations§
Source§impl Contain
impl Contain
Sourcepub const LAYOUT: Contain
pub const LAYOUT: Contain
Layout containment: the box establishes an independent formatting context and is treated as having no baseline for baseline-alignment purposes. https://drafts.csswg.org/css-contain-2/#containment-layout
Sourcepub const PAINT: Contain
pub const PAINT: Contain
Paint containment: the box establishes an independent formatting context. Its other effects don’t affect layout. https://drafts.csswg.org/css-contain-2/#containment-paint
Sourcepub const CONTENT: Contain
pub const CONTENT: Contain
The containment implied by contain: content (layout paint, ignoring style containment)
Sourcepub const fn contains(self, other: Contain) -> bool
pub const fn contains(self, other: Contain) -> bool
Returns whether self contains all of the containment types in other
Sourcepub const fn intersects(self, other: Contain) -> bool
pub const fn intersects(self, other: Contain) -> bool
Returns whether self contains any of the containment types in other
Sourcepub const fn union(self, other: Contain) -> Contain
pub const fn union(self, other: Contain) -> Contain
Returns the union of the containment types in self and other
Sourcepub const fn establishes_independent_formatting_context(self) -> bool
pub const fn establishes_independent_formatting_context(self) -> bool
Whether this containment causes the box to establish an independent formatting context (both layout and paint containment do)
Sourcepub const fn suppresses_baseline(self) -> bool
pub const fn suppresses_baseline(self) -> bool
Whether this containment suppresses the box’s baseline for baseline-alignment purposes (layout containment does, paint containment does not)
Sourcepub const fn contains_scrollable_overflow(self) -> bool
pub const fn contains_scrollable_overflow(self) -> bool
Whether this containment prevents the box’s overflowing content from contributing to an ancestor’s scrollable overflow region (layout containment treats such overflow as ink overflow; paint containment clips it)
Trait Implementations§
Source§impl BitOrAssign for Contain
impl BitOrAssign for Contain
Source§fn bitor_assign(&mut self, rhs: Contain)
fn bitor_assign(&mut self, rhs: Contain)
|= operation. Read more