pub(crate) enum Fragment {
Box(Arc<BoxFragment>),
Float(Arc<BoxFragment>),
Positioning(Arc<PositioningFragment>),
AbsoluteOrFixedPositioned(ArcRefCell<HoistedSharedFragment>),
Text(Arc<TextFragment>),
Image(Arc<ImageFragment>),
IFrame(Arc<IFrameFragment>),
}Variants§
Box(Arc<BoxFragment>)
Float(Arc<BoxFragment>)
Floating content. A floated fragment is very similar to a normal BoxFragment but it isn’t positioned using normal in block flow positioning rules (margin collapse, etc). Instead, they are laid out by the crate::flow::float::SequentialLayoutState of their float containing block formatting context.
Positioning(Arc<PositioningFragment>)
AbsoluteOrFixedPositioned(ArcRefCell<HoistedSharedFragment>)
Absolute and fixed position fragments are hoisted up so that they
are children of the BoxFragment that establishes their containing
blocks, so that they can be laid out properly. When this happens
an AbsoluteOrFixedPositioned fragment is left at the original tree
position. This allows these hoisted fragments to be painted with
regard to their original tree order during stacking context tree /
display list construction.
Text(Arc<TextFragment>)
Image(Arc<ImageFragment>)
IFrame(Arc<IFrameFragment>)
Implementations§
Source§impl Fragment
impl Fragment
pub(crate) fn hit_test( &self, hit_test: &mut HitTest<'_>, spatial_node_id: ScrollTreeNodeId, containing_block: &PhysicalRect<Au>, ) -> bool
Source§impl Fragment
impl Fragment
pub(crate) fn build_stacking_context_tree( &self, stacking_context_tree: &mut StackingContextTree, containing_block_info: &ContainingBlockManager<'_, ContainingBlock>, stacking_context: &mut StackingContext, mode: StackingContextBuildMode, text_decorations: &Arc<Vec<FragmentTextDecoration>>, )
Source§impl Fragment
impl Fragment
pub(crate) fn build_display_list( &self, builder: &mut DisplayListBuilder<'_>, containing_block: &PhysicalRect<Au>, section: StackingContextSection, is_hit_test_for_scrollable_overflow: bool, is_collapsed_table_borders: bool, text_decorations: &Arc<Vec<FragmentTextDecoration>>, )
fn build_display_list_for_text_fragment( &self, fragment: &TextFragment, builder: &mut DisplayListBuilder<'_>, containing_block: &PhysicalRect<Au>, text_decorations: &Arc<Vec<FragmentTextDecoration>>, )
fn build_display_list_for_text_decoration( &self, parent_style: &ServoArc<ComputedValues>, builder: &mut DisplayListBuilder<'_>, rect: &PhysicalRect<Au>, text_decoration: &FragmentTextDecoration, line: TextDecorationLine, )
fn build_display_list_for_broken_image_border( &self, builder: &mut DisplayListBuilder<'_>, containing_block: &PhysicalRect<Au>, common: &CommonItemProperties, )
fn build_display_list_for_text_selection( &self, fragment: &TextFragment, builder: &mut DisplayListBuilder<'_>, containing_block_rect: &PhysicalRect<Au>, fragment_x_offset: Au, justification_adjustment: Au, )
Source§impl Fragment
impl Fragment
pub fn base(&self) -> Option<&BaseFragment>
pub(crate) fn set_containing_block(&self, containing_block: &PhysicalRect<Au>)
pub fn tag(&self) -> Option<Tag>
pub fn print(&self, tree: &mut PrintTree)
pub(crate) fn scrolling_area( &self, layout_thread: &LayoutThread, ) -> PhysicalRect<Au>
Sourcepub(crate) fn clear_scrollable_overflow(&self)
pub(crate) fn clear_scrollable_overflow(&self)
Clear the scrollable overflow on this Fragment. This is called during damage
propagation when a fragment is preserved, itself or one of its descendants has
scrollable overflow damage.
pub(crate) fn scrollable_overflow_for_parent(&self) -> PhysicalRect<Au>
Sourcepub(crate) fn scrollable_overflow_padding_contribution_for_parent(
&self,
) -> Option<PhysicalRect<Au>>
pub(crate) fn scrollable_overflow_padding_contribution_for_parent( &self, ) -> Option<PhysicalRect<Au>>
From https://drafts.csswg.org/css-overflow-3/#scrollable:
This padding represents, within the scrollable overflow rectangle, the box’s own padding so that when its content is scrolled to its end, there is padding between the edge of its in-flow (or floated) content and the border edge of the box. It typically ends up being exactly the same size as the box’s own padding, except in a few cases—such as when an out-of-flow positioned element, or the visible overflow of a descendent, has already increased the size of the scrollable overflow rectangle outside the conceptual “content edge” of the scroll container’s content.
pub(crate) fn cumulative_box_area_rect( &self, area: BoxAreaType, containing_block_computation: ContainingBlockCalculation<'_>, ) -> Option<PhysicalRect<Au>>
pub(crate) fn client_rect(&self) -> Rect<i32, CSSPixel>
pub(crate) fn children(&self) -> Option<&[Fragment]>
pub(crate) fn find<T>( &self, manager: &ContainingBlockManager<'_, PhysicalRect<Au>>, level: usize, process_func: &mut impl FnMut(&Fragment, usize, &PhysicalRect<Au>) -> Option<T>, ) -> Option<T>
pub(crate) fn retrieve_box_fragment(&self) -> Option<&Arc<BoxFragment>>
Trait Implementations§
Source§impl MallocSizeOf for Fragment
impl MallocSizeOf for Fragment
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
impl Freeze for Fragment
impl !RefUnwindSafe for Fragment
impl Send for Fragment
impl Sync for Fragment
impl Unpin for Fragment
impl UnsafeUnpin for Fragment
impl !UnwindSafe for Fragment
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§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