pub struct StackingContext {
pub(crate) fragment: StackingContextFragments,
pub(crate) context_type: StackingContextType,
pub(crate) children: Vec<StackingContext>,
pub(crate) containing_block_origin: PhysicalPoint<Au>,
pub(crate) scroll_tree_node_id: ScrollTreeNodeId,
pub(crate) clip_id: ClipId,
pub(crate) z_index: i32,
pub(crate) text_decorations: Rc<Vec<FragmentTextDecoration>>,
}Expand description
Either a stacking context or a stacking container, per the definitions in https://drafts.csswg.org/css-position-4/#painting-order.
We use the term “real stacking context” in situations that call for a stacking context
but not a stacking container. Only positioned stacking containers every get a
StackingContext. The rest are handled inline during the PaintTraversal.
Fields§
§fragment: StackingContextFragmentsThe BoxFragment that established this stacking context. This is used to paint this
StackingContext and traverse its descendants for painting.
This is None for the root stacking context.
context_type: StackingContextTypeThe StackingContextType of this [StackingContet], which determines if it
a stacking context or a stacking container.
children: Vec<StackingContext>Child StackingContexts of this StackingContext.
containing_block_origin: PhysicalPoint<Au>The offset of the containing block, used to properly paint child fragments of this stacking context or stacking container.
scroll_tree_node_id: ScrollTreeNodeIdThe spatial id of this StackingContext.
clip_id: ClipIdThe clip id of this StackingContext if it has one.
z_index: i32The z-index of this StackingContext. Note that auto is represented as 0.
text_decorations: Rc<Vec<FragmentTextDecoration>>The text decorations that apply to this StackingContext propagated via the box tree.
Implementations§
Source§impl StackingContext
impl StackingContext
fn root(scroll_tree_node_id: ScrollTreeNodeId) -> Self
fn create_descendant( &self, context_type: StackingContextType, containing_block_offset: PhysicalPoint<Au>, spatial_id: ScrollTreeNodeId, clip_id: ClipId, initializing_fragment: Arc<BoxFragment>, text_decorations: Rc<Vec<FragmentTextDecoration>>, ) -> Self
pub(crate) fn fragment(&self) -> Option<&Arc<BoxFragment>>
fn sort(&mut self)
fn print(&self, tree: &mut PrintTree)
Trait Implementations§
Source§impl MallocSizeOf for StackingContext
impl MallocSizeOf for StackingContext
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
impl Freeze for StackingContext
impl !RefUnwindSafe for StackingContext
impl !Send for StackingContext
impl !Sync for StackingContext
impl Unpin for StackingContext
impl UnsafeUnpin for StackingContext
impl !UnwindSafe for StackingContext
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> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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