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),
MozBoolPref(CString),
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.
MozBoolPref(CString)
-moz-bool-pref("pref-name")
Since we need to pass it through FFI to get the pref value,
we store it as CString directly.
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 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> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
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