Type Alias style::properties_and_values::value::SpecifiedValue
source · pub type SpecifiedValue = Value<SpecifiedValueComponent>;
Expand description
Specified custom property value.
Aliased Type§
struct SpecifiedValue {
pub(crate) v: ValueInner<GenericValueComponent<Length, Number, Percentage, LengthPercentage, Color, GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<Length>, NonNegative<LengthPercentage>, GenericPosition<PositionComponent<HorizontalPositionKeyword>, PositionComponent<VerticalPositionKeyword>>, Angle, AngleOrPercentage, Color>, CssUrl, Color, Percentage, Resolution>, CssUrl, Integer, Angle, Time, Resolution, GenericTransform<GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>>>,
url_data: UrlExtraData,
}
Fields§
§v: ValueInner<GenericValueComponent<Length, Number, Percentage, LengthPercentage, Color, GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<Length>, NonNegative<LengthPercentage>, GenericPosition<PositionComponent<HorizontalPositionKeyword>, PositionComponent<VerticalPositionKeyword>>, Angle, AngleOrPercentage, Color>, CssUrl, Color, Percentage, Resolution>, CssUrl, Integer, Angle, Time, Resolution, GenericTransform<GenericTransformOperation<Angle, Number, Length, Integer, 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 SpecifiedValue
impl SpecifiedValue
sourcepub fn compute<'i, 't>(
input: &mut CSSParser<'i, 't>,
registration: &PropertyRegistrationData,
url_data: &UrlExtraData,
context: &Context<'_>,
allow_computationally_dependent: AllowComputationallyDependent
) -> Result<ComputedValue, ()>
pub fn compute<'i, 't>( input: &mut CSSParser<'i, 't>, registration: &PropertyRegistrationData, url_data: &UrlExtraData, context: &Context<'_>, allow_computationally_dependent: AllowComputationallyDependent ) -> Result<ComputedValue, ()>
Convert a registered custom property to a Computed custom property value, given input and a property registration.
sourcepub fn parse<'i, 't>(
input: &mut CSSParser<'i, 't>,
syntax: &Descriptor,
url_data: &UrlExtraData,
allow_computationally_dependent: AllowComputationallyDependent
) -> Result<Self, StyleParseError<'i>>
pub fn parse<'i, 't>( input: &mut CSSParser<'i, 't>, syntax: &Descriptor, url_data: &UrlExtraData, allow_computationally_dependent: AllowComputationallyDependent ) -> Result<Self, StyleParseError<'i>>
Parse and validate a registered custom property value according to its syntax descriptor, and check for computational independence.
source§impl<Component> Value<Component>
impl<Component> Value<Component>
sourcepub fn new(v: ValueInner<Component>, url_data: UrlExtraData) -> Self
pub fn new(v: ValueInner<Component>, url_data: UrlExtraData) -> Self
Creates a new registered custom property value.
sourcepub fn universal(var: Arc<ComputedPropertyValue>) -> Self
pub fn universal(var: Arc<ComputedPropertyValue>) -> Self
Creates a new registered custom property value presumed to have universal syntax.
Trait Implementations§
source§impl<Component> MallocSizeOf for Value<Component>where
Component: MallocSizeOf,
impl<Component> MallocSizeOf for Value<Component>where Component: MallocSizeOf,
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
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<Value<Component>> for Value<Component>
impl<Component: PartialEq> PartialEq<Value<Component>> for Value<Component>
source§impl ToComputedValue for SpecifiedValue
impl ToComputedValue for SpecifiedValue
§type ComputedValue = Value<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>>>>
type ComputedValue = Value<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 computed value type we’re going to be converted to.
source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
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§fn from_computed_value(computed: &Self::ComputedValue) -> Self
fn from_computed_value(computed: &Self::ComputedValue) -> Self
Convert a computed value to specified value form. Read more