pub(crate) struct LayoutRoot<'dom> {
node: ServoLayoutNode<'dom>,
}Expand description
A data structure to track a layout root.
Layout roots are places in the fragment tree where fragment tree layout can start. These are fragments that isolate fragment damage from their ancestors sufficiently that their ancestors can be preserved from one fragment tree layout to the next. Currently, this only includes absolutely-or-fixed-positioned fragments that do not have any escaping fixed position fragments..
During damage propagation, upward flowing fragment tree Relayout damage can be
converted into DescendantCollectedAsLayoutRoot damage. When an ancestor of a layout
root has fragment tree layout damage, DescendantCollectedAsLayoutRoot damage is
converted back into Relayout and propagated up to the next layout root or the root
of the DOM.
This is only possible because the damage propagation traversal ensures that damage
above the absolute (which might shift its static position) is converted back into
Relayout damage. This means that the absolute should be placed with the fully
adjusted static positioning rectangle between two layouts.
It’s possible that upon laying out a layout root again, a new fixed position element has started to escape from the layout root. In that case, a full fragment tree layout becomes necessary to rebuild the fragment properly.
Fields§
§node: ServoLayoutNode<'dom>Implementations§
Source§impl LayoutRoot<'_>
impl LayoutRoot<'_>
pub(crate) fn try_layout(&self, layout_context: &LayoutContext<'_>) -> bool
Trait Implementations§
Source§impl<'dom> TryFrom<ServoLayoutNode<'dom>> for LayoutRoot<'dom>
impl<'dom> TryFrom<ServoLayoutNode<'dom>> for LayoutRoot<'dom>
Auto Trait Implementations§
impl<'dom> Freeze for LayoutRoot<'dom>
impl<'dom> !RefUnwindSafe for LayoutRoot<'dom>
impl<'dom> Send for LayoutRoot<'dom>
impl<'dom> Sync for LayoutRoot<'dom>
impl<'dom> Unpin for LayoutRoot<'dom>
impl<'dom> UnsafeUnpin for LayoutRoot<'dom>
impl<'dom> !UnwindSafe for LayoutRoot<'dom>
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