pub(crate) struct BoxFragmentWithStyle<'a> {
pub(crate) box_fragment: &'a Arc<BoxFragment>,
pub(crate) style: AtomicRef<'a, Arc<ComputedValues>>,
}Expand description
Contains &Arc<BoxFragment> and dereferences to it so it can mostly
be used in the same ways, except the .style() method is shadowed to use an existing
atomic_refcell::AtomicRef that lives as long as BoxFragmentWithStyle.
Compared to calling BoxFragment::style() repeatedly, this reduce the number of atomic
increments and decrements on ArcRefCell’s borrow counter.
Fields§
§box_fragment: &'a Arc<BoxFragment>§style: AtomicRef<'a, Arc<ComputedValues>>Implementations§
Source§impl BoxFragmentWithStyle<'_>
impl BoxFragmentWithStyle<'_>
fn build_stacking_context_tree_for_children( &self, stacking_context_tree: &mut StackingContextTree, containing_block: &ContainingBlock, containing_block_info: &ContainingBlockManager<'_, ContainingBlock>, stacking_context: &mut StackingContext, text_decorations: &Rc<Vec<FragmentTextDecoration>>, )
fn build_clip_frame_if_necessary( &self, stacking_context_tree: &mut StackingContextTree, parent_scroll_node_id: ScrollTreeNodeId, parent_clip_id: ClipId, containing_block_rect: &PhysicalRect<Au>, ) -> Option<ClipId>
fn build_overflow_frame_if_necessary( &self, stacking_context_tree: &mut StackingContextTree, parent_scroll_node_id: ScrollTreeNodeId, parent_clip_id: ClipId, containing_block_rect: &PhysicalRect<Au>, ) -> Option<OverflowFrameData>
Source§impl<'a> BoxFragmentWithStyle<'a>
impl<'a> BoxFragmentWithStyle<'a>
pub(crate) fn style(&self) -> &ServoArc<ComputedValues>
Sourcepub(crate) fn clip_wholly_unreachable_scrollable_overflow(
&self,
scrollable_overflow_from_child: PhysicalRect<Au>,
clipping_rect: PhysicalRect<Au>,
) -> PhysicalRect<Au>
pub(crate) fn clip_wholly_unreachable_scrollable_overflow( &self, scrollable_overflow_from_child: PhysicalRect<Au>, clipping_rect: PhysicalRect<Au>, ) -> PhysicalRect<Au>
Return the clipped scrollable overflow based on its scroll origin, determined by
overflow direction. Return None if the scrollable overflow from child is wholly
unreachable. For an element, the clip rect is the padding rect and for viewport,
it is the initial containing block.
pub(crate) fn scrollable_overflow_for_parent(&self) -> PhysicalRect<Au>
Sourcepub(crate) fn scrollable_overflow(&self) -> PhysicalRect<Au>
pub(crate) fn scrollable_overflow(&self) -> PhysicalRect<Au>
Get the scrollable overflow for this BoxFragment relative to its containing
block, recalculating scrollable overflow when necessary, for instance after a
style change.
Sourcefn calculate_scrollable_overflow(&self) -> PhysicalRect<Au>
fn calculate_scrollable_overflow(&self) -> PhysicalRect<Au>
This is an implementation of:
Sourcepub(crate) fn is_inline_box(&self) -> bool
pub(crate) fn is_inline_box(&self) -> bool
Whether this is a non-replaced inline-level box whose inner display type is flow.
https://drafts.csswg.org/css-display-3/#inline-box
Sourcepub(crate) fn is_atomic_inline_level(&self) -> bool
pub(crate) fn is_atomic_inline_level(&self) -> bool
Whether this is an atomic inline-level box. https://drafts.csswg.org/css-display-3/#atomic-inline
pub(crate) fn has_collapsed_borders(&self) -> bool
Sourcepub(crate) fn has_outline(&self) -> bool
pub(crate) fn has_outline(&self) -> bool
Whether or not this BoxFragment has outlines.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for BoxFragmentWithStyle<'a>
impl<'a> !RefUnwindSafe for BoxFragmentWithStyle<'a>
impl<'a> Send for BoxFragmentWithStyle<'a>
impl<'a> Sync for BoxFragmentWithStyle<'a>
impl<'a> Unpin for BoxFragmentWithStyle<'a>
impl<'a> UnsafeUnpin for BoxFragmentWithStyle<'a>
impl<'a> !UnwindSafe for BoxFragmentWithStyle<'a>
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