Enum style::stylesheets::supports_rule::SupportsCondition
source · pub enum SupportsCondition {
Not(Box<SupportsCondition>),
Parenthesized(Box<SupportsCondition>),
And(Vec<SupportsCondition>),
Or(Vec<SupportsCondition>),
Declaration(Declaration),
Selector(RawSelector),
FontFormat(FontFaceSourceFormatKeyword),
FontTech(FontFaceSourceTechFlags),
FutureSyntax(String),
}
Expand description
An @supports condition
Variants§
Not(Box<SupportsCondition>)
not (condition)
Parenthesized(Box<SupportsCondition>)
(condition)
And(Vec<SupportsCondition>)
(condition) and (condition) and (condition) ..
Or(Vec<SupportsCondition>)
(condition) or (condition) or (condition) ..
Declaration(Declaration)
property-ident: value
(value can be any tokens)
Selector(RawSelector)
A selector()
function.
FontFormat(FontFaceSourceFormatKeyword)
font-format(<font-format>)
FontTech(FontFaceSourceTechFlags)
font-tech(<font-tech>)
FutureSyntax(String)
(any tokens)
or func(any tokens)
Implementations§
source§impl SupportsCondition
impl SupportsCondition
sourcepub fn parse<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>>
pub fn parse<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>>
Parse a condition
https://drafts.csswg.org/css-conditional/#supports_condition
sourcefn parse_functional<'i, 't>(
function: &str,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>>
fn parse_functional<'i, 't>( function: &str, input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>
Parses a functional supports condition.
sourcepub fn parse_for_import<'i, 't>(
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>>
pub fn parse_for_import<'i, 't>( input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>
Parses an @import
condition as per
https://drafts.csswg.org/css-cascade-5/#typedef-import-conditions
sourcefn parse_in_parens<'i, 't>(
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>>
fn parse_in_parens<'i, 't>( input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>
sourcepub fn eval(&self, cx: &ParserContext<'_>) -> bool
pub fn eval(&self, cx: &ParserContext<'_>) -> bool
Evaluate a supports condition
Trait Implementations§
source§impl Clone for SupportsCondition
impl Clone for SupportsCondition
source§fn clone(&self) -> SupportsCondition
fn clone(&self) -> SupportsCondition
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SupportsCondition
impl Debug for SupportsCondition
source§impl ToCss for SupportsCondition
impl ToCss for SupportsCondition
source§impl ToShmem for SupportsCondition
impl ToShmem for SupportsCondition
Auto Trait Implementations§
impl Freeze for SupportsCondition
impl RefUnwindSafe for SupportsCondition
impl Send for SupportsCondition
impl Sync for SupportsCondition
impl Unpin for SupportsCondition
impl UnwindSafe for SupportsCondition
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
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