Struct layout_2013::flow::BaseFlow
source · pub struct BaseFlow {Show 25 fields
pub restyle_damage: RestyleDamage,
pub children: FlowList,
pub intrinsic_inline_sizes: IntrinsicISizes,
pub position: LogicalRect<Au>,
pub overflow: Overflow,
pub parallel: FlowParallelInfo,
pub floats: Floats,
pub speculated_float_placement_in: SpeculatedFloatPlacement,
pub speculated_float_placement_out: SpeculatedFloatPlacement,
pub collapsible_margins: CollapsibleMargins,
pub stacking_relative_position: Vector2D<Au>,
pub abs_descendants: AbsoluteDescendants,
pub block_container_inline_size: Au,
pub block_container_writing_mode: WritingMode,
pub block_container_explicit_block_size: Option<Au>,
pub absolute_cb: ContainingBlockLink,
pub early_absolute_position_info: EarlyAbsolutePositionInfo,
pub late_absolute_position_info: LateAbsolutePositionInfo,
pub clip: Rect<Au>,
pub writing_mode: WritingMode,
pub thread_id: u8,
pub flags: FlowFlags,
pub text_align: T,
pub stacking_context_id: StackingContextId,
pub clipping_and_scrolling: Option<ClippingAndScrolling>,
}
Expand description
Data common to all flows.
Fields§
§restyle_damage: RestyleDamage
§children: FlowList
The children of this flow.
intrinsic_inline_sizes: IntrinsicISizes
Intrinsic inline sizes for this flow.
position: LogicalRect<Au>
The upper left corner of the box representing this flow, relative to the box representing its parent flow.
For absolute flows, this represents the position with respect to its containing block.
This does not include margins in the block flow direction, because those can collapse. So for the block direction (usually vertical), this represents the border box. For the inline direction (usually horizontal), this represents the margin box.
overflow: Overflow
The amount of overflow of this flow, relative to the containing block. Must include all the pixels of all the display list items for correct invalidation.
parallel: FlowParallelInfo
Data used during parallel traversals.
TODO(pcwalton): Group with other transient data to save space.
floats: Floats
The floats next to this flow.
speculated_float_placement_in: SpeculatedFloatPlacement
Metrics for floats in computed during the float metrics speculation phase.
speculated_float_placement_out: SpeculatedFloatPlacement
Metrics for floats out computed during the float metrics speculation phase.
collapsible_margins: CollapsibleMargins
The collapsible margins for this flow, if any.
stacking_relative_position: Vector2D<Au>
The position of this flow relative to the start of the nearest ancestor stacking context. This is computed during the top-down pass of display list construction.
abs_descendants: AbsoluteDescendants
Details about descendants with position ‘absolute’ or ‘fixed’ for which we are the containing block. This is in tree order. This includes any direct children.
block_container_inline_size: Au
The inline-size of the block container of this flow. Used for computing percentage and
automatic values for width
.
block_container_writing_mode: WritingMode
The writing mode of the block container of this flow.
FIXME (mbrubeck): Combine this and block_container_inline_size and maybe block_container_explicit_block_size into a struct, to guarantee they are set at the same time? Or just store a link to the containing block flow.
block_container_explicit_block_size: Option<Au>
The block-size of the block container of this flow, if it is an explicit size (does not
depend on content heights). Used for computing percentage values for height
.
absolute_cb: ContainingBlockLink
Reference to the Containing Block, if this flow is absolutely positioned.
early_absolute_position_info: EarlyAbsolutePositionInfo
Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be confused with absolutely-positioned flows) that is computed during block-size assignment.
late_absolute_position_info: LateAbsolutePositionInfo
Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be confused with absolutely-positioned flows) that is computed during final position assignment.
clip: Rect<Au>
The clipping rectangle for this flow and its descendants, in the coordinate system of the nearest ancestor stacking context. If this flow itself represents a stacking context, then this is in the flow’s own coordinate system.
writing_mode: WritingMode
The writing mode for this flow.
thread_id: u8
For debugging and profiling, the identifier of the thread that laid out this fragment.
flags: FlowFlags
Various flags for flows, tightly packed to save space.
text_align: T
Text alignment of this flow.
stacking_context_id: StackingContextId
The ID of the StackingContext that contains this flow. This is initialized to 0, but it assigned during the collect_stacking_contexts phase of display list construction.
clipping_and_scrolling: Option<ClippingAndScrolling>
The indices of this Flow’s ClipScrollNode. This is used to place the node’s display items into scrolling frames and clipping nodes.
Implementations§
source§impl BaseFlow
impl BaseFlow
pub fn build_display_items_for_debugging_tint( &self, state: &mut DisplayListBuildState<'_>, node: OpaqueNode, )
source§impl BaseFlow
impl BaseFlow
pub fn new( style: Option<&ComputedValues>, writing_mode: WritingMode, force_nonfloated: ForceNonfloatedFlag, ) -> BaseFlow
sourcepub fn update_flags_if_needed(&mut self, style: &ComputedValues)
pub fn update_flags_if_needed(&mut self, style: &ComputedValues)
Update the ‘flags’ field when computed styles have changed.
These flags are initially set during flow construction. They only need to be updated here
if they are based on properties that can change without triggering RECONSTRUCT_FLOW
.
sourcepub fn clone_with_children(&self, children: FlowList) -> BaseFlow
pub fn clone_with_children(&self, children: FlowList) -> BaseFlow
Return a new BaseFlow like this one but with the given children list
sourcepub fn child_iter(&self) -> FlowListIterator<'_> ⓘ
pub fn child_iter(&self) -> FlowListIterator<'_> ⓘ
Iterates over the children of this immutable flow.
pub fn child_iter_mut(&mut self) -> MutFlowListIterator<'_> ⓘ
pub fn debug_id(&self) -> usize
pub fn collect_stacking_contexts_for_children( &mut self, state: &mut StackingContextCollectionState, )
pub fn might_have_floats_in(&self) -> bool
pub fn might_have_floats_out(&self) -> bool
sourcepub fn stacking_relative_border_box_for_display_list(
&self,
fragment: &Fragment,
) -> Rect<Au>
pub fn stacking_relative_border_box_for_display_list( &self, fragment: &Fragment, ) -> Rect<Au>
Compute the fragment position relative to the parent stacking context. If the fragment itself establishes a stacking context, then the origin of its position will be (0, 0) for the purposes of this computation.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BaseFlow
impl !RefUnwindSafe for BaseFlow
impl Send for BaseFlow
impl Sync for BaseFlow
impl Unpin for BaseFlow
impl !UnwindSafe for BaseFlow
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