mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Rustfmt has changed its default style :/
This commit is contained in:
parent
82fc6d9f49
commit
be69f9c3e6
207 changed files with 1200 additions and 1339 deletions
|
@ -74,21 +74,22 @@ impl MediaList {
|
|||
pub fn evaluate(&self, device: &Device, quirks_mode: QuirksMode) -> bool {
|
||||
// Check if it is an empty media query list or any queries match.
|
||||
// https://drafts.csswg.org/mediaqueries-4/#mq-list
|
||||
self.media_queries.is_empty() || self.media_queries.iter().any(|mq| {
|
||||
let media_match = mq.media_type.matches(device.media_type());
|
||||
self.media_queries.is_empty() ||
|
||||
self.media_queries.iter().any(|mq| {
|
||||
let media_match = mq.media_type.matches(device.media_type());
|
||||
|
||||
// Check if the media condition match.
|
||||
let query_match = media_match && mq
|
||||
.condition
|
||||
.as_ref()
|
||||
.map_or(true, |c| c.matches(device, quirks_mode));
|
||||
// Check if the media condition match.
|
||||
let query_match = media_match &&
|
||||
mq.condition
|
||||
.as_ref()
|
||||
.map_or(true, |c| c.matches(device, quirks_mode));
|
||||
|
||||
// Apply the logical NOT qualifier to the result
|
||||
match mq.qualifier {
|
||||
Some(Qualifier::Not) => !query_match,
|
||||
_ => query_match,
|
||||
}
|
||||
})
|
||||
// Apply the logical NOT qualifier to the result
|
||||
match mq.qualifier {
|
||||
Some(Qualifier::Not) => !query_match,
|
||||
_ => query_match,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// Whether this `MediaList` contains no media queries.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue