Struct style::media_queries::media_list::MediaList
source · pub struct MediaList {
pub media_queries: Vec<MediaQuery>,
}
Expand description
A type that encapsulates a media query list.
Fields§
§media_queries: Vec<MediaQuery>
The list of media queries.
Implementations§
source§impl MediaList
impl MediaList
sourcepub fn parse(context: &ParserContext<'_>, input: &mut Parser<'_, '_>) -> Self
pub fn parse(context: &ParserContext<'_>, input: &mut Parser<'_, '_>) -> Self
Parse a media query list from CSS.
Always returns a media query list. If any invalid media query is found, the media query list is only filled with the equivalent of “not all”, see:
sourcepub fn evaluate(&self, device: &Device, quirks_mode: QuirksMode) -> bool
pub fn evaluate(&self, device: &Device, quirks_mode: QuirksMode) -> bool
Evaluate a whole MediaList
against Device
.
sourcepub fn append_medium(
&mut self,
context: &ParserContext<'_>,
new_medium: &str
) -> bool
pub fn append_medium(
&mut self,
context: &ParserContext<'_>,
new_medium: &str
) -> bool
Append a new media query item to the media list. https://drafts.csswg.org/cssom/#dom-medialist-appendmedium
Returns true if added, false if fail to parse the medium string.
sourcepub fn delete_medium(
&mut self,
context: &ParserContext<'_>,
old_medium: &str
) -> bool
pub fn delete_medium(
&mut self,
context: &ParserContext<'_>,
old_medium: &str
) -> bool
Delete a media query from the media list. https://drafts.csswg.org/cssom/#dom-medialist-deletemedium
Returns true if found and deleted, false otherwise.
Trait Implementations§
source§impl MallocSizeOf for MediaList
impl MallocSizeOf for MediaList
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.
Auto Trait Implementations§
impl RefUnwindSafe for MediaList
impl Send for MediaList
impl Sync for MediaList
impl Unpin for MediaList
impl UnwindSafe for MediaList
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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