Move Arc<RwLock<_>> out from CssRules tuple

This commit is contained in:
Xidorn Quan 2016-11-28 12:44:52 +11:00
parent 40917e7991
commit 599eb1c9f0
9 changed files with 58 additions and 62 deletions

View file

@ -24,7 +24,7 @@ use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use style::attr::AttrValue;
use style::str::HTML_SPACE_CHARACTERS;
use style::stylesheets::{Stylesheet, CssRule, Origin};
use style::stylesheets::{Stylesheet, CssRule, CssRules, Origin};
use style::viewport::ViewportRule;
#[dom_struct]
@ -98,7 +98,7 @@ impl HTMLMetaElement {
if !content.is_empty() {
if let Some(translated_rule) = ViewportRule::from_meta(&**content) {
*self.stylesheet.borrow_mut() = Some(Arc::new(Stylesheet {
rules: vec![CssRule::Viewport(Arc::new(RwLock::new(translated_rule)))].into(),
rules: CssRules::new(vec![CssRule::Viewport(Arc::new(RwLock::new(translated_rule)))]),
origin: Origin::Author,
base_url: window_from_node(self).get_url(),
namespaces: Default::default(),