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

source§

impl BaseFlow

source

pub fn new( style: Option<&ComputedValues>, writing_mode: WritingMode, force_nonfloated: ForceNonfloatedFlag, ) -> BaseFlow

source

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.

source

pub fn clone_with_children(&self, children: FlowList) -> BaseFlow

Return a new BaseFlow like this one but with the given children list

source

pub fn child_iter(&self) -> FlowListIterator<'_>

Iterates over the children of this immutable flow.

source

pub fn child_iter_mut(&mut self) -> MutFlowListIterator<'_>

source

pub fn debug_id(&self) -> usize

source

pub fn collect_stacking_contexts_for_children( &mut self, state: &mut StackingContextCollectionState, )

source

pub fn might_have_floats_in(&self) -> bool

source

pub fn might_have_floats_out(&self) -> bool

source

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§

source§

impl Debug for BaseFlow

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Serialize for BaseFlow

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
source§

impl<T> MaybeBoxed<Box<T>> for T

source§

fn maybe_boxed(self) -> Box<T>

Convert
source§

impl<T> MaybeBoxed<T> for T

source§

fn maybe_boxed(self) -> T

Convert
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSendSync for T

source§

impl<T> WasmNotSync for T
where T: Sync,