Struct layout_2013::flow_ref::FlowRef
source · pub struct FlowRef(Arc<dyn Flow>);
Tuple Fields§
§0: Arc<dyn Flow>
Implementations§
source§impl FlowRef
impl FlowRef
sourcefn add_new_child(&mut self, new_child: FlowRef)
fn add_new_child(&mut self, new_child: FlowRef)
Adds a new flow as a child of this flow. Fails if this flow is marked as a leaf.
sourcefn finish(&mut self)
fn finish(&mut self)
Finishes a flow. Once a flow is finished, no more child flows or fragments may be added to
it. This will normally run the bubble-inline-sizes (minimum and preferred – i.e. intrinsic
– inline-size) calculation, unless the global bubble_inline-sizes_separately
flag is on.
All flows must be finished at some point, or they will not have their intrinsic inline-sizes properly computed. (This is not, however, a memory safety problem.)
source§impl FlowRef
impl FlowRef
sourcepub fn new(r: Arc<dyn Flow>) -> Self
pub fn new(r: Arc<dyn Flow>) -> Self
FlowRef
s can only be made available to the traversal code.
See https://github.com/servo/servo/issues/14014 for more details.
pub fn get_mut(this: &mut FlowRef) -> Option<&mut dyn Flow>
pub fn downgrade(this: &FlowRef) -> WeakFlowRef
pub fn into_arc(this: FlowRef) -> Arc<dyn Flow>
sourcepub fn deref_mut(this: &mut FlowRef) -> &mut dyn Flow
pub fn deref_mut(this: &mut FlowRef) -> &mut dyn Flow
WARNING: This should only be used when there is no aliasing: when the traversal ensures that no other threads accesses the same flow at the same time. See https://github.com/servo/servo/issues/6503. Use Arc::get_mut instead when possible (e.g. on an Arc that was just created).
Trait Implementations§
source§impl MutableOwnedFlowUtils for FlowRef
impl MutableOwnedFlowUtils for FlowRef
source§fn set_absolute_descendants(&mut self, abs_descendants: AbsoluteDescendants)
fn set_absolute_descendants(&mut self, abs_descendants: AbsoluteDescendants)
Set absolute descendants for this flow.
Set yourself as the Containing Block for all the absolute descendants.
This is called during flow construction, so nothing else can be accessing the descendant
flows. This is enforced by the fact that we have a mutable FlowRef
, which only flow
construction is allowed to possess.
source§fn push_absolute_descendants(&mut self, abs_descendants: AbsoluteDescendants)
fn push_absolute_descendants(&mut self, abs_descendants: AbsoluteDescendants)
Push absolute descendants for this flow.
Set yourself as the Containing Block for the provided absolute descendants.
This is called when retreiving layout root if it’s not absolute positioned. We can’t just
call set_absolute_descendants
because it might contain other abs_descendants already.
We push descendants instead of replace it since it won’t cause circular reference.
source§fn take_applicable_absolute_descendants(
&mut self,
absolute_descendants: &mut AbsoluteDescendants,
)
fn take_applicable_absolute_descendants( &mut self, absolute_descendants: &mut AbsoluteDescendants, )
Sets the flow as the containing block for all absolute descendants that have been marked as having reached their containing block. This is needed in order to handle cases like:
<div>
<span style="position: relative">
<span style="position: absolute; ..."></span>
</span>
</div>
Auto Trait Implementations§
impl Freeze for FlowRef
impl !RefUnwindSafe for FlowRef
impl Send for FlowRef
impl Sync for FlowRef
impl Unpin for FlowRef
impl !UnwindSafe for FlowRef
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> 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