Bug 1325878: Pass the MediaList down to Servo, making <style media> work. r=xidorn

MozReview-Commit-ID: BUCSQJs2CNI
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-04-11 22:13:16 +08:00
parent 482740bb11
commit ac7bc414d9
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
14 changed files with 63 additions and 43 deletions

View file

@ -24,6 +24,7 @@ use std::ascii::AsciiExt;
use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use style::attr::AttrValue;
use style::media_queries::MediaList;
use style::str::HTML_SPACE_CHARACTERS;
use style::stylesheets::{Stylesheet, CssRule, CssRules, Origin};
use style::viewport::ViewportRule;
@ -107,7 +108,7 @@ impl HTMLMetaElement {
shared_lock: shared_lock.clone(),
url_data: window_from_node(self).get_url(),
namespaces: Default::default(),
media: Arc::new(shared_lock.wrap(Default::default())),
media: Arc::new(shared_lock.wrap(MediaList::empty())),
// Viewport constraints are always recomputed on resize; they don't need to
// force all styles to be recomputed.
dirty_on_viewport_size_change: AtomicBool::new(false),