Struct layout_2020::FragmentTree
source · pub struct FragmentTree {
pub(crate) root_fragments: Vec<ArcRefCell<Fragment>>,
pub(crate) scrollable_overflow: PhysicalRect<Au>,
pub(crate) initial_containing_block: PhysicalRect<Au>,
pub(crate) canvas_background: CanvasBackground,
pub root_scroll_sensitivity: ScrollSensitivity,
}
Fields§
§root_fragments: Vec<ArcRefCell<Fragment>>
Fragments at the top-level of the tree.
If the root element has display: none
, there are zero fragments.
Otherwise, there is at least one:
- The first fragment is generated by the root element.
- There may be additional fragments generated by positioned boxes that have the initial containing block.
scrollable_overflow: PhysicalRect<Au>
The scrollable overflow rectangle for the entire tree https://drafts.csswg.org/css-overflow/#scrollable
initial_containing_block: PhysicalRect<Au>
The containing block used in the layout of this fragment tree.
canvas_background: CanvasBackground
§root_scroll_sensitivity: ScrollSensitivity
Whether or not the root element is sensitive to scroll input events.
Implementations§
source§impl FragmentTree
impl FragmentTree
pub(crate) fn build_display_list( &self, builder: &mut DisplayListBuilder<'_>, root_stacking_context: &StackingContext, )
pub fn print(&self)
pub fn scrollable_overflow(&self) -> LayoutSize
pub(crate) fn find<T>( &self, process_func: impl FnMut(&Fragment, usize, &PhysicalRect<Au>) -> Option<T>, ) -> Option<T>
pub fn remove_nodes_in_fragment_tree_from_set( &self, set: &mut FxHashSet<AnimationSetKey>, )
sourcepub fn get_content_boxes_for_node(
&self,
requested_node: OpaqueNode,
) -> Vec<Rect<Au>>
pub fn get_content_boxes_for_node( &self, requested_node: OpaqueNode, ) -> Vec<Rect<Au>>
Get the vector of rectangles that surrounds the fragments of the node with the given address.
This function answers the getClientRects()
query and the union of the rectangles answers
the getBoundingClientRect()
query.
TODO: This function is supposed to handle scroll offsets, but that isn’t happening at all.
pub fn get_border_dimensions_for_node( &self, requested_node: OpaqueNode, ) -> Rect<i32>
pub fn get_scrolling_area_for_viewport(&self) -> PhysicalRect<Au>
pub fn get_scrolling_area_for_node( &self, requested_node: OpaqueNode, ) -> PhysicalRect<Au>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FragmentTree
impl !RefUnwindSafe for FragmentTree
impl Send for FragmentTree
impl Sync for FragmentTree
impl Unpin for FragmentTree
impl !UnwindSafe for FragmentTree
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