Type Definition style::values::computed::counters::Content

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

A computed value for the content property.

Trait Implementations§


impl ToResolvedValue for Content


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>>, MozImageRect, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>>

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

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

Convert a resolved value to a resolved value.

fn from_resolved_value(resolved: Self) -> Self

Convert a resolved value to resolved value form.