Allow empty media query list

And make empty list the default value of MediaList.

This commit also removes Option wrapper of Stylesheet.media because
a stylesheet should always have an associated media query list.
This commit is contained in:
Xidorn Quan 2016-11-10 15:32:16 +11:00
parent a91f48ee05
commit 5dfcb07f6a
7 changed files with 23 additions and 23 deletions

View file

@ -83,7 +83,7 @@ impl HTMLMetaElement {
*self.stylesheet.borrow_mut() = Some(Arc::new(Stylesheet {
rules: vec![CSSRule::Viewport(Arc::new(RwLock::new(translated_rule)))],
origin: Origin::Author,
media: None,
media: Default::default(),
// Viewport constraints are always recomputed on resize; they don't need to
// force all styles to be recomputed.
dirty_on_viewport_size_change: false,