style: Rewrite media queries so that they work on an evaluator function.

This moves most of the code to be Rust, except potentially some evaluator
functions, and allows to unblock the use case from any-hover / any-pointer and
remove nsMediaFeatures.

Differential Revision: https://phabricator.services.mozilla.com/D2976
This commit is contained in:
Emilio Cobos Álvarez 2018-08-15 16:07:11 +02:00
parent a0cb37d29d
commit dc0f937224
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
10 changed files with 1374 additions and 782 deletions

View file

@ -67,6 +67,8 @@ extern crate matches;
pub extern crate nsstring;
#[cfg(feature = "gecko")]
extern crate num_cpus;
#[macro_use]
extern crate num_derive;
extern crate num_integer;
extern crate num_traits;
extern crate ordered_float;
@ -128,15 +130,13 @@ pub mod font_face;
pub mod font_metrics;
#[cfg(feature = "gecko")]
#[allow(unsafe_code)]
pub mod gecko;
#[cfg(feature = "gecko")]
#[allow(unsafe_code)]
pub mod gecko_bindings;
pub mod hash;
pub mod invalidation;
#[allow(missing_docs)] // TODO.
pub mod logical_geometry;
pub mod matching;
#[macro_use]
pub mod media_queries;
pub mod parallel;
pub mod parser;
@ -190,11 +190,16 @@ pub mod properties {
include!(concat!(env!("OUT_DIR"), "/properties.rs"));
}
#[cfg(feature = "gecko")]
#[allow(unsafe_code)]
pub mod gecko;
// uses a macro from properties
#[cfg(feature = "servo")]
#[allow(unsafe_code)]
pub mod servo;
#[cfg(feature = "gecko")]
#[allow(unsafe_code, missing_docs)]
pub mod gecko_properties {