pub(crate) trait ComputedValuesExt {
Show 35 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_for_box_size(
&self,
box_size: LogicalVec2<Size<Au>>,
pbm: &PaddingBorderMargin,
) -> LogicalVec2<Size<Au>>;
fn content_min_box_size_for_min_size(
&self,
box_size: LogicalVec2<Size<Au>>,
pbm: &PaddingBorderMargin,
) -> LogicalVec2<Size<Au>>;
fn content_max_box_size_for_max_size(
&self,
box_size: LogicalVec2<Size<Au>>,
pbm: &PaddingBorderMargin,
) -> LogicalVec2<Size<Au>>;
fn border_style_color(
&self,
containing_block_writing_mode: WritingMode,
) -> LogicalSides<BorderStyleColor>;
fn physical_margin(&self) -> PhysicalSides<LengthPercentageOrAuto<'_>>;
fn margin(
&self,
containing_block_writing_mode: WritingMode,
) -> LogicalSides<LengthPercentageOrAuto<'_>>;
fn is_transformable(&self, fragment_flags: FragmentFlags) -> bool;
fn has_transform_or_perspective_style(&self) -> bool;
fn has_effective_transform_or_perspective(
&self,
fragment_flags: FragmentFlags,
) -> bool;
fn z_index_applies(&self, fragment_flags: FragmentFlags) -> bool;
fn effective_z_index(&self, fragment_flags: FragmentFlags) -> i32;
fn effective_overflow(&self, fragment_flags: FragmentFlags) -> AxesOverflow;
fn used_transform_style(
&self,
fragment_flags: FragmentFlags,
) -> ComputedTransformStyle;
fn establishes_block_formatting_context(
&self,
fragment_flags: FragmentFlags,
) -> bool;
fn establishes_stacking_context(
&self,
fragment_flags: FragmentFlags,
) -> bool;
fn establishes_scroll_container(
&self,
fragment_flags: FragmentFlags,
) -> bool;
fn establishes_or_extends_3d_rendering_context(
&self,
fragment_flags: FragmentFlags,
) -> 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>,
padding_border_sums: &LogicalVec2<Au>,
) -> Option<AspectRatio>;
fn background_is_transparent(&self) -> bool;
fn webrender_primitive_flags(&self) -> PrimitiveFlags;
fn bidi_control_chars(&self) -> (&'static str, &'static str);
fn resolve_align_self(
&self,
resolved_auto_value: ItemPlacement,
resolved_normal_value: AlignFlags,
) -> SelfAlignment;
fn depends_on_block_constraints_due_to_relative_positioning(
&self,
writing_mode: WritingMode,
) -> bool;
fn is_inline_box(&self, fragment_flags: FragmentFlags) -> bool;
fn is_atomic_inline_level(&self, fragment_flags: FragmentFlags) -> bool;
fn overflow_direction(&self) -> OverflowDirection;
fn to_bidi_level(&self) -> Level;
fn white_space_may_hang_conditionally(&self) -> 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_for_box_size( &self, box_size: LogicalVec2<Size<Au>>, pbm: &PaddingBorderMargin, ) -> LogicalVec2<Size<Au>>
fn content_min_box_size_for_min_size( &self, box_size: LogicalVec2<Size<Au>>, pbm: &PaddingBorderMargin, ) -> LogicalVec2<Size<Au>>
fn content_max_box_size_for_max_size( &self, box_size: LogicalVec2<Size<Au>>, pbm: &PaddingBorderMargin, ) -> LogicalVec2<Size<Au>>
fn border_style_color( &self, containing_block_writing_mode: WritingMode, ) -> LogicalSides<BorderStyleColor>
fn physical_margin(&self) -> PhysicalSides<LengthPercentageOrAuto<'_>>
fn margin( &self, containing_block_writing_mode: WritingMode, ) -> LogicalSides<LengthPercentageOrAuto<'_>>
fn is_transformable(&self, fragment_flags: FragmentFlags) -> bool
fn has_transform_or_perspective_style(&self) -> bool
fn has_effective_transform_or_perspective( &self, fragment_flags: FragmentFlags, ) -> bool
fn z_index_applies(&self, fragment_flags: FragmentFlags) -> bool
fn effective_z_index(&self, fragment_flags: FragmentFlags) -> i32
fn effective_overflow(&self, fragment_flags: FragmentFlags) -> AxesOverflow
fn used_transform_style( &self, fragment_flags: FragmentFlags, ) -> ComputedTransformStyle
fn establishes_block_formatting_context( &self, fragment_flags: FragmentFlags, ) -> bool
fn establishes_stacking_context(&self, fragment_flags: FragmentFlags) -> bool
fn establishes_scroll_container(&self, fragment_flags: FragmentFlags) -> bool
fn establishes_or_extends_3d_rendering_context( &self, fragment_flags: FragmentFlags, ) -> 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>, padding_border_sums: &LogicalVec2<Au>, ) -> Option<AspectRatio>
fn background_is_transparent(&self) -> bool
fn webrender_primitive_flags(&self) -> PrimitiveFlags
fn bidi_control_chars(&self) -> (&'static str, &'static str)
fn resolve_align_self( &self, resolved_auto_value: ItemPlacement, resolved_normal_value: AlignFlags, ) -> SelfAlignment
fn depends_on_block_constraints_due_to_relative_positioning( &self, writing_mode: WritingMode, ) -> bool
fn is_inline_box(&self, fragment_flags: FragmentFlags) -> bool
fn is_atomic_inline_level(&self, fragment_flags: FragmentFlags) -> bool
fn overflow_direction(&self) -> OverflowDirection
fn to_bidi_level(&self) -> Level
Sourcefn white_space_may_hang_conditionally(&self) -> bool
fn white_space_may_hang_conditionally(&self) -> bool
Whether or not this style causes conditional hanging in inline layout
i.e. if it is white-space-collapse: preserve and text-wrap-mode: wrap.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl ComputedValuesExt for ComputedValues
impl ComputedValuesExt for ComputedValues
Source§fn is_transformable(&self, fragment_flags: FragmentFlags) -> bool
fn is_transformable(&self, fragment_flags: FragmentFlags) -> bool
Returns true if this is a transformable element.
Source§fn has_transform_or_perspective_style(&self) -> bool
fn has_transform_or_perspective_style(&self) -> bool
Returns true if this style has a transform or perspective property set.
Source§fn has_effective_transform_or_perspective(
&self,
fragment_flags: FragmentFlags,
) -> bool
fn has_effective_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 z_index_applies(&self, fragment_flags: FragmentFlags) -> bool
fn z_index_applies(&self, fragment_flags: FragmentFlags) -> bool
Whether the z-index property applies to this fragment.
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, fragment_flags: FragmentFlags) -> AxesOverflow
fn effective_overflow(&self, fragment_flags: FragmentFlags) -> AxesOverflow
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 used_transform_style(
&self,
fragment_flags: FragmentFlags,
) -> ComputedTransformStyle
fn used_transform_style( &self, fragment_flags: FragmentFlags, ) -> ComputedTransformStyle
Get the used transform-style value according to the the rules in
https://drafts.csswg.org/css-transforms/#grouping-property-values.
Source§fn establishes_block_formatting_context(
&self,
fragment_flags: FragmentFlags,
) -> bool
fn establishes_block_formatting_context( &self, fragment_flags: FragmentFlags, ) -> bool
Return true if this style is a normal block and establishes a new block formatting context.
NOTE: This should be kept in sync with the checks in impl TElement::compute_layout_damage for ServoLayoutElement in
components/script/layout_dom/element.rs.
Source§fn establishes_scroll_container(&self, fragment_flags: FragmentFlags) -> bool
fn establishes_scroll_container(&self, fragment_flags: FragmentFlags) -> bool
Whether or not the overflow value of this style establishes a scroll container.
Source§fn establishes_or_extends_3d_rendering_context(
&self,
fragment_flags: FragmentFlags,
) -> bool
fn establishes_or_extends_3d_rendering_context( &self, fragment_flags: FragmentFlags, ) -> bool
Returns true if this fragment establishes or extends a 3D rendering context.
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>,
padding_border_sums: &LogicalVec2<Au>,
) -> Option<AspectRatio>
fn preferred_aspect_ratio( &self, natural_aspect_ratio: Option<CSSFloat>, padding_border_sums: &LogicalVec2<Au>, ) -> 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 webrender_primitive_flags(&self) -> PrimitiveFlags
fn 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.
Source§fn to_bidi_level(&self) -> Level
fn to_bidi_level(&self) -> Level
The default bidirectional embedding level for the writing mode of this style.
Returns bidi level 0 if the mode is LTR, or 1 otherwise.