pub(crate) struct BoxFragment {Show 13 fields
pub base: BaseFragment,
pub children: Vec<Fragment>,
pub cumulative_containing_block_rect: SyncPhysicalRectAu,
pub padding: PhysicalSides<Au>,
pub border: PhysicalSides<Au>,
pub margin: PhysicalSides<Au>,
baselines: Baselines,
scrollable_overflow: SyncPhysicalRectAu,
scrollable_overflow_is_up_to_date: AtomicBool,
pub background_mode: BackgroundMode,
pub rare_data: OnceBox<AtomicRefCell<BoxFragmentRareData>>,
pub block_level_layout_info: Option<Box<BlockLevelLayoutInfo>>,
pub spatial_tree_node: AtomicOptionScrollTreeNodeId,
}Fields§
§base: BaseFragment§children: Vec<Fragment>§cumulative_containing_block_rect: SyncPhysicalRectAuThis BoxFragment’s containing block rectangle in coordinates relative to
the initial containing block, but not taking into account any transforms.
padding: PhysicalSides<Au>§border: PhysicalSides<Au>§margin: PhysicalSides<Au>§baselines: BaselinesWhen this BoxFragment is for content that has a baseline, this tracks
the first and last baselines of that content. This is used to propagate baselines
to things such as tables and inline formatting contexts.
scrollable_overflow: SyncPhysicalRectAuThe scrollable overflow of this box fragment in the same coordiante system as
Self::content_rect ie a rectangle within the parent fragment’s content
rectangle. This does not take into account any transforms this fragment applies.
This is handled when calling [Self::scrollable_overflow_for_parent].
scrollable_overflow_is_up_to_date: AtomicBool§background_mode: BackgroundMode§rare_data: OnceBox<AtomicRefCell<BoxFragmentRareData>>Rare data that not all kinds of BoxFragment would have.
block_level_layout_info: Option<Box<BlockLevelLayoutInfo>>Additional information for block-level boxes.
spatial_tree_node: AtomicOptionScrollTreeNodeIdThe containing spatial tree node of this BoxFragment. This is assigned during
StackingContextTree construction, so isn’t available before that time. This is
used to for determining final viewport size and position of this node and will
also be used in the future for hit testing.
Implementations§
Source§impl BoxFragment
impl BoxFragment
pub(crate) fn stacking_context_type(&self) -> Option<StackingContextType>
fn build_stacking_context_tree( self: &Arc<Self>, fragment: Fragment, stacking_context_tree: &mut StackingContextTree, containing_block: &ContainingBlock, containing_block_info: &ContainingBlockManager<'_, ContainingBlock>, parent_stacking_context: &mut StackingContext, text_decorations: &Rc<Vec<FragmentTextDecoration>>, )
fn build_stacking_context_tree_maybe_creating_reference_frame( self: &Arc<Self>, fragment: Fragment, stacking_context_tree: &mut StackingContextTree, containing_block: &ContainingBlock, containing_block_info: &ContainingBlockManager<'_, ContainingBlock>, parent_stacking_context: &mut StackingContext, text_decorations: &Rc<Vec<FragmentTextDecoration>>, )
fn build_stacking_context_tree_maybe_creating_stacking_context( self: &Arc<Self>, fragment: Fragment, stacking_context_tree: &mut StackingContextTree, containing_block: &ContainingBlock, containing_block_info: &ContainingBlockManager<'_, ContainingBlock>, parent_stacking_context: &mut StackingContext, text_decorations: &Rc<Vec<FragmentTextDecoration>>, )
Source§impl BoxFragment
impl BoxFragment
fn build_sticky_frame_if_necessary( &self, stacking_context_tree: &mut StackingContextTree, parent_scroll_node_id: ScrollTreeNodeId, containing_block_rect: &PhysicalRect<Au>, scroll_frame_size: &Option<LayoutSize>, ) -> Option<ScrollTreeNodeId>
Sourcefn reference_frame_data_if_necessary(
&self,
containing_block_rect: &PhysicalRect<Au>,
) -> Option<ReferenceFrameData>
fn reference_frame_data_if_necessary( &self, containing_block_rect: &PhysicalRect<Au>, ) -> Option<ReferenceFrameData>
Optionally returns the data for building a reference frame, without yet building it.
Sourcepub fn calculate_transform_matrix(
&self,
border_rect: &Rect<Au, CSSPixel>,
) -> Option<LayoutTransform>
pub fn calculate_transform_matrix( &self, border_rect: &Rect<Au, CSSPixel>, ) -> Option<LayoutTransform>
Returns the 4D matrix representing this fragment’s transform.
Sourcepub fn calculate_perspective_matrix(
&self,
border_rect: &Rect<Au, CSSPixel>,
) -> Option<LayoutTransform>
pub fn calculate_perspective_matrix( &self, border_rect: &Rect<Au, CSSPixel>, ) -> Option<LayoutTransform>
Returns the 4D matrix representing this fragment’s perspective.
fn clear_spatial_tree_node_including_descendants(&self)
Source§impl BoxFragment
impl BoxFragment
fn border_radius(&self) -> BorderRadius
Source§impl BoxFragment
impl BoxFragment
pub(crate) fn new( base_fragment_info: BaseFragmentInfo, style: ServoArc<ComputedValues>, children: Vec<Fragment>, content_rect: PhysicalRect<Au>, padding: PhysicalSides<Au>, border: PhysicalSides<Au>, margin: PhysicalSides<Au>, specific_layout_info: Option<SpecificLayoutInfo>, ) -> Self
pub(crate) fn with_baselines(self, baselines: Baselines) -> Self
pub(crate) fn style<'a>(&'a self) -> AtomicRef<'a, ServoArc<ComputedValues>>
pub(crate) fn with_style(self: &Arc<Self>) -> BoxFragmentWithStyle<'_>
Sourcepub(crate) fn baselines(&self, writing_mode: WritingMode) -> Baselines
pub(crate) fn baselines(&self, writing_mode: WritingMode) -> Baselines
Get the baselines for this BoxFragment if they are compatible with the given WritingMode.
If they are not compatible, Baselines::default() is returned.
pub(crate) fn add_extra_background(&mut self, extra_background: ExtraBackground)
pub(crate) fn set_does_not_paint_background(&mut self)
pub(crate) fn ensure_rare_data(&self) -> AtomicRefMut<'_, BoxFragmentRareData>
pub(crate) fn specific_layout_info( &self, ) -> Option<AtomicRef<'_, SpecificLayoutInfo>>
pub(crate) fn resolved_sticky_insets( &self, ) -> Option<AtomicRef<'_, Box<PhysicalSides<AuOrAuto>>>>
pub(crate) fn set_resolved_sticky_insets( &self, sticky_insets: PhysicalSides<AuOrAuto>, )
pub(crate) fn generated_clip_id(&self) -> Option<ClipId>
pub(crate) fn set_generated_clip_id(&self, generated_clip_id: ClipId)
pub(crate) fn generated_scroll_tree_node_id(&self) -> Option<ScrollTreeNodeId>
pub(crate) fn set_generated_scroll_tree_node_id( &self, generated_scroll_tree_node_id: ScrollTreeNodeId, )
pub(crate) fn with_block_level_layout_info( self, block_margins_collapsed_with_children: CollapsedBlockMargins, clearance: Option<Au>, ) -> Self
Sourcepub(crate) fn clear_scrollable_overflow(&self)
pub(crate) fn clear_scrollable_overflow(&self)
Clear the scrollable overflow on this BoxFragment. This is called
during damage propagation when a fragment is preserved, itself or one of its
descendants has scrollable overflow damage.
pub(crate) fn set_containing_block(&self, containing_block: &PhysicalRect<Au>)
pub(crate) fn offset_by_containing_block( &self, rect: &PhysicalRect<Au>, containing_block_computation: ContainingBlockCalculation<'_>, ) -> PhysicalRect<Au>
pub(crate) fn cumulative_content_box_rect( &self, containing_block_computation: ContainingBlockCalculation<'_>, ) -> PhysicalRect<Au>
pub(crate) fn cumulative_padding_box_rect( &self, containing_block_computation: ContainingBlockCalculation<'_>, ) -> PhysicalRect<Au>
pub(crate) fn cumulative_border_box_rect( &self, containing_block_computation: ContainingBlockCalculation<'_>, ) -> PhysicalRect<Au>
pub(crate) fn content_rect(&self) -> PhysicalRect<Au>
pub(crate) fn padding_rect(&self) -> PhysicalRect<Au>
pub(crate) fn border_rect(&self) -> PhysicalRect<Au>
pub(crate) fn margin_rect(&self) -> PhysicalRect<Au>
pub(crate) fn padding_border_margin(&self) -> PhysicalSides<Au>
pub(crate) fn is_root_element(&self) -> bool
pub(crate) fn is_body_element_of_html_element_root(&self) -> bool
pub(crate) fn print(self: &Arc<Self>, tree: &mut PrintTree)
pub(crate) fn calculate_resolved_insets_if_positioned( &self, containing_block_computation: ContainingBlockCalculation<'_>, ) -> PhysicalSides<AuOrAuto>
Sourcepub(crate) fn is_flex_or_grid_item(&self) -> bool
pub(crate) fn is_flex_or_grid_item(&self) -> bool
Whether or this is a flex or grid item.
Sourcepub(crate) fn is_replaced(&self) -> bool
pub(crate) fn is_replaced(&self) -> bool
Whether or this box is for replaced content.
Sourcepub(crate) fn is_table_wrapper(&self) -> bool
pub(crate) fn is_table_wrapper(&self) -> bool
Whether this is a table wrapper box. https://www.w3.org/TR/css-tables-3/#table-wrapper-box
Sourcepub(crate) fn is_table_grid_with_collapsed_borders(&self) -> bool
pub(crate) fn is_table_grid_with_collapsed_borders(&self) -> bool
Whether or not this is the BoxFragment for a table grid with collapsed borders.
pub(crate) fn spatial_tree_node(&self) -> Option<ScrollTreeNodeId>
Trait Implementations§
Source§impl MallocSizeOf for BoxFragment
impl MallocSizeOf for BoxFragment
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
impl !Freeze for BoxFragment
impl !RefUnwindSafe for BoxFragment
impl Send for BoxFragment
impl Sync for BoxFragment
impl Unpin for BoxFragment
impl UnsafeUnpin for BoxFragment
impl !UnwindSafe for BoxFragment
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