Enum layout_2020::fragment_tree::fragment::Fragment
source · pub(crate) enum Fragment {
Box(BoxFragment),
Float(BoxFragment),
Positioning(PositioningFragment),
AbsoluteOrFixedPositioned(ArcRefCell<HoistedSharedFragment>),
Text(TextFragment),
Image(ImageFragment),
IFrame(IFrameFragment),
}
Variants§
Box(BoxFragment)
Float(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(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(TextFragment)
Image(ImageFragment)
IFrame(IFrameFragment)
Implementations§
source§impl Fragment
impl Fragment
pub(crate) fn build_stacking_context_tree( &mut self, fragment_ref: &ArcRefCell<Fragment>, display_list: &mut DisplayList, containing_block_info: &ContainingBlockManager<'_, ContainingBlock>, stacking_context: &mut StackingContext, mode: StackingContextBuildMode, )
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, )
fn maybe_push_hit_test_for_style_and_tag( &self, builder: &mut DisplayListBuilder<'_>, style: &ComputedValues, tag: Option<Tag>, rect: PhysicalRect<Au>, cursor: Cursor, )
fn build_display_list_for_text_fragment( &self, fragment: &TextFragment, builder: &mut DisplayListBuilder<'_>, containing_block: &PhysicalRect<Au>, )
fn build_display_list_for_text_decoration( &self, fragment: &TextFragment, builder: &mut DisplayListBuilder<'_>, rect: &PhysicalRect<Au>, color: &AbsoluteColor, )
source§impl Fragment
impl Fragment
pub fn base(&self) -> Option<&BaseFragment>
pub(crate) fn content_rect_mut(&mut self) -> Option<&mut PhysicalRect<Au>>
pub fn tag(&self) -> Option<Tag>
pub fn print(&self, tree: &mut PrintTree)
pub fn scrolling_area( &self, containing_block: &PhysicalRect<Au>, ) -> PhysicalRect<Au>
pub fn scrollable_overflow(&self) -> PhysicalRect<Au>
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>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fragment
impl !RefUnwindSafe for Fragment
impl Send for Fragment
impl Sync for Fragment
impl Unpin 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert