mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Make Stylesheet::is_effective_for_device more idiomatic
This commit is contained in:
parent
6a28d62b15
commit
7f75a881a4
1 changed files with 1 additions and 4 deletions
|
@ -148,10 +148,7 @@ impl Stylesheet {
|
||||||
///
|
///
|
||||||
/// Always true if no associated MediaQueryList exists.
|
/// Always true if no associated MediaQueryList exists.
|
||||||
pub fn is_effective_for_device(&self, device: &Device) -> bool {
|
pub fn is_effective_for_device(&self, device: &Device) -> bool {
|
||||||
match self.media {
|
self.media.as_ref().map_or(true, |ref media| media.evaluate(device))
|
||||||
Some(ref media) => media.evaluate(device),
|
|
||||||
None => true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return an iterator over all the rules within the style-sheet.
|
/// Return an iterator over all the rules within the style-sheet.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue