Trait layout_2020::style_ext::ComputedValuesExt
source · pub(crate) trait ComputedValuesExt {
Show 37 methods
// Required methods
fn physical_box_offsets(&self) -> PhysicalSides<LengthPercentageOrAuto<'_>>;
fn box_offsets(
&self,
writing_mode: WritingMode,
) -> LogicalSides<LengthPercentageOrAuto<'_>>;
fn box_size(
&self,
containing_block_writing_mode: WritingMode,
) -> LogicalVec2<Size<LengthPercentage>>;
fn min_box_size(
&self,
containing_block_writing_mode: WritingMode,
) -> LogicalVec2<Size<LengthPercentage>>;
fn max_box_size(
&self,
containing_block_writing_mode: WritingMode,
) -> LogicalVec2<Size<LengthPercentage>>;
fn content_box_size(
&self,
containing_block: &ContainingBlock<'_>,
pbm: &PaddingBorderMargin,
) -> LogicalVec2<Size<Au>>;
fn content_box_size_deprecated(
&self,
containing_block: &ContainingBlock<'_>,
pbm: &PaddingBorderMargin,
) -> LogicalVec2<AuOrAuto>;
fn content_box_size_for_box_size(
&self,
box_size: LogicalVec2<Size<Au>>,
pbm: &PaddingBorderMargin,
) -> LogicalVec2<Size<Au>>;
fn content_min_box_size(
&self,
containing_block: &ContainingBlock<'_>,
pbm: &PaddingBorderMargin,
) -> LogicalVec2<Size<Au>>;
fn content_min_box_size_deprecated(
&self,
containing_block: &ContainingBlock<'_>,
pbm: &PaddingBorderMargin,
) -> LogicalVec2<AuOrAuto>;
fn content_min_box_size_for_min_size(
&self,
box_size: LogicalVec2<Size<Au>>,
pbm: &PaddingBorderMargin,
) -> LogicalVec2<Size<Au>>;
fn content_max_box_size(
&self,
containing_block: &ContainingBlock<'_>,
pbm: &PaddingBorderMargin,
) -> LogicalVec2<Size<Au>>;
fn content_max_box_size_deprecated(
&self,
containing_block: &ContainingBlock<'_>,
pbm: &PaddingBorderMargin,
) -> LogicalVec2<Option<Au>>;
fn content_max_box_size_for_max_size(
&self,
box_size: LogicalVec2<Size<Au>>,
pbm: &PaddingBorderMargin,
) -> LogicalVec2<Size<Au>>;
fn content_box_sizes_and_padding_border_margin(
&self,
containing_block: &IndefiniteContainingBlock,
) -> ContentBoxSizesAndPBM;
fn padding_border_margin(
&self,
containing_block: &ContainingBlock<'_>,
) -> PaddingBorderMargin;
fn padding_border_margin_for_intrinsic_size(
&self,
writing_mode: WritingMode,
) -> PaddingBorderMargin;
fn padding_border_margin_with_writing_mode_and_containing_block_inline_size(
&self,
writing_mode: WritingMode,
containing_block_inline_size: Au,
) -> PaddingBorderMargin;
fn padding(
&self,
containing_block_writing_mode: WritingMode,
) -> LogicalSides<&LengthPercentage>;
fn border_style(
&self,
containing_block_writing_mode: WritingMode,
) -> LogicalSides<BorderStyle>;
fn border_width(
&self,
containing_block_writing_mode: WritingMode,
) -> LogicalSides<Au>;
fn physical_margin(&self) -> PhysicalSides<LengthPercentageOrAuto<'_>>;
fn margin(
&self,
containing_block_writing_mode: WritingMode,
) -> LogicalSides<LengthPercentageOrAuto<'_>>;
fn has_transform_or_perspective(
&self,
fragment_flags: FragmentFlags,
) -> bool;
fn effective_z_index(&self, fragment_flags: FragmentFlags) -> i32;
fn effective_overflow(&self) -> PhysicalVec<Overflow>;
fn establishes_block_formatting_context(&self) -> bool;
fn establishes_stacking_context(
&self,
fragment_flags: FragmentFlags,
) -> bool;
fn establishes_scroll_container(&self) -> bool;
fn establishes_containing_block_for_absolute_descendants(
&self,
fragment_flags: FragmentFlags,
) -> bool;
fn establishes_containing_block_for_all_descendants(
&self,
fragment_flags: FragmentFlags,
) -> bool;
fn preferred_aspect_ratio(
&self,
natural_aspect_ratio: Option<CSSFloat>,
containing_block: &IndefiniteContainingBlock,
) -> Option<AspectRatio>;
fn background_is_transparent(&self) -> bool;
fn get_webrender_primitive_flags(&self) -> PrimitiveFlags;
fn bidi_control_chars(&self) -> (&'static str, &'static str);
fn resolve_align_self(
&self,
resolved_auto_value: AlignItems,
resolved_normal_value: AlignItems,
) -> AlignItems;
fn depends_on_block_constraints_due_to_relative_positioning(
&self,
writing_mode: WritingMode,
) -> bool;
}
Required Methods§
fn physical_box_offsets(&self) -> PhysicalSides<LengthPercentageOrAuto<'_>>
fn box_offsets( &self, writing_mode: WritingMode, ) -> LogicalSides<LengthPercentageOrAuto<'_>>
fn box_size( &self, containing_block_writing_mode: WritingMode, ) -> LogicalVec2<Size<LengthPercentage>>
fn min_box_size( &self, containing_block_writing_mode: WritingMode, ) -> LogicalVec2<Size<LengthPercentage>>
fn max_box_size( &self, containing_block_writing_mode: WritingMode, ) -> LogicalVec2<Size<LengthPercentage>>
fn content_box_size( &self, containing_block: &ContainingBlock<'_>, pbm: &PaddingBorderMargin, ) -> LogicalVec2<Size<Au>>
fn content_box_size_deprecated( &self, containing_block: &ContainingBlock<'_>, pbm: &PaddingBorderMargin, ) -> LogicalVec2<AuOrAuto>
fn content_box_size_for_box_size( &self, box_size: LogicalVec2<Size<Au>>, pbm: &PaddingBorderMargin, ) -> LogicalVec2<Size<Au>>
fn content_min_box_size( &self, containing_block: &ContainingBlock<'_>, pbm: &PaddingBorderMargin, ) -> LogicalVec2<Size<Au>>
fn content_min_box_size_deprecated( &self, containing_block: &ContainingBlock<'_>, pbm: &PaddingBorderMargin, ) -> LogicalVec2<AuOrAuto>
fn content_min_box_size_for_min_size( &self, box_size: LogicalVec2<Size<Au>>, pbm: &PaddingBorderMargin, ) -> LogicalVec2<Size<Au>>
fn content_max_box_size( &self, containing_block: &ContainingBlock<'_>, pbm: &PaddingBorderMargin, ) -> LogicalVec2<Size<Au>>
fn content_max_box_size_deprecated( &self, containing_block: &ContainingBlock<'_>, pbm: &PaddingBorderMargin, ) -> LogicalVec2<Option<Au>>
fn content_max_box_size_for_max_size( &self, box_size: LogicalVec2<Size<Au>>, pbm: &PaddingBorderMargin, ) -> LogicalVec2<Size<Au>>
fn content_box_sizes_and_padding_border_margin( &self, containing_block: &IndefiniteContainingBlock, ) -> ContentBoxSizesAndPBM
fn padding_border_margin( &self, containing_block: &ContainingBlock<'_>, ) -> PaddingBorderMargin
fn padding_border_margin_for_intrinsic_size( &self, writing_mode: WritingMode, ) -> PaddingBorderMargin
fn padding_border_margin_with_writing_mode_and_containing_block_inline_size( &self, writing_mode: WritingMode, containing_block_inline_size: Au, ) -> PaddingBorderMargin
fn padding( &self, containing_block_writing_mode: WritingMode, ) -> LogicalSides<&LengthPercentage>
fn border_style( &self, containing_block_writing_mode: WritingMode, ) -> LogicalSides<BorderStyle>
fn border_width( &self, containing_block_writing_mode: WritingMode, ) -> LogicalSides<Au>
fn physical_margin(&self) -> PhysicalSides<LengthPercentageOrAuto<'_>>
fn margin( &self, containing_block_writing_mode: WritingMode, ) -> LogicalSides<LengthPercentageOrAuto<'_>>
fn has_transform_or_perspective(&self, fragment_flags: FragmentFlags) -> bool
fn effective_z_index(&self, fragment_flags: FragmentFlags) -> i32
fn effective_overflow(&self) -> PhysicalVec<Overflow>
fn establishes_block_formatting_context(&self) -> bool
fn establishes_stacking_context(&self, fragment_flags: FragmentFlags) -> bool
fn establishes_scroll_container(&self) -> bool
fn establishes_containing_block_for_absolute_descendants( &self, fragment_flags: FragmentFlags, ) -> bool
fn establishes_containing_block_for_all_descendants( &self, fragment_flags: FragmentFlags, ) -> bool
fn preferred_aspect_ratio( &self, natural_aspect_ratio: Option<CSSFloat>, containing_block: &IndefiniteContainingBlock, ) -> Option<AspectRatio>
fn background_is_transparent(&self) -> bool
fn get_webrender_primitive_flags(&self) -> PrimitiveFlags
fn bidi_control_chars(&self) -> (&'static str, &'static str)
fn resolve_align_self( &self, resolved_auto_value: AlignItems, resolved_normal_value: AlignItems, ) -> AlignItems
fn depends_on_block_constraints_due_to_relative_positioning( &self, writing_mode: WritingMode, ) -> bool
Implementations on Foreign Types§
source§impl ComputedValuesExt for ComputedValues
impl ComputedValuesExt for ComputedValues
source§fn has_transform_or_perspective(&self, fragment_flags: FragmentFlags) -> bool
fn has_transform_or_perspective(&self, fragment_flags: FragmentFlags) -> bool
Returns true if this style has a transform, or perspective property set and it applies to this element.
source§fn effective_z_index(&self, fragment_flags: FragmentFlags) -> i32
fn effective_z_index(&self, fragment_flags: FragmentFlags) -> i32
Get the effective z-index of this fragment. Z-indices only apply to positioned elements per CSS 2 9.9.1 (http://www.w3.org/TR/CSS2/visuren.html#z-index), so this value may differ from the value specified in the style.
source§fn effective_overflow(&self) -> PhysicalVec<Overflow>
fn effective_overflow(&self) -> PhysicalVec<Overflow>
Get the effective overflow of this box. The property only applies to block containers, flex containers, and grid containers. And some box types only accept a few values. https://www.w3.org/TR/css-overflow-3/#overflow-control
source§fn establishes_block_formatting_context(&self) -> bool
fn establishes_block_formatting_context(&self) -> bool
Return true if this style is a normal block and establishes a new block formatting context.
source§fn establishes_scroll_container(&self) -> bool
fn establishes_scroll_container(&self) -> bool
Whether or not the overflow
value of this style establishes a scroll container.
source§fn establishes_stacking_context(&self, fragment_flags: FragmentFlags) -> bool
fn establishes_stacking_context(&self, fragment_flags: FragmentFlags) -> bool
Returns true if this fragment establishes a new stacking context and false otherwise.
source§fn establishes_containing_block_for_absolute_descendants(
&self,
fragment_flags: FragmentFlags,
) -> bool
fn establishes_containing_block_for_absolute_descendants( &self, fragment_flags: FragmentFlags, ) -> bool
Returns true if this style establishes a containing block for absolute
descendants (position: absolute
). If this style happens to establish a
containing block for “all descendants” (ie including position: fixed
descendants) this method will return true, but a true return value does
not imply that the style establishes a containing block for all descendants.
Use establishes_containing_block_for_all_descendants()
instead.
source§fn establishes_containing_block_for_all_descendants(
&self,
fragment_flags: FragmentFlags,
) -> bool
fn establishes_containing_block_for_all_descendants( &self, fragment_flags: FragmentFlags, ) -> bool
Returns true if this style establishes a containing block for
all descendants, including fixed descendants (position: fixed
).
Note that this also implies that it establishes a containing block
for absolute descendants (position: absolute
).
source§fn preferred_aspect_ratio(
&self,
natural_aspect_ratio: Option<CSSFloat>,
containing_block: &IndefiniteContainingBlock,
) -> Option<AspectRatio>
fn preferred_aspect_ratio( &self, natural_aspect_ratio: Option<CSSFloat>, containing_block: &IndefiniteContainingBlock, ) -> Option<AspectRatio>
Resolve the preferred aspect ratio according to the given natural aspect
ratio and the aspect-ratio
property.
See https://drafts.csswg.org/css-sizing-4/#aspect-ratio.
source§fn background_is_transparent(&self) -> bool
fn background_is_transparent(&self) -> bool
Whether or not this style specifies a non-transparent background.
source§fn get_webrender_primitive_flags(&self) -> PrimitiveFlags
fn get_webrender_primitive_flags(&self) -> PrimitiveFlags
Generate appropriate WebRender PrimitiveFlags
that should be used
for display items generated by the Fragment
which owns this style.
source§fn bidi_control_chars(&self) -> (&'static str, &'static str)
fn bidi_control_chars(&self) -> (&'static str, &'static str)
If the ‘unicode-bidi’ property has a value other than ‘normal’, return the bidi control codes to inject before and after the text content of the element. See the table in http://dev.w3.org/csswg/css-writing-modes/#unicode-bidi.