pub(crate) struct IndependentFormattingContext {
pub base: LayoutBoxBase,
contents: IndependentFormattingContextContents,
}
Expand description
Fields§
§base: LayoutBoxBase
§contents: IndependentFormattingContextContents
Implementations§
Source§impl IndependentFormattingContext
impl IndependentFormattingContext
fn layout_into_line_items( &self, layout: &mut InlineFormattingContextLayout<'_>, offset_in_text: usize, bidi_level: Level, )
Sourcefn pick_baseline(&self, baselines: &Baselines) -> Option<Au>
fn pick_baseline(&self, baselines: &Baselines) -> Option<Au>
Picks either the first or the last baseline, depending on baseline-source
.
TODO: clarify that this is not to be used for box alignment in flex/grid
https://drafts.csswg.org/css-inline/#baseline-source
fn get_block_sizes_and_baseline_offset( &self, ifc: &InlineFormattingContextLayout<'_>, block_size: Au, baseline_offset_in_content_area: Au, ) -> (LineBlockSizes, Au)
Source§impl IndependentFormattingContext
impl IndependentFormattingContext
Sourcepub(crate) fn layout_in_flow_block_level(
&self,
layout_context: &LayoutContext<'_>,
positioning_context: &mut PositioningContext,
containing_block: &ContainingBlock<'_>,
sequential_layout_state: Option<&mut SequentialLayoutState>,
ignore_block_margins_for_stretch: LogicalSides1D<bool>,
) -> BoxFragment
pub(crate) fn layout_in_flow_block_level( &self, layout_context: &LayoutContext<'_>, positioning_context: &mut PositioningContext, containing_block: &ContainingBlock<'_>, sequential_layout_state: Option<&mut SequentialLayoutState>, ignore_block_margins_for_stretch: LogicalSides1D<bool>, ) -> BoxFragment
Lay out an in-flow block-level box that establishes an independent formatting context in its containing formatting context.
Sourcefn layout_in_flow_block_level_sequentially(
&self,
layout_context: &LayoutContext<'_>,
positioning_context: &mut PositioningContext,
containing_block: &ContainingBlock<'_>,
sequential_layout_state: &mut SequentialLayoutState,
ignore_block_margins_for_stretch: LogicalSides1D<bool>,
) -> BoxFragment
fn layout_in_flow_block_level_sequentially( &self, layout_context: &LayoutContext<'_>, positioning_context: &mut PositioningContext, containing_block: &ContainingBlock<'_>, sequential_layout_state: &mut SequentialLayoutState, ignore_block_margins_for_stretch: LogicalSides1D<bool>, ) -> BoxFragment
Lay out a normal in flow non-replaced block that establishes an independent formatting context in its containing formatting context but handling sequential layout concerns, such clearing and placing the content next to floats.
Source§impl IndependentFormattingContext
impl IndependentFormattingContext
pub(crate) fn layout_float_or_atomic_inline( &self, layout_context: &LayoutContext<'_>, child_positioning_context: &mut PositioningContext, containing_block: &ContainingBlock<'_>, ) -> IndependentFloatOrAtomicLayoutResult
Source§impl IndependentFormattingContext
impl IndependentFormattingContext
pub(crate) fn new( base: LayoutBoxBase, contents: IndependentFormattingContextContents, ) -> Self
pub fn construct( context: &LayoutContext<'_>, node_and_style_info: &NodeAndStyleInfo<'_>, display_inside: DisplayInside, contents: Contents, propagated_data: PropagatedBoxTreeData, ) -> Self
pub fn style(&self) -> &Arc<ComputedValues>
pub fn base_fragment_info(&self) -> BaseFragmentInfo
pub(crate) fn inline_content_sizes( &self, layout_context: &LayoutContext<'_>, constraint_space: &ConstraintSpace, ) -> InlineContentSizesResult
Sourcepub(crate) fn tentative_block_content_size(
&self,
preferred_aspect_ratio: Option<AspectRatio>,
) -> Option<ContentSizes>
pub(crate) fn tentative_block_content_size( &self, preferred_aspect_ratio: Option<AspectRatio>, ) -> Option<ContentSizes>
Computes the tentative intrinsic block sizes that may be needed while computing
the intrinsic inline sizes. Therefore, this ignores the values of the sizing
properties in both axes.
A return value of None
indicates that there is no suitable tentative intrinsic
block size, so intrinsic keywords in the block sizing properties will be ignored,
possibly resulting in an indefinite [SizeConstraint
] for computing the intrinsic
inline sizes and laying out the contents.
A return value of Some
indicates that intrinsic keywords in the block sizing
properties will be resolved as the contained value, guaranteeing a definite amount
for computing the intrinsic inline sizes and laying out the contents.
pub(crate) fn outer_inline_content_sizes( &self, layout_context: &LayoutContext<'_>, containing_block: &IndefiniteContainingBlock, auto_minimum: &LogicalVec2<Au>, auto_block_size_stretches_to_containing_block: bool, ) -> InlineContentSizesResult
pub(crate) fn repair_style( &mut self, context: &SharedStyleContext<'_>, node: &ServoThreadSafeLayoutNode<'_>, new_style: &Arc<ComputedValues>, )
pub(crate) fn is_block_container(&self) -> bool
pub(crate) fn is_replaced(&self) -> bool
pub(crate) fn is_table(&self) -> bool
fn layout_without_caching( &self, layout_context: &LayoutContext<'_>, positioning_context: &mut PositioningContext, containing_block_for_children: &ContainingBlock<'_>, containing_block: &ContainingBlock<'_>, preferred_aspect_ratio: Option<AspectRatio>, lazy_block_size: &LazySize<'_>, ) -> CacheableLayoutResult
pub(crate) fn layout( &self, layout_context: &LayoutContext<'_>, positioning_context: &mut PositioningContext, containing_block_for_children: &ContainingBlock<'_>, containing_block: &ContainingBlock<'_>, preferred_aspect_ratio: Option<AspectRatio>, lazy_block_size: &LazySize<'_>, ) -> CacheableLayoutResult
pub(crate) fn layout_style(&self) -> LayoutStyle<'_>
pub(crate) fn preferred_aspect_ratio( &self, padding_border_sums: &LogicalVec2<Au>, ) -> Option<AspectRatio>
Trait Implementations§
Source§impl Debug for IndependentFormattingContext
impl Debug for IndependentFormattingContext
Source§impl MallocSizeOf for IndependentFormattingContext
impl MallocSizeOf for IndependentFormattingContext
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
impl !Freeze for IndependentFormattingContext
impl !RefUnwindSafe for IndependentFormattingContext
impl Send for IndependentFormattingContext
impl Sync for IndependentFormattingContext
impl Unpin for IndependentFormattingContext
impl !UnwindSafe for IndependentFormattingContext
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