Port servo to the new media query system.

Port `width`, and also add the `scan` media feature so I don't need to add
ugliness just to workaround the unused keyword_evaluator macro.
This commit is contained in:
Emilio Cobos Álvarez 2018-08-18 18:19:34 +02:00
parent 8ae1322fb3
commit 935b5393a9
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 57 additions and 134 deletions

View file

@ -161,6 +161,18 @@ impl MediaFeatureDescription {
}
}
/// A simple helper to construct a `MediaFeatureDescription`.
macro_rules! feature {
($name:expr, $allows_ranges:expr, $evaluator:expr, $reqs:expr,) => {
$crate::media_queries::media_feature::MediaFeatureDescription {
name: $name,
allows_ranges: $allows_ranges,
evaluator: $evaluator,
requirements: $reqs,
}
}
}
impl fmt::Debug for MediaFeatureDescription {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("MediaFeatureExpression")