style::properties_and_values::value

Type Alias ComputedValue

Source
pub type ComputedValue = Value<ComputedValueComponent>;
Expand description

Computed custom property value.

Aliased Type§

struct ComputedValue {
    pub(crate) v: ValueInner<GenericValueComponent<CSSPixelLength, f32, Percentage, LengthPercentage, GenericColor<Percentage>, GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>, ComputedUrl, i32, Angle, Time, Resolution, GenericTransform<GenericTransformOperation<Angle, f32, CSSPixelLength, i32, LengthPercentage>>>>,
    url_data: UrlExtraData,
}

Fields§

§v: ValueInner<GenericValueComponent<CSSPixelLength, f32, Percentage, LengthPercentage, GenericColor<Percentage>, GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>, ComputedUrl, i32, Angle, Time, Resolution, GenericTransform<GenericTransformOperation<Angle, f32, CSSPixelLength, i32, LengthPercentage>>>>

The registered custom property value.

§url_data: UrlExtraData

The URL data of the registered custom property from before it was computed. This is necessary to uncompute registered custom properties.

Implementations§

Source§

impl ComputedValue

Source

fn serialization_types( &self, ) -> (TokenSerializationType, TokenSerializationType)

Source

fn to_declared_value(&self) -> CustomDeclarationValue

Source

pub fn as_universal(&self) -> Option<&Arc<ComputedPropertyValue>>

Returns the contained variable value if it exists, otherwise None.

Source

pub fn is_parsed(&self, registration: &PropertyRegistrationData) -> bool

Returns whether the the property is computed.

Source

pub fn to_variable_value(&self) -> ComputedPropertyValue

Convert to an untyped variable value.

Source§

impl<Component> Value<Component>

Source

pub fn new(v: ValueInner<Component>, url_data: UrlExtraData) -> Self

Creates a new registered custom property value.

Source

pub fn universal(var: Arc<ComputedPropertyValue>) -> Self

Creates a new registered custom property value presumed to have universal syntax.

Trait Implementations

Source§

impl<Component: Animate> Animate for Value<Component>

Source§

fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>

Animate a value towards another one, given an animation procedure.
Source§

impl<Component: Clone> Clone for Value<Component>

Source§

fn clone(&self) -> Value<Component>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Component: Debug> Debug for Value<Component>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Component> MallocSizeOf for Value<Component>
where Component: MallocSizeOf,

Source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
Source§

impl<Component: PartialEq> PartialEq for Value<Component>

Source§

fn eq(&self, other: &Value<Component>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Component> ToComputedValue for Value<Component>
where Component: ToComputedValue,

Source§

type ComputedValue = Value<<Component as ToComputedValue>::ComputedValue>

The computed value type we’re going to be converted to.
Source§

fn from_computed_value(from: &Self::ComputedValue) -> Self

Convert a computed value to specified value form. Read more
Source§

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

Convert a specified value to a computed value, using itself and the data inside the Context.
Source§

impl<Component> ToCss for Value<Component>
where Component: ToCss,

Source§

fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Result
where W: Write,

Serialize self in CSS syntax, writing to dest.
Source§

fn to_css_string(&self) -> String

Serialize self in CSS syntax and return a string. Read more
Source§

impl<Component> ToResolvedValue for Value<Component>
where Component: ToResolvedValue,

Source§

type ResolvedValue = Value<<Component as ToResolvedValue>::ResolvedValue>

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

fn from_resolved_value(from: Self::ResolvedValue) -> Self

Convert a resolved value to resolved value form.
Source§

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

Convert a resolved value to a resolved value.
Source§

impl<Component> ToShmem for Value<Component>
where Component: ToShmem,

Source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

Clones this value into a form suitable for writing into a SharedMemoryBuilder. Read more
Source§

impl<Component> StructuralPartialEq for Value<Component>