pub struct Substitution<'a> {
pub css: Cow<'a, str>,
pub first_token_type: TokenSerializationType,
pub last_token_type: TokenSerializationType,
pub attr_tainted: bool,
}Expand description
The result of substituting a value or a single substitution function.
Fields§
§css: Cow<'a, str>The substituted CSS.
first_token_type: TokenSerializationTypeThe serialization type of the first token in css.
last_token_type: TokenSerializationTypeThe serialization type of the last token in css.
attr_tainted: boolWhether any attr()-tainted values were involved in the substitution.
Implementations§
Source§impl<'a> Substitution<'a>
impl<'a> Substitution<'a>
Sourcepub fn from_value(v: VariableValue, attr_tainted: bool) -> Self
pub fn from_value(v: VariableValue, attr_tainted: bool) -> Self
Creates a substitution from a variable value.
Sourcepub fn into_value(
self,
url_data: &UrlExtraData,
registration: &PropertyDescriptors,
computed_context: &Context<'_>,
property_id: Option<PropertyIdRef<'_>>,
) -> Result<ComputedRegisteredValue, ()>
pub fn into_value( self, url_data: &UrlExtraData, registration: &PropertyDescriptors, computed_context: &Context<'_>, property_id: Option<PropertyIdRef<'_>>, ) -> Result<ComputedRegisteredValue, ()>
Computes the substitution against the registration of a custom property.
Sourcepub fn new(
css: Cow<'a, str>,
first_token_type: TokenSerializationType,
last_token_type: TokenSerializationType,
attr_tainted: bool,
) -> Self
pub fn new( css: Cow<'a, str>, first_token_type: TokenSerializationType, last_token_type: TokenSerializationType, attr_tainted: bool, ) -> Self
Creates a substitution from its parts.
Trait Implementations§
Source§impl<'a> Debug for Substitution<'a>
impl<'a> Debug for Substitution<'a>
Source§impl<'a> Default for Substitution<'a>
impl<'a> Default for Substitution<'a>
Source§fn default() -> Substitution<'a>
fn default() -> Substitution<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for Substitution<'a>
impl<'a> RefUnwindSafe for Substitution<'a>
impl<'a> Send for Substitution<'a>
impl<'a> Sync for Substitution<'a>
impl<'a> Unpin for Substitution<'a>
impl<'a> UnsafeUnpin for Substitution<'a>
impl<'a> UnwindSafe for Substitution<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert