Type Alias style::values::computed::counters::Content

source ·
pub type Content = GenericContent<Image>;
Expand description

A computed value for the content property.

Aliased Type§

enum Content {
    Normal,
    None,
    Items(GenericContentItems<GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>>),
}

Variants§

Trait Implementations§

source§

impl ToResolvedValue for Content

https://drafts.csswg.org/css-content/#content-property

We implement this at resolved value time because otherwise it causes us to allocate a bunch of useless initial structs for ::before / ::after, which is a bit unfortunate.

Though these should be temporary, mostly, so if this causes complexity in other places, it should be fine to move to StyleAdjuster.

See https://github.com/w3c/csswg-drafts/issues/4632 for where some related issues are being discussed.

§

type ResolvedValue = GenericContent<GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>>

The resolved value type we’re going to be converted to.
source§

fn to_resolved_value(self, context: &Context<'_>) -> Self

Convert a resolved value to a resolved value.
source§

fn from_resolved_value(resolved: Self) -> Self

Convert a resolved value to resolved value form.